Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Kaustabh Chakraborty <kauschluss@disroot.org>
Cc: "David Lechner" <dlechner@baylibre.com>,
	"Nuno Sá" <nuno.sa@analog.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Peter Griffin" <peter.griffin@linaro.org>,
	"Alim Akhtar" <alim.akhtar@samsung.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH v4 0/3] Add Sharp GP2AP070S Proximity Driver and enable it in Galaxy J6 (j6lte)
Date: Sun, 16 Aug 2026 21:04:14 +0100	[thread overview]
Message-ID: <20260816210414.6ce52946@jic23-huawei> (raw)
In-Reply-To: <20260807-gp2ap070s-v4-0-74f6a67b6272@disroot.org>

On Fri, 07 Aug 2026 01:18:40 +0530
Kaustabh Chakraborty <kauschluss@disroot.org> wrote:

> Sharp GP2AP070S is a promixity sensor (NOT an ambient light sensor) in
> mobile devices. This sensor chip is found in mobile devices, including
> (but perhaps not limited to) Samsung Galaxy J6 (codename: j6lte).
> 
> To the best of my knowledge, there's no public documentation available
> for this device. [1] is a downstream kernel implementation, which has
> been the single source for developing this driver. Some bits have also
> been stolen from existing GP2AP* drivers available in iio/light.
> 
> The last patch in this series touches the device tree sources to add the
> light sensor node in j6lte. This needs to be accepted into next only
> when the former patches are in next.
> 
> [1] https://github.com/Exynos7870/android_kernel_samsung_universal7870/blob/lineage-16.0/drivers/sensors/gp2ap070s.c
> 
> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Make sure to take a look at sashiko feedback.
https://sashiko.dev/#/patchset/20260807-gp2ap070s-v4-0-74f6a67b6272%40disroot.org

regcache flat is very rarely the write option.  maple is fine for even small
sets of registers and avoids some pitfalls (I'm not sure the exact issue
sashiko is calling out is real - I haven't checked)

The timestamp skid thing isn't important (though it is correct) so
I'd ignore that one. However it's point that you might as well
do the work in a non threaded interrupt is valid given the simplicity.


Calling regmap_reinit_cache() seems illogical even if not wrong
on a teardown that is about to wipe out the regmap.

I didn't look at the dtsi comments.



> ---
> Changes in v4:
> - Clarify non-mandatory vled-supply commit message (Krzysztof Kozlowski)
> - Simplify driver probe return paths (David Lechner)
> - Rephrase fsleep() usage to use unit macros (David Lechner)
> - Use regmap_reinit_cache() instead of regcache_mark_dirty() (David Lechner)
> - Use regmap_assign_bits() instead on branch on regmap_{set,clear}_bits()
>   (David Lechner)
> - Drop redundant explicit cast to u16 (David Lechner)
> - Replace (1 << 16) with macrofied BIT(16) (David Lechner)
> - Add max_register to regmap config (David Lechner)
> - Add upper byte register for proximity distance volatile registers (Sashiko)
> - Return 0 instead of IIO_VAL_INT in iio config write calls (Sashiko)
> - Add REGCACHE_FLAT to regmap (Sashiko)
> - Link to v3: https://patch.msgid.link/20260731-gp2ap070s-v3-0-d1f5cecf9fe7@disroot.org
> 
> Changes in v3:
> - Revoke stale patches sent erroneously, v2 changelog applies
> - Link to v2: https://patch.msgid.link/20260731-gp2ap070s-v2-0-1bdfee07d5ea@disroot.org
> 
> Changes in v2:
> - Reshuffle and add missing header inclusions (Joshua Crofts)
> - Add missing regulators in driver and dt-schema
>   (Joshua Crofts, Jonathan Cameron)
> - Rename and rearrange register addresses, masks and values (Jonathan Cameron)
> - Use regmap_get_device() for carrying dev pointer (Jonathan Cameron)
> - Use FIELD_GET() instead of !! (Jonathan Cameron)
> - Drop unused i2c_set_clientdata() (Jonathan Cameron)
> - Use fsleep() instead of usleep_range() (Jonathan Cameron)
> - Check if proximity-near-level is available before reading its value
>   (Jonathan Cameron)
> - Drop redundant dev_err_probe() from devm_request_threaded_irq()
>   (Joshua Crofts)
> - Use mutex guards for guarding concurrent read/write calls (Sashiko)
> - Add reset chip action on removal (Sashiko)
> - Ensure input value in iio_write_event_value() is 16-bit (Sashiko)
> - Use regmap_bulk_*() instead of regmap_raw_*() (Jonathan Cameron)
> - Hint volatile registers for regmap (Jonathan Cameron)
> - Link to v1: https://patch.msgid.link/20260723-gp2ap070s-v1-0-b8ca3a4c10dd@disroot.org
> 
> ---
> Kaustabh Chakraborty (3):
>       dt-bindings: iio: proximity: add Sharp GP2AP070S proximity sensor
>       iio: proximity: add driver for Sharp GP2AP070S proximity sensor
>       arm64: dts: exynos7870-j6lte: add Sharp GP2AP070S proximity sensor
> 
>  .../bindings/iio/proximity/sharp,gp2ap070s.yaml    |  60 +++
>  arch/arm64/boot/dts/exynos/exynos7870-j6lte.dts    |  55 ++-
>  drivers/iio/proximity/Kconfig                      |  11 +
>  drivers/iio/proximity/Makefile                     |   1 +
>  drivers/iio/proximity/gp2ap070s.c                  | 491 +++++++++++++++++++++
>  5 files changed, 616 insertions(+), 2 deletions(-)
> ---
> base-commit: 290aaf24a551d5a0dce037e3fab30820f9113a10
> change-id: 20260723-gp2ap070s-f7e0120970a5
> 
> Best regards,
> --  
> Kaustabh Chakraborty <kauschluss@disroot.org>
> 


      parent reply	other threads:[~2026-08-16 20:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-06 19:48 [PATCH v4 0/3] Add Sharp GP2AP070S Proximity Driver and enable it in Galaxy J6 (j6lte) Kaustabh Chakraborty
2026-08-06 19:48 ` [PATCH v4 1/3] dt-bindings: iio: proximity: add Sharp GP2AP070S proximity sensor Kaustabh Chakraborty
2026-08-07  7:27   ` Krzysztof Kozlowski
2026-08-06 19:48 ` [PATCH v4 2/3] iio: proximity: add driver for " Kaustabh Chakraborty
2026-08-06 20:02   ` sashiko-bot
2026-08-10 16:58   ` Andy Shevchenko
2026-08-06 19:48 ` [PATCH v4 3/3] arm64: dts: exynos7870-j6lte: add " Kaustabh Chakraborty
2026-08-06 20:06   ` sashiko-bot
2026-08-16 20:04 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260816210414.6ce52946@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=kauschluss@disroot.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=peter.griffin@linaro.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox