drivers:iio:stm:pressure: add support to LPS28DFW STMEMS sensor

Extends support of LPS22DF ST MEMS pressure and temperature sensor
driver to the compatible LPS28DFW device.

Signed-off-by: Mario Tesi <mario.tesi@st.com>
Change-Id: I0b69cff701b3d7fafeb7b949d373a80d9a449473
Reviewed-on: https://sczcxd1104.scz.st.com/gerrit/c/linux/stm-ldd-iio/+/603
Tested-by: CI STM MSD <aosp-ger@st.com>
Reviewed-by: Denis CIOCCA <denis.ciocca@st.com>
This commit is contained in:
Mario Tesi 2022-04-19 12:04:11 +02:00 committed by Denis CIOCCA
parent 82c65e1894
commit 89831e476b
4 changed files with 25 additions and 8 deletions

View File

@ -3,6 +3,7 @@
Required properties for all bus drivers:
- compatible: must be one of:
"st,lps22df"
"st,lps28dfw"
Required properties for the i2c bindings:
- reg: i2c slave address
@ -13,12 +14,15 @@ Required properties for the spi bindings:
constrained by external circuitry
Optional properties for all bus drivers:
- interrupts: interrupt mapping for IRQ. It should be configured with
flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING,
IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_EDGE_FALLING.
- interrupts: interrupt mapping for IRQ. It should be configured with
flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING,
IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_EDGE_FALLING.
Refer to interrupt-controller/interrupts.txt for generic interrupt
client node bindings.
Refer to interrupt-controller/interrupts.txt for generic
interrupt client node bindings.
- int-active-low: set device int pin active low (default active high)
- int-open-drain: set device int pin open in drain configuration (default
is push pull)
Example for an spi device node:
@ -29,3 +33,12 @@ lps22df-pressure@0 {
interrupt-parent = <&gpio0>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
};
Example for an i2c device node:
lps28dfw-pressure@5c {
compatible = "st,lps28dfw";
reg = <0x5c>;
interrupt-parent = <&gpio0>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
};

View File

@ -26,15 +26,15 @@ config ST_LPS22HH_SPI_IIO
depends on ST_LPS22HH_IIO
config ST_LPS22DF_IIO
tristate "STMicroelectronics LPS22DF sensor"
tristate "STMicroelectronics LPS22DF/LPS28DFW sensor"
depends on (I2C || SPI_MASTER) && SYSFS
select IIO_BUFFER
select IIO_KFIFO_BUF
select ST_LPS22DF_I2C_IIO if (I2C)
select ST_LPS22DF_SPI_IIO if (SPI)
help
Say yes here to build support for the ST MEMS LPS22DF pressure and
temperature sensor.
Say yes here to build support for the ST MEMS LPS22DF/LPS28DFW
pressure and temperature sensor.
This driver can be built as a module. The module will be called
st-lps22df.

View File

@ -77,12 +77,14 @@ static int st_lps22df_i2c_probe(struct i2c_client *client,
static const struct i2c_device_id st_lps22df_ids[] = {
{ "lps22df" },
{ "lps28dfw" },
{}
};
MODULE_DEVICE_TABLE(i2c, st_lps22df_ids);
static const struct of_device_id st_lps22df_id_table[] = {
{ .compatible = "st,lps22df" },
{ .compatible = "st,lps28dfw" },
{},
};
MODULE_DEVICE_TABLE(of, st_lps22df_id_table);

View File

@ -74,12 +74,14 @@ static int st_lps22df_spi_probe(struct spi_device *spi)
static const struct spi_device_id st_lps22df_ids[] = {
{ "lps22df" },
{ "lps28dfw" },
{}
};
MODULE_DEVICE_TABLE(spi, st_lps22df_ids);
static const struct of_device_id st_lps22df_id_table[] = {
{ .compatible = "st,lps22df" },
{ .compatible = "st,lps28dfw" },
{},
};
MODULE_DEVICE_TABLE(of, st_lps22df_id_table);