Messages in this thread | | | Date | Mon, 27 Oct 2008 10:01:15 +0100 | From | Pavel Machek <> | Subject | Re: [PATCH] LIS3LV02Dx Accelerometer driver |
| |
Hi!
Thanks for taking the patch...
> > +/* joystick device poll interval in milliseconds */ > > +#define MDPS_POLL_INTERVAL 50 > > > > ... > > > > +static int lis3lv02d_joystick_kthread(void *data) > > +{ > > + int x, y, z; > > + > > + while (!kthread_should_stop()) { > > + lis3lv02d_get_xyz(adev.device->handle, &x, &y, &z); > > + input_report_abs(adev.idev, ABS_X, x - adev.xcalib); > > + input_report_abs(adev.idev, ABS_Y, y - adev.ycalib); > > + input_report_abs(adev.idev, ABS_Z, z - adev.zcalib); > > + > > + input_sync(adev.idev); > > + > > + try_to_freeze(); > > + msleep_interruptible(MDPS_POLL_INTERVAL); > > You'll have the powertop police on your tail. > > Is there no alternative?
No, I do not think so. The device is noisy enough that it will "always" generate a change -- even when sittig on the desktop quietly. We could switch to interrupt mode but it would just give us iterrupts at 40Hz.
For harddisk protection it _might_ be possible to do something clever with threshold comparator on the chip, but... we are not even using the comparator for now. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
| |