]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
UBUNTU:SAUCE: iio: st-accel: add support for lis2dh12
authorGiuseppe Barba <giuseppe.barba@st.com>
Fri, 16 Dec 2016 10:05:30 +0000 (18:05 +0800)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 19 Dec 2016 18:51:09 +0000 (18:51 +0000)
BugLink: http://bugs.launchpad.net/bugs/1650112
This commit add support for STMicroelectronics lis2dh12 accelerometer.
Datasheet for this device can be found here:

http://www.st.com/st-web-ui/static/active/en/resource/technical/
document/datasheet/DM00091513.pdf

Signed-off-by: Giuseppe Barba <giuseppe.barba@st.com>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
(cherry picked from commit 34dc578d99449a83dcb0f5ef4444215590183af4)
Signed-off-by: Shrirang Bagul <shrirang.bagul@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Documentation/devicetree/bindings/iio/st-sensors.txt
drivers/iio/accel/Kconfig
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 b25fe929e8c17727f87c13918a6b227c287488b1..ab0912552f5cfa7819e9a0bdd0f9513e3c62fb3e 100644 (file)
@@ -36,6 +36,7 @@ Accelerometers:
 - st,lsm303dlm-accel
 - st,lsm330-accel
 - st,lsm303agr-accel
+- st,lis2dh12-accel
 
 Gyroscopes:
 - st,l3g4200d-gyro
index 16cc5c691a557af50b4f3dd448136d13c7f5c2a2..b978fbc89856a2bb053731c74344dd1d9345b96e 100644 (file)
@@ -64,7 +64,7 @@ config IIO_ST_ACCEL_3AXIS
        help
          Say yes here to build support for STMicroelectronics accelerometers:
          LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC,
-         LIS331DLH, LSM303DL, LSM303DLM, LSM330.
+         LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12.
 
          This driver can also be built as a module. If so, these modules
          will be created:
index 468f21fa2950bd2bd59c226919b7b22be1407398..5d4a1897b293ec60644efe18f1f8d0508b051fa9 100644 (file)
@@ -27,6 +27,7 @@
 #define LSM303DLM_ACCEL_DEV_NAME       "lsm303dlm_accel"
 #define LSM330_ACCEL_DEV_NAME          "lsm330_accel"
 #define LSM303AGR_ACCEL_DEV_NAME       "lsm303agr_accel"
+#define LIS2DH12_ACCEL_DEV_NAME                "lis2dh12_accel"
 
 /**
 * struct st_sensors_platform_data - default accel platform data
index 197a08b4e2f3634ad48af3f246fb855d04f8b12d..70f042797f152a42bff02304987dad0c60d2fd0f 100644 (file)
@@ -232,6 +232,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
                        [3] = LSM330DL_ACCEL_DEV_NAME,
                        [4] = LSM330DLC_ACCEL_DEV_NAME,
                        [5] = LSM303AGR_ACCEL_DEV_NAME,
+                       [6] = LIS2DH12_ACCEL_DEV_NAME,
                },
                .ch = (struct iio_chan_spec *)st_accel_12bit_channels,
                .odr = {
index 8b9cc84fd44f96be22186fb7364a5cf6259de701..294a32f89367b479fb29b4316b3f12c622db6efa 100644 (file)
@@ -72,6 +72,10 @@ static const struct of_device_id st_accel_of_match[] = {
                .compatible = "st,lsm303agr-accel",
                .data = LSM303AGR_ACCEL_DEV_NAME,
        },
+       {
+               .compatible = "st,lis2dh12-accel",
+               .data = LIS2DH12_ACCEL_DEV_NAME,
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, st_accel_of_match);
@@ -121,6 +125,7 @@ static const struct i2c_device_id st_accel_id_table[] = {
        { LSM303DLM_ACCEL_DEV_NAME },
        { LSM330_ACCEL_DEV_NAME },
        { LSM303AGR_ACCEL_DEV_NAME },
+       { LIS2DH12_ACCEL_DEV_NAME },
        {},
 };
 MODULE_DEVICE_TABLE(i2c, st_accel_id_table);
index f71b0d391272476a96656bef1ad22172fd3e2f28..fcd5847a3fd34a11531e2db3ae6ed0365cd71bd5 100644 (file)
@@ -58,6 +58,7 @@ static const struct spi_device_id st_accel_id_table[] = {
        { LSM303DLM_ACCEL_DEV_NAME },
        { LSM330_ACCEL_DEV_NAME },
        { LSM303AGR_ACCEL_DEV_NAME },
+       { LIS2DH12_ACCEL_DEV_NAME },
        {},
 };
 MODULE_DEVICE_TABLE(spi, st_accel_id_table);