Advertisement
Guest User

Untitled

a guest
Oct 18th, 2011
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. diff --git a/drivers/input/misc/capella_cm3602.c b/drivers/input/misc/capella_cm3602.c
  2. index 04338ad..3e79413 100644
  3. --- a/drivers/input/misc/capella_cm3602.c
  4. +++ b/drivers/input/misc/capella_cm3602.c
  5. @@ -201,9 +201,22 @@ static long capella_cm3602_ioctl(struct file *file, unsigned int cmd, unsigned l
  6. }
  7. }
  8.  
  9. +static ssize_t capella_cm3602_read(struct file *file, char *buf, size_t count, loff_t *off)
  10. +{
  11. + if (!the_data.enabled)
  12. + capella_cm3602_enable(&the_data);
  13. + int val = gpio_get_value(the_data.pdata->p_out);
  14. + D("%s val %d count %u\n", __func__, val, count);
  15. + if(*off==0) {
  16. + *off+=1;
  17. + return sprintf(buf,"%d\n",val);
  18. + } else
  19. + return 0;
  20. +}
  21. static struct file_operations capella_cm3602_fops = {
  22. .owner = THIS_MODULE,
  23. .open = capella_cm3602_open,
  24. + .read = capella_cm3602_read,
  25. .release = capella_cm3602_release,
  26. .unlocked_ioctl = capella_cm3602_ioctl
  27. };
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement