Commit d9aaf6ca authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/src/26-stable-dev

into intel.com:/home/lenb/src/26-latest-dev
parents 091cced3 dc6d190e
obj-$(CONFIG_ACPI_BOOT) := boot.o
obj-$(CONFIG_ACPI_BOOT) := boot.o earlyquirk.o
obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
......@@ -818,6 +818,10 @@ acpi_boot_init (void)
return error;
}
#ifdef __i386__
check_acpi_pci();
#endif
acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
/*
......
/*
* Do early PCI probing for bug detection when the main PCI subsystem is
* not up yet.
*/
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/pci.h>
#include <asm/pci-direct.h>
#include <asm/acpi.h>
static int __init check_bridge(int vendor, int device)
{
/* According to Nvidia all timer overrides are bogus. Just ignore
them all. */
if (vendor == PCI_VENDOR_ID_NVIDIA) {
acpi_skip_timer_override = 1;
}
return 0;
}
void __init check_acpi_pci(void)
{
int num,slot,func;
/* Assume the machine supports type 1. If not it will
always read ffffffff and should not have any side effect. */
/* Poor man's PCI discovery */
for (num = 0; num < 32; num++) {
for (slot = 0; slot < 32; slot++) {
for (func = 0; func < 8; func++) {
u32 class;
u32 vendor;
class = read_pci_config(num,slot,func,
PCI_CLASS_REVISION);
if (class == 0xffffffff)
break;
if ((class >> 16) != PCI_CLASS_BRIDGE_PCI)
continue;
vendor = read_pci_config(num, slot, func,
PCI_VENDOR_ID);
if (check_bridge(vendor&0xffff, vendor >> 16))
return;
}
}
}
}
This diff is collapsed.
/*
* acpi_ec.c - ACPI Embedded Controller Driver ($Revision: 38 $)
*
* Copyright (C) 2004 Luming Yu <luming.yu@intel.com>
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
*
......@@ -29,6 +30,7 @@
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <asm/io.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
......@@ -441,9 +443,15 @@ acpi_ec_space_handler (
ACPI_FUNCTION_TRACE("acpi_ec_space_handler");
if ((address > 0xFF) || (bit_width != 8) || !value || !handler_context)
if ((address > 0xFF) || !value || !handler_context)
return_VALUE(AE_BAD_PARAMETER);
if(bit_width != 8) {
printk(KERN_WARNING PREFIX "acpi_ec_space_handler: bit_width should be 8\n");
if (acpi_strict)
return_VALUE(AE_BAD_PARAMETER);
}
ec = (struct acpi_ec *) handler_context;
switch (function) {
......@@ -484,41 +492,38 @@ struct proc_dir_entry *acpi_ec_dir;
static int
acpi_ec_read_info (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
acpi_ec_read_info (struct seq_file *seq, void *offset)
{
struct acpi_ec *ec = (struct acpi_ec *) data;
char *p = page;
int len = 0;
struct acpi_ec *ec = (struct acpi_ec *) seq->private;
ACPI_FUNCTION_TRACE("acpi_ec_read_info");
if (!ec || (off != 0))
if (!ec)
goto end;
p += sprintf(p, "gpe bit: 0x%02x\n",
seq_printf(seq, "gpe bit: 0x%02x\n",
(u32) ec->gpe_bit);
p += sprintf(p, "ports: 0x%02x, 0x%02x\n",
seq_printf(seq, "ports: 0x%02x, 0x%02x\n",
(u32) ec->status_addr.address, (u32) ec->data_addr.address);
p += sprintf(p, "use global lock: %s\n",
seq_printf(seq, "use global lock: %s\n",
ec->global_lock?"yes":"no");
end:
len = (p - page);
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
return_VALUE(0);
}
static int acpi_ec_info_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_ec_read_info, PDE(inode)->data);
}
static struct file_operations acpi_ec_info_ops = {
.open = acpi_ec_info_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.owner = THIS_MODULE,
};
static int
acpi_ec_add_fs (
......@@ -535,13 +540,17 @@ acpi_ec_add_fs (
return_VALUE(-ENODEV);
}
entry = create_proc_read_entry(ACPI_EC_FILE_INFO, S_IRUGO,
acpi_device_dir(device), acpi_ec_read_info,
acpi_driver_data(device));
entry = create_proc_entry(ACPI_EC_FILE_INFO, S_IRUGO,
acpi_device_dir(device));
if (!entry)
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"Unable to create '%s' fs entry\n",
ACPI_EC_FILE_INFO));
else {
entry->proc_fops = &acpi_ec_info_ops;
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}
return_VALUE(0);
}
......
......@@ -28,6 +28,7 @@
#include <linux/init.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <asm/uaccess.h>
#include <acpi/acpi_bus.h>
......@@ -75,51 +76,41 @@ struct proc_dir_entry *acpi_fan_dir;
static int
acpi_fan_read_state (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
acpi_fan_read_state (struct seq_file *seq, void *offset)
{
struct acpi_fan *fan = (struct acpi_fan *) data;
char *p = page;
int len = 0;
struct acpi_fan *fan = (struct acpi_fan *) seq->private;
int state = 0;
ACPI_FUNCTION_TRACE("acpi_fan_read_state");
if (!fan || (off != 0))
if (!fan)
goto end;
if (acpi_bus_get_power(fan->handle, &state))
goto end;
p += sprintf(p, "status: %s\n",
seq_printf(seq, "status: %s\n",
!state?"on":"off");
end:
len = (p - page);
if (len <= off+count) *eof = 1;
*start = page + off;
len -= off;
if (len>count) len = count;
if (len<0) len = 0;
return_VALUE(len);
return_VALUE(0);
}
static int acpi_fan_state_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_fan_read_state, PDE(inode)->data);
}
static int
static ssize_t
acpi_fan_write_state (
struct file *file,
const char __user *buffer,
unsigned long count,
void *data)
size_t count,
loff_t *ppos)
{
int result = 0;
struct acpi_fan *fan = (struct acpi_fan *) data;
struct seq_file *m = (struct seq_file *)file->private_data;
struct acpi_fan *fan = (struct acpi_fan *) m->private;
char state_string[12] = {'\0'};
ACPI_FUNCTION_TRACE("acpi_fan_write_state");
......@@ -140,6 +131,14 @@ acpi_fan_write_state (
return_VALUE(count);
}
static struct file_operations acpi_fan_state_ops = {
.open = acpi_fan_state_open_fs,
.read = seq_read,
.write = acpi_fan_write_state,
.llseek = seq_lseek,
.release = single_release,
.owner = THIS_MODULE,
};
static int
acpi_fan_add_fs (
......@@ -168,8 +167,7 @@ acpi_fan_add_fs (
"Unable to create '%s' fs entry\n",
ACPI_FAN_FILE_STATE));
else {
entry->read_proc = acpi_fan_read_state;
entry->write_proc = acpi_fan_write_state;
entry->proc_fops = &acpi_fan_state_ops;
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}
......
......@@ -24,6 +24,7 @@
*/
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <asm/uaccess.h>
......@@ -48,35 +49,26 @@ extern FADT_DESCRIPTOR acpi_fadt;
-------------------------------------------------------------------------- */
static int
acpi_system_read_info (
char *page,
char **start,
off_t off,
int count,
int *eof,
void *data)
acpi_system_read_info (struct seq_file *seq, void *offset)
{
char *p = page;
int size = 0;
ACPI_FUNCTION_TRACE("acpi_system_read_info");
if (off != 0)
goto end;
p += sprintf(p, "version: %x\n", ACPI_CA_VERSION);
end:
size = (p - page);
if (size <= off+count) *eof = 1;
*start = page + off;
size -= off;
if (size>count) size = count;
if (size<0) size = 0;
seq_printf(seq, "version: %x\n", ACPI_CA_VERSION);
return_VALUE(0);
}
return_VALUE(size);
static int acpi_system_info_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_system_read_info, PDE(inode)->data);
}
static struct file_operations acpi_system_info_ops = {
.open = acpi_system_info_open_fs,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};
static ssize_t acpi_system_read_dsdt (struct file*, char __user *, size_t, loff_t*);
static struct file_operations acpi_system_dsdt_ops = {
......@@ -152,10 +144,13 @@ static int __init acpi_system_init (void)
/* 'info' [R] */
name = ACPI_SYSTEM_FILE_INFO;
entry = create_proc_read_entry(name,
S_IRUGO, acpi_root_dir, acpi_system_read_info,NULL);
entry = create_proc_entry(name,
S_IRUGO, acpi_root_dir);
if (!entry)
goto Error;
else {
entry->proc_fops = &acpi_system_info_ops;
}
/* 'dsdt' [R] */
name = ACPI_SYSTEM_FILE_DSDT;
......
......@@ -138,6 +138,8 @@ extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
extern int skip_ioapic_setup;
extern int acpi_skip_timer_override;
extern void check_acpi_pci(void);
static inline void disable_ioapic_setup(void)
{
skip_ioapic_setup = 1;
......
#include "asm-x86_64/pci-direct.h"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment