aboutsummaryrefslogtreecommitdiff
path: root/drivers/iio/light
AgeCommit message (Collapse)AuthorFilesLines
2024-10-24iio: light: veml6030: fix microlux value calculationJavier Carrasco1-1/+1
The raw value conversion to obtain a measurement in lux as INT_PLUS_MICRO does not calculate the decimal part properly to display it as micro (in this case microlux). It only calculates the module to obtain the decimal part from a resolution that is 10000 times the provided in the datasheet (0.5376 lux/cnt for the veml6030). The resulting value must still be multiplied by 100 to make it micro. This bug was introduced with the original implementation of the driver. Only the illuminance channel is fixed becuase the scale is non sensical for the intensity channels anyway. Cc: [email protected] Fixes: 7b779f573c48 ("iio: light: add driver for veml6030 ambient light sensor") Signed-off-by: Javier Carrasco <[email protected]> Link: https://patch.msgid.link/20241016-veml6030-fix-processed-micro-v1-1-4a5644796437@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-10-13Merge tag 'iio-fixes-for-6.12a' of ↵Greg Kroah-Hartman3-3/+8
ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-linus Jonathan writes: IIO: 1st set of fixes for the 6.12 cycle. Most of this pull request is the result of Javier Carrasco doing a careful audit for missing Kconfig dependencies that luck has meant the random builds have never hit. The rest is the usual mix of old bugs that have surfaced and some fallout from the recent merge window. adi,ad5686 - Fix binding duplication of compatible strings. bosch,bma400 - Fix an uninitialized variable in the event tap handling. bosch,bmi323 - Fix several issues in the register saving and restore on suspend/resume sensiron,spd500 - Fix missing CRC8 dependency ti,op3001 - Fix a missing full-scale range value (values above this point were all reported wrongly) vishay,veml6030 - Fix a segmentation fault due to some type confusion. - Fix wrong ambient light sensor resolution. * tag 'iio-fixes-for-6.12a' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (34 commits) iio: frequency: admv4420: fix missing select REMAP_SPI in Kconfig iio: frequency: {admv4420,adrf6780}: format Kconfig entries iio: adc: ad4695: Add missing Kconfig select iio: adc: ti-ads8688: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig iio: hid-sensors: Fix an error handling path in _hid_sensor_set_report_latency() iioc: dac: ltc2664: Fix span variable usage in ltc2664_channel_config() iio: dac: stm32-dac-core: add missing select REGMAP_MMIO in Kconfig iio: dac: ltc1660: add missing select REGMAP_SPI in Kconfig iio: dac: ad5770r: add missing select REGMAP_SPI in Kconfig iio: amplifiers: ada4250: add missing select REGMAP_SPI in Kconfig iio: frequency: adf4377: add missing select REMAP_SPI in Kconfig iio: resolver: ad2s1210: add missing select (TRIGGERED_)BUFFER in Kconfig iio: resolver: ad2s1210 add missing select REGMAP in Kconfig iio: proximity: mb1232: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig iio: pressure: bm1390: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig iio: magnetometer: af8133j: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig iio: light: bu27008: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig iio: chemical: ens160: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig iio: dac: ad5766: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig iio: dac: ad3552r: add missing select IIO_(TRIGGERED_)BUFFER in Kconfig ...
2024-10-06iio: light: bu27008: add missing select IIO_(TRIGGERED_)BUFFER in KconfigJavier Carrasco1-0/+2
This driver makes use of triggered buffers, but does not select the required modules. Add the missing 'select IIO_BUFFER' and 'select IIO_TRIGGERED_BUFFER'. Fixes: 41ff93d14f78 ("iio: light: ROHM BU27008 color sensor") Signed-off-by: Javier Carrasco <[email protected]> Acked-by: Matti Vaittinen <[email protected]> Link: https://patch.msgid.link/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2024-10-02move asm/unaligned.h to linux/unaligned.hAl Viro7-7/+7
asm/unaligned.h is always an include of asm-generic/unaligned.h; might as well move that thing to linux/unaligned.h and include that - there's nothing arch-specific in that header. auto-generated by the following: for i in `git grep -l -w asm/unaligned.h`; do sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i done for i in `git grep -l -w asm-generic/unaligned.h`; do sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i done git mv include/asm-generic/unaligned.h include/linux/unaligned.h git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
2024-09-30iio: light: veml6030: fix ALS sensor resolutionJavier Carrasco1-1/+1
The driver still uses the sensor resolution provided in the datasheet until Rev. 1.6, 28-Apr-2022, which was updated with Rev 1.7, 28-Nov-2023. The original ambient light resolution has been updated from 0.0036 lx/ct to 0.0042 lx/ct, which is the value that can be found in the current device datasheet. Update the default resolution for IT = 100 ms and GAIN = 1/8 from the original 4608 mlux/cnt to the current value from the "Resolution and maximum detection range" table (Application Note 84367, page 5), 5376 mlux/cnt. Cc: <[email protected]> Fixes: 7b779f573c48 ("iio: light: add driver for veml6030 ambient light sensor") Signed-off-by: Javier Carrasco <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-09-30iio: light: opt3001: add missing full-scale range valueEmil Gedenryd1-0/+4
The opt3001 driver uses predetermined full-scale range values to determine what exponent to use for event trigger threshold values. The problem is that one of the values specified in the datasheet is missing from the implementation. This causes larger values to be scaled down to an incorrect exponent, effectively reducing the maximum settable threshold value by a factor of 2. Add missing full-scale range array value. Fixes: 94a9b7b1809f ("iio: light: add support for TI's opt3001 light sensor") Signed-off-by: Emil Gedenryd <[email protected]> Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-09-30iio: light: veml6030: fix IIO device retrieval from embedded deviceJavier Carrasco1-2/+1
The dev pointer that is received as an argument in the in_illuminance_period_available_show function references the device embedded in the IIO device, not in the i2c client. dev_to_iio_dev() must be used to accessthe right data. The current implementation leads to a segmentation fault on every attempt to read the attribute because indio_dev gets a NULL assignment. This bug has been present since the first appearance of the driver, apparently since the last version (V6) before getting applied. A constant attribute was used until then, and the last modifications might have not been tested again. Cc: [email protected] Fixes: 7b779f573c48 ("iio: light: add driver for veml6030 ambient light sensor") Signed-off-by: Javier Carrasco <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-17iio: light: ltr390: Calculate 'counts_per_uvi' dynamicallyAbhash Jha1-2/+12
counts_per_uvi depends on the current value of gain and resolution. Hence, we cannot use the hardcoded value 96. The `counts_per_uvi` function gives the count based on the current gain and resolution (integration time). Signed-off-by: Abhash Jha <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-17iio: light: ltr390: Add ALS channel and support for gain and resolutionAbhash Jha1-15/+90
Add new ALS channel and allow reading lux and scale values. Also provide gain and resolution configuration for ALS channel. Add automatic mode switching between the UVS and ALS channel based on which channel is being accessed. The default mode in which the sensor start is ALS mode. Signed-off-by: Abhash Jha <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-17iio: light: noa1305: Fix up integration time look upMarek Vasut1-1/+1
The current code is always iterating over two fields in the noa1305_int_time_available array. Fix iteration limit, which has to be halved to avoid out of bounds access in case the value that is being looked up is not in the array. Fixes: 025f23cfebad ("iio: light: noa1305: Make integration time configurable") Reported-by: Dan Carpenter <[email protected]> Suggested-by: Jonathan Cameron <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-10iio: light: apds9960: Add proximity and gesture offset calibrationAbhash Jha1-1/+54
Proximity and gesture offset registers perform offset correction to improve cross-talk performance. Added `calibbias` to the proximity and gesture channels. Provided facility to set calibbias based on the channel number. Signed-off-by: Abhash Jha <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: ltr390: Add configurable gain and resolutionAbhash Jha1-11/+125
Add support for configuring and reading the gain and resolution (integration time). Also provide the available values for gain and resoltion respectively via `read_avail` callback. Signed-off-by: Abhash Jha <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: stk3310: add support for stk3013Kaustabh Chakraborty1-0/+5
Add support for Sensortek's STK3013 in the driver. The part bears the product ID 0x31. As seen in [1], Sensortek lists STK3013 as a proximity sensor. But it has been experimentally observed that they do have ambient light sensing capabilities. Furthermore, [2] implements a proximity and ambient light sensor driver for STK3x1x devices, which is also indicative of the fact that these parts are also ambient light sensors. [1] https://www.sensortek.com.tw/index.php/en/products/optical-sensor/ [2] https://android.googlesource.com/kernel/msm.git/+/e6dfa4641d88201e8019be19ff557e5d2cf4572f Signed-off-by: Kaustabh Chakraborty <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: stk3310: relax chipid check warningKaustabh Chakraborty1-1/+1
In order to allow newer devices which are compatible with existing sensors, issuing a warning for an unknown chipid indicates that something has gone wrong with the init process, which isn't ideal. Swap it with a friendlier info message to get things right. Suggested-by: Conor Dooley <[email protected]> Signed-off-by: Kaustabh Chakraborty <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: ROHM BH1745 colour sensorMudit Sharma3-0/+920
Add support for BH1745, which is an I2C colour sensor with red, green, blue and clear channels. It has a programmable active low interrupt pin. Interrupt occurs when the signal from the selected interrupt source channel crosses set interrupt threshold high or low level. Interrupt source for the device can be configured by enabling the corresponding event. Interrupt latch is always enabled when setting up interrupt. Add myself as the maintainer for this driver in MAINTAINERS. Signed-off-by: Mudit Sharma <[email protected]> Reviewed-by: Ivan Orlov <[email protected]> Reviewed-by: Javier Carrasco <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: tcs3472: make use of iio_for_each_active_channel()Nuno Sa1-2/+1
Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa <[email protected]> Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-17-8e12cd042906@analog.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: tcs3414: make use of iio_for_each_active_channel()Nuno Sa1-2/+1
Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa <[email protected]> Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-16-8e12cd042906@analog.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: si1145: use new '.masklength' accessorsNuno Sa1-4/+3
Make use of iio_get_masklength) and iio_for_each_active_channel() to access '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa <[email protected]> Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-15-8e12cd042906@analog.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: isl29125: make use of iio_for_each_active_channel()Nuno Sa1-2/+1
Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa <[email protected]> Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-14-8e12cd042906@analog.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: gp2ap020a00f: make use of iio_for_each_active_channel()Nuno Sa1-6/+3
Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa <[email protected]> Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-13-8e12cd042906@analog.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: adjd_s311: make use of iio_for_each_active_channel()Nuno Sa1-2/+1
Use iio_for_each_active_channel() to iterate over active channels accessing '.masklength' so it can be annotated as __private when there are no more direct users of it. Signed-off-by: Nuno Sa <[email protected]> Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-12-8e12cd042906@analog.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: noa1305: Make integration time configurableMarek Vasut1-0/+61
Add another attribute which is the integration time. Report available integration time settings, support read of integration time currently configured in hardware, and support configuration of integration time into hardware. Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: noa1305: Report available scale valuesMarek Vasut1-0/+21
Make use of the new static table of scale values and expose available scale values via sysfs attribute of the IIO device. Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: noa1305: Use static table lookup of scale valuesMarek Vasut1-36/+15
Move scale values into a static table, perform look up of those scale values in noa1305_scale() simply by using the integration time register content as an index, because the integration time register content directly maps to the table values. Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: noa1305: Assign val in noa1305_measure()Marek Vasut1-8/+5
Make noa1305_measure() behave similar to noa1305_scale(), make it assign the 'val' output variable on success and return IIO_VAL_INT. This further simplifies noa1305_read_raw() and allows removal of ret variable altogether. Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: noa1305: Simplify noa1305_read_raw()Marek Vasut1-24/+13
The only channel this hardware supports is IIO_LIGHT, if the channel is anything else, exit right away. The 'ret' variable is now always only assigned by noa1305_measure(), do not initialize it anymore. Update function parameter indent. No functional change. Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: light: ltrf216a: Add LTR-308 supportMarek Vasut1-10/+43
Add LiteOn LTR-308 support into LTR-F216A kernel driver. The two devices seem to have almost identical register map, except that the LTR-308 does not have three CLEAR_DATA registers, which are unused by this driver. Furthermore, LTR-308 and LTR-F216A use different lux calculation constants, 0.6 and 0.45 respectively. Both differences are handled using chip info data. https://optoelectronics.liteon.com/upload/download/DS86-2016-0027/LTR-308ALS_Final_%20DS_V1%201.pdf https://optoelectronics.liteon.com/upload/download/DS86-2019-0016/LTR-F216A_Final_DS_V1.4.PDF Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03iio: bu27034: Add a read only HARDWAREGAINMatti Vaittinen1-1/+14
The ROHM BU27034 light sensor has two data channels for measuring different frequencies of light. The result from these channels is combined into Lux value while the raw channel values are reported via intensity channels. Both of the intensity channels have adjustable gain setting which impacts the scale of the raw channels. Eg, doubling the gain will double the values read from the raw channels, which halves the scale value. The integration time can also be set for the sensor. This does also have an impact to the scale of the intensity channels because increasing the integration time will also increase the values reported via the raw channels. Impact of integration time to the scale and the fact that the scale value does not start from '1', can make it hard for a human reader to compute the gain values based on the scale. Add read-only HARDWAREGAIN to help debugging. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://patch.msgid.link/ec349847cc994f3bd632e99b408a31e7c70581d0.1720176341.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03bu27034: ROHM BU27034ANUC correct lux calculationMatti Vaittinen1-126/+31
The ROHM BU27034NUC was cancelled and BU27034ANUC is replacing this sensor. The lux computation based on the data from a BU27034ANUC is different from the computation for the data from an old BU27034NUC. Fix the lux computation. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://patch.msgid.link/b7bea76b54b28eb354dc523771a0e0a8b6f26095.1720176341.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03bu27034: ROHM BU27034ANUC correct gains and timesMatti Vaittinen1-19/+9
The ROHM BU27034NUC was cancelled and BU27034ANUC is replacing this sensor. The BU27034ANUC does not support all the gains or all the integration times that were supported on BU27034NUC. Srop unsupported times and gains Signed-off-by: Matti Vaittinen <[email protected]> Link: https://patch.msgid.link/19f8cca2b5498fbfea6e657b7b9c90b78516866a.1720176341.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03bu27034: ROHM BU27034NUC to BU27034ANUC drop data2Matti Vaittinen1-104/+28
The ROHM BU27034NUC was cancelled and BU27034ANUC is replacing this sensor. The BU27034ANUC does not have the data2 channel. Drop the data2 channel. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://patch.msgid.link/6f261d4499e9c0e161279717261cc9a20764a6bd.1720176341.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-08-03bu27034: ROHM BU27034NUC to BU27034ANUCMatti Vaittinen1-3/+2
The ROHM BU27034NUC was cancelled and BU27034ANUC is replacing this sensor. These senors aren't compatible from the software point of view. According to ROHM, the BU27034NUC was never mass-produced. Hence dropping the BU27034NUC support and using this driver to support BU27034ANUC should not be a problem to users. We however need to ensure than people who use old kernel with the old BU27034NUC driver don't get the old driver probed for the new sensor. Prepare to use the BU27034NUC driver to support the new BU27034ANUC and change the compatible to prevent probing the old driver with the new sensor. Signed-off-by: Matti Vaittinen <[email protected]> Link: https://patch.msgid.link/ed8b963b0cd3a84c06a494c79969a136d5abcf92.1720176341.git.mazziesaccount@gmail.com Signed-off-by: Jonathan Cameron <[email protected]>
2024-07-29iio: light: gp2ap002: Constify struct regmap_busJavier Carrasco1-1/+1
`gp2ap002_regmap_bus` is not modified and can be declared as const to move its data to a read-only section. Signed-off-by: Javier Carrasco <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-07-19Merge tag 'char-misc-6.11-rc1' of ↵Linus Torvalds39-67/+369
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc and other driver updates from Greg KH: "Here is the "big" set of char/misc and other driver subsystem changes for 6.11-rc1. Nothing major in here, just loads of new drivers and updates. Included in here are: - IIO api updates and new drivers added - wait_interruptable_timeout() api cleanups for some drivers - MODULE_DESCRIPTION() additions for loads of drivers - parport out-of-bounds fix - interconnect driver updates and additions - mhi driver updates and additions - w1 driver fixes - binder speedups and fixes - eeprom driver updates - coresight driver updates - counter driver update - new misc driver additions - other minor api updates All of these, EXCEPT for the final Kconfig build fix for 32bit systems, have been in linux-next for a while with no reported issues. The Kconfig fixup went in 29 hours ago, so might have missed the latest linux-next, but was acked by everyone involved" * tag 'char-misc-6.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (330 commits) misc: Kconfig: exclude mrvl-cn10k-dpi compilation for 32-bit systems misc: delete Makefile.rej binder: fix hang of unregistered readers misc: Kconfig: add a new dependency for MARVELL_CN10K_DPI virtio: add missing MODULE_DESCRIPTION() macro agp: uninorth: add missing MODULE_DESCRIPTION() macro spmi: add missing MODULE_DESCRIPTION() macros dev/parport: fix the array out-of-bounds risk samples: configfs: add missing MODULE_DESCRIPTION() macro misc: mrvl-cn10k-dpi: add Octeon CN10K DPI administrative driver misc: keba: Fix missing AUXILIARY_BUS dependency slimbus: Fix struct and documentation alignment in stream.c MAINTAINERS: CC dri-devel list on Qualcomm FastRPC patches misc: fastrpc: use coherent pool for untranslated Compute Banks misc: fastrpc: support complete DMA pool access to the DSP misc: fastrpc: add missing MODULE_DESCRIPTION() macro misc: fastrpc: Add missing dev_err newlines misc: fastrpc: Use memdup_user() nvmem: core: Implement force_ro sysfs attribute nvmem: Use sysfs_emit() for type attribute ...
2024-06-29iio: light: apds9306: Fix error handingMudit Sharma1-2/+2
The return value of 'iio_gts_find_int_time_by_sel()' is assigned to variable 'intg_old' but value of 'ret' is checked for error. Update to use 'intg_old' for error checking. Fixes: 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor") Signed-off-by: Mudit Sharma <[email protected]> Reviewed-by: Subhajit Ghosh <[email protected]> Link: https://patch.msgid.link/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-25iio: light: veml6030: make use of regmap_clear_bits()Trevor Gamblin1-2/+2
Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König <[email protected]> Signed-off-by: Trevor Gamblin <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-25iio: light: st_uvis25_core: make use of regmap_clear_bits()Trevor Gamblin1-2/+2
Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König <[email protected]> Signed-off-by: Trevor Gamblin <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-25iio: light: isl29018: make use of regmap_clear_bits()Trevor Gamblin1-3/+3
Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König <[email protected]> Signed-off-by: Trevor Gamblin <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-25iio: light: iqs621-als: make use of regmap_clear_bits()Trevor Gamblin1-2/+2
Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König <[email protected]> Signed-off-by: Trevor Gamblin <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-25iio: light: adux1020: make use of regmap_clear_bits(), regmap_set_bits()Trevor Gamblin1-7/+6
Instead of using regmap_update_bits() and passing the mask twice, use regmap_set_bits(). Instead of using regmap_update_bits() and passing val = 0, use regmap_clear_bits(). Suggested-by: Uwe Kleine-König <[email protected]> Signed-off-by: Trevor Gamblin <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-13iio: light: driver for Vishay VEML6040Arthur Becker3-0/+293
Implements driver for the Vishay VEML6040 rgbw light sensor. Included functionality: setting the integration time and reading the raw values for the four channels Not yet implemented: setting the measurements to 'Manual Force Mode' (Auto measurements off, and adding a measurement trigger) Datasheet: https://www.vishay.com/docs/84276/veml6040.pdf Signed-off-by: Arthur Becker <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-04iio: light: stk3310: support more stk3311 variantsBarnabás Czémán1-0/+4
Add support for more stk3311 variants like stk3311-a and stk3311-s34, they are register compatible but they have different chip ids. Signed-off-by: Barnabás Czémán <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-04iio: light: stk3310: make chip id check expandableBarnabás Czémán1-5/+19
Modify chip id check for support easier additions for compatible variants. Signed-off-by: Barnabás Czémán <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-04iio: light: stk3310: relax failure to match idBarnabás Czémán1-2/+1
Relax failure to match ID to a warning rather than probe fail. This add abilty to use other compatible variants when chip id is not defined in the driver. Signed-off-by: Barnabás Czémán <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-06-04iio: light: rohm-bu27034: remove unused struct 'bu27034_result'Dr. David Alan Gilbert1-6/+0
'bu27034_result' is unused since the original commit e52afbd61039 ("iio: light: ROHM BU27034 Ambient Light Sensor"). Remove it. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Acked-by: Matti Vaittinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0Uwe Kleine-König32-37/+37
These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. While add it, also remove commas after the sentinel entries. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-05-27iio: light: gp2ap020a00f: Remove some unused field in struct gp2ap020a00f_dataChristophe JAILLET1-1/+0
In "struct gp2ap020a00f_data", the 'pdata' field is unused. Moreover the "struct gp2ap020a00f_platform_data" is defined nowhere. Neither in this file, nor in a global .h file, so it is completely pointless. So, remove it. Found with cppcheck, unusedStructMember. Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/57e9f29c7062d1bb846064bf6dbd7a8385a855e7.1714568099.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jonathan Cameron <[email protected]>
2024-04-29iio: light: stk3310: Drop most likely fake ACPI IDAndy Shevchenko1-1/+0
The commit in question does not proove that ACPI ID exists. Quite likely it was a cargo cult addition while doint that for DT-based enumeration. Drop most likely fake ACPI ID. Googling for STK3335 gives no useful results in regard to DSDT. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-04-28iio: light: apds9306: Fix input arguments to in_range()Subhajit Ghosh1-6/+6
Third input argument to in_range() function requires the number of values in range, not the last value in that range. Update macro for persistence and adaptive threshold to reflect number of values supported instead of the maximum values supported. Fixes: 620d1e6c7a3f ("iio: light: Add support for APDS9306 Light Sensor") Signed-off-by: Subhajit Ghosh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-04-06iio: light: apds9306: Improve apds9306_write_event_config()Subhajit Ghosh1-21/+27
Simplify event configuration flow. Suggested-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/all/20240310124237.52fa8a56@jic23-huawei/ Signed-off-by: Subhajit Ghosh <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>