[PATCH v2 0/3] MSM8916-mainline: improve gp2ap002 proximity sensor v2

From: Christoph Rudorff

Date: Sat Oct 17 2026 - 13:46:35 EST


Samsung J5 is equipped with GP2AP002 proximity sensor.
Unfortunally the driver wasn't working, no irq received.

According to datasheet page 8 "Recommended external circuit",
it can have tree supplies: vio, vdd and vled.

It missed to power up the LED.

I found this looking in downstream kernel, where
several #ifdefs handled the case of 2 or 3 supplies.

Now it works. Tested on samsung-j5:

$ cd /sys/bus/iio/devices/iio\:device1
$ echo 1 > events/in_proximity_thresh_either_en

$ iio_event_monitor /dev/iio\:device1

Event: time: 1791460068846871297, type: proximity, channel: 0,
evtype: thresh, direction: rising

Event: time: 1791460068876669724, type: proximity, channel: 0,
evtype: thresh, direction: falling

Signed-off-by: Christoph Rudorff <chris@xxxxxxxxxxx>
---
Changes in v2:
- reorganized patch serie
- gp2ap002: use regulator bulk framework
- Link to v1: https://patch.msgid.link/20261016-iio-light-gp2ap002-v1-0-7c93312fa8d5@xxxxxxxxxxx

To: Linus Walleij <linusw@xxxxxxxxxx>
To: Jonathan Cameron <jic23@xxxxxxxxxx>
To: David Lechner <dlechner@xxxxxxxxxxxx>
To: Nuno Sá <nuno.sa@xxxxxxxxxx>
To: Andy Shevchenko <andy@xxxxxxxxxx>
To: Rob Herring <robh@xxxxxxxxxx>
To: Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>
To: Conor Dooley <conor+dt@xxxxxxxxxx>
To: Bjorn Andersson <andersson@xxxxxxxxxx>
To: Konrad Dybcio <konradybcio@xxxxxxxxxx>
Cc: linux-iio@xxxxxxxxxxxxxxx
Cc: devicetree@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-arm-msm@xxxxxxxxxxxxxxx

---
Christoph Rudorff (3):
dt-bindings: iio: light: gp2ap002: add vled
iio: light: gp2ap002: add led power supply
arm64: dts: qcom: msm8916-samsung-j5: Add proximity sensor

.../bindings/iio/light/sharp,gp2ap002.yaml | 4 +
.../boot/dts/qcom/msm8916-samsung-j5-common.dtsi | 15 +++
arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts | 32 +++++++
drivers/iio/light/gp2ap002.c | 101 +++++++++++----------
4 files changed, 106 insertions(+), 46 deletions(-)
---
base-commit: a2de78ee6ed8bf8cd99d177c74865a6e8c3cb6ea
change-id: 20261016-iio-light-gp2ap002-6bd553aecb4b

Best regards,
--
Christoph Rudorff <chris@xxxxxxxxxxx>