Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b954d77a authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Jonathan Cameron
Browse files

iio: pressure: add support to LPS33HW and LPS35HW

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: default avatarLorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 2711e642
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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),
+10 −0
Original line number Diff line number Diff line
@@ -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);
+10 −0
Original line number Diff line number Diff line
@@ -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);