From nobody Fri Jul 24 23:30:14 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 795B1480962; Wed, 22 Jul 2026 08:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784709827; cv=none; b=Jwbn6A/auK9yyzdXOM1mpMluAqnnVHGNdpRiBoAxgXRhG3YCnSBvVuSoALa9ZjHgJEpCZg+OXL4YAftnBUj5t/sPL3bGa4u5Sph5ixOn56FsOeJEuFi2YnuL/ZC+EN6GC35S351Ds0lW/FjslbzZTQJXpLCqm9uD81Na4UU/OuE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784709827; c=relaxed/simple; bh=II7rqJ8vAH0MCpVujV5WTZLZYW7Z+swXHrvYP22m8bM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AwX4p966/YH2qVwppFn49E71fiZXf/x8pDK2fF6Y4bALvBb6c8gfqEd0kghQKjcGkLQYjeWUv9TAUcwqdou4k5lh/c0bkoRoRihtrJOqyBsz6KVflKkRKQxxDHI/VC+bDrnnV242TOM+y4v8cUqqLVANUFbz5nicmnKoqzoSXNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=xU4Y3Erg; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="xU4Y3Erg" Received: by smtp.kernel.org (Postfix) with ESMTPS id 8B6A0C2BCFD; Wed, 22 Jul 2026 08:43:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1784709826; bh=II7rqJ8vAH0MCpVujV5WTZLZYW7Z+swXHrvYP22m8bM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=xU4Y3ErgYmUXacoC1IfoasU+sYtSuymwy+toG9dqWH0fB9wHX5t+AIP6/l+nPySI3 CCCjv9Ovuoqo6Q64Sx11qGPxsey/bc2oI9eW2Jvzr+y9mUO+LfMel0105ms8mqbIeO eH8Ab+q8oP3kIvN4sKCgsCvM3eeRU1CTLZQXkcMU= Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41ECDC4453A; Wed, 22 Jul 2026 08:43:46 +0000 (UTC) From: Richard Leitner Date: Wed, 22 Jul 2026 10:42:46 +0200 Subject: [PATCH RFC 1/2] dt-bindings: regmap: add common schema for no-sequential-read Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260722-regmap-single-read-v1-1-aaaf31591669@linux.dev> References: <20260722-regmap-single-read-v1-0-aaaf31591669@linux.dev> In-Reply-To: <20260722-regmap-single-read-v1-0-aaaf31591669@linux.dev> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: Laurent Pinchart , Dave Stevenson , Alexander Stein , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, driver-core@lists.linux.dev, Richard Leitner X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1784709824; l=1961; i=richard.leitner@linux.dev; s=20250225; h=from:subject:message-id; bh=II7rqJ8vAH0MCpVujV5WTZLZYW7Z+swXHrvYP22m8bM=; b=hRG5jhYvYw0e42JCiJ9i03gLnYgCrKFWKO8iOB/MeSkF+h2EUj9fuZB/HRjVFN7ti/CQRjO8k rwuU3Nw3KHdAF+GTKBcgkPyHnBNacebkXLnrRLIflFuKLxzogFFvl+o X-Developer-Key: i=richard.leitner@linux.dev; a=ed25519; pk=8hZNyyyQFqZ5ruVJsSGBSPIrmJpfDm5HwHU4QVOP1Pk= X-Endpoint-Received: by B4 Relay for richard.leitner@linux.dev/20250225 with auth_id=350 Introduce a common regmap dt-binding schema with an optional boolean property no-sequential-read to describe hardware integrations where reading multiple consecutive registers in a single operation is not reliable and registers must be read individually. A typical case are imaging sensors used on vendor-provided camera modules whose bus integration does not support reads that advance across consecutive register addresses. In such cases, single-register reads work, but bulk reads do not. This restriction is a property of the concrete hardware integration, not of the chip itself. It therefore cannot be identified from the device driver and duplicating firmware parsing in each affected driver does not scale. Signed-off-by: Richard Leitner --- .../devicetree/bindings/regmap/common.yaml | 26 ++++++++++++++++++= ++++ 1 file changed, 26 insertions(+) diff --git a/Documentation/devicetree/bindings/regmap/common.yaml b/Documen= tation/devicetree/bindings/regmap/common.yaml new file mode 100644 index 0000000000000..1d713bc3217da --- /dev/null +++ b/Documentation/devicetree/bindings/regmap/common.yaml @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regmap/common.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Common register access constraints + +maintainers: + - TBD + +description: + Common properties describing register access constraints. + +properties: + no-sequential-read: + type: boolean + description: + Indicates that this device instance does not support sequential + register reads. + + Reads may start at a given register address, but reading multiple + consecutive registers in a single operation is not reliable. + Software must instead read registers individually. + +additionalProperties: true --=20 2.53.0 From nobody Fri Jul 24 23:30:14 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6997353A76; Wed, 22 Jul 2026 08:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784709828; cv=none; b=CJWlKo4dOImQGf6O5oXXwx2jFxAF8HnOhDDXW3ndSM2RI+qg5DVHaGkTbhF3Ctr3CgvJg0ijUXJ6H5OPrE4BQwYaBPdZ4OM4wV/LoGaBJlmrd4Lofmrol/EMDuGhvlD+TkEhDaj/0MeP0BfMpao6TiDepH80xbGnWvT7PKy6OX8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784709828; c=relaxed/simple; bh=FSQEUR5lT0QLgko7oEg3PWkGA9UVMNb6nFeAFck4zDA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=IZtritWfxu7USvYD+J+PHroyH5t1da5gG/CXpMGYLvtZMSN907a61AKqtBq72fUtk+x8+jJ0qI05u/udJHFrFPr0HKBIz6S/yjUhhy92gekRh2t4+4cgSQ7gAOxA2aHu0OWdZp6wPClJ4QpPbH9ilw/XTWfQatUgtuCwMInmusE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=X56yk58x; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="X56yk58x" Received: by smtp.kernel.org (Postfix) with ESMTPS id 0BEDEC2BCC7; Wed, 22 Jul 2026 08:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.dev; s=korg; t=1784709827; bh=FSQEUR5lT0QLgko7oEg3PWkGA9UVMNb6nFeAFck4zDA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=X56yk58xYujYdT/ywSAZ5CcXNKWfJTHNV0muNk9jT+THJDX9aS+78Ov2yxj3DyxwL U9qyagSPk1H+p/bZ+7tPXBVyZ+SA9ouOy0Hzhoxnn6DSZzduqf8rid6Nt+Vu23Cp2L DzqlfBIVUKWkLHaz+gT4KKIe5DPsY7OHdokHD/8A= Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2FB6C44539; Wed, 22 Jul 2026 08:43:46 +0000 (UTC) From: Richard Leitner Date: Wed, 22 Jul 2026 10:42:47 +0200 Subject: [PATCH RFC 2/2] regmap: implement no-sequential-read firmware property Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260722-regmap-single-read-v1-2-aaaf31591669@linux.dev> References: <20260722-regmap-single-read-v1-0-aaaf31591669@linux.dev> In-Reply-To: <20260722-regmap-single-read-v1-0-aaaf31591669@linux.dev> To: Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich Cc: Laurent Pinchart , Dave Stevenson , Alexander Stein , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, driver-core@lists.linux.dev, Richard Leitner X-Mailer: b4 0.16-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1784709824; l=2027; i=richard.leitner@linux.dev; s=20250225; h=from:subject:message-id; bh=FSQEUR5lT0QLgko7oEg3PWkGA9UVMNb6nFeAFck4zDA=; b=yhW5fWkALMD91mWste1/aLkqZojp0RQkFIQWkzILzZZXVRUTbbPSSSLnD4VoDSvfUAdSzATdi 9GEwKk+OvUdAYg8MHRD/hVLN4b+AktqlRnF8p1/PD/BIVsni8XiYVG4 X-Developer-Key: i=richard.leitner@linux.dev; a=ed25519; pk=8hZNyyyQFqZ5ruVJsSGBSPIrmJpfDm5HwHU4QVOP1Pk= X-Endpoint-Received: by B4 Relay for richard.leitner@linux.dev/20250225 with auth_id=350 Some devices are integrated in hardware modules where incrementing multi-register reads are not reliable, even though the underlying chip normally supports them. regmap already owns a configuration that selects between bulk reads and single-register reads. Letting regmap consume this firmware property makes use of this configuration and therefore keeps the override in the actual layer of implementation. If the property is absent, existing behaviour is unchanged. Signed-off-by: Richard Leitner --- drivers/base/regmap/regmap.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index e6e022b026375..ed08db764cdcb 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -674,6 +674,18 @@ enum regmap_endian regmap_get_val_endian(struct device= *dev, } EXPORT_SYMBOL_GPL(regmap_get_val_endian); =20 +static bool regmap_get_use_single_read(struct device *dev, + const struct regmap_bus *bus, + const struct regmap_config *config) +{ + struct fwnode_handle *fwnode =3D dev ? dev_fwnode(dev) : NULL; + + if (fwnode_property_read_bool(fwnode, "no-sequential-read")) + return true; + + return config->use_single_read || !(config->read || (bus && bus->read)); +} + struct regmap *__regmap_init(struct device *dev, const struct regmap_bus *bus, void *bus_context, @@ -786,7 +798,7 @@ struct regmap *__regmap_init(struct device *dev, map->reg_stride_order =3D ilog2(map->reg_stride); else map->reg_stride_order =3D -1; - map->use_single_read =3D config->use_single_read || !(config->read || (bu= s && bus->read)); + map->use_single_read =3D regmap_get_use_single_read(dev, bus, config); map->use_single_write =3D config->use_single_write || !(config->write || = (bus && bus->write)); map->can_multi_write =3D config->can_multi_write && (config->write || (bu= s && bus->write)); if (bus) { --=20 2.53.0