Devicetree
 help / color / mirror / Atom feed
From: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
To: Linus Walleij <linusw@kernel.org>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	linux-gpio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
Subject: [PATCH 1/5] gpio: fxl6408: Fix reserved register access and disable burst transfers
Date: Thu, 26 Nov 2026 19:03:11 +0100	[thread overview]
Message-ID: <20261126180315.98034-2-gianfranco.mariotti94@gmail.com> (raw)
In-Reply-To: <20261126180315.98034-1-gianfranco.mariotti94@gmail.com>

All valid registers on the FXL6408 are at odd addresses (0x01..0x13),
while all even addresses (0x02..0x12) are marked Reserved in the
datasheet. In addition, the FXL6408 datasheet explicitly states that I2C
burst read and write modes are not supported.

Currently rd_range and wr_range specify { FXL6408_REG_IO_DIR,
FXL6408_REG_OUTPUT } (0x03..0x05), which exposes the reserved register
0x04 to regcache_hw_init() and debugfs, and causes REGCACHE_MAPLE to
group 0x03..0x05 into a contiguous block that regcache_sync() attempts
to restore with a multi-byte raw I2C write on resume. Meanwhile, the
read/write OUTPUT_HIGH_Z register (0x07) was omitted from rd_range.

List only the valid odd registers in rd_range and wr_range, include
FXL6408_REG_OUTPUT_HIGH_Z in rd_range, and set use_single_read and
use_single_write in regmap_config.

Fixes: 03810031c91d ("gpio: fxl6408: add I2C GPIO expander driver")
Signed-off-by: Gianfranco Mariotti <gianfranco.mariotti94@gmail.com>
---
 drivers/gpio/gpio-fxl6408.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-fxl6408.c b/drivers/gpio/gpio-fxl6408.c
index 8a7e70180efd9..9f80ea1214e03 100644
--- a/drivers/gpio/gpio-fxl6408.c
+++ b/drivers/gpio/gpio-fxl6408.c
@@ -45,13 +45,16 @@
 
 static const struct regmap_range rd_range[] = {
 	{ FXL6408_REG_DEVICE_ID, FXL6408_REG_DEVICE_ID },
-	{ FXL6408_REG_IO_DIR, FXL6408_REG_OUTPUT },
+	{ FXL6408_REG_IO_DIR, FXL6408_REG_IO_DIR },
+	{ FXL6408_REG_OUTPUT, FXL6408_REG_OUTPUT },
+	{ FXL6408_REG_OUTPUT_HIGH_Z, FXL6408_REG_OUTPUT_HIGH_Z },
 	{ FXL6408_REG_INPUT_STATUS, FXL6408_REG_INPUT_STATUS },
 };
 
 static const struct regmap_range wr_range[] = {
 	{ FXL6408_REG_DEVICE_ID, FXL6408_REG_DEVICE_ID },
-	{ FXL6408_REG_IO_DIR, FXL6408_REG_OUTPUT },
+	{ FXL6408_REG_IO_DIR, FXL6408_REG_IO_DIR },
+	{ FXL6408_REG_OUTPUT, FXL6408_REG_OUTPUT },
 	{ FXL6408_REG_OUTPUT_HIGH_Z, FXL6408_REG_OUTPUT_HIGH_Z },
 };
 
@@ -78,6 +81,8 @@ static const struct regmap_access_table volatile_table = {
 static const struct regmap_config regmap = {
 	.reg_bits = 8,
 	.val_bits = 8,
+	.use_single_read = true,
+	.use_single_write = true,
 
 	.max_register = FXL6408_REG_INT_STS,
 	.wr_table = &wr_table,
-- 
2.25.1


  reply	other threads:[~2026-11-26 18:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 18:03 [PATCH 0/5] gpio: fxl6408: Fix regmap ranges/bursts and add PI4IOE5V6408, reset, bias, and IRQ support Gianfranco Mariotti
2026-11-26 18:03 ` Gianfranco Mariotti [this message]
2026-11-26 18:03 ` [PATCH 2/5] dt-bindings: gpio: Split fcs,fxl6408 from trivial-gpio and add diodes,pi4ioe5v6408 Gianfranco Mariotti
2026-11-26 18:03 ` [PATCH 3/5] gpio: fxl6408: Support optional power supplies and reset GPIO Gianfranco Mariotti
2026-11-26 18:03 ` [PATCH 4/5] gpio: fxl6408: Add pull-up and pull-down bias configuration Gianfranco Mariotti
2026-11-26 18:03 ` [PATCH 5/5] gpio: fxl6408: Add interrupt controller support Gianfranco Mariotti

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=20261126180315.98034-2-gianfranco.mariotti94@gmail.com \
    --to=gianfranco.mariotti94@gmail.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=brgl@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=emanuele.ghidoli@toradex.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=krzk+dt@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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