Skip to contentSkip to conversation

dt-bindings: i2c: convert davinci i2c to dt-schema

PATCH Superseded Chaitanya Sabnis 2 participants 2 messages May 12 – May 13

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 dt-bindings: i2c: convert davinci i2c to dt-schema

Convert the Texas Instruments DaVinci and Keystone I2C controller bindings from legacy text format to modern dt-schema (YAML).

During the conversion, the interrupts property was made required to match the strict requirement in the driver probe function. The custom ti,has-pfunc and power-domains properties were also properly defined to match SoC-specific hardware features.

---
Changes in v2:
- Updated MAINTAINERS file to point to the new ti,davinci-i2c.yaml file instead of the deleted .txt file.

 .../devicetree/bindings/i2c/i2c-davinci.txt   | 43 -------------
 .../bindings/i2c/ti,davinci-i2c.yaml          | 62 +++++++++++++++++++
 MAINTAINERS                                   |  2 +-
 3 files changed, 63 insertions(+), 44 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-davinci.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/ti,davinci-i2c.yaml
Documentation/devicetree/bindings/i2c/i2c-davinci.txt deleted +0 -43
deleted file mode 100644
index 6590501c53d4..000000000000
@@ -1,43 +0,0 @@
-* Texas Instruments Davinci/Keystone I2C
-
-This file provides information, what the device node for the
-davinci/keystone i2c interface contains.
-
-Required properties:
-- compatible: "ti,davinci-i2c" or "ti,keystone-i2c";
-- reg : Offset and length of the register set for the device
-- clocks: I2C functional clock phandle.
-	  For 66AK2G this property should be set per binding,
-	  Documentation/devicetree/bindings/clock/ti,sci-clk.yaml
-
-SoC-specific Required Properties:
-
-The following are mandatory properties for Keystone 2 66AK2G SoCs only:
-
-- power-domains:	Should contain a phandle to a PM domain provider node
-			and an args specifier containing the I2C device id
-			value. This property is as per the binding,
-			Documentation/devicetree/bindings/soc/ti/sci-pm-domain.yaml
-
-Recommended properties :
-- interrupts : standard interrupt property.
-- clock-frequency : desired I2C bus clock frequency in Hz.
-- ti,has-pfunc: boolean; if defined, it indicates that SoC supports PFUNC
-	registers. PFUNC registers allow to switch I2C pins to function as
-	GPIOs, so they can be toggled manually.
-
-Example (enbw_cmc board):
-	i2c@1c22000 {
-		compatible = "ti,davinci-i2c";
-		reg = <0x22000 0x1000>;
-		clock-frequency = <100000>;
-		interrupts = <15>;
-		interrupt-parent = <&intc>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-
-		dtt@48 {
-			compatible = "national,lm75";
-			reg = <0x48>;
-		};
-	};
Documentation/devicetree/bindings/i2c/ti,davinci-i2c.yaml new file +62 -0

62 lines not on this page · raw message

MAINTAINERS +1 -1
index bc3bcc641663..50a11a8d71a2 100644
@@ -26396,7 +26396,7 @@ M:	Bartosz Golaszewski <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
 S:	Maintained
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
-F:	Documentation/devicetree/bindings/i2c/i2c-davinci.txt
+F:	Documentation/devicetree/bindings/i2c/ti,davinci-i2c.yaml
 F:	arch/arm/boot/dts/ti/davinci/
 F:	arch/arm/mach-davinci/
 F:	drivers/i2c/busses/i2c-davinci.c
Signature · 1 line
2.43.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] The dt-schema conversion drops the mandatory requirement for the `power-domains` property on…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The dt-schema conversion drops the mandatory requirement for the power-domains property on Keystone 2 66AK2G SoCs.
- [Medium] Typo in the maintainer's email address in the YAML schema.
--

commit 15717022cbf5ba5c5c00abf42db38f66896bb215
Author: Chaitanya Sabnis <[email protected]>
Subject: dt-bindings: i2c: convert davinci i2c to dt-schema

This commit converts the Texas Instruments DaVinci and Keystone I2C controller bindings from legacy text format to YAML. It makes the interrupts property required and defines the ti,has-pfunc and power-domains properties.

Quoted 4 lines
Documentation/devicetree/bindings/i2c/i2c-davinci.txt deleted +0 -0
deleted file mode 100644

[ ... ]

Quoted 5 lines
Documentation/devicetree/bindings/i2c/i2c-davinci.txt deleted +0 -5
-SoC-specific Required Properties:
-
-The following are mandatory properties for Keystone 2 66AK2G SoCs only:
-
-- power-domains:	Should contain a phandle to a PM domain provider node

[ ... ]

Quoted 5 lines
Documentation/devicetree/bindings/i2c/ti,davinci-i2c.yaml new file +0 -0
new file mode 100644

Documentation/devicetree/bindings/i2c/ti,davinci-i2c.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/i2c/ti,davinci-i2c.yaml new file +10 -0
@@ -0,0 +1,62 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/ti,davinci-i2c.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments DaVinci/Keystone I2C
+
+maintainers:
+  - Chaitanya Sabnis <[email protected]>

This isn't a bug, but there's a typo in the email address. The address is missing the trailing 's' compared to your author email.

[ ... ]

Documentation/devicetree/bindings/i2c/ti,davinci-i2c.yaml line 45

Quoted 7 lines
Documentation/devicetree/bindings/i2c/ti,davinci-i2c.yaml new file +7 -0
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+
+unevaluatedProperties: false

Does this conversion drop the mandatory requirement for the power-domains property on Keystone 2 66AK2G SoCs?

The original text binding explicitly documented that power-domains is mandatory for the ti,keystone-i2c compatible string. Should there be an allOf conditional block added here to ensure incomplete device trees missing this requirement do not silently pass schema validation?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1