diff options
author | Daniel Hillenbrand <daniel.hillenbrand@codeworkx.de> | 2012-06-17 11:46:27 +0200 |
---|---|---|
committer | Daniel Hillenbrand <daniel.hillenbrand@codeworkx.de> | 2012-06-17 11:46:27 +0200 |
commit | 27ea210e09b99ff35bde6b63aa4f5a620f50fd3b (patch) | |
tree | c00193d8dc656613f1ae45ae392ff6e6abbe142c | |
parent | 9fd45304a24f8ac4d6e8785d56d7598652e1a5ed (diff) | |
download | kernel_samsung_smdk4412-27ea210e09b99ff35bde6b63aa4f5a620f50fd3b.tar.gz kernel_samsung_smdk4412-27ea210e09b99ff35bde6b63aa4f5a620f50fd3b.tar.bz2 kernel_samsung_smdk4412-27ea210e09b99ff35bde6b63aa4f5a620f50fd3b.zip |
cypress: support reading of timeout and force_disable sysfs
-rw-r--r-- | drivers/input/keyboard/cypress/cypress-touchkey.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/input/keyboard/cypress/cypress-touchkey.c b/drivers/input/keyboard/cypress/cypress-touchkey.c index b36f9416e43..dde89e4120f 100644 --- a/drivers/input/keyboard/cypress/cypress-touchkey.c +++ b/drivers/input/keyboard/cypress/cypress-touchkey.c @@ -1138,7 +1138,18 @@ static ssize_t touchkey_led_control(struct device *dev, return size; } -static ssize_t touch_led_force_disable(struct device *dev, +static ssize_t touch_led_force_disable_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + int ret; + + ret = sprintf(buf, "%d\n", touch_led_disabled); + pr_info("[Touchkey] %s: touch_led_disabled=%d\n", __func__, touch_led_disabled); + + return ret; +} + +static ssize_t touch_led_force_disable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { @@ -1162,9 +1173,20 @@ static ssize_t touch_led_force_disable(struct device *dev, return size; } static DEVICE_ATTR(force_disable, S_IRUGO | S_IWUSR | S_IWGRP, - NULL, touch_led_force_disable); + touch_led_force_disable_show, touch_led_force_disable_store); + +static ssize_t touch_led_timeout_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + int ret; + + ret = sprintf(buf, "%d\n", touch_led_timeout); + pr_info("[Touchkey] %s: touch_led_timeout=%d\n", __func__, touch_led_timeout); + + return ret; +} -static ssize_t touch_led_set_timeout(struct device *dev, +static ssize_t touch_led_timeout_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) { @@ -1182,7 +1204,7 @@ static ssize_t touch_led_set_timeout(struct device *dev, return size; } static DEVICE_ATTR(timeout, S_IRUGO | S_IWUSR | S_IWGRP, - NULL, touch_led_set_timeout); + touch_led_timeout_show, touch_led_timeout_store); void touch_led_timedout(unsigned long ptr) { |