aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2010-11-29 02:14:13 -0500
committerMatthew Garrett <mjg@redhat.com>2011-01-07 17:03:44 -0500
commit62a75d83131c8887237d26a36ffeabd53c3640fd (patch)
tree6ada03ec08dcb4a6f9f615f8543648f2b21aea49 /drivers/platform
parentdfed65d56f9a94466bb4afd44ec8e900a6709cda (diff)
eeepc-laptop: add a getter for touchpad led
Allow te get the current led state in a more accurate way. Signed-off-by: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/eeepc-laptop.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index b2edfdcdcb84..e9fc530e7dc2 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -529,6 +529,15 @@ static void tpd_led_set(struct led_classdev *led_cdev,
529 queue_work(eeepc->led_workqueue, &eeepc->tpd_led_work); 529 queue_work(eeepc->led_workqueue, &eeepc->tpd_led_work);
530} 530}
531 531
532static enum led_brightness tpd_led_get(struct led_classdev *led_cdev)
533{
534 struct eeepc_laptop *eeepc;
535
536 eeepc = container_of(led_cdev, struct eeepc_laptop, tpd_led);
537
538 return get_acpi(eeepc, CM_ASL_TPD);
539}
540
532static int eeepc_led_init(struct eeepc_laptop *eeepc) 541static int eeepc_led_init(struct eeepc_laptop *eeepc)
533{ 542{
534 int rv; 543 int rv;
@@ -543,6 +552,8 @@ static int eeepc_led_init(struct eeepc_laptop *eeepc)
543 552
544 eeepc->tpd_led.name = "eeepc::touchpad"; 553 eeepc->tpd_led.name = "eeepc::touchpad";
545 eeepc->tpd_led.brightness_set = tpd_led_set; 554 eeepc->tpd_led.brightness_set = tpd_led_set;
555 if (get_acpi(eeepc, CM_ASL_TPD) >= 0) /* if method is available */
556 eeepc->tpd_led.brightness_get = tpd_led_get;
546 eeepc->tpd_led.max_brightness = 1; 557 eeepc->tpd_led.max_brightness = 1;
547 558
548 rv = led_classdev_register(&eeepc->platform_device->dev, 559 rv = led_classdev_register(&eeepc->platform_device->dev,