Devicetree
 help / color / mirror / Atom feed
* [PATCH v4 0/2] iio: proximity: add Imagis ISG5320A (Samsung Galaxy XCover5)
@ 2026-12-05  3:35 Adil Hüsrev Tepe
  2026-12-05  3:35 ` [PATCH v4 1/2] dt-bindings: iio: proximity: add Imagis ISG5320A Adil Hüsrev Tepe
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Adil Hüsrev Tepe @ 2026-12-05  3:35 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-iio, devicetree, linux-kernel, phone-devel, Joshua Crofts,
	Adil Hüsrev Tepe

This series adds an IIO driver and its DT binding for the Imagis
ISG5320A capacitive SAR/grip proximity sensor (I2C), as fitted on the
Samsung Galaxy XCover5 (SM-G525F, Exynos850).

Andy asked on v1 why this is a brand new driver: mainline has no driver
for this chip or its register map. The two Imagis drivers in the tree,
drivers/input/touchscreen/imagis.c (IST30xx touchscreen controllers)
and drivers/input/misc/isa1200.c (a haptic driver), are for unrelated
devices, and the SAR drivers in drivers/iio/proximity are for chips
from other vendors (Semtech, Awinic, TYHX).

v4 reworks the driver along the v3 reviews from Jonathan Cameron and
Joshua Crofts and the v2 review from Andy Shevchenko, which v3 had not
addressed, and fixes the two Sashiko AI findings on v3:

- Reads much less like a vendor driver: the per-line vendor references,
  the init-table read-back check, the CHIPID read and the dev_info()
  noise are gone, constant write sequences use regmap_multi_reg_write(),
  and the 16-bit registers use get_unaligned_be16().
- The init table was checked against the values read back after a soft
  reset (one unit): 29 of the 150 entries repeat them. Two are dropped.
  The other 27 are next to a register that the table changes and stay,
  because the register layout is not documented.
- The binding now requires vdd-supply, so Krzysztof's Reviewed-by on
  v3 1/2 is dropped. The driver uses devm_regulator_get_enable()
  instead of the _optional variant and always applies the power-on
  delay.
- Power management is simpler: no disable_irq(), no wakeup support for
  now (DEFINE_RUNTIME_DEV_PM_OPS), devm_pm_runtime_set_active_enabled(),
  no shutdown(), and the chip is put back to sleep if probe fails after
  starting it.

Per-patch details are below each patch's "---" line.

v3: https://lore.kernel.org/r/20261117173333.1853986-1-tadilhusrev@gmail.com

Tested on one Samsung Galaxy XCover5 (SM-G525F, Exynos850) as a module
on a v7.4-rc3 based tree (7.4.0-rc3-00023-gdcb8b91fb779+), this exact
code: probe/bind, runtime suspend/resume, raw reads, and threshold
events on a hand grip. With the thresholds at 300 (rising) / 150
(falling), gripping the lower-left of the back swung in_proximity0_raw
from a ~4 baseline to ~13000 and back, and iio_event_monitor reported
the matching proximity threshold rising-on-grip and falling-on-release
events, the chip's GPIO interrupt count tracking them one for one. The
chip can occasionally need a calibration retry at resume, which the
driver now handles; it stayed calibrated through the grip run. System
suspend was not tested.

Build-tested on arm64 with W=1 (no warnings); dt_binding_check passes
for the binding. checkpatch.pl --strict reports one warning on each
patch, the reminder to check MAINTAINERS for the new file.

Based on v7.4-rc1.

Tool usage
----------
This series was developed during XCover5 mainline bring-up with the
help of an AI coding assistant (Claude Code, Anthropic), which drafted
the IIO driver from the Samsung vendor driver's register map, reworked
it for v4 along the reviews, and drafted these changelogs. I reviewed
every line and take full responsibility for the contribution. Review
comments are welcome and I will answer them myself.

---
Adil Hüsrev Tepe (2):
      dt-bindings: iio: proximity: add Imagis ISG5320A
      iio: proximity: add Imagis ISG5320A SAR sensor driver

 .../bindings/iio/proximity/imagis,isg5320a.yaml    |  54 ++
 drivers/iio/proximity/Kconfig                      |  11 +
 drivers/iio/proximity/Makefile                     |   1 +
 drivers/iio/proximity/isg5320a.c                   | 745 +++++++++++++++++++++
 4 files changed, 811 insertions(+)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261122-isg5320a-6ee19adaa600

Best regards,
--  
Adil Hüsrev Tepe <tadilhusrev@gmail.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-05 11:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-05  3:35 [PATCH v4 0/2] iio: proximity: add Imagis ISG5320A (Samsung Galaxy XCover5) Adil Hüsrev Tepe
2026-12-05  3:35 ` [PATCH v4 1/2] dt-bindings: iio: proximity: add Imagis ISG5320A Adil Hüsrev Tepe
2026-12-05  3:35 ` [PATCH v4 2/2] iio: proximity: add Imagis ISG5320A SAR sensor driver Adil Hüsrev Tepe
2026-12-05  3:58   ` sashiko-bot
2026-12-05 11:08 ` [PATCH v4 0/2] iio: proximity: add Imagis ISG5320A (Samsung Galaxy XCover5) Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox