Commit graph

4 commits

Author SHA1 Message Date
David Lechner
acddd60981 iio: light: opt4060: use = { } instead of memset()
Use { } instead of memset() to zero-initialize stack memory to simplify
the code.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20250611-iio-zero-init-stack-with-instead-of-memset-v1-20-ebb2d0a24302@baylibre.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-06-26 19:32:57 +01:00
chuguangqing
5cc2608766 iio: light: opt4060: convert to use maple tree register cache
The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: chuguangqing <chuguangqing@inspur.com>
Link: https://patch.msgid.link/20250611085838.4761-11-chuguangqing@inspur.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-06-26 19:32:53 +01:00
Jonathan Cameron
7e8c0ec196 iio: light: opt4060: Switch to sparse friendly iio_device_claim/release_direct()
These new functions allow sparse to find failures to release
direct mode reducing chances of bugs over the claim_direct_mode()
functions that are deprecated.  This is a case where the code
is pinning down the mode so also has a claim on buffered mode.
A follow up set may move those calls over to a sparse friendly
form as well.

Tested-by: Per-Daniel Olsson <perdaniel.olsson@axis.com>
Reviewed-by: Per-Daniel Olsson <perdaniel.olsson@axis.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250309170633.1347476-10-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2025-04-22 19:09:56 +01:00
Per-Daniel Olsson
0c6db4506a iio: light: Add support for TI OPT4060 color sensor
Add support for Texas Instruments OPT4060 RGBW Color sensor.

Signed-off-by: Per-Daniel Olsson <perdaniel.olsson@axis.com>
Link: https://patch.msgid.link/20241218104836.2784523-3-perdaniel.olsson@axis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2024-12-28 14:28:13 +00:00