Pull battery into test branch
authorLen Brown <len.brown@intel.com>
Sat, 14 Oct 2006 06:25:48 +0000 (02:25 -0400)
committerLen Brown <len.brown@intel.com>
Sat, 14 Oct 2006 06:25:48 +0000 (02:25 -0400)
Documentation/ibm-acpi.txt
drivers/acpi/asus_acpi.c
drivers/acpi/events/evrgnini.c
drivers/acpi/ibm_acpi.c

index 71aa403..e50595b 100644 (file)
@@ -30,9 +30,10 @@ detailed description):
        - ACPI sounds
        - temperature sensors
        - Experimental: embedded controller register dump
-       - Experimental: LCD brightness control
-       - Experimental: volume control
+       - LCD brightness control
+       - Volume control
        - Experimental: fan speed, fan enable/disable
+       - Experimental: WAN enable and disable
 
 A compatibility table by model and feature is maintained on the web
 site, http://ibm-acpi.sf.net/. I appreciate any success or failure
@@ -52,40 +53,7 @@ Installation
 
 If you are compiling this driver as included in the Linux kernel
 sources, simply enable the CONFIG_ACPI_IBM option (Power Management /
-ACPI / IBM ThinkPad Laptop Extras). The rest of this section describes
-how to install this driver when downloaded from the web site.
-
-First, you need to get a kernel with ACPI support up and running.
-Please refer to http://acpi.sourceforge.net/ for help with this
-step. How successful you will be depends a lot on you ThinkPad model,
-the kernel you are using and any additional patches applied. The
-kernel provided with your distribution may not be good enough. I
-needed to compile a 2.6.7 kernel with the 20040715 ACPI patch to get
-ACPI working reliably on my ThinkPad X40. Old ThinkPad models may not
-be supported at all.
-
-Assuming you have the basic ACPI support working (e.g. you can see the
-/proc/acpi directory), follow the following steps to install this
-driver:
-
-       - unpack the archive:
-
-               tar xzvf ibm-acpi-x.y.tar.gz; cd ibm-acpi-x.y
-
-       - compile the driver:
-
-               make
-
-       - install the module in your kernel modules directory:
-
-               make install
-
-       - load the module:
-
-               modprobe ibm_acpi
-
-After loading the module, check the "dmesg" output for any error messages.
-
+ACPI / IBM ThinkPad Laptop Extras).
 
 Features
 --------
@@ -523,13 +491,8 @@ registers contain the current battery capacity, etc. If you experiment
 with this, do send me your results (including some complete dumps with
 a description of the conditions when they were taken.)
 
-EXPERIMENTAL: LCD brightness control -- /proc/acpi/ibm/brightness
------------------------------------------------------------------
-
-This feature is marked EXPERIMENTAL because the implementation
-directly accesses hardware registers and may not work as expected. USE
-WITH CAUTION! To use this feature, you need to supply the
-experimental=1 parameter when loading the module.
+LCD brightness control -- /proc/acpi/ibm/brightness
+---------------------------------------------------
 
 This feature allows software control of the LCD brightness on ThinkPad
 models which don't have a hardware brightness slider. The available
@@ -542,13 +505,8 @@ commands are:
 The <level> number range is 0 to 7, although not all of them may be
 distinct. The current brightness level is shown in the file.
 
-EXPERIMENTAL: Volume control -- /proc/acpi/ibm/volume
------------------------------------------------------
-
-This feature is marked EXPERIMENTAL because the implementation
-directly accesses hardware registers and may not work as expected. USE
-WITH CAUTION! To use this feature, you need to supply the
-experimental=1 parameter when loading the module.
+Volume control -- /proc/acpi/ibm/volume
+---------------------------------------
 
 This feature allows volume control on ThinkPad models which don't have
 a hardware volume knob. The available commands are:
@@ -611,6 +569,23 @@ with the following command:
 
        echo 'level <level>' > /proc/acpi/ibm/thermal
 
+EXPERIMENTAL: WAN -- /proc/acpi/ibm/wan
+---------------------------------------
+
+This feature is marked EXPERIMENTAL because the implementation
+directly accesses hardware registers and may not work as expected. USE
+WITH CAUTION! To use this feature, you need to supply the
+experimental=1 parameter when loading the module.
+
+This feature shows the presence and current state of a WAN (Sierra
+Wireless EV-DO) device. If WAN is installed, the following commands can
+be used:
+
+       echo enable > /proc/acpi/ibm/wan
+       echo disable > /proc/acpi/ibm/wan
+
+It was tested on a Lenovo Thinkpad X60. It should probably work on other
+Thinkpad models which come with this module installed.
 
 Multiple Commands, Module Parameters
 ------------------------------------
