Pull misc-for-upstream into release branch
authorLen Brown <len.brown@intel.com>
Fri, 16 Feb 2007 23:52:41 +0000 (18:52 -0500)
committerLen Brown <len.brown@intel.com>
Fri, 16 Feb 2007 23:52:41 +0000 (18:52 -0500)
Conflicts:

drivers/usb/misc/appledisplay.c

Signed-off-by: Len Brown <len.brown@intel.com>
19 files changed:
MAINTAINERS
drivers/acpi/Kconfig
drivers/acpi/asus_acpi.c
drivers/acpi/bay.c
drivers/acpi/ec.c
drivers/acpi/events/evgpe.c
drivers/acpi/glue.c
drivers/acpi/ibm_acpi.c
drivers/acpi/osl.c
drivers/acpi/processor_core.c
drivers/acpi/processor_idle.c
drivers/acpi/tables/tbxface.c
drivers/acpi/thermal.c
drivers/acpi/toshiba_acpi.c
drivers/pnp/pnpacpi/Kconfig
drivers/usb/misc/appledisplay.c
include/acpi/acpi_drivers.h
include/acpi/acpiosxf.h
include/asm-i386/acpi.h

index b0fd71b..5a546e5 100644 (file)
@@ -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 <linux@thorsten-knabe.de>
index 20eacc2..2d21fed 100644 (file)
@@ -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 
index 31ad70a..fa19a6c 100644 (file)
@@ -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;
 }
index 91082ce..9c28081 100644 (file)
@@ -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;
@@ -303,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;
        }
@@ -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);
index 743ce27..8f5aaf7 100644 (file)
@@ -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 */
index dfac3ec..635ba44 100644 (file)
@@ -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
index 7b6c9ff..4334c20 100644 (file)
@@ -241,3 +241,65 @@ 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 <linux/mc146818rtc.h>
+
+static struct cmos_rtc_board_info rtc_info;
+
+
+/* PNP devices are registered in a subsys_initcall();
+ * ACPI specifies the PNP IDs to use.
+ */
+#include <linux/pnp.h>
+
+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);
+}
+
+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
index c6144ca..2429e11 100644 (file)
@@ -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;
index 0f6f3bc..99d6c51 100644 (file)
@@ -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)
                /*
@@ -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) {
index 0079bc5..4b3d15f 100644 (file)
@@ -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 &&
@@ -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);
index 8206fc1..835595a 100644 (file)
 #include <asm/apic.h>
 #endif
 
+/*
+ * 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 <asm/apic.h>
+#endif
+
 #include <asm/io.h>
 #include <asm/uaccess.h>
 
index 807978d..417ef5f 100644 (file)
@@ -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);
 }
@@ -408,7 +409,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);
index 986afd4..442bfd5 100644 (file)
@@ -270,7 +270,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;
 }
index d9b651f..0208d3a 100644 (file)
@@ -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;
index ad27e5e..b04767c 100644 (file)
@@ -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)
index 32f0e3a..e573c8b 100644 (file)
@@ -281,8 +281,8 @@ 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,
-               pdata, &appledisplay_bl_data);
+       pdata->bd = backlight_device_register(bl_name, NULL, pdata,
+                                               &appledisplay_bl_data);
        if (IS_ERR(pdata->bd)) {
                err("appledisplay: Backlight registration failed");
                goto error;
index 4dc8a50..3d7ebe0 100644 (file)
@@ -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__*/
index 781394b..2785058 100644 (file)
@@ -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);
index 5e657eb..449f3f2 100644 (file)
@@ -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 */