]> git.karo-electronics.de Git - linux-beck.git/commitdiff
iio: st-accel: add support for lsm303agr accelerometer
authorGiuseppe Barba <giuseppe.barba@st.com>
Tue, 21 Jul 2015 08:35:44 +0000 (10:35 +0200)
committerJonathan Cameron <jic23@kernel.org>
Thu, 23 Jul 2015 19:43:22 +0000 (20:43 +0100)
This adds support for the lsm303agr accelerometer.

Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Documentation/devicetree/bindings/iio/st-sensors.txt
drivers/iio/accel/st_accel.h
drivers/iio/accel/st_accel_core.c
drivers/iio/accel/st_accel_i2c.c
drivers/iio/accel/st_accel_spi.c

index 8a6be3bdf2671e8b6f9edbfb9407cb3513e51659..d80bdaa75754c239f200f1b22c87b3cddf74e2d2 100644 (file)
@@ -35,6 +35,7 @@ Accelerometers:
 - st,lsm303dl-accel
 - st,lsm303dlm-accel
 - st,lsm330-accel
+- st,lsm303agr-accel
 
 Gyroscopes:
 - st,l3g4200d-gyro
index aa1001931d0c418705dd968c154ce7b149c5324b..468f21fa2950bd2bd59c226919b7b22be1407398 100644 (file)
@@ -26,6 +26,7 @@
 #define LSM303DLH_ACCEL_DEV_NAME       "lsm303dlh_accel"
 #define LSM303DLM_ACCEL_DEV_NAME       "lsm303dlm_accel"
 #define LSM330_ACCEL_DEV_NAME          "lsm330_accel"
+#define LSM303AGR_ACCEL_DEV_NAME       "lsm303agr_accel"
 
 /**
 * struct st_sensors_platform_data - default accel platform data
index 12b42f6e70ab90139c428f85d47d846c13c3342a..ff30f880688019fa099d79d7fce3f53b28cfb828 100644 (file)
@@ -233,6 +233,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
                        [2] = LSM330D_ACCEL_DEV_NAME,
                        [3] = LSM330DL_ACCEL_DEV_NAME,
                        [4] = LSM330DLC_ACCEL_DEV_NAME,
+                       [5] = LSM303AGR_ACCEL_DEV_NAME,
                },
                .ch = (struct iio_chan_spec *)st_accel_12bit_channels,
                .odr = {
index a2f1c20319eb3a6f852b459a17059d29d1ebaa3d..8b9cc84fd44f96be22186fb7364a5cf6259de701 100644 (file)
@@ -68,6 +68,10 @@ static const struct of_device_id st_accel_of_match[] = {
                .compatible = "st,lsm330-accel",
                .data = LSM330_ACCEL_DEV_NAME,
        },
+       {
+               .compatible = "st,lsm303agr-accel",
+               .data = LSM303AGR_ACCEL_DEV_NAME,
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, st_accel_of_match);
@@ -116,6 +120,7 @@ static const struct i2c_device_id st_accel_id_table[] = {
        { LSM303DL_ACCEL_DEV_NAME },
        { LSM303DLM_ACCEL_DEV_NAME },
        { LSM330_ACCEL_DEV_NAME },
+       { LSM303AGR_ACCEL_DEV_NAME },
        {},
 };
 MODULE_DEVICE_TABLE(i2c, st_accel_id_table);
index 12ec29389e4ba15c794d3aaa74df3c5c917d3cee..54b61a3961c305e60222de437e4355103ae67029 100644 (file)
@@ -57,6 +57,7 @@ static const struct spi_device_id st_accel_id_table[] = {
        { LSM303DL_ACCEL_DEV_NAME },
        { LSM303DLM_ACCEL_DEV_NAME },
        { LSM330_ACCEL_DEV_NAME },
+       { LSM303AGR_ACCEL_DEV_NAME },
        {},
 };
 MODULE_DEVICE_TABLE(spi, st_accel_id_table);