This patch series adds support for Capella cm36686 and cm36672p ambient light and proximity sensors.
Capella cm36686 is a combined ambient light and proximity sensor with adjustable integration time, interrupt and hysteresis support. It has the slave address of 0x60. cm36672p is fully compatible with cm36686, except that it is a proximity-only sensor. Unfortunately, datasheets for these sensors are not publicly available. Initially, this patch series introduced a new driver, which had code based on Android downstream kernels for devices which did use these sensors and a previous submission for cm36672p to mailing lists: https://github.com/LineageOS/android_kernel_xiaomi_msm8992/blob/cm-14.1/drivers/iio/light/cm36686.c https://github.com/shakalaca/ASUS_ZenFone_ZD551KL/blob/android-6.0/kernel/drivers/input/misc/cm36283.c https://lore.kernel.org/linux-iio/[email protected]/ However, a compatible driver has been found which is already upstream and can be used instead. Hence, this patch series adds support for Capella CM36686 and CM36672P to an existing driver for VCNL4040. The following code has been tested on Asus ZenFone 2 Laser/Selfie, which uses cm36686 as its ambient light and proximity sensor. Changes since v3 (misversioned as v1): - Move Capella enum IDs up so device IDs are sorted by string literal. - Move device tree table entries up so they are sorted by string literal. - Add a trailing comma to the cm36672p_channels proximity channel entry. - Link to v3: https://lore.kernel.org/linux-iio/[email protected]/ Changes since v2: - Remove the previous unnecessary proposed driver and bindings. - Add a fallback compatible for cm36686 of vcnl4040. - Add a new compatible for cm36672p. - Add channel info for cm36672p. - Remove redundant information in the dt-bindings commit message. - Link to v2: https://lore.kernel.org/linux-iio/[email protected]/ Changes since v1: - Add copyright information. - Sort includes in alphabetical order. - Add trailing commas. - Remove blank spaces where unnecessary. - Add a fallback for capella,cm36686 compatible. - Make power supplies required. - Add '-microamp' suffix for capella,proximity-led-current. - Replace local caching and i2c_smbus calls with regmap API. - Make interrupt optional. - Add action or reset only after setup is done. - Replace mutex_[un]lock calls with guard(mutex) - Add comments on where mutex is used. - Add comments on proximity register defaults. - Remove default proximity sensor duty ratio and integration time. Those were taken from the testing device and had no real reason to be there. - Replace dev_err_probe on device's part ID with a warning. - Replace chip->supplies property with a single devm_regulator_bulk_get_enable call. - Use individual structs instead of array-style device info - Remove enums which are no longer used. - Link to v1: https://lore.kernel.org/linux-iio/[email protected]/ Signed-off-by: Erikas Bitovtas <[email protected]> --- Erikas Bitovtas (2): dt-bindings: iio: light: vcnl4000: add Capella CM36686 and CM36672P iio: light: vcnl4000: add support for Capella CM36686 and CM36672P .../bindings/iio/light/vishay,vcnl4000.yaml | 17 +++++---- drivers/iio/light/vcnl4000.c | 40 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 6 deletions(-) --- base-commit: 9152bc8cebcb14dc16b03ec81f2377ee8ce12268 change-id: 20260201-cm36686-fc7a8385f1cd Best regards, -- Erikas Bitovtas <[email protected]>

