Skip to content

Commit

Permalink
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (44 commits)
  ACPI: remove function tracing macros from drivers/acpi/*.c
  ACPI: add support for Smart Battery
  ACPI: handle battery notify event on broken BIOS
  ACPI: handle AC notify event on broken BIOS
  ACPI: asus_acpi: add S1N WLED control
  ACPI: asus_acpi: correct M6N/M6R display nodes
  ACPI: asus_acpi: add S1N WLED control
  ACPI: asus_acpi: rework model detection
  ACPI: asus_acpi: support L5D
  ACPI: asus_acpi: handle internal Bluetooth / support W5A
  ACPI: asus_acpi: support A4G
  ACPI: asus_acpi: support W3400N
  ACPI: asus_acpi: LED display support
  ACPI: asus_acpi: support A3G
  ACPI: asus_acpi: misc cleanups
  ACPI: video: Remove unneeded acpi_handle from driver.
  ACPI: thermal: Remove unneeded acpi_handle from driver.
  ACPI: power: Remove unneeded acpi_handle from driver.
  ACPI: pci_root: Remove unneeded acpi_handle from driver.
  ACPI: pci_link: Remove unneeded acpi_handle from driver.
  ...
  • Loading branch information
Linus Torvalds committed Jul 4, 2006
2 parents 075395d + 309b0f1 commit e82ca04
Show file tree
Hide file tree
Showing 33 changed files with 2,732 additions and 318 deletions.
2 changes: 1 addition & 1 deletion arch/ia64/kernel/acpi-ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static acpi_status hp_ccsr_locate(acpi_handle obj, u64 *base, u64 *length)
memcpy(length, vendor->byte_data + 8, sizeof(*length));

exit:
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return status;
}

Expand Down
12 changes: 6 additions & 6 deletions arch/ia64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,21 +856,21 @@ int acpi_map_lsapic(acpi_handle handle, int *pcpu)
obj = buffer.pointer;
if (obj->type != ACPI_TYPE_BUFFER ||
obj->buffer.length < sizeof(*lsapic)) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return -EINVAL;
}

lsapic = (struct acpi_table_lsapic *)obj->buffer.pointer;

if ((lsapic->header.type != ACPI_MADT_LSAPIC) ||
(!lsapic->flags.enabled)) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return -EINVAL;
}

physid = ((lsapic->id << 8) | (lsapic->eid));

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
buffer.length = ACPI_ALLOCATE_BUFFER;
buffer.pointer = NULL;

Expand Down Expand Up @@ -934,20 +934,20 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
obj = buffer.pointer;
if (obj->type != ACPI_TYPE_BUFFER ||
obj->buffer.length < sizeof(*iosapic)) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return AE_OK;
}

iosapic = (struct acpi_table_iosapic *)obj->buffer.pointer;

if (iosapic->header.type != ACPI_MADT_IOSAPIC) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return AE_OK;
}

gsi_base = iosapic->global_irq_base;

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);

/*
* OK, it's an IOSAPIC MADT entry, look for a _PXM value to tell
Expand Down
12 changes: 12 additions & 0 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,18 @@ config ACPI_HOTPLUG_MEMORY
If one selects "m," this driver can be loaded using the following
command:
$>modprobe acpi_memhotplug

config ACPI_SBS
tristate "Smart Battery System (EXPERIMENTAL)"
depends on X86 && I2C
depends on EXPERIMENTAL
default y
help
This driver adds support for the Smart Battery System.
Depends on I2C (Device Drivers ---> I2C support)
A "Smart Battery" is quite old and quite rare compared
to today's ACPI "Control Method" battery.

endif # ACPI

endmenu
2 changes: 2 additions & 0 deletions drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ obj-$(CONFIG_ACPI_IBM) += ibm_acpi.o
obj-$(CONFIG_ACPI_TOSHIBA) += toshiba_acpi.o
obj-y += scan.o motherboard.o
obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o
obj-y += cm_sbs.o
obj-$(CONFIG_ACPI_SBS) += i2c_ec.o sbs.o
32 changes: 17 additions & 15 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ ACPI_MODULE_NAME("acpi_ac")
MODULE_DESCRIPTION(ACPI_AC_DRIVER_NAME);
MODULE_LICENSE("GPL");

extern struct proc_dir_entry *acpi_lock_ac_dir(void);
extern void *acpi_unlock_ac_dir(struct proc_dir_entry *acpi_ac_dir);

static int acpi_ac_add(struct acpi_device *device);
static int acpi_ac_remove(struct acpi_device *device, int type);
static int acpi_ac_open_fs(struct inode *inode, struct file *file);
Expand All @@ -65,7 +68,7 @@ static struct acpi_driver acpi_ac_driver = {
};

struct acpi_ac {
acpi_handle handle;
struct acpi_device * device;
unsigned long state;
};

Expand All @@ -88,7 +91,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
if (!ac)
return -EINVAL;

status = acpi_evaluate_integer(ac->handle, "_PSR", NULL, &ac->state);
status = acpi_evaluate_integer(ac->device->handle, "_PSR", NULL, &ac->state);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Error reading AC Adapter state"));
ac->state = ACPI_AC_STATUS_UNKNOWN;
Expand Down Expand Up @@ -191,11 +194,11 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
if (!ac)
return;

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

device = ac->device;
switch (event) {
case ACPI_AC_NOTIFY_STATUS:
case ACPI_NOTIFY_BUS_CHECK:
case ACPI_NOTIFY_DEVICE_CHECK:
acpi_ac_get_state(ac);
acpi_bus_generate_event(device, event, (u32) ac->state);
break;
Expand Down Expand Up @@ -223,7 +226,7 @@ static int acpi_ac_add(struct acpi_device *device)
return -ENOMEM;
memset(ac, 0, sizeof(struct acpi_ac));

ac->handle = device->handle;
ac->device = device;
strcpy(acpi_device_name(device), ACPI_AC_DEVICE_NAME);
strcpy(acpi_device_class(device), ACPI_AC_CLASS);
acpi_driver_data(device) = ac;
Expand All @@ -236,8 +239,8 @@ static int acpi_ac_add(struct acpi_device *device)
if (result)
goto end;

status = acpi_install_notify_handler(ac->handle,
ACPI_DEVICE_NOTIFY, acpi_ac_notify,
status = acpi_install_notify_handler(device->handle,
ACPI_ALL_NOTIFY, acpi_ac_notify,
ac);
if (ACPI_FAILURE(status)) {
result = -ENODEV;
Expand Down Expand Up @@ -268,8 +271,8 @@ static int acpi_ac_remove(struct acpi_device *device, int type)

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

status = acpi_remove_notify_handler(ac->handle,
ACPI_DEVICE_NOTIFY, acpi_ac_notify);
status = acpi_remove_notify_handler(device->handle,
ACPI_ALL_NOTIFY, acpi_ac_notify);

acpi_ac_remove_fs(device);

Expand All @@ -280,17 +283,16 @@ static int acpi_ac_remove(struct acpi_device *device, int type)

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


acpi_ac_dir = proc_mkdir(ACPI_AC_CLASS, acpi_root_dir);
acpi_ac_dir = acpi_lock_ac_dir();
if (!acpi_ac_dir)
return -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);
acpi_unlock_ac_dir(acpi_ac_dir);
return -ENODEV;
}

Expand All @@ -302,7 +304,7 @@ static void __exit acpi_ac_exit(void)

acpi_bus_unregister_driver(&acpi_ac_driver);

remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
acpi_unlock_ac_dir(acpi_ac_dir);

return;
}
Expand Down
18 changes: 9 additions & 9 deletions drivers/acpi/acpi_memhotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct acpi_memory_info {
};

struct acpi_memory_device {
acpi_handle handle;
struct acpi_device * device;
unsigned int state; /* State of the memory device */
struct list_head res_list;
};
Expand Down Expand Up @@ -129,7 +129,7 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
struct acpi_memory_info *info, *n;


