[PATCH v3 0/3] MSM8916: improve gp2ap002 proximity sensor v3
From: Christoph Rudorff
Date: Tue Oct 20 2026 - 07:46:07 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 got tree pins to supply: vio, vdd and vled->leda.
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>
Assisted-by: gpio-hammer
---
Changes in v3:
- rename vled leda
- j5 dt: moved declarations from j5-common
- Link to v2: https://patch.msgid.link/20261017-iio-light-gp2ap002-v2-0-d6879767a446@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 leda power supply
iio: light: gp2ap002: add led power supply
arm64: dts: qcom: msm8916-samsung-j5: Add proximity sensor
.../bindings/iio/light/sharp,gp2ap002.yaml | 3 +
arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts | 52 ++++++++++++++
drivers/iio/light/gp2ap002.c | 84 ++++++++++------------
3 files changed, 93 insertions(+), 46 deletions(-)
---
base-commit: a2de78ee6ed8bf8cd99d177c74865a6e8c3cb6ea
change-id: 20261016-iio-light-gp2ap002-6bd553aecb4b
Best regards,
--
Christoph Rudorff <chris@xxxxxxxxxxx>