summaryrefslogtreecommitdiffstats
path: root/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
diff options
context:
space:
mode:
authorAnilKumar Ch <anilkumar@ti.com>2012-08-22 12:00:39 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-05 13:44:04 -0700
commit0bf5a8be4723fd5f243d9d1ed8e6eb9d81f31cf2 (patch)
treead3c4f0265c8a06c878d2f5918e68bcb2b8dc476 /drivers/misc/lis3lv02d/lis3lv02d_i2c.c
parent7da59d2fe30d8169c7c9e7b488beb1b9af932608 (diff)
downloadlinux-0bf5a8be4723fd5f243d9d1ed8e6eb9d81f31cf2.tar.gz
linux-0bf5a8be4723fd5f243d9d1ed8e6eb9d81f31cf2.tar.bz2
linux-0bf5a8be4723fd5f243d9d1ed8e6eb9d81f31cf2.zip
lis3lv02d: Add STMicroelectronics lis331dlh digital accelerometer
This patch adds support for lis331dlh digital accelerometer to the lis3lv02d driver family. Adds ID field for detecting the lis331dlh module, based on this ID field lis3lv02d driver will export the lis331dlh module functionality. Signed-off-by: AnilKumar Ch <anilkumar@ti.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/lis3lv02d/lis3lv02d_i2c.c')
-rw-r--r--drivers/misc/lis3lv02d/lis3lv02d_i2c.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
index e8c0019da97a..15255eb8ac81 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
@@ -90,7 +90,11 @@ static int lis3_i2c_init(struct lis3lv02d *lis3)
if (ret < 0)
return ret;
- reg |= CTRL1_PD0 | CTRL1_Xen | CTRL1_Yen | CTRL1_Zen;
+ if (lis3->whoami == WAI_3DLH)
+ reg |= CTRL1_PM0 | CTRL1_Xen | CTRL1_Yen | CTRL1_Zen;
+ else
+ reg |= CTRL1_PD0 | CTRL1_Xen | CTRL1_Yen | CTRL1_Zen;
+
return lis3->write(lis3, CTRL_REG1, reg);
}
@@ -232,6 +236,7 @@ static int lis3_i2c_runtime_resume(struct device *dev)
static const struct i2c_device_id lis3lv02d_id[] = {
{"lis3lv02d", 0 },
+ {"lis331dlh", LIS331DLH},
{}
};