Skip to content

Commit

Permalink
lge_touch_core: sweep2wake: use more standard sysfs store method
Browse files Browse the repository at this point in the history
Signed-off-by: faux123 <[email protected]>
  • Loading branch information
faux123 committed Nov 19, 2014
1 parent d15de9c commit a931250
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions drivers/input/touchscreen/lge_touch_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1769,18 +1769,30 @@ static ssize_t lge_touch_sweep2wake_show(struct device *dev,
return count;
}

static ssize_t lge_touch_sweep2wake_dump(struct device *dev,
static ssize_t lge_touch_sweep2wake_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
if (buf[0] >= '0' && buf[0] <= '2' && buf[1] == '\n')
if (s2w_switch != buf[0] - '0')
s2w_switch = buf[0] - '0';
unsigned int data;

if(sscanf(buf, "%u\n", &data) == 1) {
if (data == 1) {
pr_info("%s: enabled\n", __FUNCTION__);
s2w_switch = data;
}
else if (data == 0) {
pr_info("%s: disabled\n", __FUNCTION__);
s2w_switch = data;
}
else
pr_info("%s: bad value: %u\n", __FUNCTION__, data);
} else
pr_info("%s: unknown input!\n", __FUNCTION__);

return count;
}

static DEVICE_ATTR(sweep2wake, (S_IWUSR|S_IRUGO),
lge_touch_sweep2wake_show, lge_touch_sweep2wake_dump);
lge_touch_sweep2wake_show, lge_touch_sweep2wake_store);
#endif

static struct kobject *android_touch_kobj;
Expand Down

0 comments on commit a931250

Please sign in to comment.