[PATCH v8 0/3] gpio: Add AD7768 GPIO support

Janani Sunil posted 3 patches 2 weeks ago
drivers/gpio/Kconfig        |  12 +++++
drivers/gpio/Makefile       |   1 +
drivers/gpio/gpio-ad7768.c  | 121 ++++++++++++++++++++++++++++++++++++++++++++
drivers/gpio/gpio-regmap.c  |  98 +++++++++++++++++++++++++++++------
include/linux/gpio/regmap.h |   2 +
5 files changed, 219 insertions(+), 15 deletions(-)
[PATCH v8 0/3] gpio: Add AD7768 GPIO support
Posted by Janani Sunil 2 weeks ago
Add GPIO support for the Analog Devices AD7768 and AD7768-4
simultaneous sampling ADCs.

Datasheet:
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7768-ad7768-4.pdf

**Device Overview:**
The AD7768 and AD7768-4 provide five on-chip GPIO pins controlled
through registers shared with the parent IIO device. The GPIO driver is
registered as an auxiliary driver and shares the parent's regmap and
runtime power-management state.

**Features Implemented:**
- Use regmap_test_bits() for single-bit gpio-regmap value and direction
  reads.
- Add optional runtime PM support to gpio-regmap.
- Expose the five AD7768 GPIO pins through gpio-regmap.
- Read output GPIO values from the output-latch register while retaining
  input-state reads for input pins.
- Reserve GPIO4 when it is used to select the crystal or LVDS master
  clock source.

**Patch Summary:**
1. Use regmap_test_bits() for single-bit gpio-regmap reads.
2. Add optional runtime PM support to gpio-regmap.
3. Add the AD7768 GPIO auxiliary driver.

**Testing:**
The complete AD7768 driver was compiled and tested on the
EVAL-AD7768FMCZ using a Zedboard with a mainline kernel.

**Base:**
This series is based on the GPIO subsystem's gpio/for-next branch,
commit a2cfc48fee416f0ea78e7dc38acbf2ce072574cc

Signed-off-by: Janani Sunil <janani.sunil@analog.com>
---
Changes in v8:
- Associate the GPIO chip with the AD7768 firmware node and use it for
  clock-source property lookup.
- Link to v7: https://lore.kernel.org/r/20260908-ad7768-gpio-v7-0-52ee6ef18a1e@analog.com

Changes in v7:
- Replace bitmap_clear() with __clear_bit() and use bitops.h.
- Initialize the parent device pointer at declaration.
- Link to v6: https://lore.kernel.org/r/20260903-ad7768-gpio-v6-0-4254ef6c9b38@analog.com

Changes in v6:
- Split the GPIO patches from the main AD7768 IIO series.
- Rebase onto gpio/for-next commit
  a2cfc48fee416f0ea78e7dc38acbf2ce072574cc.
- Adapt the gpio-regmap callbacks to the operation argument present in
  gpio/for-next.
- Align the gpio-regmap runtime-PM member layout with review feedback.
- Move GPIO valid-mask handling into the GPIO driver and reserve GPIO4
  there when it is used for crystal or LVDS clock selection.
- Link to v5: https://lore.kernel.org/r/20260828-ad7768-driver-v5-0-e33ca6f841a2@analog.com

---
Janani Sunil (3):
      gpio: regmap: Use regmap_test_bits() for single bit reads
      gpio: regmap: Add optional runtime PM support
      gpio: ad7768: Add AD7768 GPIO auxiliary driver

 drivers/gpio/Kconfig        |  12 +++++
 drivers/gpio/Makefile       |   1 +
 drivers/gpio/gpio-ad7768.c  | 121 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/gpio/gpio-regmap.c  |  98 +++++++++++++++++++++++++++++------
 include/linux/gpio/regmap.h |   2 +
 5 files changed, 219 insertions(+), 15 deletions(-)
---
base-commit: a2cfc48fee416f0ea78e7dc38acbf2ce072574cc
change-id: 20260903-ad7768-gpio-4a19153b1470

Best regards,
-- 
Janani Sunil <janani.sunil@analog.com>
Re: [PATCH v8 0/3] gpio: Add AD7768 GPIO support
Posted by Bartosz Golaszewski 1 week, 2 days ago
On Thu, 10 Sep 2026 19:29:09 +0200, Janani Sunil wrote:
> Add GPIO support for the Analog Devices AD7768 and AD7768-4
> simultaneous sampling ADCs.
> 
> Datasheet:
> https://www.analog.com/media/en/technical-documentation/data-sheets/ad7768-ad7768-4.pdf
> 
> **Device Overview:**
> The AD7768 and AD7768-4 provide five on-chip GPIO pins controlled
> through registers shared with the parent IIO device. The GPIO driver is
> registered as an auxiliary driver and shares the parent's regmap and
> runtime power-management state.
> 
> [...]

Applied, thanks!

[1/3] gpio: regmap: Use regmap_test_bits() for single bit reads
      https://git.kernel.org/brgl/c/a4319947b59145b95353aabed4db879e9448ea50
[2/3] gpio: regmap: Add optional runtime PM support
      https://git.kernel.org/brgl/c/73748b4ec54da0323bb2ec62b483ea3f60ff657f
[3/3] gpio: ad7768: Add AD7768 GPIO auxiliary driver
      https://git.kernel.org/brgl/c/ea4f5a734cd7625ab161ead75403aded18c0c5ab

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>