aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Kagstrom <simon.kagstrom@gmail.com>2008-11-19 17:11:25 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-11-19 17:11:25 +0000
commit107b2462fc4872eec18e7fa4a8f498f6f5c5e75d (patch)
treeae861741cb94aa5e69b68ec1d220fc76015a238d /include
parentc298e74a6c0f6c94f57e40767b5a8be3f2ec314f (diff)
: lis302dl-port-work-from-stable.patch
Merge in the accelerometer functionality from stable From: Simon Kagstrom <simon.kagstrom@gmail.com> This giant patch merges the functionality from stable. It also changes the default threshold to 0 (generate interrupts on data). As the level-triggered interrupts cause too frequent interruptions on low thresholds, also set a lower limit to 36mg to avoid slowing down the phone too much. Also rearrange the probe function to disable interrupts only over device I/O. This fixes the kernel errors when inserting the module. Andy was right: In stable-tracking, no magic workaround is needed to make suspend/resume work. I've tested the accelerometers under heavy load (making the phone basically unusable) without getting lockups. Signed-off-by: Simon Kagstrom <simon.kagstrom@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/lis302dl.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/lis302dl.h b/include/linux/lis302dl.h
index 4578db4ad6d..662ac60f607 100644
--- a/include/linux/lis302dl.h
+++ b/include/linux/lis302dl.h
@@ -16,7 +16,8 @@ struct lis302dl_platform_data {
unsigned long pin_miso;
int open_drain;
int interrupt;
- void (*lis302dl_bitbang_read_sample)(struct lis302dl_info *);
+ void (*lis302dl_bitbang)(struct lis302dl_info *lis, u8 *tx,
+ int tx_bytes, u8 *rx, int rx_bytes);
void (*lis302dl_suspend_io)(struct lis302dl_info *, int resuming);
int (*lis302dl_bitbang_reg_read)(struct lis302dl_info *, u8 reg);
void (*lis302dl_bitbang_reg_write)(struct lis302dl_info *, u8 reg,
@@ -28,6 +29,12 @@ struct lis302dl_info {
struct device *dev;
struct input_dev *input_dev;
unsigned int flags;
+ unsigned int threshold;
+ unsigned int duration;
+ struct {
+ unsigned int threshold; /* mg */
+ unsigned int duration; /* ms */
+ } wakeup;
u_int8_t regs[0x40];
};
@@ -140,6 +147,7 @@ enum lis302dl_reg_cloik_src {
#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 */
+#define LIS302DL_F_DR 0x0100 /* Data rate, 400Hz/100Hz */
#endif /* _LINUX_LIS302DL_H */