diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-06-16 18:34:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 22:47:57 -0400 |
commit | 8f3128e714ded7cf1e8c786c204a4f253b5d8ff4 (patch) | |
tree | cb3c1e9df2da5e4817acfeb75284e8d7b92eae33 /drivers/hwmon/lis3lv02d_spi.c | |
parent | 0093716e6dd18dad554bef81cc788a4c50d32a09 (diff) |
lis3: add click function
The LIS302DL accelerometer chip has a 'click' feature which can be used to
detect sudden motion on any of the three axis. Configuration data is
passed via spi platform_data and no action is taken if that's not
specified, so it won't harm any existing platform.
To make the configuration effective, the IRQ lines need to be set up
appropriately. This patch also adds a way to do that from board support
code.
The DD_* definitions were factored out to an own enum because they are
specific to LIS3LV02D devices.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: 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_spi.c')
-rw-r--r-- | drivers/hwmon/lis3lv02d_spi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hwmon/lis3lv02d_spi.c b/drivers/hwmon/lis3lv02d_spi.c index 07ae74b0e191..3827ff04485f 100644 --- a/drivers/hwmon/lis3lv02d_spi.c +++ b/drivers/hwmon/lis3lv02d_spi.c | |||
@@ -72,6 +72,7 @@ static int __devinit lis302dl_spi_probe(struct spi_device *spi) | |||
72 | lis3_dev.write = lis3_spi_write; | 72 | lis3_dev.write = lis3_spi_write; |
73 | lis3_dev.irq = spi->irq; | 73 | lis3_dev.irq = spi->irq; |
74 | lis3_dev.ac = lis3lv02d_axis_normal; | 74 | lis3_dev.ac = lis3lv02d_axis_normal; |
75 | lis3_dev.pdata = spi->dev.platform_data; | ||
75 | spi_set_drvdata(spi, &lis3_dev); | 76 | spi_set_drvdata(spi, &lis3_dev); |
76 | 77 | ||
77 | ret = lis3lv02d_init_device(&lis3_dev); | 78 | ret = lis3lv02d_init_device(&lis3_dev); |