Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/drivers/input/misc/capella_cm3602.c b/drivers/input/misc/capella_cm3602.c
- index 04338ad..3e79413 100644
- --- a/drivers/input/misc/capella_cm3602.c
- +++ b/drivers/input/misc/capella_cm3602.c
- @@ -201,9 +201,22 @@ static long capella_cm3602_ioctl(struct file *file, unsigned int cmd, unsigned l
- }
- }
- +static ssize_t capella_cm3602_read(struct file *file, char *buf, size_t count, loff_t *off)
- +{
- + if (!the_data.enabled)
- + capella_cm3602_enable(&the_data);
- + int val = gpio_get_value(the_data.pdata->p_out);
- + D("%s val %d count %u\n", __func__, val, count);
- + if(*off==0) {
- + *off+=1;
- + return sprintf(buf,"%d\n",val);
- + } else
- + return 0;
- +}
- static struct file_operations capella_cm3602_fops = {
- .owner = THIS_MODULE,
- .open = capella_cm3602_open,
- + .read = capella_cm3602_read,
- .release = capella_cm3602_release,
- .unlocked_ioctl = capella_cm3602_ioctl
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement