Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 31459
b: refs/heads/master
c: 38a2713
h: refs/heads/master
i:
  31457: 6e87314
  31455: 1a2f3e2
v: v3
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jun 30, 2006
1 parent a70209f commit 2c8429d
Show file tree
Hide file tree
Showing 79 changed files with 2,737 additions and 2,654 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e8d6ad9bf1f02fdb9fd119c3c266d4b73b7175d
refs/heads/master: 38a2713ada91d5e7e4c0a1a0b12e45e2ec7079c3
2 changes: 1 addition & 1 deletion trunk/arch/i386/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ endchoice
config ACPI_SRAT
bool
default y
depends on ACPI && NUMA && (X86_SUMMIT || X86_GENERICARCH)
depends on NUMA && (X86_SUMMIT || X86_GENERICARCH)
select ACPI_NUMA

config HAVE_ARCH_PARSE_SRAT
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,14 +418,8 @@ acpi_cpufreq_cpu_init (
goto err_free;

perf = data->acpi_data;
policy->cpus = perf->shared_cpu_map;
policy->shared_type = perf->shared_type;
/*
* Will let policy->cpus know about dependency only when software
* coordination is required.
*/
if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
policy->shared_type == CPUFREQ_SHARED_TYPE_ANY)
policy->cpus = perf->shared_cpu_map;

if (cpu_has(c, X86_FEATURE_CONSTANT_TSC)) {
acpi_cpufreq_driver.flags |= CPUFREQ_CONST_LOOPS;
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,8 @@ static int centrino_cpu_init_acpi(struct cpufreq_policy *policy)
dprintk(PFX "obtaining ACPI data failed\n");
return -EIO;
}
policy->cpus = p->shared_cpu_map;
policy->shared_type = p->shared_type;
/*
* Will let policy->cpus know about dependency only when software
* coordination is required.
*/
if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
policy->shared_type == CPUFREQ_SHARED_TYPE_ANY)
policy->cpus = p->shared_cpu_map;

/* verify the acpi_data */
if (p->state_count <= 1) {
Expand Down
7 changes: 0 additions & 7 deletions trunk/drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,6 @@ config ACPI_FAN
This driver adds support for ACPI fan devices, allowing user-mode
applications to perform basic fan control (on, off, status).

config ACPI_DOCK
tristate "Dock"
depends on !ACPI_IBM_DOCK
default y
help
This driver adds support for ACPI controlled docking stations

config ACPI_PROCESSOR
tristate "Processor"
default y
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ obj-$(CONFIG_ACPI_BATTERY) += battery.o
obj-$(CONFIG_ACPI_BUTTON) += button.o
obj-$(CONFIG_ACPI_EC) += ec.o
obj-$(CONFIG_ACPI_FAN) += fan.o
obj-$(CONFIG_ACPI_DOCK) += dock.o
obj-$(CONFIG_ACPI_VIDEO) += video.o
obj-$(CONFIG_ACPI_HOTKEY) += hotkey.o
obj-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
Expand Down
63 changes: 40 additions & 23 deletions trunk/drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,18 +84,20 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
{
acpi_status status = AE_OK;

ACPI_FUNCTION_TRACE("acpi_ac_get_state");

if (!ac)
return -EINVAL;
return_VALUE(-EINVAL);

status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error reading AC Adapter state\n"));
ac->state = ACPI_AC_STATUS_UNKNOWN;
return -ENODEV;
return_VALUE(-ENODEV);
}

return 0;
return_VALUE(0);
}

/* --------------------------------------------------------------------------
Expand All @@ -108,13 +110,14 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
{
struct acpi_ac *ac = (struct acpi_ac *)seq->private;

ACPI_FUNCTION_TRACE("acpi_ac_seq_show");

if (!ac)
return 0;
return_VALUE(0);

if (acpi_ac_get_state(ac)) {
seq_puts(seq, "ERROR: Unable to read AC Adapter state\n");
return 0;
return_VALUE(0);
}

seq_puts(seq, "state: ");
Expand All @@ -130,7 +133,7 @@ static int acpi_ac_seq_show(struct seq_file *seq, void *offset)
break;
}

return 0;
return_VALUE(0);
}

static int acpi_ac_open_fs(struct inode *inode, struct file *file)
Expand All @@ -142,31 +145,35 @@ static int acpi_ac_add_fs(struct acpi_device *device)
{
struct proc_dir_entry *entry = NULL;

ACPI_FUNCTION_TRACE("acpi_ac_add_fs");

if (!acpi_device_dir(device)) {
acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device),
acpi_ac_dir);
if (!acpi_device_dir(device))
return -ENODEV;
return_VALUE(-ENODEV);
acpi_device_dir(device)->owner = THIS_MODULE;
}

/* 'state' [R] */
entry = create_proc_entry(ACPI_AC_FILE_STATE,
S_IRUGO, acpi_device_dir(device));
if (!entry)
return -ENODEV;
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Unable to create '%s' fs entry\n",
ACPI_AC_FILE_STATE));
else {
entry->proc_fops = &acpi_ac_fops;
entry->data = acpi_driver_data(device);
entry->owner = THIS_MODULE;
}