index e9ee4c5..c7ac929 100644 (file)
@@ -138,6 +138,7 @@ struct asus_hotk {
                S2x,            //S200 (J1 reported), Victor MP-XP7210
                W1N,            //W1000N
                W5A,            //W5A
+               W3V,            //W3030V
                xxN,            //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N
                //(Centrino)
                END_MODEL
@@ -376,6 +377,17 @@ static struct model_data model_conf[END_MODEL] = {
         .display_get = "\\ADVG"},
 
        {
+        .name = "W3V",
+        .mt_mled = "MLED",
+        .mt_wled = "WLED",
+        .mt_lcd_switch = xxN_PREFIX "_Q10",
+        .lcd_status = "\\BKLT",
+        .brightness_set = "SPLV",
+        .brightness_get = "GPLV",
+        .display_set = "SDSP",
+        .display_get = "\\INFB"},
+
+       {
         .name = "xxN",
         .mt_mled = "MLED",
 /* WLED present, but not controlled by ACPI */
@@ -555,11 +567,11 @@ static int
 write_led(const char __user * buffer, unsigned long count,
          char *ledname, int ledmask, int invert)
 {
-       int value;
+       int rv, value;
        int led_out = 0;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0)
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0)
                led_out = value ? 1 : 0;
 
        hotk->status =
@@ -572,7 +584,7 @@ write_led(const char __user * buffer, unsigned long count,
                printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
                       ledname);
 
-       return count;
+       return rv;
 }
 
 /*
@@ -607,20 +619,18 @@ static int
 proc_write_ledd(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
-       int value;
+       int rv, value;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0) {
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0) {
                if (!write_acpi_int
                    (hotk->handle, hotk->methods->mt_ledd, value, NULL))
                        printk(KERN_WARNING
                               "Asus ACPI: LED display write failed\n");
                else
                        hotk->ledd_status = (u32) value;
-       } else if (count < 0)
-               printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
-
-       return count;
+       }
+       return rv;
 }
 
 /*
@@ -761,12 +771,12 @@ static int
 proc_write_lcd(struct file *file, const char __user * buffer,
               unsigned long count, void *data)
 {
-       int value;
+       int rv, value;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0)
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0)
                set_lcd_state(value);
-       return count;
+       return rv;
 }
 
 static int read_brightness(void)
@@ -830,18 +840,15 @@ static int
 proc_write_brn(struct file *file, const char __user * buffer,
               unsigned long count, void *data)
 {
-       int value;
+       int rv, value;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0) {
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0) {
                value = (0 < value) ? ((15 < value) ? 15 : value) : 0;
                /* 0 <= value <= 15 */
                set_brightness(value);
-       } else if (count < 0) {
-               printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
        }
-
-       return count;
+       return rv;
 }
 
 static void set_display(int value)
@@ -880,15 +887,12 @@ static int
 proc_write_disp(struct file *file, const char __user * buffer,
                unsigned long count, void *data)
 {
-       int value;
+       int rv, value;
 
-       count = parse_arg(buffer, count, &value);
-       if (count > 0)
+       rv = parse_arg(buffer, count, &value);
+       if (rv > 0)
                set_display(value);
-       else if (count < 0)
-               printk(KERN_WARNING "Asus ACPI: Error reading user input\n");
-
-       return count;
+       return rv;
 }
 
 typedef int (proc_readfunc) (char *page, char **start, off_t off, int count,
@@ -1097,6 +1101,8 @@ static int asus_model_match(char *model)
                return A4G;
        else if (strncmp(model, "W1N", 3) == 0)
                return W1N;
+       else if (strncmp(model, "W3V", 3) == 0)
+               return W3V;
        else if (strncmp(model, "W5A", 3) == 0)
                return W5A;
        else
@@ -1200,9 +1206,10 @@ static int asus_hotk_get_info(void)
                hotk->methods->mt_wled = NULL;
        /* L5D's WLED is not controlled by ACPI */
        else if (strncmp(string, "M2N", 3) == 0 ||
+                strncmp(string, "W3V", 3) == 0 ||
                 strncmp(string, "S1N", 3) == 0)
                hotk->methods->mt_wled = "WLED";
-       /* M2N and S1N have a usable WLED */
+       /* M2N, S1N and W3V have a usable WLED */
        else if (asus_info) {
                if (strncmp(asus_info->oem_table_id, "L1", 2) == 0)
                        hotk->methods->mled_status = NULL;
index 5b3c7a8..203d135 100644 (file)
@@ -225,13 +225,12 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
                                if (!
                                    (ACPI_STRNCMP
                                     (object_hID.value, PCI_ROOT_HID_STRING,
-                                     sizeof(PCI_ROOT_HID_STRING))
-                                    ||
-                                    !(ACPI_STRNCMP
-                                      (object_hID.value,
-                                       PCI_EXPRESS_ROOT_HID_STRING,
-                                       sizeof(PCI_EXPRESS_ROOT_HID_STRING)))))
-                               {
+                                     sizeof(PCI_ROOT_HID_STRING)))
+                                   ||
+                                   !(ACPI_STRNCMP
+                                     (object_hID.value,
+                                      PCI_EXPRESS_ROOT_HID_STRING,
+                                      sizeof(PCI_EXPRESS_ROOT_HID_STRING)))) {
 
                                        /* Install a handler for this PCI root bridge */
 
index 15fc124..003a987 100644 (file)
@@ -1702,13 +1702,11 @@ static struct ibm_struct ibms[] = {
         .name = "brightness",
         .read = brightness_read,
         .write = brightness_write,
-        .experimental = 1,
         },
        {
         .name = "volume",
         .read = volume_read,
         .write = volume_write,
-        .experimental = 1,
         },
        {
         .name = "fan",