All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Éric Piel" <eric.piel@tremplin-utc.net>
To: Pavel Machek <pavel@suse.cz>
Cc: kernel list <linux-kernel@vger.kernel.org>,
	trenn@suse.de, hmh@hmh.eng.br
Subject: Re: HP accelerometer: free fall detection working, testers wanted
Date: Sun, 30 Nov 2008 23:16:29 +0100	[thread overview]
Message-ID: <493310BD.8050506@tremplin-utc.net> (raw)
In-Reply-To: <20081128104459.GA32417@atrey.karlin.mff.cuni.cz>

Pavel Machek schreef:
> Hi!
> 
>>> I got free fall detection to work -- apparently BIOS does all the
>>> important stuff itself. 
>>>
>>> Now... I'd like some testers. (Don't comment on code... yet. Yes, it
>>> has some issues).

>> Also, how do you try free fall? Did you try also with the lid
>> opened?
> 
> With the lid opened, too, yes. I just took the machine, then tried to
> let go and catch it meter below that. (Of course I did not really let
> go, but released the grip and followed...)

Hi,
I've tested it. Mostly, it works. If I let it fall, it detects it. If I
repeat, it detects it again. If shake it, it doesn't detect any freefall
(good). However, for this to work on my laptop (2510p), after the device
is turned on, the AC must be unplugged and lid closed before it starts
working. It seems that that's only this specific state that triggers the
configuration of the sensor by the bios. Once setup, I can plug back and
open again the lid, the sensor keeps detecting the freefalls (until it's
turned off again).

So I think it's still necessary to explicitly set up the sensor. It's
just a matter of setting up the registers as the bios does. We should be
able to manage (just by dumping them once).

BTW, there were a couple of problems with the scripts. You have change
"/dev/misc" to "/dev/freefall" (which I also like more) but forgot to
update the driver itself.

For hp3dg, it couldn't find the led (not the same truncation of the name
of the led). Probably you could replace the name of the led by:
/sys/class/leds/*hddprotect*/

The led never turns off, because the sleep is slightly shorter than the
unload command.

Moreover, on my system I have neither /proc/acpi/button/lid/LID/state
nor /proc/acpi/ac_adapter/AC0/state ! I guess they could be replaced by
a clever use of /dev/input/eventX (contening Lid) and
/sys/class/power_supply/*/online

>>> hp3dg script should do all the important things.
>> :
>>> --- /dev/null
>>> +++ b/Documentation/hwmon/hp3dg
>> :
>>> +while true; do
>>> +	./readaccel foo
>>> +	unload 2
>>> +	if cat /proc/acpi/button/lid/LID/state | grep open && cat /proc/acpi/ac_adapter/AC0/state | grep off-line; then
>>> +		unload 20
>>> +	fi
>>> +done
>> Why a special case if the lid is opened and the laptop unplugged? Is it
>> a special behaviour of the hardware, or simply some kind of basic user
>> behaviour guess?
> 
> Behaviour guess, HP asked for those values. Idea is that if the user
> is walking with machine, park as much as possible because machine is
> in danger :-).
Yes, I guess it's not a bad idea. Anyway, this is just an example
daemon, and I'm sure people will come up with even more rules like this
in a full feature daemon...

Eric

  reply	other threads:[~2008-11-30 22:16 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-21 21:21 HP accelerometer: split chip handling from HP ACPI interface Pavel Machek
2008-11-22  0:00 ` Andrew Morton
2008-11-22  0:25   ` Éric Piel
2008-11-22  0:51     ` Éric Piel
2008-11-22  0:55       ` [PATCH 1/2] LIS3LV02D: separate the core from HP ACPI API Éric Piel
2008-11-22 12:35         ` Pavel Machek
2008-11-22 14:28           ` Éric Piel
2008-11-22  0:55       ` [PATCH 2/2] LIS3LV02D: Merge with leds-hp-disk Éric Piel
2008-11-22 12:21       ` HP accelerometer: split chip handling from HP ACPI interface Pavel Machek
2008-11-22  0:58 ` Andrew Morton
2008-11-28  8:22 ` HP accelerometer: free fall detection working, testers wanted Pavel Machek
2008-11-28 10:02   ` Éric Piel
2008-11-28 10:44     ` Pavel Machek
2008-11-30 22:16       ` Éric Piel [this message]
2008-12-01 11:55         ` Thomas Renninger
2008-12-01 12:03           ` Éric Piel
2009-01-09 10:13         ` Pavel Machek

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=493310BD.8050506@tremplin-utc.net \
    --to=eric.piel@tremplin-utc.net \
    --cc=hmh@hmh.eng.br \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.