aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/asus_acpi.c67
1 files changed, 37 insertions, 30 deletions
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
555write_led(const char __user * buffer, unsigned long count, 567write_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
607proc_write_ledd(struct file *file, const char __user * buffer, 619proc_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
761proc_write_lcd(struct file *file, const char __user * buffer, 771proc_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
772static int read_brightness(void) 782static int read_brightness(void)
@@ -830,18 +840,15 @@ static int
830proc_write_brn(struct file *file, const char __user * buffer, 840proc_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
847static void set_display(int value) 854static void set_display(int value)
@@ -880,15 +887,12 @@ static int
880proc_write_disp(struct file *file, const char __user * buffer, 887proc_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
894typedef int (proc_readfunc) (char *page, char **start, off_t off, int count, 898typedef 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;