aboutsummaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2009-02-03 10:11:40 +0000
committerAndy Green <agreen@octopus.localdomain>2009-02-03 10:11:40 +0000
commit088da01e5e09455d2201b6c62052a258a4f82555 (patch)
treec67c9ccacf83a01f690a5ab51df3f6be52caef8d /drivers/input
parent5962b071d390bf448b045d3d4de119901457f383 (diff)
fix-lis302dl-clear-wakeup-source-if-threshold.patch
We need to clear down the wakeup source reg if we woke from threshold. Reported-by: Simon Kagstrom <simon.kagstrom@gmail.com> Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/lis302dl.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/input/misc/lis302dl.c b/drivers/input/misc/lis302dl.c
index bc73e972bff..424abbc83d1 100644
--- a/drivers/input/misc/lis302dl.c
+++ b/drivers/input/misc/lis302dl.c
@@ -216,13 +216,12 @@ static void lis302dl_bitbang_read_sample(struct lis302dl_info *lis)
u8 data = 0xc0 | LIS302DL_REG_STATUS; /* read, autoincrement */
u8 read[(LIS302DL_REG_OUT_Z - LIS302DL_REG_STATUS) + 1];
unsigned long flags;
- int mg_per_sample;
+ int mg_per_sample = __threshold_to_mg(lis, 1);
- local_irq_save(flags);
- mg_per_sample = __threshold_to_mg(lis, 1);
+ /* grab the set of register containing status and XYZ data */
+ local_irq_save(flags);
(lis->pdata->lis302dl_bitbang)(lis, &data, 1, &read[0], sizeof(read));
-
local_irq_restore(flags);
/*
@@ -249,6 +248,10 @@ static void lis302dl_bitbang_read_sample(struct lis302dl_info *lis)
input_sync(lis->input_dev);
}
+
+ if (lis->threshold)
+ /* acknowledge the wakeup source */
+ __reg_read(lis, LIS302DL_REG_FF_WU_SRC_1);
}
static irqreturn_t lis302dl_interrupt(int irq, void *_lis)