dt-bindings: i2c: i2c-fsi: Convert to json-schema
Eddie James
maintainerPATCH v5 1/1 dt-bindings: i2c: i2c-fsi: Convert to json-schema
Convert to json-schema for the FSI-attached I2C controller.
---
This patch was previously included in
https://lore.kernel.org/all/[email protected]/
Changes since v4:
- Add patternProperties for the busses that will reference the i2c-controller schema, since the root node provides multiple i2c busses.
Changes since v3:
- Update MAINTAINERS
- Change commit message to match similar commits
.../devicetree/bindings/i2c/i2c-fsi.txt | 40 ---------- .../devicetree/bindings/i2c/ibm,i2c-fsi.yaml | 76 +++++++++++++++++++ MAINTAINERS | 2 +- 3 files changed, 77 insertions(+), 41 deletions(-) delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-fsi.txt create mode 100644 Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml
Documentation/devicetree/bindings/i2c/i2c-fsi.txt deleted +0 -40
@@ -1,40 +0,0 @@ -Device-tree bindings for FSI-attached I2C master and busses ------------------------------------------------------------ - -Required properties: - - compatible = "ibm,i2c-fsi"; - - reg = < address size >; : The FSI CFAM address and address - space size. - - #address-cells = <1>; : Number of address cells in child - nodes. - - #size-cells = <0>; : Number of size cells in child nodes. - - child nodes : Nodes to describe busses off the I2C - master. - -Child node required properties: - - reg = < port number > : The port number on the I2C master. - -Child node optional properties: - - child nodes : Nodes to describe devices on the I2C - bus. - -Examples: - - i2c@1800 { - compatible = "ibm,i2c-fsi"; - reg = < 0x1800 0x400 >; - #address-cells = <1>; - #size-cells = <0>; - - i2c-bus@0 { - reg = <0>; - }; - - i2c-bus@1 { - reg = <1>; - - eeprom@50 { - compatible = "vendor,dev-name"; - }; - }; - };
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml new file +76 -0
76 lines not on this page · raw message
MAINTAINERS +1 -1
@@ -8976,7 +8976,7 @@ M: Eddie James <[email protected]> L: [email protected] L: [email protected] (moderated for non-subscribers) S: Maintained -F: Documentation/devicetree/bindings/i2c/i2c-fsi.txt +F: Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml F: drivers/i2c/busses/i2c-fsi.c FSI-ATTACHED SPI DRIVER
Signature · 1 line
2.39.3
Quoted 7 lines · Eddie James
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml new file +7
-0+properties: + compatible: + enum: + - ibm,i2c-fsi + + reg: + items:
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml line 32
Quoted 10 lines
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml new file +10
-0+ - description: FSI slave address + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +patternProperties: + "^i2c(@.*)?":
Either you have or you have not unit addresses. Please fix the pattern. Why is this so flexible? Do you want to deprecate i2c-bus in favor of i2c? If so, then example should use new naming. I am fine with children as i2c-bus, assuming this is allowed by dtschema. Did you actually test it?
Best regards,
Krzysztof
Eddie James
maintainerQuoted 15 lines · Krzysztof Kozlowski
Quoted 13 lines · Eddie James
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml new file +13
-0+properties: + compatible: + enum: + - ibm,i2c-fsi + + reg: + items: + - description: FSI slave address + + "#address-cells": + const: 1 + + "#size-cells":
Quoted 8 lines
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml line 32
Quoted 4 lines
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml new file +4
-0+ const: 0 + +patternProperties: + "^i2c(@.*)?":Either you have or you have not unit addresses. Please fix the pattern. Why is this so flexible? Do you want to deprecate i2c-bus in favor of i2c? If so, then example should use new naming. I am fine with children as i2c-bus, assuming this is allowed by dtschema. Did you actually test it?
This is the exact pattern of the i2c-controller schema node name, which I thought would be good. I can make it more specific. But yes I tested it, i2c-bus works fine
Thanks, Eddie
Quoted 4 lines
Best regards,
Krzysztof
Quoted 27 lines · Eddie James
Quoted 15 lines · Krzysztof Kozlowski
Quoted 13 lines · Eddie James
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml new file +13
-0+properties: + compatible: + enum: + - ibm,i2c-fsi + + reg: + items: + - description: FSI slave address + + "#address-cells": + const: 1 + + "#size-cells":Quoted 8 lines
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml line 32
Quoted 4 lines
Documentation/devicetree/bindings/i2c/ibm,i2c-fsi.yaml new file +4
-0+ const: 0 + +patternProperties: + "^i2c(@.*)?":Either you have or you have not unit addresses. Please fix the pattern. Why is this so flexible? Do you want to deprecate i2c-bus in favor of i2c? If so, then example should use new naming. I am fine with children as i2c-bus, assuming this is allowed by dtschema. Did you actually test it?
Quoted 3 lines
This is the exact pattern of the i2c-controller schema node name, which I thought would be good. I can make it more specific. But yes I tested it, i2c-bus works fine
i2c-controller schema is a generic schema, applicable to various cases, including non-MMIO. You have here specific instances.
Best regards,
Krzysztof