iio: pressure: add support to LPS33HW and LPS35HW
authorLorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Sat, 2 Sep 2017 17:39:14 +0000 (19:39 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 3 Sep 2017 17:10:33 +0000 (18:10 +0100)
add support to STMicroelectronics LPS33HW and LPS35HW pressure sensors
to st_pressure framework

http://www.st.com/resource/en/datasheet/lps33hw.pdf
http://www.st.com/resource/en/datasheet/lps35hw.pdf
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/pressure/st_pressure.h
drivers/iio/pressure/st_pressure_core.c
drivers/iio/pressure/st_pressure_i2c.c
drivers/iio/pressure/st_pressure_spi.c

index 7d99593..e67eb0d 100644 (file)
@@ -19,6 +19,8 @@ enum st_press_type {
        LPS25H,
        LPS331AP,
        LPS22HB,
+       LPS33HW,
+       LPS35HW,
        ST_PRESS_MAX,
 };
 
@@ -26,6 +28,8 @@ enum st_press_type {
 #define LPS25H_PRESS_DEV_NAME          "lps25h"
 #define LPS331AP_PRESS_DEV_NAME                "lps331ap"
 #define LPS22HB_PRESS_DEV_NAME         "lps22hb"
+#define LPS33HW_PRESS_DEV_NAME         "lps33hw"
+#define LPS35HW_PRESS_DEV_NAME         "lps35hw"
 
 /**
  * struct st_sensors_platform_data - default press platform data
index 3117f4c..8612071 100644 (file)
@@ -410,6 +410,8 @@ static const struct st_sensor_settings st_press_sensors_settings[] = {
                .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
                .sensors_supported = {
                        [0] = LPS22HB_PRESS_DEV_NAME,
+                       [1] = LPS33HW_PRESS_DEV_NAME,
+                       [2] = LPS35HW_PRESS_DEV_NAME,
                },
                .ch = (struct iio_chan_spec *)st_press_lps22hb_channels,
                .num_ch = ARRAY_SIZE(st_press_lps22hb_channels),
index 7f15e92..fbb5905 100644 (file)
@@ -37,6 +37,14 @@ static const struct of_device_id st_press_of_match[] = {
                .compatible = "st,lps22hb-press",
                .data = LPS22HB_PRESS_DEV_NAME,
        },
+       {
+               .compatible = "st,lps33hw",
+               .data = LPS33HW_PRESS_DEV_NAME,
+       },
+       {
+               .compatible = "st,lps35hw",
+               .data = LPS35HW_PRESS_DEV_NAME,
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, st_press_of_match);
@@ -59,6 +67,8 @@ static const struct i2c_device_id st_press_id_table[] = {
        { LPS25H_PRESS_DEV_NAME,  LPS25H },
        { LPS331AP_PRESS_DEV_NAME, LPS331AP },
        { LPS22HB_PRESS_DEV_NAME, LPS22HB },
+       { LPS33HW_PRESS_DEV_NAME, LPS33HW },
+       { LPS35HW_PRESS_DEV_NAME, LPS35HW },
        {},
 };
 MODULE_DEVICE_TABLE(i2c, st_press_id_table);
index f5ebd36..9a3441b 100644 (file)
@@ -41,6 +41,14 @@ static const struct of_device_id st_press_of_match[] = {
                .compatible = "st,lps22hb-press",
                .data = LPS22HB_PRESS_DEV_NAME,
        },
+       {
+               .compatible = "st,lps33hw",
+               .data = LPS33HW_PRESS_DEV_NAME,
+       },
+       {
+               .compatible = "st,lps35hw",
+               .data = LPS35HW_PRESS_DEV_NAME,
+       },
        {},
 };
 MODULE_DEVICE_TABLE(of, st_press_of_match);
@@ -83,6 +91,8 @@ static const struct spi_device_id st_press_id_table[] = {
        { LPS25H_PRESS_DEV_NAME },
        { LPS331AP_PRESS_DEV_NAME },
        { LPS22HB_PRESS_DEV_NAME },
+       { LPS33HW_PRESS_DEV_NAME },
+       { LPS35HW_PRESS_DEV_NAME },
        {},
 };
 MODULE_DEVICE_TABLE(spi, st_press_id_table);