From: "Éric Piel" <eric.piel@tremplin-utc.net>
To: pavel@suse.cz
Cc: akpm@linux-foundation.org, LKML <linux-kernel@vger.kernel.org>,
trenn@suse.de
Subject: Re: hp accelerometer: add freefall detection
Date: Wed, 11 Feb 2009 13:33:02 +0100 [thread overview]
Message-ID: <4992C57E.9050109@tremplin-utc.net> (raw)
In-Reply-To: <200901162234.n0GMYB8Z022317@imap1.linux-foundation.org>
From: Pavel Machek <pavel@suse.cz>
>
> This adds freefall handling to hp_accel driver. According to HP, it
> should just work, without us having to set the chip up by hand.
>
> hpfall.c is example .c program that parks the disk when accelerometer
> detects free fall. It should work; for now, it uses fixed 20seconds
> protection period.
>
> Signed-off-by: Pavel Machek <pavel@suse.cz>
> Cc: Thomas Renninger <trenn@suse.de>
> Cc: �ric Piel <eric.piel@tremplin-utc.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Hi Pavel,
Sorry for being amazingly late, reading the latest patches from
Giuseppe, I noticed some parts in this patch which are strange.
Basically you scrap all the init and all the poweroff. Some of the
things there were put for some purpose, and I wonder if you've verified
everything keeps working correctly.
> @@ -110,26 +114,13 @@ static void lis3lv02d_get_xyz(acpi_handl
> void lis3lv02d_poweroff(acpi_handle handle)
> {
> adev.is_on = 0;
> - /* disable X,Y,Z axis and power down */
> - adev.write(handle, CTRL_REG1, 0x00);
So we are not turning off the device on poweroff()?! Why? Did you notice
problems when we were doing it?
Actually I've always wondered if it was worthy to turn it off because
I've never been able to measure a difference in power consumption. Have
you done the measurement and noticed there is no effect? I'd be glad we
can get rid of this power management thing, but then we can scratch much
more than just this line!
> - /*
> - * BDU: LSB and MSB values are not updated until both have been read.
> - * So the value read will always be correct.
> - * IEN: Interrupt for free-fall and DD, not for data-ready.
> - */
> - adev.read(handle, CTRL_REG2, &val);
> - val |= CTRL2_BDU | CTRL2_IEN;
> - adev.write(handle, CTRL_REG2, val);
This part is rather scary. Did you read the comment? If you don't
activate BDU you cannot be sure that the data you read is valid. I see
no reason why this would interfere with the free-fall detection so
unless you have a really good case, let's keep it. On the other hand, I
don't mind removing IEN if you've noticed that it's not useful or
interfering.
Eric
next parent reply other threads:[~2009-02-11 12:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200901162234.n0GMYB8Z022317@imap1.linux-foundation.org>
2009-02-11 12:33 ` Éric Piel [this message]
2009-02-13 12:28 ` hp accelerometer: add freefall detection Pavel Machek
2009-02-14 16:01 ` Frans Pop
2009-03-08 21:14 ` Pavel Machek
2009-01-12 9:29 hp accelerometer: fix LED handling and " Pavel Machek
2009-01-12 9:33 ` Éric Piel
2009-01-16 12:19 ` hp accelerometer: " Pavel Machek
2009-01-16 22:34 ` Andrew Morton
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=4992C57E.9050109@tremplin-utc.net \
--to=eric.piel@tremplin-utc.net \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@suse.cz \
--cc=trenn@suse.de \
/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