mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 19:07:52 +00:00
iio: accel: add support for LIS302DL variant
Add support for STMicroelectronics LIS302DL accelerometer to the st_accel framework. Datasheet: https://www.st.com/resource/en/datasheet/lis302dl.pdf Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220307132502.73854-4-absicsz@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
a85257f0df
commit
8a7449d686
4 changed files with 13 additions and 0 deletions
|
@ -36,8 +36,10 @@
|
||||||
#define LIS3DE_ACCEL_DEV_NAME "lis3de"
|
#define LIS3DE_ACCEL_DEV_NAME "lis3de"
|
||||||
#define LIS2DE12_ACCEL_DEV_NAME "lis2de12"
|
#define LIS2DE12_ACCEL_DEV_NAME "lis2de12"
|
||||||
#define LIS2HH12_ACCEL_DEV_NAME "lis2hh12"
|
#define LIS2HH12_ACCEL_DEV_NAME "lis2hh12"
|
||||||
|
#define LIS302DL_ACCEL_DEV_NAME "lis302dl"
|
||||||
#define SC7A20_ACCEL_DEV_NAME "sc7a20"
|
#define SC7A20_ACCEL_DEV_NAME "sc7a20"
|
||||||
|
|
||||||
|
|
||||||
#ifdef CONFIG_IIO_BUFFER
|
#ifdef CONFIG_IIO_BUFFER
|
||||||
int st_accel_allocate_ring(struct iio_dev *indio_dev);
|
int st_accel_allocate_ring(struct iio_dev *indio_dev);
|
||||||
int st_accel_trig_set_state(struct iio_trigger *trig, bool state);
|
int st_accel_trig_set_state(struct iio_trigger *trig, bool state);
|
||||||
|
|
|
@ -444,6 +444,7 @@ static const struct st_sensor_settings st_accel_sensors_settings[] = {
|
||||||
.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
|
.wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS,
|
||||||
.sensors_supported = {
|
.sensors_supported = {
|
||||||
[0] = LIS331DL_ACCEL_DEV_NAME,
|
[0] = LIS331DL_ACCEL_DEV_NAME,
|
||||||
|
[1] = LIS302DL_ACCEL_DEV_NAME,
|
||||||
},
|
},
|
||||||
.ch = (struct iio_chan_spec *)st_accel_8bit_channels,
|
.ch = (struct iio_chan_spec *)st_accel_8bit_channels,
|
||||||
.odr = {
|
.odr = {
|
||||||
|
|
|
@ -107,6 +107,10 @@ static const struct of_device_id st_accel_of_match[] = {
|
||||||
.compatible = "st,lis2hh12",
|
.compatible = "st,lis2hh12",
|
||||||
.data = LIS2HH12_ACCEL_DEV_NAME,
|
.data = LIS2HH12_ACCEL_DEV_NAME,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.compatible = "st,lis302dl",
|
||||||
|
.data = LIS302DL_ACCEL_DEV_NAME,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.compatible = "silan,sc7a20",
|
.compatible = "silan,sc7a20",
|
||||||
.data = SC7A20_ACCEL_DEV_NAME,
|
.data = SC7A20_ACCEL_DEV_NAME,
|
||||||
|
@ -146,6 +150,7 @@ static const struct i2c_device_id st_accel_id_table[] = {
|
||||||
{ LIS3DE_ACCEL_DEV_NAME },
|
{ LIS3DE_ACCEL_DEV_NAME },
|
||||||
{ LIS2DE12_ACCEL_DEV_NAME },
|
{ LIS2DE12_ACCEL_DEV_NAME },
|
||||||
{ LIS2HH12_ACCEL_DEV_NAME },
|
{ LIS2HH12_ACCEL_DEV_NAME },
|
||||||
|
{ LIS302DL_ACCEL_DEV_NAME },
|
||||||
{ SC7A20_ACCEL_DEV_NAME },
|
{ SC7A20_ACCEL_DEV_NAME },
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
|
|
@ -92,6 +92,10 @@ static const struct of_device_id st_accel_of_match[] = {
|
||||||
.compatible = "st,lis3de",
|
.compatible = "st,lis3de",
|
||||||
.data = LIS3DE_ACCEL_DEV_NAME,
|
.data = LIS3DE_ACCEL_DEV_NAME,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.compatible = "st,lis302dl",
|
||||||
|
.data = LIS302DL_ACCEL_DEV_NAME,
|
||||||
|
},
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, st_accel_of_match);
|
MODULE_DEVICE_TABLE(of, st_accel_of_match);
|
||||||
|
@ -147,6 +151,7 @@ static const struct spi_device_id st_accel_id_table[] = {
|
||||||
{ LIS2DW12_ACCEL_DEV_NAME },
|
{ LIS2DW12_ACCEL_DEV_NAME },
|
||||||
{ LIS3DHH_ACCEL_DEV_NAME },
|
{ LIS3DHH_ACCEL_DEV_NAME },
|
||||||
{ LIS3DE_ACCEL_DEV_NAME },
|
{ LIS3DE_ACCEL_DEV_NAME },
|
||||||
|
{ LIS302DL_ACCEL_DEV_NAME },
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(spi, st_accel_id_table);
|
MODULE_DEVICE_TABLE(spi, st_accel_id_table);
|
||||||
|
|
Loading…
Reference in a new issue