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: magnetometer: st_magn: Add LSM303C

The magnetometer part of ST LSM303C is similar (perhaps even identical)
to the already supported standalone LIS3MDL magnetometer, so just
add the new st,lsm303c-magn 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-4-stephan@gerhold.net
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Stephan Gerhold and committed by
Jonathan Cameron
721a2a7e 23fd6f0b

+13 -1
+1 -1
drivers/iio/magnetometer/Kconfig
··· 119 119 select IIO_TRIGGERED_BUFFER if (IIO_BUFFER) 120 120 help 121 121 Say yes here to build support for STMicroelectronics magnetometers: 122 - LSM303DLHC, LSM303DLM, LIS3MDL. 122 + LSM303C, LSM303DLHC, LSM303DLM, LIS3MDL. 123 123 124 124 Also need to enable at least one of I2C and SPI interface drivers 125 125 below.
+1
drivers/iio/magnetometer/st_magn.h
··· 22 22 #define LIS2MDL_MAGN_DEV_NAME "lis2mdl" 23 23 #define LSM9DS1_MAGN_DEV_NAME "lsm9ds1_magn" 24 24 #define IIS2MDC_MAGN_DEV_NAME "iis2mdc" 25 + #define LSM303C_MAGN_DEV_NAME "lsm303c_magn" 25 26 26 27 #ifdef CONFIG_IIO_BUFFER 27 28 int st_magn_allocate_ring(struct iio_dev *indio_dev);
+1
drivers/iio/magnetometer/st_magn_core.c
··· 305 305 .sensors_supported = { 306 306 [0] = LIS3MDL_MAGN_DEV_NAME, 307 307 [1] = LSM9DS1_MAGN_DEV_NAME, 308 + [2] = LSM303C_MAGN_DEV_NAME, 308 309 }, 309 310 .ch = (struct iio_chan_spec *)st_magn_2_16bit_channels, 310 311 .odr = {
+5
drivers/iio/magnetometer/st_magn_i2c.c
··· 50 50 .compatible = "st,iis2mdc", 51 51 .data = IIS2MDC_MAGN_DEV_NAME, 52 52 }, 53 + { 54 + .compatible = "st,lsm303c-magn", 55 + .data = LSM303C_MAGN_DEV_NAME, 56 + }, 53 57 {}, 54 58 }; 55 59 MODULE_DEVICE_TABLE(of, st_magn_of_match); ··· 101 97 { LIS2MDL_MAGN_DEV_NAME }, 102 98 { LSM9DS1_MAGN_DEV_NAME }, 103 99 { IIS2MDC_MAGN_DEV_NAME }, 100 + { LSM303C_MAGN_DEV_NAME }, 104 101 {}, 105 102 }; 106 103 MODULE_DEVICE_TABLE(i2c, st_magn_id_table);
+5
drivers/iio/magnetometer/st_magn_spi.c
··· 45 45 .compatible = "st,iis2mdc", 46 46 .data = IIS2MDC_MAGN_DEV_NAME, 47 47 }, 48 + { 49 + .compatible = "st,lsm303c-magn", 50 + .data = LSM303C_MAGN_DEV_NAME, 51 + }, 48 52 {} 49 53 }; 50 54 MODULE_DEVICE_TABLE(of, st_magn_of_match); ··· 93 89 { LIS2MDL_MAGN_DEV_NAME }, 94 90 { LSM9DS1_MAGN_DEV_NAME }, 95 91 { IIS2MDC_MAGN_DEV_NAME }, 92 + { LSM303C_MAGN_DEV_NAME }, 96 93 {}, 97 94 }; 98 95 MODULE_DEVICE_TABLE(spi, st_magn_id_table);