From: Pavel Machek <pavel@suse.cz>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: kernel list <linux-kernel@vger.kernel.org>,
Eric Piel <eric.piel@tremplin-utc.net>,
Yan Burman <burman.yan@gmail.com>,
Pau Oliva Fora <pau@eslack.org>
Subject: Re: [PATCH] LIS3LV02Dx Accelerometer driver
Date: Mon, 27 Oct 2008 10:01:15 +0100 [thread overview]
Message-ID: <20081027090115.GD30526@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <20081026233901.7087e74a.akpm@linux-foundation.org>
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
prev parent reply other threads:[~2008-10-27 9:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-22 15:44 Pavel Machek
2008-10-22 17:54 ` Éric Piel
2008-10-26 8:53 ` [PATCH] LIS3LV02D: Conform to the new ACPI API Eric Piel
2008-10-27 6:39 ` [PATCH] LIS3LV02Dx Accelerometer driver Andrew Morton
2008-10-27 9:01 ` Pavel Machek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081027090115.GD30526@atrey.karlin.mff.cuni.cz \
--to=pavel@suse.cz \
--cc=akpm@linux-foundation.org \
--cc=burman.yan@gmail.com \
--cc=eric.piel@tremplin-utc.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pau@eslack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®