From c41458aca0defd5b16239ffd65630d1b87672ee5 Mon Sep 17 00:00:00 2001 From: Kristen Carlson Accardi Date: Mon, 5 Feb 2007 16:09:07 -0800 Subject: ACPI: bay: remove ACPI driver struct The bay driver is a platform driver, and doesn't need to also be an acpi driver. Remove the acpi driver related structures and callbacks, they didn't do anything anyway. Switch to uevent for user space event notification. Signed-off-by: Kristen Carlson Accardi Signed-off-by: Andrew Morton Signed-off-by: Len Brown diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c index 667fa1d..9fdee61 100644 --- a/drivers/acpi/bay.c +++ b/drivers/acpi/bay.c @@ -47,18 +47,6 @@ MODULE_LICENSE("GPL"); acpi_get_name(h, ACPI_FULL_PATHNAME, &buffer);\ printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, s); } static void bay_notify(acpi_handle handle, u32 event, void *data); -static int acpi_bay_add(struct acpi_device *device); -static int acpi_bay_remove(struct acpi_device *device, int type); - -static struct acpi_driver acpi_bay_driver = { - .name = ACPI_BAY_DRIVER_NAME, - .class = ACPI_BAY_CLASS, - .ids = ACPI_BAY_HID, - .ops = { - .add = acpi_bay_add, - .remove = acpi_bay_remove, - }, -}; struct bay { acpi_handle handle; @@ -234,14 +222,6 @@ int eject_removable_drive(struct device *dev) } EXPORT_SYMBOL_GPL(eject_removable_drive); -static int acpi_bay_add(struct acpi_device *device) -{ - bay_dprintk(device->handle, "adding bay device"); - strcpy(acpi_device_name(device), "Dockable Bay"); - strcpy(acpi_device_class(device), "bay"); - return 0; -} - static int acpi_bay_add_fs(struct bay *bay) { int ret; @@ -339,52 +319,6 @@ bay_add_err: return -ENODEV; } -static int acpi_bay_remove(struct acpi_device *device, int type) -{ - /*** FIXME: do something here */ - return 0; -} - -/** - * bay_create_acpi_device - add new devices to acpi - * @handle - handle of the device to add - * - * This function will create a new acpi_device for the given - * handle if one does not exist already. This should cause - * acpi to scan for drivers for the given devices, and call - * matching driver's add routine. - * - * Returns a pointer to the acpi_device corresponding to the handle. - */ -static struct acpi_device * bay_create_acpi_device(acpi_handle handle) -{ - struct acpi_device *device = NULL; - struct acpi_device *parent_device; - acpi_handle parent; - int ret; - - bay_dprintk(handle, "Trying to get device"); - if (acpi_bus_get_device(handle, &device)) { - /* - * no device created for this object, - * so we should create one. - */ - bay_dprintk(handle, "No device for handle"); - acpi_get_parent(handle, &parent); - if (acpi_bus_get_device(parent, &parent_device)) - parent_device = NULL; - - ret = acpi_bus_add(&device, parent_device, handle, - ACPI_BUS_TYPE_DEVICE); - if (ret) { - pr_debug("error adding bus, %x\n", - -ret); - return NULL; - } - } - return device; -} - /** * bay_notify - act upon an acpi bay notification * @handle: the bay handle @@ -394,38 +328,19 @@ static struct acpi_device * bay_create_acpi_device(acpi_handle handle) */ static void bay_notify(acpi_handle handle, u32 event, void *data) { - struct acpi_device *dev; + struct bay *bay_dev = (struct bay *)data; + struct device *dev = &bay_dev->pdev->dev; bay_dprintk(handle, "Bay event"); switch(event) { case ACPI_NOTIFY_BUS_CHECK: - printk("Bus Check\n"); case ACPI_NOTIFY_DEVICE_CHECK: - printk("Device Check\n"); - dev = bay_create_acpi_device(handle); - if (dev) - acpi_bus_generate_event(dev, event, 0); - else - printk("No device for generating event\n"); - /* wouldn't it be a good idea to just rescan SATA - * right here? - */ - break; case ACPI_NOTIFY_EJECT_REQUEST: - printk("Eject request\n"); - dev = bay_create_acpi_device(handle); - if (dev) - acpi_bus_generate_event(dev, event, 0); - else - printk("No device for generating eventn"); - - /* wouldn't it be a good idea to just call the - * eject_device here if we were a SATA device? - */ + kobject_uevent(&dev->kobj, KOBJ_CHANGE); break; default: - printk("unknown event %d\n", event); + printk(KERN_ERR PREFIX "Bay: unknown event %d\n", event); } } @@ -457,10 +372,6 @@ static int __init bay_init(void) acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX, find_bay, &bays, NULL); - if (bays) - if ((acpi_bus_register_driver(&acpi_bay_driver) < 0)) - printk(KERN_ERR "Unable to register bay driver\n"); - if (!bays) return -ENODEV; @@ -481,8 +392,6 @@ static void __exit bay_exit(void) kfree(bay->name); kfree(bay); } - - acpi_bus_unregister_driver(&acpi_bay_driver); } postcore_initcall(bay_init); -- cgit v0.10.2 From 1c0f0575fd02a3996f09cac2ef29c4cc5c2d279d Mon Sep 17 00:00:00 2001 From: Matthew C Campbell Date: Mon, 5 Feb 2007 16:09:09 -0800 Subject: ACPI: asus_acpi: Add support for Asus Z81SP Adds support in asus_acpi for the Asus Z81SP laptop. This preserves all old functionality when improperly detected as well as enabling Bluetooth support. Signed-off-by: Matthew C Campbell Acked-by: Corentin Chary Cc: Karol Kozimor Cc: Signed-off-by: Andrew Morton Signed-off-by: Len Brown diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index 31ad70a..fa19a6c 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c @@ -141,6 +141,7 @@ struct asus_hotk { W5A, //W5A W3V, //W3030V xxN, //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N + A4S, //Z81sp //(Centrino) END_MODEL } model; //Models currently supported @@ -397,7 +398,16 @@ static struct model_data model_conf[END_MODEL] = { .brightness_set = "SPLV", .brightness_get = "GPLV", .display_set = "SDSP", - .display_get = "\\ADVG"} + .display_get = "\\ADVG"}, + + { + .name = "A4S", + .brightness_set = "SPLV", + .brightness_get = "GPLV", + .mt_bt_switch = "BLED", + .mt_wled = "WLED" + } + }; /* procdir we use */ @@ -1117,6 +1127,8 @@ static int asus_model_match(char *model) return W3V; else if (strncmp(model, "W5A", 3) == 0) return W5A; + else if (strncmp(model, "A4S", 3) == 0) + return A4S; else return END_MODEL; } -- cgit v0.10.2 From a74388e21ef2adbba4450f7b3f05ffe88df630d5 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 5 Feb 2007 16:09:11 -0800 Subject: ACPI: updates rtc-cmos device platform_data Update ACPI to export its RTC extension information through platform_data to the PNPACPI or platform bus device node used on the system being set up. This will need to be updated later to provide a firmware hook to handle system suspend with an alarm pending. Len notes that "Eventually we may bundle ACPI/PNP/PNPACPI..." but if/when that happens, ACPI can simplify this without my help. And until it does, the separate patch creating a platform_device (on all X86_PC systems, even without ACPI) will be needed. Signed-off-by: David Brownell Cc: Bjorn Helgaas Signed-off-by: Andrew Morton Signed-off-by: Len Brown diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 7b6c9ff..9950087 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -241,3 +241,92 @@ static int __init init_acpi_device_notify(void) } arch_initcall(init_acpi_device_notify); + + +#if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) + +/* Every ACPI platform has a mc146818 compatible "cmos rtc". Here we find + * its device node and pass extra config data. This helps its driver use + * capabilities that the now-obsolete mc146818 didn't have, and informs it + * that this board's RTC is wakeup-capable (per ACPI spec). + */ +#include + +static struct cmos_rtc_board_info rtc_info; + + +#ifdef CONFIG_PNPACPI + +/* PNP devices are registered in a subsys_initcall(); + * ACPI specifies the PNP IDs to use. + */ +#include + +static int __init pnp_match(struct device *dev, void *data) +{ + static const char *ids[] = { "PNP0b00", "PNP0b01", "PNP0b02", }; + struct pnp_dev *pnp = to_pnp_dev(dev); + int i; + + for (i = 0; i < ARRAY_SIZE(ids); i++) { + if (compare_pnp_id(pnp->id, ids[i]) != 0) + return 1; + } + return 0; +} + +static struct device *__init get_rtc_dev(void) +{ + return bus_find_device(&pnp_bus_type, NULL, NULL, pnp_match); +} + +#else + +/* We expect non-PNPACPI platforms to register an RTC device, usually + * at or near arch_initcall(). That also helps for example PCs that + * aren't configured with ACPI (where this code wouldn't run, but the + * RTC would still be available). The device name matches the driver; + * that's how the platform bus works. + */ +#include + +static int __init platform_match(struct device *dev, void *data) +{ + struct platform_device *pdev; + + pdev = container_of(dev, struct platform_device, dev); + return strcmp(pdev->name, "rtc_cmos") == 0; +} + +static struct device *__init get_rtc_dev(void) +{ + return bus_find_device(&platform_bus_type, NULL, NULL, platform_match); +} + +#endif + +static int __init acpi_rtc_init(void) +{ + struct device *dev = get_rtc_dev(); + + if (dev) { + rtc_info.rtc_day_alarm = acpi_gbl_FADT.day_alarm; + rtc_info.rtc_mon_alarm = acpi_gbl_FADT.month_alarm; + rtc_info.rtc_century = acpi_gbl_FADT.century; + + /* NOTE: acpi_gbl_FADT->rtcs4 is NOT currently useful */ + + dev->platform_data = &rtc_info; + + /* RTC always wakes from S1/S2/S3, and often S4/STD */ + device_init_wakeup(dev, 1); + + put_device(dev); + } else + pr_debug("ACPI: RTC unavailable?\n"); + return 0; +} +/* do this between RTC subsys_initcall() and rtc_cmos driver_initcall() */ +fs_initcall(acpi_rtc_init); + +#endif -- cgit v0.10.2 From d94d3dff0d5da3bdfcbb424ba5c08534521fd690 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 7 Feb 2007 16:51:46 -0800 Subject: ACPI: bay: fix build warning drivers/acpi/bay.c: In function 'bay_add': drivers/acpi/bay.c:310: warning: statement with no effect Fix it by rewriting those macros in C. Much nicer. Cc: Kristen Carlson Accardi Signed-off-by: Andrew Morton Signed-off-by: Len Brown diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 4dc8a50..3d7ebe0 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -122,10 +122,24 @@ extern int register_hotplug_dock_device(acpi_handle handle, acpi_notify_handler handler, void *context); extern void unregister_hotplug_dock_device(acpi_handle handle); #else -#define is_dock_device(h) (0) -#define register_dock_notifier(nb) (-ENODEV) -#define unregister_dock_notifier(nb) do { } while(0) -#define register_hotplug_dock_device(h1, h2, c) (-ENODEV) -#define unregister_hotplug_dock_device(h) do { } while(0) +static inline int is_dock_device(acpi_handle handle) +{ + return 0; +} +static inline int register_dock_notifier(struct notifier_block *nb) +{ + return -ENODEV; +} +static inline void unregister_dock_notifier(struct notifier_block *nb) +{ +} +static inline int register_hotplug_dock_device(acpi_handle handle, + acpi_notify_handler handler, void *context) +{ + return -ENODEV; +} +static inline void unregister_hotplug_dock_device(acpi_handle handle) +{ +} #endif #endif /*__ACPI_DRIVERS_H__*/ -- cgit v0.10.2 From b2b7910d5d3cb6e53b40a435bbc3f1de60f4464a Mon Sep 17 00:00:00 2001 From: "Ahmed S. Darwish" Date: Tue, 6 Feb 2007 16:14:43 -0800 Subject: ACPI: toshiba_acpi: Use ARRAY_SIZE macro when appropriate Use ARRAY_SIZE macro already defined in kernel.h Signed-off-by: Ahmed S. Darwish Signed-off-by: Andrew Morton Signed-off-by: Len Brown diff --git a/drivers/acpi/toshiba_acpi.c b/drivers/acpi/toshiba_acpi.c index d9b651f..0208d3a 100644 --- a/drivers/acpi/toshiba_acpi.c +++ b/drivers/acpi/toshiba_acpi.c @@ -125,7 +125,7 @@ static int write_acpi_int(const char *methodName, int val) union acpi_object in_objs[1]; acpi_status status; - params.count = sizeof(in_objs) / sizeof(in_objs[0]); + params.count = ARRAY_SIZE(in_objs); params.pointer = in_objs; in_objs[0].type = ACPI_TYPE_INTEGER; in_objs[0].integer.value = val; -- cgit v0.10.2 From a3c94e5c5921b0fd75b33042ca598aee52f1f7b9 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 9 Feb 2007 16:05:07 +0000 Subject: ACPI: bay: fix wrong order of kzalloc arguments Signed-off-by: Al Viro Signed-off-by: Len Brown diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c index 9fdee61..73dc10d 100644 --- a/drivers/acpi/bay.c +++ b/drivers/acpi/bay.c @@ -276,7 +276,7 @@ static int bay_add(acpi_handle handle, int id) /* * Initialize bay device structure */ - new_bay = kzalloc(GFP_ATOMIC, sizeof(*new_bay)); + new_bay = kzalloc(sizeof(*new_bay), GFP_ATOMIC); INIT_LIST_HEAD(&new_bay->list); new_bay->handle = handle; new_bay->name = (char *)nbuffer.pointer; -- cgit v0.10.2 From 3945ac36af3da6014cde9836c5acc5b3adaaa379 Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Tue, 6 Feb 2007 19:13:44 -0200 Subject: ACPI: ibm-acpi: cleanup init and exit paths Fix a small memory leak on module removal, and other assorted minor cleanups on the module init codepath. Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index c6144ca..2429e11 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c @@ -496,6 +496,10 @@ static int ibm_acpi_driver_init(void) printk(IBM_INFO "%s v%s\n", IBM_DESC, IBM_VERSION); printk(IBM_INFO "%s\n", IBM_URL); + if (ibm_thinkpad_ec_found) + printk(IBM_INFO "ThinkPad EC firmware %s\n", + ibm_thinkpad_ec_found); + return 0; } @@ -2617,7 +2621,7 @@ static void __init ibm_handle_init(char *name, ibm_handle_init(#object, &object##_handle, *object##_parent, \ object##_paths, ARRAY_SIZE(object##_paths), &object##_path) -static int set_ibm_param(const char *val, struct kernel_param *kp) +static int __init set_ibm_param(const char *val, struct kernel_param *kp) { unsigned int i; @@ -2659,7 +2663,8 @@ static void acpi_ibm_exit(void) for (i = ARRAY_SIZE(ibms) - 1; i >= 0; i--) ibm_exit(&ibms[i]); - remove_proc_entry(IBM_DIR, acpi_root_dir); + if (proc_dir) + remove_proc_entry(IBM_DIR, acpi_root_dir); if (ibm_thinkpad_ec_found) kfree(ibm_thinkpad_ec_found); @@ -2710,9 +2715,6 @@ static int __init acpi_ibm_init(void) /* Models with newer firmware report the EC in DMI */ ibm_thinkpad_ec_found = check_dmi_for_ec(); - if (ibm_thinkpad_ec_found) - printk(IBM_INFO "ThinkPad EC firmware %s\n", - ibm_thinkpad_ec_found); /* these handles are not required */ IBM_HANDLE_INIT(vid); @@ -2742,6 +2744,7 @@ static int __init acpi_ibm_init(void) proc_dir = proc_mkdir(IBM_DIR, acpi_root_dir); if (!proc_dir) { printk(IBM_ERR "unable to create proc dir %s", IBM_DIR); + acpi_ibm_exit(); return -ENODEV; } proc_dir->owner = THIS_MODULE; -- cgit v0.10.2 From d78112e1f1da2a8be1ac0d7b583dcc25aa4f079c Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Sat, 10 Feb 2007 00:47:44 -0500 Subject: ACPI: video: Fix null pointer in appledisplay driver commit "ACPI: video: Add dev argument for backlight_device_register" 519ab5f2be65b72cf12ae99c89752bbe79b44df6 broke the apple display driver. Signed-off-by: Michael Hanselmann Signed-off-by: Len Brown diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c index a7932a7..31ab83c 100644 --- a/drivers/usb/misc/appledisplay.c +++ b/drivers/usb/misc/appledisplay.c @@ -281,7 +281,7 @@ static int appledisplay_probe(struct usb_interface *iface, /* Register backlight device */ snprintf(bl_name, sizeof(bl_name), "appledisplay%d", atomic_inc_return(&count_displays) - 1); - pdata->bd = backlight_device_register(bl_name, NULL, NULL, + pdata->bd = backlight_device_register(bl_name, NULL, pdata &appledisplay_bl_data); if (IS_ERR(pdata->bd)) { err("appledisplay: Backlight registration failed"); -- cgit v0.10.2 From 359acec8cd78d35e64147565e28b516599066e08 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Sat, 10 Feb 2007 01:59:24 -0500 Subject: ACPI: add video driver MAINTAINER Signed-off-by: Len Brown diff --git a/MAINTAINERS b/MAINTAINERS index fe35f3a..7c5d329 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -247,6 +247,13 @@ L: linux-acpi@vger.kernel.org W: http://acpi.sourceforge.net/ S: Supported +ACPI VIDEO DRIVER +P: Luming Yu +M: luming.yu@intel.com +L: linux-acpi@vger.kernel.org +W: http://acpi.sourceforge.net/ +S: Supported + AD1816 SOUND DRIVER P: Thorsten Knabe M: Thorsten Knabe -- cgit v0.10.2 From 615d5f235b6c402ca01098a828c3d67e79e57cb6 Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Mon, 12 Feb 2007 10:51:23 -0500 Subject: ACPI: IA64: fix calculation of apic_id fix regression from recent table re-write Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 0079bc5..61d976e 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -404,7 +404,7 @@ static int map_lsapic_id(struct acpi_subtable_header *entry, if (lsapic->lapic_flags & ACPI_MADT_ENABLED) { /* First check against id */ if (lsapic->processor_id == acpi_id) { - *apic_id = lsapic->id; + *apic_id = (lsapic->id << 8) | lsapic->eid; return 1; /* Check against optional uid */ } else if (entry->length >= 16 && -- cgit v0.10.2 From a795ca5852fb944f21bd71c1230fcc5456e7d5ef Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 12 Feb 2007 14:39:38 +1100 Subject: ACPI: cleanup: make disable_acpi() valid w/o CONFIG_ACPI Len Brown said: > Okay, but better to use disable_acpi() > indeed, since this would be the first code not already inside CONFIG_ACPI > to invoke disable_acpi(), we could define the inline as empty and you could > then scratch the #ifdef too. Signed-off-by: Rusty Russell Signed-off-by: Len Brown diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index 5e657eb..449f3f2 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h @@ -127,6 +127,7 @@ extern int acpi_irq_balance_set(char *str); #define acpi_ioapic 0 static inline void acpi_noirq_set(void) { } static inline void acpi_disable_pci(void) { } +static inline void disable_acpi(void) { } #endif /* !CONFIG_ACPI */ -- cgit v0.10.2 From f3ccb06f3b8e0cf42b579db21f3ca7f17fcc3f38 Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Tue, 13 Feb 2007 02:35:50 -0500 Subject: ACPI: Disable wake GPEs only once. fixes Suspend/Resume regressions due to recent ACPICA update. Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown diff --git a/drivers/acpi/events/evgpe.c b/drivers/acpi/events/evgpe.c index dfac3ec..635ba44 100644 --- a/drivers/acpi/events/evgpe.c +++ b/drivers/acpi/events/evgpe.c @@ -636,17 +636,6 @@ acpi_ev_gpe_dispatch(struct acpi_gpe_event_info *gpe_event_info, u32 gpe_number) } } - if (!acpi_gbl_system_awake_and_running) { - /* - * We just woke up because of a wake GPE. Disable any further GPEs - * until we are fully up and running (Only wake GPEs should be enabled - * at this time, but we just brute-force disable them all.) - * 1) We must disable this particular wake GPE so it won't fire again - * 2) We want to disable all wake GPEs, since we are now awake - */ - (void)acpi_hw_disable_all_gpes(); - } - /* * Dispatch the GPE to either an installed handler, or the control method * associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke -- cgit v0.10.2 From 70c0846e430881967776582e13aefb81407919f1 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Tue, 13 Feb 2007 16:11:36 -0800 Subject: ACPI: Fix sparse warnings Use NULL for pointers drivers/acpi/osl.c:208:10: warning: Using plain integer as NULL pointer drivers/acpi/tables/tbxface.c:411:49: warning: Using plain integer as NULL pointer drivers/acpi/processor_core.c:1008:10: warning: Using plain integer as NULL pointer Signed-off-by: Randy Dunlap Signed-off-by: Len Brown diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 0f6f3bc..63060a1 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -205,7 +205,7 @@ void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size) { if (phys > ULONG_MAX) { printk(KERN_ERR PREFIX "Cannot map memory that high\n"); - return 0; + return NULL; } if (acpi_gbl_permanent_mmap) /* diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 61d976e..4b3d15f 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c @@ -1005,7 +1005,7 @@ static int __init acpi_processor_init(void) #ifdef CONFIG_SMP if (ACPI_FAILURE(acpi_get_table(ACPI_SIG_MADT, 0, (struct acpi_table_header **)&madt))) - madt = 0; + madt = NULL; #endif acpi_processor_dir = proc_mkdir(ACPI_PROCESSOR_CLASS, acpi_root_dir); diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c index 807978d..8193700 100644 --- a/drivers/acpi/tables/tbxface.c +++ b/drivers/acpi/tables/tbxface.c @@ -408,7 +408,7 @@ acpi_get_table(char *signature, } if (!acpi_gbl_permanent_mmap) { - acpi_gbl_root_table_list.tables[i].pointer = 0; + acpi_gbl_root_table_list.tables[i].pointer = NULL; } return (status); -- cgit v0.10.2 From fc955f670c0a66aca965605dae797e747b2bef7d Mon Sep 17 00:00:00 2001 From: Len Brown Date: Thu, 15 Feb 2007 22:11:48 -0500 Subject: ACPI: remove acpi_os_readable(), acpi_os_writable() ...which are now unused Signed-off-by: Len Brown diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 63060a1..99d6c51 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c @@ -890,26 +890,6 @@ u32 acpi_os_get_line(char *buffer) } #endif /* ACPI_FUTURE_USAGE */ -/* Assumes no unreadable holes inbetween */ -u8 acpi_os_readable(void *ptr, acpi_size len) -{ -#if defined(__i386__) || defined(__x86_64__) - char tmp; - return !__get_user(tmp, (char __user *)ptr) - && !__get_user(tmp, (char __user *)ptr + len - 1); -#endif - return 1; -} - -#ifdef ACPI_FUTURE_USAGE -u8 acpi_os_writable(void *ptr, acpi_size len) -{ - /* could do dummy write (racy) or a kernel page table lookup. - The later may be difficult at early boot when kmap doesn't work yet. */ - return 1; -} -#endif - acpi_status acpi_os_signal(u32 function, void *info) { switch (function) { diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 781394b..2785058 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h @@ -240,12 +240,6 @@ acpi_status acpi_os_validate_address(u8 space_id, acpi_physical_address address, acpi_size length); -u8 acpi_os_readable(void *pointer, acpi_size length); - -#ifdef ACPI_FUTURE_USAGE -u8 acpi_os_writable(void *pointer, acpi_size length); -#endif - u64 acpi_os_get_timer(void); acpi_status acpi_os_signal(u32 function, void *info); -- cgit v0.10.2 From 243b66e76ab722cdec1921d7f80c0cb808131c37 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Thu, 15 Feb 2007 22:34:36 -0500 Subject: ACPI: always enable CONFIG_PNPACPI on CONFIG_ACPI kernels We removed the ACPI motherboard driver which handled the ACPI=y, PNP=n case, so now we need to enforce that PNP & PNPACPI are always enabled for ACPI kernels. Most major distros ship this way this already. Cc: Bjorn Helgaas Signed-off-by: Len Brown diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 20eacc2..2d21fed 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -13,6 +13,7 @@ config ACPI depends on IA64 || X86 depends on PCI depends on PM + select PNP default y ---help--- Advanced Configuration and Power Interface (ACPI) support for diff --git a/drivers/pnp/pnpacpi/Kconfig b/drivers/pnp/pnpacpi/Kconfig index ad27e5e..b04767c 100644 --- a/drivers/pnp/pnpacpi/Kconfig +++ b/drivers/pnp/pnpacpi/Kconfig @@ -2,17 +2,5 @@ # Plug and Play ACPI configuration # config PNPACPI - bool "Plug and Play ACPI support" - depends on PNP && ACPI - default y - ---help--- - Linux uses the PNPACPI to autodetect built-in - mainboard resources (e.g. parallel port resources). - - Some features (e.g. real hotplug) are not currently - implemented. - - If you would like the kernel to detect and allocate resources to - your mainboard devices (on some systems they are disabled by the - BIOS) say Y here. Also the PNPACPI can help prevent resource - conflicts between mainboard devices and other bus devices. + bool + default (PNP && ACPI) -- cgit v0.10.2 From 8d4956c201c2f7683289f70095443c59a39f94ef Mon Sep 17 00:00:00 2001 From: Len Brown Date: Thu, 15 Feb 2007 22:46:42 -0500 Subject: ACPI: remove non-PNPACPI version of get_rtc_dev() It isn't needed in ACPI code anymore because now ACPI always includes PNPACPI. Cc: David Brownell Signed-off-by: Len Brown diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 9950087..4334c20 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -255,8 +255,6 @@ arch_initcall(init_acpi_device_notify); static struct cmos_rtc_board_info rtc_info; -#ifdef CONFIG_PNPACPI - /* PNP devices are registered in a subsys_initcall(); * ACPI specifies the PNP IDs to use. */ @@ -280,31 +278,6 @@ static struct device *__init get_rtc_dev(void) return bus_find_device(&pnp_bus_type, NULL, NULL, pnp_match); } -#else - -/* We expect non-PNPACPI platforms to register an RTC device, usually - * at or near arch_initcall(). That also helps for example PCs that - * aren't configured with ACPI (where this code wouldn't run, but the - * RTC would still be available). The device name matches the driver; - * that's how the platform bus works. - */ -#include - -static int __init platform_match(struct device *dev, void *data) -{ - struct platform_device *pdev; - - pdev = container_of(dev, struct platform_device, dev); - return strcmp(pdev->name, "rtc_cmos") == 0; -} - -static struct device *__init get_rtc_dev(void) -{ - return bus_find_device(&platform_bus_type, NULL, NULL, platform_match); -} - -#endif - static int __init acpi_rtc_init(void) { struct device *dev = get_rtc_dev(); -- cgit v0.10.2 From 5c95d3f5783ab184f64b7848f0a871352c35c3cf Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 15 Feb 2007 23:25:53 -0500 Subject: ACPI: include apic.h in processor driver for benefit of UP kernels apic.h does not get included on UP compiles. That way the APICTIMER_STOPS_ON_C3 is not there and UP boxen have no support for timer broadcasting. This was never noticed, because the lapic timer is only used for profiling on UP. Signed-off-by: Thomas Gleixner Signed-off-by: Ingo Molnar Cc: Roman Zippel Cc: john stultz Cc: Andi Kleen Signed-off-by: Andrew Morton Signed-off-by: Len Brown diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 6c6751b..59fac8d 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -40,6 +40,14 @@ #include /* need_resched() */ #include +/* + * Include the apic definitions for x86 to have the APIC timer related defines + * available also for UP (on SMP it gets magically included via linux/smp.h). + */ +#ifdef CONFIG_X86 +#include +#endif + #include #include -- cgit v0.10.2 From 636cedf9df6a6442364e78b51925f306a1056e43 Mon Sep 17 00:00:00 2001 From: Sanjoy Mahajan Date: Fri, 16 Feb 2007 01:24:43 -0500 Subject: ACPI: thermal: fix units in debug output http://bugzilla.kernel.org/show_bug.cgi?id=4972 Signed-off-by: Len Brown diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index f76d316..ff078d9 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c @@ -269,7 +269,7 @@ static int acpi_thermal_set_polling(struct acpi_thermal *tz, int seconds) ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Polling frequency set to %lu seconds\n", - tz->polling_frequency)); + tz->polling_frequency/10)); return 0; } -- cgit v0.10.2 From c24e912b61b1ab2301c59777134194066b06465c Mon Sep 17 00:00:00 2001 From: Alexey Starikovskiy Date: Thu, 15 Feb 2007 23:16:18 +0300 Subject: ACPI: ec: add unlock in error path Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 743ce27..8f5aaf7 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -280,8 +280,10 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command, mutex_lock(&ec->lock); if (ec->global_lock) { status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); - if (ACPI_FAILURE(status)) + if (ACPI_FAILURE(status)) { + mutex_unlock(&ec->lock); return -ENODEV; + } } /* Make sure GPE is enabled before doing transaction */ -- cgit v0.10.2 From ecb5f7521a309cb9c5fc0832b9705cd2a03d7d45 Mon Sep 17 00:00:00 2001 From: John Keller Date: Thu, 15 Feb 2007 14:08:30 -0600 Subject: ACPI: acpi_unload_table_id() always returns error acpi_unload_table_id() is always returning an error status. Also, once the matching table is found, don't bother looking for another match. Signed-off-by: John Keller Signed-off-by: Len Brown diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c index 8193700..417ef5f 100644 --- a/drivers/acpi/tables/tbxface.c +++ b/drivers/acpi/tables/tbxface.c @@ -338,9 +338,9 @@ acpi_status acpi_unload_table_id(acpi_owner_id id) int i; acpi_status status = AE_NOT_EXIST; - ACPI_FUNCTION_TRACE(acpi_unload_table); + ACPI_FUNCTION_TRACE(acpi_unload_table_id); - /* Find table from the requested type list */ + /* Find table in the global table list */ for (i = 0; i < acpi_gbl_root_table_list.count; ++i) { if (id != acpi_gbl_root_table_list.tables[i].owner_id) { continue; @@ -352,8 +352,9 @@ acpi_status acpi_unload_table_id(acpi_owner_id id) * simply a position within the hierarchy */ acpi_tb_delete_namespace_by_owner(i); - acpi_tb_release_owner_id(i); + status = acpi_tb_release_owner_id(i); acpi_tb_set_table_loaded_flag(i, FALSE); + break; } return_ACPI_STATUS(status); } -- cgit v0.10.2 From 0539771d7236b425f285652f6f297cc7939c8f9a Mon Sep 17 00:00:00 2001 From: Henrique de Moraes Holschuh Date: Wed, 14 Feb 2007 10:55:00 -0200 Subject: ACPI: bay: use IS_ERR for return of register_platform_device_simple register_platform_device_simple returns ERR_PTR(foo), so test it with IS_ERR(foo). Signed-off-by: Henrique de Moraes Holschuh Signed-off-by: Len Brown diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c index 73dc10d..9c28081 100644 --- a/drivers/acpi/bay.c +++ b/drivers/acpi/bay.c @@ -283,7 +283,7 @@ static int bay_add(acpi_handle handle, int id) /* initialize platform device stuff */ pdev = platform_device_register_simple(ACPI_BAY_CLASS, id, NULL, 0); - if (pdev == NULL) { + if (IS_ERR(pdev)) { printk(KERN_ERR PREFIX "Error registering bay device\n"); goto bay_add_err; } -- cgit v0.10.2