Al Viro
5f60d5f6bb
move asm/unaligned.h to linux/unaligned.h
...
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-10-02 17:23:23 -04:00
Abhash Jha
4bd7e5ce51
iio: light: ltr390: Calculate 'counts_per_uvi' dynamically
...
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 <abhashkumarjha123@gmail.com >
Link: https://patch.msgid.link/20240814113135.14575-3-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-17 15:38:14 +01:00
Abhash Jha
14e0d914a8
iio: light: ltr390: Add ALS channel and support for gain and resolution
...
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 <abhashkumarjha123@gmail.com >
Link: https://patch.msgid.link/20240814113135.14575-2-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-17 15:38:14 +01:00
Marek Vasut
076c4d18de
iio: light: noa1305: Fix up integration time look up
...
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: 025f23cfeb ("iio: light: noa1305: Make integration time configurable")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org >
Suggested-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Signed-off-by: Marek Vasut <marex@denx.de >
Link: https://patch.msgid.link/20240814191946.81386-1-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-17 15:37:37 +01:00
Abhash Jha
06e91ad344
iio: light: apds9960: Add proximity and gesture offset calibration
...
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 <abhashkumarjha123@gmail.com >
Link: https://patch.msgid.link/20240804134212.51682-2-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-10 11:17:35 +01:00
Abhash Jha
13fad2607d
iio: light: ltr390: Add configurable gain and resolution
...
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 <abhashkumarjha123@gmail.com >
Link: https://patch.msgid.link/20240731063706.25412-2-abhashkumarjha123@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 15:01:11 +01:00
Kaustabh Chakraborty
a50f537002
iio: light: stk3310: add support for stk3013
...
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] e6dfa4641d
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org >
Link: https://patch.msgid.link/20240727-stk3310-v4-2-02497b1407ba@disroot.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:44 +01:00
Kaustabh Chakraborty
b3508a2ba5
iio: light: stk3310: relax chipid check warning
...
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 <conor@kernel.org >
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org >
Link: https://patch.msgid.link/20240727-stk3310-v4-1-02497b1407ba@disroot.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:44 +01:00
Mudit Sharma
eab35358aa
iio: light: ROHM BH1745 colour sensor
...
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 <muditsharma.info@gmail.com >
Reviewed-by: Ivan Orlov <ivan.orlov0322@gmail.com >
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com >
Link: https://patch.msgid.link/20240718220208.331942-2-muditsharma.info@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:41 +01:00
Nuno Sa
0718d52bb0
iio: light: tcs3472: make use of iio_for_each_active_channel()
...
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 <nuno.sa@analog.com >
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-17-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:40 +01:00
Nuno Sa
f8d6c31d47
iio: light: tcs3414: make use of iio_for_each_active_channel()
...
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 <nuno.sa@analog.com >
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-16-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:40 +01:00
Nuno Sa
72c399838b
iio: light: si1145: use new '.masklength' accessors
...
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 <nuno.sa@analog.com >
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-15-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:40 +01:00
Nuno Sa
4ab4d09e87
iio: light: isl29125: make use of iio_for_each_active_channel()
...
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 <nuno.sa@analog.com >
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-14-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:40 +01:00
Nuno Sa
327f46fe12
iio: light: gp2ap020a00f: make use of iio_for_each_active_channel()
...
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 <nuno.sa@analog.com >
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-13-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:40 +01:00
Nuno Sa
f801ab1a3f
iio: light: adjd_s311: make use of iio_for_each_active_channel()
...
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 <nuno.sa@analog.com >
Link: https://patch.msgid.link/20240718-dev-iio-masklength-private2-v1-12-8e12cd042906@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:40 +01:00
Marek Vasut
025f23cfeb
iio: light: noa1305: Make integration time configurable
...
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 <marex@denx.de >
Link: https://patch.msgid.link/20240715183120.143417-5-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:39 +01:00
Marek Vasut
98077d34d0
iio: light: noa1305: Report available scale values
...
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 <marex@denx.de >
Link: https://patch.msgid.link/20240715183120.143417-4-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:39 +01:00
Marek Vasut
968a3bed1c
iio: light: noa1305: Use static table lookup of scale values
...
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 <marex@denx.de >
Link: https://patch.msgid.link/20240715183120.143417-3-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:38 +01:00
Marek Vasut
dde56b6db4
iio: light: noa1305: Assign val in noa1305_measure()
...
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 <marex@denx.de >
Link: https://patch.msgid.link/20240715183120.143417-2-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:38 +01:00
Marek Vasut
0cef1c3232
iio: light: noa1305: Simplify noa1305_read_raw()
...
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 <marex@denx.de >
Link: https://patch.msgid.link/20240715183120.143417-1-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:38 +01:00
Marek Vasut
7c7d917030
iio: light: ltrf216a: Add LTR-308 support
...
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 <marex@denx.de >
Link: https://patch.msgid.link/20240708114227.18283-2-marex@denx.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:36 +01:00
Matti Vaittinen
06342d3f97
iio: bu27034: Add a read only HARDWAREGAIN
...
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 <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/ec349847cc994f3bd632e99b408a31e7c70581d0.1720176341.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:35 +01:00
Matti Vaittinen
eb13959e2d
bu27034: ROHM BU27034ANUC correct lux calculation
...
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 <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/b7bea76b54b28eb354dc523771a0e0a8b6f26095.1720176341.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:35 +01:00
Matti Vaittinen
bb1059815f
bu27034: ROHM BU27034ANUC correct gains and times
...
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 <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/19f8cca2b5498fbfea6e657b7b9c90b78516866a.1720176341.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:35 +01:00
Matti Vaittinen
acfc80c702
bu27034: ROHM BU27034NUC to BU27034ANUC drop data2
...
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 <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/6f261d4499e9c0e161279717261cc9a20764a6bd.1720176341.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:35 +01:00
Matti Vaittinen
dd77c0ff99
bu27034: ROHM BU27034NUC to BU27034ANUC
...
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 <mazziesaccount@gmail.com >
Link: https://patch.msgid.link/ed8b963b0cd3a84c06a494c79969a136d5abcf92.1720176341.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-08-03 10:13:35 +01:00
Javier Carrasco
9abedf82c7
iio: light: gp2ap002: Constify struct regmap_bus
...
`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 <javier.carrasco.cruz@gmail.com >
Link: https://patch.msgid.link/20240703-iio-cont-regmap_bus-v1-9-34754f355b65@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-07-29 20:31:10 +01:00
Linus Torvalds
acc5965b9f
Merge tag 'char-misc-6.11-rc1' of 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-07-19 15:55:08 -07:00
Mudit Sharma
1a5cba4309
iio: light: apds9306: Fix error handing
...
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: 620d1e6c7a ("iio: light: Add support for APDS9306 Light Sensor")
Signed-off-by: Mudit Sharma <muditsharma.info@gmail.com >
Reviewed-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com >
Link: https://patch.msgid.link/20240625210203.522179-1-muditsharma.info@gmail.com
Cc: <Stable@vger.kernel.org >
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-29 18:51:25 +01:00
Trevor Gamblin
df4083d388
iio: light: veml6030: make use of regmap_clear_bits()
...
Instead of using regmap_update_bits() and passing val = 0, use
regmap_clear_bits().
Suggested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com >
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Link: https://patch.msgid.link/20240617-review-v3-32-88d1338c4cca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-25 21:04:47 +01:00
Trevor Gamblin
feeae7fd1a
iio: light: st_uvis25_core: make use of regmap_clear_bits()
...
Instead of using regmap_update_bits() and passing val = 0, use
regmap_clear_bits().
Suggested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com >
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Link: https://patch.msgid.link/20240617-review-v3-31-88d1338c4cca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-25 21:04:47 +01:00
Trevor Gamblin
7832023d66
iio: light: isl29018: make use of regmap_clear_bits()
...
Instead of using regmap_update_bits() and passing val = 0, use
regmap_clear_bits().
Suggested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com >
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Link: https://patch.msgid.link/20240617-review-v3-30-88d1338c4cca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-25 21:04:47 +01:00
Trevor Gamblin
9ff43d2876
iio: light: iqs621-als: make use of regmap_clear_bits()
...
Instead of using regmap_update_bits() and passing val = 0, use
regmap_clear_bits().
Suggested-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com >
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Link: https://patch.msgid.link/20240617-review-v3-29-88d1338c4cca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-25 21:04:47 +01:00
Trevor Gamblin
1131f1e720
iio: light: adux1020: make use of regmap_clear_bits(), regmap_set_bits()
...
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 <u.kleine-koenig@baylibre.com >
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com >
Acked-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com >
Link: https://patch.msgid.link/20240617-review-v3-28-88d1338c4cca@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-25 21:04:47 +01:00
Arthur Becker
3c34171c1b
iio: light: driver for Vishay VEML6040
...
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 <arthur.becker@sentec.com >
Link: https://lore.kernel.org/r/20240604-veml6040-v4-1-5a4d59597874@sentec.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-13 19:19:25 +01:00
Barnabás Czémán
cba37c2e53
iio: light: stk3310: support more stk3311 variants
...
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 <trabarni@gmail.com >
Link: https://lore.kernel.org/r/20240521-stk3311-v1-3-07a4966b355a@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-04 19:53:06 +01:00
Barnabás Czémán
745712c7bb
iio: light: stk3310: make chip id check expandable
...
Modify chip id check for support easier additions
for compatible variants.
Signed-off-by: Barnabás Czémán <trabarni@gmail.com >
Link: https://lore.kernel.org/r/20240521-stk3311-v1-2-07a4966b355a@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-04 19:53:06 +01:00
Barnabás Czémán
709aeedcc7
iio: light: stk3310: relax failure to match id
...
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 <trabarni@gmail.com >
Link: https://lore.kernel.org/r/20240521-stk3311-v1-1-07a4966b355a@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-04 19:53:06 +01:00
Dr. David Alan Gilbert
4d8c7da08b
iio: light: rohm-bu27034: remove unused struct 'bu27034_result'
...
'bu27034_result' is unused since the original
commit e52afbd610 ("iio: light: ROHM BU27034 Ambient Light Sensor").
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org >
Acked-by: Matti Vaittinen <mazziesaccount@gmail.com >
Link: https://lore.kernel.org/r/20240522230457.478156-4-linux@treblig.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-06-04 19:53:06 +01:00
Uwe Kleine-König
4391affa10
iio: Drop explicit initialization of struct i2c_device_id::driver_data to 0
...
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 <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/20240508072928.2135858-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-05-27 09:48:57 +01:00
Christophe JAILLET
eef3681983
iio: light: gp2ap020a00f: Remove some unused field in struct gp2ap020a00f_data
...
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 <christophe.jaillet@wanadoo.fr >
Link: https://lore.kernel.org/r/57e9f29c7062d1bb846064bf6dbd7a8385a855e7.1714568099.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-05-27 09:48:56 +01:00
Andy Shevchenko
62de5e3e31
iio: light: stk3310: Drop most likely fake ACPI ID
...
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 <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20240415141852.853490-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-04-29 20:53:25 +01:00
Subhajit Ghosh
0d8d626407
iio: light: apds9306: Fix input arguments to in_range()
...
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: 620d1e6c7a ("iio: light: Add support for APDS9306 Light Sensor")
Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com >
Link: https://lore.kernel.org/r/20240427090914.37274-1-subhajit.ghosh@tweaklogic.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-04-28 12:46:53 +01:00
Subhajit Ghosh
85795d3edd
iio: light: apds9306: Improve apds9306_write_event_config()
...
Simplify event configuration flow.
Suggested-by: Jonathan Cameron <jic23@kernel.org >
Link: https://lore.kernel.org/all/20240310124237.52fa8a56@jic23-huawei/
Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com >
Link: https://lore.kernel.org/r/20240405104641.29478-1-subhajit.ghosh@tweaklogic.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-04-06 16:52:45 +01:00
Dan Carpenter
c8e2d48739
iio: light: apds9306: Fix off by one in apds9306_sampling_freq_get()
...
The > comparison needs to be >= to prevent an out of bounds access.
Fixes: 620d1e6c7a ("iio: light: Add support for APDS9306 Light Sensor")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Reviewed-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com >
Link: https://lore.kernel.org/r/69c5cb83-0209-40ff-a276-a0ae5e81c528@moroto.mountain
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-04-06 16:41:27 +01:00
Subhajit Ghosh
620d1e6c7a
iio: light: Add support for APDS9306 Light Sensor
...
Driver support for Avago (Broadcom) APDS9306 Ambient Light Sensor.
It has two channels - ALS and CLEAR. The ALS (Ambient Light Sensor)
channel approximates the response of the human-eye providing direct
read out where the output count is proportional to ambient light levels.
It is internally temperature compensated and rejects 50Hz and 60Hz flicker
caused by artificial light sources. Hardware interrupt configuration is
optional. It is a low power device with 20 bit resolution and has
configurable adaptive interrupt mode and interrupt persistence mode.
The device also features inbuilt hardware gain, multiple integration time
selection options and sampling frequency selection options.
This driver also uses the IIO GTS (Gain Time Scale) Helpers Namespace for
Scales, Gains and Integration time implementation.
Signed-off-by: Subhajit Ghosh <subhajit.ghosh@tweaklogic.com >
Link: https://lore.kernel.org/r/20240309105031.10313-6-subhajit.ghosh@tweaklogic.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-03-25 20:10:12 +00:00
Javier Carrasco
ba7352d019
io: light: st_uvis25: drop casting to void in dev_set_drvdata
...
The C standard specifies that there is no need to cast from a pointer to
void [1]. Therefore, it can be safely dropped.
[1] C Standard Committee: https://c0x.shape-of-code.com/6.3.2.3.html
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com >
Link: https://lore.kernel.org/r/20240303-void_in_dev_set_drvdata-v1-2-ae39027d740b@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-03-25 20:10:12 +00:00
Jonathan Cameron
a5d8684fe5
iio: light: al3010: Switch from linux/of.h to linux/mod_devicetable.h
...
The only of specific definition used is of_device_id table and that
is found in mod_devicetable.h not of.h
Reviewed-by: Nuno Sa <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20240218173323.1023703-4-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-02-28 19:26:35 +00:00
Jonathan Cameron
c7618c4fce
iio: light: al3320a: Drop unused linux/of.h include
...
Nothing from linux/of.h used in this driver.
Reviewed-by: Nuno Sa <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20240218173323.1023703-3-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-02-28 19:26:35 +00:00
Jonathan Cameron
d0dc99c0ae
iio: light: vl6180: Drop unused linux/of.h include
...
Nothing from linux/of.h is used in this driver.
Reviewed-by: Nuno Sa <nuno.sa@analog.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Link: https://lore.kernel.org/r/20240218173323.1023703-2-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
2024-02-28 19:26:34 +00:00