Skip to content

Commit

Permalink
Make the smart cover thing work.
Browse files Browse the repository at this point in the history
  • Loading branch information
javilonas committed May 15, 2015
1 parent b64576e commit 5d72949
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/input/keyboard/gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ static void flip_cover_work(struct work_struct *work)
__func__, ddata->flip_cover);

input_report_switch(ddata->input,
SW_FLIP, ddata->flip_cover);
SW_LID, !ddata->flip_cover);
input_sync(ddata->input);
} else {
printk(KERN_DEBUG "%s : Value is not same!\n", __func__);
Expand All @@ -611,7 +611,7 @@ static void flip_cover_work(struct work_struct *work)
__func__, ddata->flip_cover);

input_report_switch(ddata->input,
SW_FLIP, ddata->flip_cover);
SW_LID, !ddata->flip_cover);
input_sync(ddata->input);
}
#endif // CONFIG_SEC_FACTORY
Expand Down Expand Up @@ -697,6 +697,7 @@ static void gpio_keys_close(struct input_dev *input)
static ssize_t sysfs_hall_detect_show(struct device *dev,
struct device_attribute *attr, char *buf)
{

if (flip_cover)
snprintf(buf, 6, "%s\n", "OPEN");
else
Expand Down Expand Up @@ -962,7 +963,7 @@ static int gpio_keys_probe(struct platform_device *pdev)
wake_lock_init(&ddata->flip_wake_lock, WAKE_LOCK_SUSPEND, "flip_wake_lock");
if(ddata->gpio_flip_cover != 0) {
input->evbit[0] |= BIT_MASK(EV_SW);
input_set_capability(input, EV_SW, SW_FLIP);
input_set_capability(input, EV_SW, SW_LID);
}
#endif
ddata->pdata = pdata;
Expand Down

0 comments on commit 5d72949

Please sign in to comment.