Skip to contentSkip to conversation

dt-bindings: i2c: Convert mxs i2c to json-schema

PATCH Applied Anson Huang 2 participants 4 messages Jun 16, 2020 – Jul 9, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 dt-bindings: i2c: Convert mxs i2c to json-schema

Convert the MXS I2C binding to DT schema format using json-schema

---
Changes since V2:
- remove 'clock-frequency' property's typs and use enum for it, as it ONLY support 100KHz/400KHz.

---
 Documentation/devicetree/bindings/i2c/i2c-mxs.txt  | 25 -----------
 Documentation/devicetree/bindings/i2c/i2c-mxs.yaml | 51 ++++++++++++++++++++++
 2 files changed, 51 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mxs.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mxs.yaml
Documentation/devicetree/bindings/i2c/i2c-mxs.txt deleted +0 -25
deleted file mode 100644
index 4e1c8ac..0000000
@@ -1,25 +0,0 @@
-* Freescale MXS Inter IC (I2C) Controller
-
-Required properties:
-- compatible: Should be "fsl,<chip>-i2c"
-- reg: Should contain registers location and length
-- interrupts: Should contain ERROR interrupt number
-- clock-frequency: Desired I2C bus clock frequency in Hz.
-                   Only 100000Hz and 400000Hz modes are supported.
-- dmas: DMA specifier, consisting of a phandle to DMA controller node
-  and I2C DMA channel ID.
-  Refer to dma.txt and fsl-mxs-dma.txt for details.
-- dma-names: Must be "rx-tx".
-
-Examples:
-
-i2c0: i2c@80058000 {
-	#address-cells = <1>;
-	#size-cells = <0>;
-	compatible = "fsl,imx28-i2c";
-	reg = <0x80058000 2000>;
-	interrupts = <111>;
-	clock-frequency = <100000>;
-	dmas = <&dma_apbx 6>;
-	dma-names = "rx-tx";
-};
Documentation/devicetree/bindings/i2c/i2c-mxs.yaml new file +51 -0

51 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH v3 2/2 dt-bindings: i2c: Convert imx i2c to json-schema

Convert the i.MX I2C binding to DT schema format using json-schema, some improvements applied, such as update example based on latest DT file, add more compatible for existing SoCs, and remove unnecessary common property "pinctrl".

---
Changes since V2:
- remove 'clock-frequency' property's type and use enum for it, ONLY support 100KHz/400KHz.
- remove *-gpios's typs/description, since it is already defined in i2c-gpio.yaml.
- fix space issue in example.

---
 Documentation/devicetree/bindings/i2c/i2c-imx.txt  |  49 ----------
 Documentation/devicetree/bindings/i2c/i2c-imx.yaml | 103 +++++++++++++++++++++
 2 files changed, 103 insertions(+), 49 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-imx.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-imx.yaml
Documentation/devicetree/bindings/i2c/i2c-imx.txt deleted +0 -49
deleted file mode 100644
index b967544..0000000
@@ -1,49 +0,0 @@
-* Freescale Inter IC (I2C) and High Speed Inter IC (HS-I2C) for i.MX
-
-Required properties:
-- compatible :
-  - "fsl,imx1-i2c" for I2C compatible with the one integrated on i.MX1 SoC
-  - "fsl,imx21-i2c" for I2C compatible with the one integrated on i.MX21 SoC
-  - "fsl,vf610-i2c" for I2C compatible with the one integrated on Vybrid vf610 SoC
-- reg : Should contain I2C/HS-I2C registers location and length
-- interrupts : Should contain I2C/HS-I2C interrupt
-- clocks : Should contain the I2C/HS-I2C clock specifier
-
-Optional properties:
-- clock-frequency : Constains desired I2C/HS-I2C bus clock frequency in Hz.
-  The absence of the property indicates the default frequency 100 kHz.
-- dmas: A list of two dma specifiers, one for each entry in dma-names.
-- dma-names: should contain "tx" and "rx".
-- scl-gpios: specify the gpio related to SCL pin
-- sda-gpios: specify the gpio related to SDA pin
-- pinctrl: add extra pinctrl to configure i2c pins to gpio function for i2c
-  bus recovery, call it "gpio" state
-
-Examples:
-
-i2c@83fc4000 { /* I2C2 on i.MX51 */
-	compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
-	reg = <0x83fc4000 0x4000>;
-	interrupts = <63>;
-};
-
-i2c@70038000 { /* HS-I2C on i.MX51 */
-	compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
-	reg = <0x70038000 0x4000>;
-	interrupts = <64>;
-	clock-frequency = <400000>;
-};
-
-i2c0: i2c@40066000 { /* i2c0 on vf610 */
-	compatible = "fsl,vf610-i2c";
-	reg = <0x40066000 0x1000>;
-	interrupts =<0 71 0x04>;
-	dmas = <&edma0 0 50>,
-		<&edma0 0 51>;
-	dma-names = "rx","tx";
-	pinctrl-names = "default", "gpio";
-	pinctrl-0 = <&pinctrl_i2c1>;
-	pinctrl-1 = <&pinctrl_i2c1_gpio>;
-	scl-gpios = <&gpio5 26 GPIO_ACTIVE_HIGH>;
-	sda-gpios = <&gpio5 27 GPIO_ACTIVE_HIGH>;
-};
Documentation/devicetree/bindings/i2c/i2c-imx.yaml new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
2.7.4
maintainer Applied
#2 lore raw

Re: [PATCH V3 2/2] dt-bindings: i2c: Convert imx i2c to json-schema

Quoted 11 lines · Anson Huang

Convert the i.MX I2C binding to DT schema format using json-schema, some improvements applied, such as update example based on latest DT file, add more compatible for existing SoCs, and remove unnecessary common property "pinctrl".

---
Changes since V2:
- remove 'clock-frequency' property's type and use enum for it, ONLY support 100KHz/400KHz.
- remove *-gpios's typs/description, since it is already defined in i2c-gpio.yaml.
- fix space issue in example.

Quoted 7 lines
---
 Documentation/devicetree/bindings/i2c/i2c-imx.txt  |  49 ----------
 Documentation/devicetree/bindings/i2c/i2c-imx.yaml | 103 +++++++++++++++++++++
 2 files changed, 103 insertions(+), 49 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-imx.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-imx.yaml

Applied, thanks!

maintainer Applied
#3 lore raw
In reply to Anson Huang
Quoted 6 lines · Anson Huang

Convert the MXS I2C binding to DT schema format using json-schema

---
Changes since V2:
- remove 'clock-frequency' property's typs and use enum for it, as it ONLY support 100KHz/400KHz.

Quoted 7 lines
---
 Documentation/devicetree/bindings/i2c/i2c-mxs.txt  | 25 -----------
 Documentation/devicetree/bindings/i2c/i2c-mxs.yaml | 51 ++++++++++++++++++++++
 2 files changed, 51 insertions(+), 25 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mxs.txt
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mxs.yaml

Applied, thanks!