aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/asus-laptop.c
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2007-03-11 05:26:48 -0400
committerLen Brown <len.brown@intel.com>2007-03-11 15:44:52 -0400
commitfdd8d08084663242b42e27f7d71739f3f9009286 (patch)
tree0a113f4761db783af725b9c37813c29d50d9c31b /drivers/misc/asus-laptop.c
parent935ffeeca84fe5d48d0cc9f35c58db42b384229f (diff)
asus-laptop: add GLED
Add support for "gaming" led. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc/asus-laptop.c')
-rw-r--r--drivers/misc/asus-laptop.c15
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");
103ASUS_HANDLE(tled_set, ASUS_HOTK_PREFIX "TLED"); 104ASUS_HANDLE(tled_set, ASUS_HOTK_PREFIX "TLED");
104ASUS_HANDLE(rled_set, ASUS_HOTK_PREFIX "RLED"); /* W1JC */ 105ASUS_HANDLE(rled_set, ASUS_HOTK_PREFIX "RLED"); /* W1JC */
105ASUS_HANDLE(pled_set, ASUS_HOTK_PREFIX "PLED"); /* A7J */ 106ASUS_HANDLE(pled_set, ASUS_HOTK_PREFIX "PLED"); /* A7J */
107ASUS_HANDLE(gled_set, ASUS_HOTK_PREFIX "GLED"); /* G1, G2 (probably) */
106 108
107/* LEDD */ 109/* LEDD */
108ASUS_HANDLE(ledd_set, ASUS_HOTK_PREFIX "SLCM"); 110ASUS_HANDLE(ledd_set, ASUS_HOTK_PREFIX "SLCM");
@@ -221,6 +223,7 @@ ASUS_LED(mled, "mail");
221ASUS_LED(tled, "touchpad"); 223ASUS_LED(tled, "touchpad");
222ASUS_LED(rled, "record"); 224ASUS_LED(rled, "record");
223ASUS_LED(pled, "phone"); 225ASUS_LED(pled, "phone");
226ASUS_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);
307ASUS_LED_HANDLER(pled, PLED_ON); 313ASUS_LED_HANDLER(pled, PLED_ON);
308ASUS_LED_HANDLER(rled, RLED_ON); 314ASUS_LED_HANDLER(rled, RLED_ON);
309ASUS_LED_HANDLER(tled, TLED_ON); 315ASUS_LED_HANDLER(tled, TLED_ON);
316ASUS_LED_HANDLER(gled, GLED_ON);
310 317
311static int get_lcd_state(void) 318static 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;