lkml.org 
[lkml]   [2008]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-10-27 10:03    [W:0.062 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site