Input: wacom - make LED status readable through sysfs
authorPing Cheng <pinglinux@gmail.com>
Wed, 5 Oct 2011 06:51:49 +0000 (23:51 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 5 Oct 2011 07:26:24 +0000 (00:26 -0700)
Reviewed-by: Eduard Hasenleithner <eduard@hasenleithner.at>
Tested-by: Eduard Hasenleithner <eduard@hasenleithner.at>
Signed-off-by: Ping Cheng <pingc@wacom.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/tablet/wacom_sys.c

index abe5920e2cdb51ca342832be3567a9cfd58ef57d..a205055a4c517d8a602e1d7d2b478d4342e783e6 100644 (file)
@@ -584,7 +584,14 @@ static ssize_t wacom_led##SET_ID##_select_store(struct device *dev,        \
 {                                                                      \
        return wacom_led_select_store(dev, SET_ID, buf, count);         \
 }                                                                      \
-static DEVICE_ATTR(status_led##SET_ID##_select, S_IWUSR, NULL,         \
+static ssize_t wacom_led##SET_ID##_select_show(struct device *dev,     \
+       struct device_attribute *attr, char *buf)                       \
+{                                                                      \
+       struct wacom *wacom = dev_get_drvdata(dev);                     \
+       return snprintf(buf, 2, "%d\n", wacom->led.select[SET_ID]);     \
+}                                                                      \
+static DEVICE_ATTR(status_led##SET_ID##_select, S_IWUSR | S_IRUSR,     \
+                   wacom_led##SET_ID##_select_show,                    \
                    wacom_led##SET_ID##_select_store)
 
 DEVICE_LED_SELECT_ATTR(0);