aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lis3lv02d.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-09-21 20:04:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-22 10:17:48 -0400
commit8873c33483e62988ed886230aab71ef4c678f710 (patch)
tree441cdc48497b84c823330241ecff147642e136a4 /drivers/hwmon/lis3lv02d.c
parent0ec48915e8bbb37dea3df85c41e4c3498b95664b (diff)
lis3: add free-fall/wakeup function via platform_data
This offers a way for platforms to define flags and thresholds for the free-fall/wakeup functions of the lis302d chips. More registers needed to be seperated as they are specific to the Signed-off-by: Daniel Mack <daniel@caiaq.de> Acked-by: Pavel Machek <pavel@ucw.cz> Cc: Eric Piel <eric.piel@tremplin-utc.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon/lis3lv02d.c')
-rw-r--r--drivers/hwmon/lis3lv02d.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hwmon/lis3lv02d.c b/drivers/hwmon/lis3lv02d.c
index 271338bdb6be..cf5afb9a10ab 100644
--- a/drivers/hwmon/lis3lv02d.c
+++ b/drivers/hwmon/lis3lv02d.c
@@ -454,6 +454,15 @@ int lis3lv02d_init_device(struct lis3lv02d *dev)
454 (p->click_thresh_y << 4)); 454 (p->click_thresh_y << 4));
455 } 455 }
456 456
457 if (p->wakeup_flags && (dev->whoami == LIS_SINGLE_ID)) {
458 dev->write(dev, FF_WU_CFG_1, p->wakeup_flags);
459 dev->write(dev, FF_WU_THS_1, p->wakeup_thresh & 0x7f);
460 /* default to 2.5ms for now */
461 dev->write(dev, FF_WU_DURATION_1, 1);
462 /* enable high pass filter for both free-fall units */
463 dev->write(dev, CTRL_REG2, HP_FF_WU1 | HP_FF_WU2);
464 }
465
457 if (p->irq_cfg) 466 if (p->irq_cfg)
458 dev->write(dev, CTRL_REG3, p->irq_cfg); 467 dev->write(dev, CTRL_REG3, p->irq_cfg);
459 } 468 }