dt-bindings: i2c: convert i2c-mux-reg to DT schema

Convert Documentation/devicetree/bindings/i2c/i2c-mux-reg.txt to
the YAML schema so the i2c-mux-reg binding is validated by
dt_binding_check.  Faithful port of the existing properties; no
semantic change.

Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260608-i2c-mux-reg-base-bus-num-v2-1-776e313f213a@nexthop.ai
This commit is contained in:
Abdurrahman Hussain 2026-06-08 12:17:39 -07:00 committed by Andi Shyti
parent e43f32816a
commit 5da26ab52a
No known key found for this signature in database
GPG Key ID: DA78056626D32D6E
2 changed files with 92 additions and 74 deletions

View File

@ -1,74 +0,0 @@
Register-based I2C Bus Mux
This binding describes an I2C bus multiplexer that uses a single register
to route the I2C signals.
Required properties:
- compatible: i2c-mux-reg
- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side
port is connected to.
* Standard I2C mux properties. See i2c-mux.yaml in this directory.
* I2C child bus nodes. See i2c-mux.yaml in this directory.
Optional properties:
- reg: this pair of <offset size> specifies the register to control the mux.
The <offset size> depends on its parent node. It can be any memory-mapped
address. The size must be either 1, 2, or 4 bytes. If reg is omitted, the
resource of this device will be used.
- little-endian: The existence indicates the register is in little endian.
- big-endian: The existence indicates the register is in big endian.
If both little-endian and big-endian are omitted, the endianness of the
CPU will be used.
- write-only: The existence indicates the register is write-only.
- idle-state: value to set the muxer to when idle. When no value is
given, it defaults to the last value used.
Whenever an access is made to a device on a child bus, the value set
in the relevant node's reg property will be output to the register.
If an idle state is defined, using the idle-state (optional) property,
whenever an access is not being made to a device on a child bus, the
register will be set according to the idle value.
If an idle state is not defined, the most recently used value will be
left programmed into the register.
Example of a mux on PCIe card, the host is a powerpc SoC (big endian):
i2c-mux {
/* the <offset size> depends on the address translation
* of the parent device. If omitted, device resource
* will be used instead. The size is to determine
* whether iowrite32, iowrite16, or iowrite8 will be used.
*/
reg = <0x6028 0x4>;
little-endian; /* little endian register on PCIe */
compatible = "i2c-mux-reg";
#address-cells = <1>;
#size-cells = <0>;
i2c-parent = <&i2c1>;
i2c@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
si5338: clock-generator@70 {
compatible = "silabs,si5338";
reg = <0x70>;
/* other stuff */
};
};
i2c@1 {
/* data is written using iowrite32 */
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
si5338: clock-generator@70 {
compatible = "silabs,si5338";
reg = <0x70>;
/* other stuff */
};
};
};

View File

@ -0,0 +1,92 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/i2c/i2c-mux-reg.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Register-based I2C Bus Mux
maintainers:
- Peter Rosin <peda@axentia.se>
description: |
This binding describes an I2C bus multiplexer that uses a single
memory-mapped register to route the I2C signals.
Whenever an access is made to a device on a child bus, the value
set in the relevant node's reg property is output to the register.
If an idle state is defined via the idle-state property, the
register is set to that value whenever no access is being made.
Otherwise the most recently used value is left programmed.
allOf:
- $ref: /schemas/i2c/i2c-mux.yaml#
properties:
compatible:
const: i2c-mux-reg
reg:
maxItems: 1
description: |
Offset and size of the register that selects the active child
bus, relative to the parent node's address space. The size
determines the access width and must be 1, 2, or 4 bytes. If
omitted, the platform device's own memory resource is used
instead.
i2c-parent:
$ref: /schemas/types.yaml#/definitions/phandle
description:
Phandle of the I2C bus that this multiplexer's master-side port
is connected to.
little-endian:
type: boolean
description: Register is accessed in little-endian byte order.
big-endian:
type: boolean
description: Register is accessed in big-endian byte order.
write-only:
type: boolean
description:
Register is write-only; the driver must not read back the
current selection.
idle-state:
$ref: /schemas/types.yaml#/definitions/uint32
description:
Value to write to the register when no child bus is selected.
required:
- compatible
- i2c-parent
unevaluatedProperties: false
examples:
- |
i2c-mux@6028 {
compatible = "i2c-mux-reg";
reg = <0x6028 0x4>;
little-endian;
#address-cells = <1>;
#size-cells = <0>;
i2c-parent = <&i2c1>;
i2c@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
};
i2c@1 {
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
};
};
...