diff options
-rw-r--r-- | drivers/misc/asus-laptop.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/misc/asus-laptop.c b/drivers/misc/asus-laptop.c index 3ba579899ac7..475709b8d391 100644 --- a/drivers/misc/asus-laptop.c +++ b/drivers/misc/asus-laptop.c | |||
@@ -81,7 +81,8 @@ | |||
81 | #define TLED_ON 0x08 //touchpad LED | 81 | #define TLED_ON 0x08 //touchpad LED |
82 | #define RLED_ON 0x10 //Record LED | 82 | #define RLED_ON 0x10 //Record LED |
83 | #define PLED_ON 0x20 //Phone LED | 83 | #define PLED_ON 0x20 //Phone LED |
84 | #define LCD_ON 0x40 //LCD backlight | 84 | #define GLED_ON 0x40 //Gaming LED |
85 | #define LCD_ON 0x80 //LCD backlight | ||
85 | 86 | ||
86 | #define ASUS_LOG ASUS_HOTK_FILE ": " | 87 | #define ASUS_LOG ASUS_HOTK_FILE ": " |
87 | #define ASUS_ERR KERN_ERR ASUS_LOG | 88 | #define ASUS_ERR KERN_ERR ASUS_LOG |
@@ -103,6 +104,7 @@ ASUS_HANDLE(mled_set, ASUS_HOTK_PREFIX "MLED"); | |||
103 | ASUS_HANDLE(tled_set, ASUS_HOTK_PREFIX "TLED"); | 104 | ASUS_HANDLE(tled_set, ASUS_HOTK_PREFIX "TLED"); |
104 | ASUS_HANDLE(rled_set, ASUS_HOTK_PREFIX "RLED"); /* W1JC */ | 105 | ASUS_HANDLE(rled_set, ASUS_HOTK_PREFIX "RLED"); /* W1JC */ |
105 | ASUS_HANDLE(pled_set, ASUS_HOTK_PREFIX "PLED"); /* A7J */ | 106 | ASUS_HANDLE(pled_set, ASUS_HOTK_PREFIX "PLED"); /* A7J */ |
107 | ASUS_HANDLE(gled_set, ASUS_HOTK_PREFIX "GLED"); /* G1, G2 (probably) */ | ||
106 | 108 | ||
107 | /* LEDD */ | 109 | /* LEDD */ |
108 | ASUS_HANDLE(ledd_set, ASUS_HOTK_PREFIX "SLCM"); | 110 | ASUS_HANDLE(ledd_set, ASUS_HOTK_PREFIX "SLCM"); |
@@ -221,6 +223,7 @@ ASUS_LED(mled, "mail"); | |||
221 | ASUS_LED(tled, "touchpad"); | 223 | ASUS_LED(tled, "touchpad"); |
222 | ASUS_LED(rled, "record"); | 224 | ASUS_LED(rled, "record"); |
223 | ASUS_LED(pled, "phone"); | 225 | ASUS_LED(pled, "phone"); |
226 | ASUS_LED(gled, "gaming"); | ||
224 | 227 | ||
225 | /* | 228 | /* |
226 | * This function evaluates an ACPI method, given an int as parameter, the | 229 | * This function evaluates an ACPI method, given an int as parameter, the |
@@ -280,6 +283,9 @@ static void write_status(acpi_handle handle, int out, int mask) | |||
280 | case MLED_ON: | 283 | case MLED_ON: |
281 | out = !out & 0x1; | 284 | out = !out & 0x1; |
282 | break; | 285 | break; |
286 | case GLED_ON: | ||
287 | out = (out & 0x1) + 1; | ||
288 | break; | ||
283 | default: | 289 | default: |
284 | out &= 0x1; | 290 | out &= 0x1; |
285 | break; | 291 | break; |
@@ -307,6 +313,7 @@ ASUS_LED_HANDLER(mled, MLED_ON); | |||
307 | ASUS_LED_HANDLER(pled, PLED_ON); | 313 | ASUS_LED_HANDLER(pled, PLED_ON); |
308 | ASUS_LED_HANDLER(rled, RLED_ON); | 314 | ASUS_LED_HANDLER(rled, RLED_ON); |
309 | ASUS_LED_HANDLER(tled, TLED_ON); | 315 | ASUS_LED_HANDLER(tled, TLED_ON); |
316 | ASUS_LED_HANDLER(gled, GLED_ON); | ||
310 | 317 | ||
311 | static int get_lcd_state(void) | 318 | static int get_lcd_state(void) |
312 | { | 319 | { |
@@ -835,6 +842,7 @@ static int asus_hotk_get_info(void) | |||
835 | ASUS_HANDLE_INIT(tled_set); | 842 | ASUS_HANDLE_INIT(tled_set); |
836 | ASUS_HANDLE_INIT(rled_set); | 843 | ASUS_HANDLE_INIT(rled_set); |
837 | ASUS_HANDLE_INIT(pled_set); | 844 | ASUS_HANDLE_INIT(pled_set); |
845 | ASUS_HANDLE_INIT(gled_set); | ||
838 | 846 | ||
839 | ASUS_HANDLE_INIT(ledd_set); | 847 | ASUS_HANDLE_INIT(ledd_set); |
840 | 848 | ||
@@ -1001,6 +1009,7 @@ static void asus_led_exit(void) | |||
1001 | ASUS_LED_UNREGISTER(tled); | 1009 | ASUS_LED_UNREGISTER(tled); |
1002 | ASUS_LED_UNREGISTER(pled); | 1010 | ASUS_LED_UNREGISTER(pled); |
1003 | ASUS_LED_UNREGISTER(rled); | 1011 | ASUS_LED_UNREGISTER(rled); |
1012 | ASUS_LED_UNREGISTER(gled); | ||
1004 | 1013 | ||
1005 | destroy_workqueue(led_workqueue); | 1014 | destroy_workqueue(led_workqueue); |
1006 | } | 1015 | } |
@@ -1072,6 +1081,10 @@ static int asus_led_init(struct device *dev) | |||
1072 | if (rv) | 1081 | if (rv) |
1073 | return rv; | 1082 | return rv; |
1074 | 1083 | ||
1084 | rv = ASUS_LED_REGISTER(gled, dev); | ||
1085 | if (rv) | ||
1086 | return rv; | ||
1087 | |||
1075 | led_workqueue = create_singlethread_workqueue("led_workqueue"); | 1088 | led_workqueue = create_singlethread_workqueue("led_workqueue"); |
1076 | if (!led_workqueue) | 1089 | if (!led_workqueue) |
1077 | return -ENOMEM; | 1090 | return -ENOMEM; |