From: Markus Stockhausen <markus.stockhausen@gmx.de>
To: brgl@kernel.org, wsa+renesas@sang-engineering.com,
andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, linux-i2c@vger.kernel.org,
devicetree@vger.kernel.org
Cc: Markus Stockhausen <markus.stockhausen@gmx.de>
Subject: [PATCH v2 1/2] dt-bindings: i2c: Add i2c-shared-gpio
Date: Mon, 11 May 2026 18:25:27 +0200 [thread overview]
Message-ID: <20260511162528.84508-2-markus.stockhausen@gmx.de> (raw)
In-Reply-To: <20260511162528.84508-1-markus.stockhausen@gmx.de>
Document the driver for bitbanged gpio I2C busses
with shared SCL lines.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
---
.../bindings/i2c/i2c-gpio-shared.yaml | 105 ++++++++++++++++++
1 file changed, 105 insertions(+)
create mode 100644 Documentation/devicetree/bindings/i2c/i2c-gpio-shared.yaml
diff --git a/Documentation/devicetree/bindings/i2c/i2c-gpio-shared.yaml b/Documentation/devicetree/bindings/i2c/i2c-gpio-shared.yaml
new file mode 100644
index 000000000000..4a21638bd842
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-gpio-shared.yaml
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/i2c-gpio-shared.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Multiple GPIO bitbanged I2C buses with shared SCL
+
+maintainers:
+ - Markus Stockhausen <markus.stockhausen@gmx.de>
+
+description:
+ Bitbanging I2C bus driver that supports multiple independent I2C buses
+ sharing a single SCL line. Each child node represents one I2C bus with
+ its own SDA line. The index of each entry in the parent's sda-gpios
+ property must match the reg value of the corresponding child bus node.
+
+properties:
+ compatible:
+ const: i2c-gpio-shared
+
+ scl-gpios:
+ maxItems: 1
+ description:
+ GPIO used for the shared SCL signal. Must be configured as open-drain.
+
+ sda-gpios:
+ minItems: 2
+ maxItems: 32
+ description:
+ GPIOs used for the SDA signals of the individual I2C buses. The index
+ of the GPIO in this list corresponds to the 'reg' property of the
+ child bus nodes (e.g., the first GPIO is for the child with reg = <0>).
+ Must be configured as open-drain.
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+required:
+ - compatible
+ - scl-gpios
+ - sda-gpios
+ - "#address-cells"
+ - "#size-cells"
+
+patternProperties:
+ "^i2c@[0-9a-f]+$":
+ type: object
+ $ref: /schemas/i2c/i2c-controller.yaml#
+ unevaluatedProperties: false
+
+ properties:
+ reg:
+ items:
+ - minimum: 0
+ maximum: 31
+ description:
+ Index into the sda-gpios array used by this specific bus.
+
+ clock-frequency:
+ minimum: 1
+ maximum: 400000
+ default: 100000
+ description:
+ Desired I2C bus clock frequency in Hz.
+
+ required:
+ - reg
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/gpio/gpio.h>
+
+ i2c {
+ compatible = "i2c-gpio-shared";
+ scl-gpios = <&gpio1 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>,
+ <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ i2c@0 {
+ reg = <0>;
+ clock-frequency = <100000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ eeprom@50 {
+ compatible = "atmel,24c02";
+ reg = <0x50>;
+ };
+ };
+
+ i2c@1 {
+ reg = <1>;
+ clock-frequency = <400000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
--
2.54.0
next prev parent reply other threads:[~2026-05-11 16:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 16:25 [PATCH v2 0/2] i2c: Add i2c-shared-gpio driver Markus Stockhausen
2026-05-11 16:25 ` Markus Stockhausen [this message]
2026-05-11 17:36 ` [PATCH v2 1/2] dt-bindings: i2c: Add i2c-shared-gpio Rob Herring (Arm)
2026-05-12 20:59 ` sashiko-bot
2026-05-11 16:25 ` [PATCH v2 2/2] i2c: Add driver for gpio based busses with shared SCL Markus Stockhausen
2026-05-12 21:44 ` sashiko-bot
2026-05-12 11:00 ` [PATCH v2 0/2] i2c: Add i2c-shared-gpio driver Bartosz Golaszewski
2026-05-13 5:33 ` AW: " markus.stockhausen
2026-05-13 7:12 ` Wolfram Sang
2026-05-13 7:26 ` Bartosz Golaszewski
2026-05-13 7:47 ` Wolfram Sang
2026-05-13 7:50 ` Bartosz Golaszewski
2026-05-13 12:11 ` Rob Herring
2026-05-13 12:25 ` AW: " markus.stockhausen
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=20260511162528.84508-2-markus.stockhausen@gmx.de \
--to=markus.stockhausen@gmx.de \
--cc=andi.shyti@kernel.org \
--cc=brgl@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=robh@kernel.org \
--cc=wsa+renesas@sang-engineering.com \
/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