title: miscdevice: when does poll get called?
body: <p>I'm trying to write a simple mouse driver (as part of a project to use my phone as a mouse for linux).  If I understand correctly:
  1) I should use misc_register() in the init() for the module
  2) the file_operations' poll() will be called periodically to determine if the mouse should move?
  3) open() and read() get called to determine how it should move?</p>
  
  <p>Am I misunderstanding something?  Is there another step to ensure that the poll() gets called?</p>
  
  <pre><code>struct file_operations mousey_fops = {
      ...
      poll:   mousey_poll
  };
  
  static struct miscdevice mousey = {
      minor:MISC_DYNAMIC_MINOR, 
      ...
      fops:&amp;mousey_fops
  };
  
  ...
  
  int mousey_init(void){
      // This gets executed, result == 0
      printk (KERN_ALERT "mousey_init called\n");
      result = misc_register(&amp;mousey);
      ...
  }
  
  ...
  
  ... mousey_poll(...){
      // this never gets executed
      printk (KERN_ALERT "mousey_poll called\n");
      return POLLIN | POLLRDNORM;
  }
  </code></pre>
  
  <p>full code is here in case it's needed:
  <a href="https://github.com/jeremydeanlakey/linuxdriverexperiment/blob/master/mousey.c" rel="nofollow">https://github.com/jeremydeanlakey/linuxdriverexperiment/blob/master/mousey.c</a></p>