status = acpi_walk_resources(mem_device->handle, METHOD_NAME__CRS,
status = acpi_walk_resources(mem_device->device->handle, METHOD_NAME__CRS,
acpi_memory_get_resource, mem_device);
if (ACPI_FAILURE(status)) {
list_for_each_entry_safe(info, n, &mem_device->res_list, list)
Expand Down Expand Up @@ -192,7 +192,7 @@ static int acpi_memory_check_device(struct acpi_memory_device *mem_device)


/* Get device present/absent information from the _STA */
if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->handle, "_STA",
if (ACPI_FAILURE(acpi_evaluate_integer(mem_device->device->handle, "_STA",
NULL, &current_status)))
return -ENODEV;
/*
Expand Down Expand Up @@ -222,7 +222,7 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
return result;
}

node = acpi_get_node(mem_device->handle);
node = acpi_get_node(mem_device->device->handle);
/*
* Tell the VM there is more memory here...
* Note: Assume that this function returns zero on success
Expand Down Expand Up @@ -269,7 +269,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
arg_list.pointer = &arg;
arg.type = ACPI_TYPE_INTEGER;
arg.integer.value = 1;
status = acpi_evaluate_object(mem_device->handle,
status = acpi_evaluate_object(mem_device->device->handle,
"_EJ0", &arg_list, NULL);
/* Return on _EJ0 failure */
if (ACPI_FAILURE(status)) {
Expand All @@ -278,7 +278,7 @@ static int acpi_memory_powerdown_device(struct acpi_memory_device *mem_device)
}

/* Evalute _STA to check if the device is disabled */
status = acpi_evaluate_integer(mem_device->handle, "_STA",
status = acpi_evaluate_integer(mem_device->device->handle, "_STA",
NULL, &current_status);
if (ACPI_FAILURE(status))
return -ENODEV;
Expand Down Expand Up @@ -398,7 +398,7 @@ static int acpi_memory_device_add(struct acpi_device *device)
memset(mem_device, 0, sizeof(struct acpi_memory_device));

INIT_LIST_HEAD(&mem_device->res_list);
mem_device->handle = device->handle;
mem_device->device = device;
sprintf(acpi_device_name(device), "%s", ACPI_MEMORY_DEVICE_NAME);
sprintf(acpi_device_class(device), "%s", ACPI_MEMORY_DEVICE_CLASS);
acpi_driver_data(device) = mem_device;
Expand Down Expand Up @@ -466,7 +466,7 @@ static acpi_status is_memory_device(acpi_handle handle)

info = buffer.pointer;
if (!(info->valid & ACPI_VALID_HID)) {
acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return AE_ERROR;
}

Expand All @@ -475,7 +475,7 @@ static acpi_status is_memory_device(acpi_handle handle)
(strcmp(hardware_id, ACPI_MEMORY_DEVICE_HID)))
status = AE_ERROR;

acpi_os_free(buffer.pointer);
kfree(buffer.pointer);
return status;
}

Expand Down
Loading

0 comments on commit e82ca04

Please sign in to comment.