summaryrefslogtreecommitdiff
path: root/drivers/iio/magnetometer/st_magn_i2c.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2015-04-30 16:15:50 +0300
committerJonathan Cameron <jic23@kernel.org>2015-05-07 12:42:34 +0300
commit1038a6872802bb4a07f627162ff989bf49e2e5cc (patch)
treeef6ecde1b4806c79c8c798741b63c2b8c4ca635c /drivers/iio/magnetometer/st_magn_i2c.c
parent5e02bac3172fcad964eeef70ad21f583982a6eba (diff)
downloadlinux-1038a6872802bb4a07f627162ff989bf49e2e5cc.tar.xz
iio: magnetometer: support for lsm303dlh
The LSM303DLH accelerometer/magnetometer has a different device identification method than using register 0x0f, instead three registers contain a magic value. We rely on WhoAmI to be zero for this variant. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/magnetometer/st_magn_i2c.c')
-rw-r--r--drivers/iio/magnetometer/st_magn_i2c.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/iio/magnetometer/st_magn_i2c.c b/drivers/iio/magnetometer/st_magn_i2c.c
index 92e5c15452a3..5311d8aea8cc 100644
--- a/drivers/iio/magnetometer/st_magn_i2c.c
+++ b/drivers/iio/magnetometer/st_magn_i2c.c
@@ -21,6 +21,10 @@
#ifdef CONFIG_OF
static const struct of_device_id st_magn_of_match[] = {
{
+ .compatible = "st,lsm303dlh-magn",
+ .data = LSM303DLH_MAGN_DEV_NAME,
+ },
+ {
.compatible = "st,lsm303dlhc-magn",
.data = LSM303DLHC_MAGN_DEV_NAME,
},
@@ -71,6 +75,7 @@ static int st_magn_i2c_remove(struct i2c_client *client)
}
static const struct i2c_device_id st_magn_id_table[] = {
+ { LSM303DLH_MAGN_DEV_NAME },
{ LSM303DLHC_MAGN_DEV_NAME },
{ LSM303DLM_MAGN_DEV_NAME },
{ LIS3MDL_MAGN_DEV_NAME },