diff options
-rw-r--r-- | Documentation/ibm-acpi.txt | 75 | ||||
-rw-r--r-- | drivers/acpi/asus_acpi.c | 67 | ||||
-rw-r--r-- | drivers/acpi/events/evrgnini.c | 13 | ||||
-rw-r--r-- | drivers/acpi/ibm_acpi.c | 2 |
4 files changed, 68 insertions, 89 deletions
diff --git a/Documentation/ibm-acpi.txt b/Documentation/ibm-acpi.txt index 71aa40345272..e50595bfd8ea 100644 --- a/Documentation/ibm-acpi.txt +++ b/Documentation/ibm-acpi.txt | |||
@@ -30,9 +30,10 @@ detailed description): | |||
30 | - ACPI sounds | 30 | - ACPI sounds |
31 | - temperature sensors | 31 | - temperature sensors |
32 | - Experimental: embedded controller register dump | 32 | - Experimental: embedded controller register dump |
33 | - Experimental: LCD brightness control | 33 | - LCD brightness control |
34 | - Experimental: volume control | 34 | - Volume control |
35 | - Experimental: fan speed, fan enable/disable | 35 | - Experimental: fan speed, fan enable/disable |
36 | - Experimental: WAN enable and disable | ||
36 | 37 | ||
37 | A compatibility table by model and feature is maintained on the web | 38 | A compatibility table by model and feature is maintained on the web |
38 | site, http://ibm-acpi.sf.net/. I appreciate any success or failure | 39 | site, http://ibm-acpi.sf.net/. I appreciate any success or failure |
@@ -52,40 +53,7 @@ Installation | |||
52 | 53 | ||
53 | If you are compiling this driver as included in the Linux kernel | 54 | If you are compiling this driver as included in the Linux kernel |
54 | sources, simply enable the CONFIG_ACPI_IBM option (Power Management / | 55 | sources, simply enable the CONFIG_ACPI_IBM option (Power Management / |
55 | ACPI / IBM ThinkPad Laptop Extras). The rest of this section describes | 56 | ACPI / IBM ThinkPad Laptop Extras). |
56 | how to install this driver when downloaded from the web site. | ||
57 | |||
58 | First, you need to get a kernel with ACPI support up and running. | ||
59 | Please refer to http://acpi.sourceforge.net/ for help with this | ||
60 | step. How successful you will be depends a lot on you ThinkPad model, | ||
61 | the kernel you are using and any additional patches applied. The | ||
62 | kernel provided with your distribution may not be good enough. I | ||
63 | needed to compile a 2.6.7 kernel with the 20040715 ACPI patch to get | ||
64 | ACPI working reliably on my ThinkPad X40. Old ThinkPad models may not | ||
65 | be supported at all. | ||
66 | |||
67 | Assuming you have the basic ACPI support working (e.g. you can see the | ||
68 | /proc/acpi directory), follow the following steps to install this | ||
69 | driver: | ||
70 | |||
71 | - unpack the archive: | ||
72 | |||
73 | tar xzvf ibm-acpi-x.y.tar.gz; cd ibm-acpi-x.y | ||
74 | |||
75 | - compile the driver: | ||
76 | |||
77 | make | ||
78 | |||
79 | - install the module in your kernel modules directory: | ||
80 | |||
81 | make install | ||
82 | |||
83 | - load the module: | ||
84 | |||
85 | modprobe ibm_acpi | ||
86 | |||
87 | After loading the module, check the "dmesg" output for any error messages. | ||
88 | |||
89 | 57 | ||
90 | Features | 58 | Features |
91 | -------- | 59 | -------- |
@@ -523,13 +491,8 @@ registers contain the current battery capacity, etc. If you experiment | |||
523 | with this, do send me your results (including some complete dumps with | 491 | with this, do send me your results (including some complete dumps with |
524 | a description of the conditions when they were taken.) | 492 | a description of the conditions when they were taken.) |
525 | 493 | ||
526 | EXPERIMENTAL: LCD brightness control -- /proc/acpi/ibm/brightness | 494 | LCD brightness control -- /proc/acpi/ibm/brightness |
527 | ----------------------------------------------------------------- | 495 | --------------------------------------------------- |
528 | |||
529 | This feature is marked EXPERIMENTAL because the implementation | ||
530 | directly accesses hardware registers and may not work as expected. USE | ||
531 | WITH CAUTION! To use this feature, you need to supply the | ||
532 | experimental=1 parameter when loading the module. | ||
533 | 496 | ||
534 | This feature allows software control of the LCD brightness on ThinkPad | 497 | This feature allows software control of the LCD brightness on ThinkPad |
535 | models which don't have a hardware brightness slider. The available | 498 | models which don't have a hardware brightness slider. The available |
@@ -542,13 +505,8 @@ commands are: | |||
542 | The <level> number range is 0 to 7, although not all of them may be | 505 | The <level> number range is 0 to 7, although not all of them may be |
543 | distinct. The current brightness level is shown in the file. | 506 | distinct. The current brightness level is shown in the file. |
544 | 507 | ||
545 | EXPERIMENTAL: Volume control -- /proc/acpi/ibm/volume | 508 | Volume control -- /proc/acpi/ibm/volume |
546 | ----------------------------------------------------- | 509 | --------------------------------------- |
547 | |||
548 | This feature is marked EXPERIMENTAL because the implementation | ||
549 | directly accesses hardware registers and may not work as expected. USE | ||
550 | WITH CAUTION! To use this feature, you need to supply the | ||
551 | experimental=1 parameter when loading the module. | ||
552 | 510 | ||
553 | This feature allows volume control on ThinkPad models which don't have | 511 | This feature allows volume control on ThinkPad models which don't have |
554 | a hardware volume knob. The available commands are: | 512 | a hardware volume knob. The available commands are: |
@@ -611,6 +569,23 @@ with the following command: | |||
611 | 569 | ||
612 | echo 'level <level>' > /proc/acpi/ibm/thermal | 570 | echo 'level <level>' > /proc/acpi/ibm/thermal |
613 | 571 | ||
572 | EXPERIMENTAL: WAN -- /proc/acpi/ibm/wan | ||
573 | --------------------------------------- | ||
574 | |||
575 | This feature is marked EXPERIMENTAL because the implementation | ||
576 | directly accesses hardware registers and may not work as expected. USE | ||
577 | WITH CAUTION! To use this feature, you need to supply the | ||
578 | experimental=1 parameter when loading the module. | ||
579 | |||
580 | This feature shows the presence and current state of a WAN (Sierra | ||
581 | Wireless EV-DO) device. If WAN is installed, the following commands can | ||
582 | be used: | ||
583 | |||
584 | echo enable > /proc/acpi/ibm/wan | ||
585 | echo disable > /proc/acpi/ibm/wan | ||
586 | |||
587 | It was tested on a Lenovo Thinkpad X60. It should probably work on other | ||
588 | Thinkpad models which come with this module installed. | ||
614 | 589 | ||
615 | Multiple Commands, Module Parameters | 590 | Multiple Commands, Module Parameters |
616 | ------------------------------------ | 591 | ------------------------------------ |
diff --git a/drivers/acpi/asus_acpi.c b/drivers/acpi/asus_acpi.c index e9ee4c52a5f6..c7ac9297a204 100644 --- a/drivers/acpi/asus_acpi.c +++ b/drivers/acpi/asus_acpi.c | |||
@@ -138,6 +138,7 @@ struct asus_hotk { | |||
138 | S2x, //S200 (J1 reported), Victor MP-XP7210 | 138 | S2x, //S200 (J1 reported), Victor MP-XP7210 |
139 | W1N, //W1000N | 139 | W1N, //W1000N |
140 | W5A, //W5A | 140 | W5A, //W5A |
141 | W3V, //W3030V | ||
141 | xxN, //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N | 142 | xxN, //M2400N, M3700N, M5200N, M6800N, S1300N, S5200N |
142 | //(Centrino) | 143 | //(Centrino) |
143 | END_MODEL | 144 | END_MODEL |
@@ -376,6 +377,17 @@ static struct model_data model_conf[END_MODEL] = { | |||
376 | .display_get = "\\ADVG"}, | 377 | .display_get = "\\ADVG"}, |
377 | 378 | ||
378 | { | 379 | { |
380 | .name = "W3V", | ||
381 | .mt_mled = "MLED", | ||
382 | .mt_wled = "WLED", | ||
383 | .mt_lcd_switch = xxN_PREFIX "_Q10", | ||
384 | .lcd_status = "\\BKLT", | ||
385 | .brightness_set = "SPLV", | ||
386 | .brightness_get = "GPLV", | ||
387 | .display_set = "SDSP", | ||
388 | .display_get = "\\INFB"}, | ||
389 | |||
390 | { | ||
379 | .name = "xxN", | 391 | .name = "xxN", |
380 | .mt_mled = "MLED", | 392 | .mt_mled = "MLED", |
381 | /* WLED present, but not controlled by ACPI */ | 393 | /* WLED present, but not controlled by ACPI */ |
@@ -555,11 +567,11 @@ static int | |||
555 | write_led(const char __user * buffer, unsigned long count, | 567 | write_led(const char __user * buffer, unsigned long count, |
556 | char *ledname, int ledmask, int invert) | 568 | char *ledname, int ledmask, int invert) |
557 | { | 569 | { |
558 | int value; | 570 | int rv, value; |
559 | int led_out = 0; | 571 | int led_out = 0; |
560 | 572 | ||
561 | count = parse_arg(buffer, count, &value); | 573 | rv = parse_arg(buffer, count, &value); |
562 | if (count > 0) | 574 | if (rv > 0) |
563 | led_out = value ? 1 : 0; | 575 | led_out = value ? 1 : 0; |
564 | 576 | ||
565 | hotk->status = | 577 | hotk->status = |
@@ -572,7 +584,7 @@ write_led(const char __user * buffer, unsigned long count, | |||
572 | printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n", | 584 | printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n", |
573 | ledname); | 585 | ledname); |
574 | 586 | ||
575 | return count; | 587 | return rv; |
576 | } | 588 | } |
577 | 589 | ||
578 | /* | 590 | /* |
@@ -607,20 +619,18 @@ static int | |||
607 | proc_write_ledd(struct file *file, const char __user * buffer, | 619 | proc_write_ledd(struct file *file, const char __user * buffer, |
608 | unsigned long count, void *data) | 620 | unsigned long count, void *data) |
609 | { | 621 | { |
610 | int value; | 622 | int rv, value; |
611 | 623 | ||
612 | count = parse_arg(buffer, count, &value); | 624 | rv = parse_arg(buffer, count, &value); |
613 | if (count > 0) { | 625 | if (rv > 0) { |
614 | if (!write_acpi_int | 626 | if (!write_acpi_int |
615 | (hotk->handle, hotk->methods->mt_ledd, value, NULL)) | 627 | (hotk->handle, hotk->methods->mt_ledd, value, NULL)) |
616 | printk(KERN_WARNING | 628 | printk(KERN_WARNING |
617 | "Asus ACPI: LED display write failed\n"); | 629 | "Asus ACPI: LED display write failed\n"); |
618 | else | 630 | else |
619 | hotk->ledd_status = (u32) value; | 631 | hotk->ledd_status = (u32) value; |
620 | } else if (count < 0) | 632 | } |
621 | printk(KERN_WARNING "Asus ACPI: Error reading user input\n"); | 633 | return rv; |
622 | |||
623 | return count; | ||
624 | } | 634 | } |
625 | 635 | ||
626 | /* | 636 | /* |
@@ -761,12 +771,12 @@ static int | |||
761 | proc_write_lcd(struct file *file, const char __user * buffer, | 771 | proc_write_lcd(struct file *file, const char __user * buffer, |
762 | unsigned long count, void *data) | 772 | unsigned long count, void *data) |
763 | { | 773 | { |
764 | int value; | 774 | int rv, value; |
765 | 775 | ||
766 | count = parse_arg(buffer, count, &value); | 776 | rv = parse_arg(buffer, count, &value); |
767 | if (count > 0) | 777 | if (rv > 0) |
768 | set_lcd_state(value); | 778 | set_lcd_state(value); |
769 | return count; | 779 | return rv; |
770 | } | 780 | } |
771 | 781 | ||
772 | static int read_brightness(void) | 782 | static int read_brightness(void) |
@@ -830,18 +840,15 @@ static int | |||
830 | proc_write_brn(struct file *file, const char __user * buffer, | 840 | proc_write_brn(struct file *file, const char __user * buffer, |
831 | unsigned long count, void *data) | 841 | unsigned long count, void *data) |
832 | { | 842 | { |
833 | int value; | 843 | int rv, value; |
834 | 844 | ||
835 | count = parse_arg(buffer, count, &value); | 845 | rv = parse_arg(buffer, count, &value); |
836 | if (count > 0) { | 846 | if (rv > 0) { |
837 | value = (0 < value) ? ((15 < value) ? 15 : value) : 0; | 847 | value = (0 < value) ? ((15 < value) ? 15 : value) : 0; |
838 | /* 0 <= value <= 15 */ | 848 | /* 0 <= value <= 15 */ |
839 | set_brightness(value); | 849 | set_brightness(value); |
840 | } else if (count < 0) { | ||
841 | printk(KERN_WARNING "Asus ACPI: Error reading user input\n"); | ||
842 | } | 850 | } |
843 | 851 | return rv; | |
844 | return count; | ||
845 | } | 852 | } |
846 | 853 | ||
847 | static void set_display(int value) | 854 | static void set_display(int value) |
@@ -880,15 +887,12 @@ static int | |||
880 | proc_write_disp(struct file *file, const char __user * buffer, | 887 | proc_write_disp(struct file *file, const char __user * buffer, |
881 | unsigned long count, void *data) | 888 | unsigned long count, void *data) |
882 | { | 889 | { |
883 | int value; | 890 | int rv, value; |
884 | 891 | ||
885 | count = parse_arg(buffer, count, &value); | 892 | rv = parse_arg(buffer, count, &value); |
886 | if (count > 0) | 893 | if (rv > 0) |
887 | set_display(value); | 894 | set_display(value); |
888 | else if (count < 0) | 895 | return rv; |
889 | printk(KERN_WARNING "Asus ACPI: Error reading user input\n"); | ||
890 | |||
891 | return count; | ||
892 | } | 896 | } |
893 | 897 | ||
894 | typedef int (proc_readfunc) (char *page, char **start, off_t off, int count, | 898 | typedef int (proc_readfunc) (char *page, char **start, off_t off, int count, |
@@ -1097,6 +1101,8 @@ static int asus_model_match(char *model) | |||
1097 | return A4G; | 1101 | return A4G; |
1098 | else if (strncmp(model, "W1N", 3) == 0) | 1102 | else if (strncmp(model, "W1N", 3) == 0) |
1099 | return W1N; | 1103 | return W1N; |
1104 | else if (strncmp(model, "W3V", 3) == 0) | ||
1105 | return W3V; | ||
1100 | else if (strncmp(model, "W5A", 3) == 0) | 1106 | else if (strncmp(model, "W5A", 3) == 0) |
1101 | return W5A; | 1107 | return W5A; |
1102 | else | 1108 | else |
@@ -1200,9 +1206,10 @@ static int asus_hotk_get_info(void) | |||
1200 | hotk->methods->mt_wled = NULL; | 1206 | hotk->methods->mt_wled = NULL; |
1201 | /* L5D's WLED is not controlled by ACPI */ | 1207 | /* L5D's WLED is not controlled by ACPI */ |
1202 | else if (strncmp(string, "M2N", 3) == 0 || | 1208 | else if (strncmp(string, "M2N", 3) == 0 || |
1209 | strncmp(string, "W3V", 3) == 0 || | ||
1203 | strncmp(string, "S1N", 3) == 0) | 1210 | strncmp(string, "S1N", 3) == 0) |
1204 | hotk->methods->mt_wled = "WLED"; | 1211 | hotk->methods->mt_wled = "WLED"; |
1205 | /* M2N and S1N have a usable WLED */ | 1212 | /* M2N, S1N and W3V have a usable WLED */ |
1206 | else if (asus_info) { | 1213 | else if (asus_info) { |
1207 | if (strncmp(asus_info->oem_table_id, "L1", 2) == 0) | 1214 | if (strncmp(asus_info->oem_table_id, "L1", 2) == 0) |
1208 | hotk->methods->mled_status = NULL; | 1215 | hotk->methods->mled_status = NULL; |
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c index 5b3c7a85eb9a..203d1359190a 100644 --- a/drivers/acpi/events/evrgnini.c +++ b/drivers/acpi/events/evrgnini.c | |||
@@ -225,13 +225,12 @@ acpi_ev_pci_config_region_setup(acpi_handle handle, | |||
225 | if (! | 225 | if (! |
226 | (ACPI_STRNCMP | 226 | (ACPI_STRNCMP |
227 | (object_hID.value, PCI_ROOT_HID_STRING, | 227 | (object_hID.value, PCI_ROOT_HID_STRING, |
228 | sizeof(PCI_ROOT_HID_STRING)) | 228 | sizeof(PCI_ROOT_HID_STRING))) |
229 | || | 229 | || |
230 | !(ACPI_STRNCMP | 230 | !(ACPI_STRNCMP |
231 | (object_hID.value, | 231 | (object_hID.value, |
232 | PCI_EXPRESS_ROOT_HID_STRING, | 232 | PCI_EXPRESS_ROOT_HID_STRING, |
233 | sizeof(PCI_EXPRESS_ROOT_HID_STRING))))) | 233 | sizeof(PCI_EXPRESS_ROOT_HID_STRING)))) { |
234 | { | ||
235 | 234 | ||
236 | /* Install a handler for this PCI root bridge */ | 235 | /* Install a handler for this PCI root bridge */ |
237 | 236 | ||
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index 15fc12482ba0..003a9876c968 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c | |||
@@ -1702,13 +1702,11 @@ static struct ibm_struct ibms[] = { | |||
1702 | .name = "brightness", | 1702 | .name = "brightness", |
1703 | .read = brightness_read, | 1703 | .read = brightness_read, |
1704 | .write = brightness_write, | 1704 | .write = brightness_write, |
1705 | .experimental = 1, | ||
1706 | }, | 1705 | }, |
1707 | { | 1706 | { |
1708 | .name = "volume", | 1707 | .name = "volume", |
1709 | .read = volume_read, | 1708 | .read = volume_read, |
1710 | .write = volume_write, | 1709 | .write = volume_write, |
1711 | .experimental = 1, | ||
1712 | }, | 1710 | }, |
1713 | { | 1711 | { |
1714 | .name = "fan", | 1712 | .name = "fan", |