Re: [PATCH v2 0/3] MSM8916-mainline: improve gp2ap002 proximity sensor v2
From: Jonathan Cameron
Date: Sat Oct 17 2026 - 14:17:10 EST
On Sat, 17 Oct 2026 19:27:40 +0200
Christoph Rudorff <chris@xxxxxxxxxxx> wrote:
> 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
>
https://sashiko.dev/#/patchset/20261017-iio-light-gp2ap002-v2-0-d6879767a446%40rudorff.com
Spotted stuff I missed.
J
> ---
> 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>
>