Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: accel: st_accel: Add LSM303C

The accelerometer part of ST LSM303C is similar (perhaps even identical)
to the already supported standalone LIS2HH12 accelerometer, so just
add the new st,lsm303c-accel compatible for the existing definitions.

Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230106102239.9647-3-stephan@gerhold.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Stephan Gerhold and committed by
Jonathan Cameron
23fd6f0b 4aaf3e40

+13 -1
+1 -1
drivers/iio/accel/Kconfig
··· 380 380 select IIO_TRIGGERED_BUFFER if (IIO_BUFFER) 381 381 help 382 382 Say yes here to build support for STMicroelectronics accelerometers: 383 - LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC, 383 + LSM303C, LSM303DLH, LSM303DLHC, LIS3DH, LSM330D, LSM330DL, LSM330DLC, 384 384 LIS331DLH, LSM303DL, LSM303DLM, LSM330, LIS2DH12, H3LIS331DL, 385 385 LNG2DM, LIS3DE, LIS2DE12, LIS2HH12 386 386
+1
drivers/iio/accel/st_accel.h
··· 37 37 #define LIS2DE12_ACCEL_DEV_NAME "lis2de12" 38 38 #define LIS2HH12_ACCEL_DEV_NAME "lis2hh12" 39 39 #define LIS302DL_ACCEL_DEV_NAME "lis302dl" 40 + #define LSM303C_ACCEL_DEV_NAME "lsm303c_accel" 40 41 #define SC7A20_ACCEL_DEV_NAME "sc7a20" 41 42 42 43
+1
drivers/iio/accel/st_accel_core.c
··· 929 929 .wai_addr = ST_SENSORS_DEFAULT_WAI_ADDRESS, 930 930 .sensors_supported = { 931 931 [0] = LIS2HH12_ACCEL_DEV_NAME, 932 + [1] = LSM303C_ACCEL_DEV_NAME, 932 933 }, 933 934 .ch = (struct iio_chan_spec *)st_accel_16bit_channels, 934 935 .odr = {
+5
drivers/iio/accel/st_accel_i2c.c
··· 112 112 .data = LIS302DL_ACCEL_DEV_NAME, 113 113 }, 114 114 { 115 + .compatible = "st,lsm303c-accel", 116 + .data = LSM303C_ACCEL_DEV_NAME, 117 + }, 118 + { 115 119 .compatible = "silan,sc7a20", 116 120 .data = SC7A20_ACCEL_DEV_NAME, 117 121 }, ··· 155 151 { LIS2DE12_ACCEL_DEV_NAME }, 156 152 { LIS2HH12_ACCEL_DEV_NAME }, 157 153 { LIS302DL_ACCEL_DEV_NAME }, 154 + { LSM303C_ACCEL_DEV_NAME }, 158 155 { SC7A20_ACCEL_DEV_NAME }, 159 156 {}, 160 157 };
+5
drivers/iio/accel/st_accel_spi.c
··· 96 96 .compatible = "st,lis302dl", 97 97 .data = LIS302DL_ACCEL_DEV_NAME, 98 98 }, 99 + { 100 + .compatible = "st,lsm303c-accel", 101 + .data = LSM303C_ACCEL_DEV_NAME, 102 + }, 99 103 {} 100 104 }; 101 105 MODULE_DEVICE_TABLE(of, st_accel_of_match); ··· 156 152 { LIS3DHH_ACCEL_DEV_NAME }, 157 153 { LIS3DE_ACCEL_DEV_NAME }, 158 154 { LIS302DL_ACCEL_DEV_NAME }, 155 + { LSM303C_ACCEL_DEV_NAME }, 159 156 {}, 160 157 }; 161 158 MODULE_DEVICE_TABLE(spi, st_accel_id_table);