return 0;
return_VALUE(0);
}

static int acpi_ac_remove_fs(struct acpi_device *device)
{
ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");

if (acpi_device_dir(device)) {
remove_proc_entry(ACPI_AC_FILE_STATE, acpi_device_dir(device));
Expand All @@ -175,7 +182,7 @@ static int acpi_ac_remove_fs(struct acpi_device *device)
acpi_device_dir(device) = NULL;
}

return 0;
return_VALUE(0);
}

/* --------------------------------------------------------------------------
Expand All @@ -187,12 +194,13 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
struct acpi_ac *ac = (struct acpi_ac *)data;
struct acpi_device *device = NULL;

ACPI_FUNCTION_TRACE("acpi_ac_notify");

if (!ac)
return;
return_VOID;

if (acpi_bus_get_device(ac->handle, &device))
return;
return_VOID;

switch (event) {
case ACPI_AC_NOTIFY_STATUS:
Expand All @@ -205,7 +213,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
break;
}

return;
return_VOID;
}

static int acpi_ac_add(struct acpi_device *device)
Expand All @@ -214,13 +222,14 @@ static int acpi_ac_add(struct acpi_device *device)
acpi_status status = AE_OK;
struct acpi_ac *ac = NULL;

ACPI_FUNCTION_TRACE("acpi_ac_add");

if (!device)
return -EINVAL;
return_VALUE(-EINVAL);

ac = kmalloc(sizeof(struct acpi_ac), GFP_KERNEL);
if (!ac)
return -ENOMEM;
return_VALUE(-ENOMEM);
memset(ac, 0, sizeof(struct acpi_ac));

ac->handle = device->handle;
Expand All @@ -240,6 +249,8 @@ static int acpi_ac_add(struct acpi_device *device)
ACPI_DEVICE_NOTIFY, acpi_ac_notify,
ac);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error installing notify handler\n"));
result = -ENODEV;
goto end;
}
Expand All @@ -254,57 +265,63 @@ static int acpi_ac_add(struct acpi_device *device)
kfree(ac);
}

return result;
return_VALUE(result);
}

static int acpi_ac_remove(struct acpi_device *device, int type)
{
acpi_status status = AE_OK;
struct acpi_ac *ac = NULL;

ACPI_FUNCTION_TRACE("acpi_ac_remove");

if (!device || !acpi_driver_data(device))
return -EINVAL;
return_VALUE(-EINVAL);

ac = (struct acpi_ac *)acpi_driver_data(device);

status = acpi_remove_notify_handler(ac->handle,
ACPI_DEVICE_NOTIFY, acpi_ac_notify);
if (ACPI_FAILURE(status))
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error removing notify handler\n"));

acpi_ac_remove_fs(device);

kfree(ac);

return 0;
return_VALUE(0);
}

static int __init acpi_ac_init(void)
{
int result = 0;

ACPI_FUNCTION_TRACE("acpi_ac_init");

acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
if (!acpi_ac_dir)
return -ENODEV;
return_VALUE(-ENODEV);
acpi_ac_dir->owner = THIS_MODULE;

result = acpi_bus_register_driver(&acpi_ac_driver);
if (result < 0) {
remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
return -ENODEV;
return_VALUE(-ENODEV);
}

return 0;
return_VALUE(0);
}

static void __exit acpi_ac_exit(void)
{
ACPI_FUNCTION_TRACE("acpi_ac_exit");

acpi_bus_unregister_driver(&acpi_ac_driver);

remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);

return;
return_VOID;
}

module_init(acpi_ac_init);
Expand Down
Loading

0 comments on commit 2c8429d

Please sign in to comment.