: lis302dl-wakeup-configuration.patch
commit006ff8b616c54409d6badd795ff88f66b9e5dde1
authorSimon Kagstrom <simon.kagstrom@gmail.com>
Thu, 16 Oct 2008 00:19:56 +0000 (16 01:19 +0100)
committerMike Westerhof <mwester@dls.net>
Mon, 20 Oct 2008 04:25:12 +0000 (19 23:25 -0500)
tree9ae67922ad0c0731c41f2fc6fa4b7230c9a49944
parentecb7fd50c4cb9effbe344ce3f5e9c1662bfeb6cf
: lis302dl-wakeup-configuration.patch

Setup accelerometer interrupt to wake the device up

From: Simon Kagstrom <simon.kagstrom@gmail.com>

The threshold implementation recently broke this functionality. This
patch reinstates it again and simplifies the code a bit. It only
supports one of the two lis302dl interrupt sources now (which is the
only connected one on the openmoko). If you need to configure both, buy
an Iphone!

(Or flame this patch)

Note that, as before, the device immediately wakes up when put to sleep
with the wakeup configured. The interface is therefore not currently
very useful, but to use it do e.g.,

   echo 1 1 1 180 0 1 > wakeup

The value is of the form

   X Y Z THRESHOLD DURATION SPEC

X, Y and Z are threshold values, given as a value > 0, < 0 or 0 to
specify if an interrupt should be generated for high or low thresholds
or neither (off). THRESHOLD specifies the threshold that must be
exceeded, in mg. DURATION specifies the time in milliseconds for which
the acceleration should be measured. SPEC is either '1' or '0' and
specifies if the thresholds should be taken all together or one at a
time ('and' or 'or' mode).

Echoing '0' to the file turns off the interrupts.

Signed-off-by: Simon Kagstrom <simon.kagstrom@gmail.com>
drivers/input/misc/lis302dl.c
include/linux/lis302dl.h