aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Kagstrom <simon.kagstrom@gmail.com>2008-11-19 17:10:51 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:10:51 +0000
commitba3c1cc04bc71cb061fdbb5ae21669b99bd489c6 (patch)
tree0e682ba4aa93a04c515820e4433bdc30e60a4d77 /include
parent685b99ad165ddb7eaa64962e66342f6bb1d48b30 (diff)
interface for configuring freefall/wakeup interrupts for the accelerometers
Hi! First: Unfortunately, the freerunner currently wakes up immediately on suspend when the accelerometer IRQ is selected as a wakeup source. I'm posting this for comments and if someone else wants to have a look at this problem. The patch should be safe to apply even though the sleep portion doesn't work - as long as it's configured it will not disturb anything. // Simon -- lis302dl-configure-wakeup-interrupts.patch From: simon.kagstrom <simon.kagstrom@gmail.com> First: Unfortunately, the freerunner currently wakes up immediately on suspend when the accelerometer IRQ is selected as a wakeup source. Add configuration of wakeup/freefall interrupts through a sysfs interface. Configuration is done through echoing a value of the form X Y Z THRESHOLD DURATION SPEC to freefall_wakeup_1/2. 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. 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. Example: echo "1 1 1 60 60 0" > freefall_wakeup_1 # Turn on x,y,z, 60ms/60 threshold, or-mode echo "0" > freefall_wakeup_1 # Turn off interrupt The hardware supports two simulataneous wakeup sources to be configured, but the freerunner only connects one of the interrupt outputs. The patch exports both. Similarly, only the "top" accelerometer can be used as a wake-up source, and it's not possible to generate DATA_READY interrupts while the wakeup interrupts are active. Signed-off-by: Simon Kagstrom <simon.kagstrom@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/lis302dl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/lis302dl.h b/include/linux/lis302dl.h
index e4a44f561aa..7daa8b39980 100644
--- a/include/linux/lis302dl.h
+++ b/include/linux/lis302dl.h
@@ -129,10 +129,14 @@ enum lis302dl_reg_cloik_src {
#define LIS302DL_WHO_AM_I_MAGIC 0x3b
-#define LIS302DL_F_WUP_FF 0x0001 /* wake up from free fall */
-#define LIS302DL_F_WUP_CLICK 0x0002
+#define LIS302DL_F_WUP_FF_1 0x0001 /* wake up from free fall */
+#define LIS302DL_F_WUP_FF_2 0x0002
+#define LIS302DL_F_WUP_FF 0x0003
+#define LIS302DL_F_WUP_CLICK 0x0004
#define LIS302DL_F_POWER 0x0010
#define LIS302DL_F_FS 0x0020 /* ADC full scale */
+#define LIS302DL_F_INPUT_OPEN 0x0040 /* Set if input device is opened */
+#define LIS302DL_F_IRQ_WAKE 0x0080 /* IRQ is setup in wake mode */
#endif /* _LINUX_LIS302DL_H */