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>
This commit is contained in:
AnilKumar Ch
2012-08-22 12:00:39 +05:30
committed by Greg Kroah-Hartman
parent 7da59d2fe3
commit 0bf5a8be47
4 changed files with 87 additions and 9 deletions

View File

@@ -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},
{}
};