Skip to contentSkip to conversation

at24: convert the binding document to yaml

PATCH Applied Bartosz Golaszewski 2 participants 5 messages Oct 2, 2019 – Oct 9, 2019

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

v6 cover at24: convert the binding document to yaml

From: Bartosz Golaszewski <[email protected]>

The first patch converts the at24 DT binding to yaml. The second adds a new compatible special case that's being used undocumented currently.

v1 -> v2:
- modified the compatible property: we now list all possible combinations and non-standard types with appropriate fallbacks to be as strict as possible
- minor changes to other properties: added constraints, converted to enums where applicable and referenced the types from schema

v2 -> v3:
(Rob Herring:)
- Here's my reworking of compatible schema and all the other fixes I found. The inner 'oneOf' is probably a little excessive given the number of lines. All it does is ensure both compatible strings have the same part number.

v3 -> v4:
- Add a $nodename definition
- Turns out the compatible schema is too complex for generating a 'select' schema and only a small subset where getting validated. So we need a custom 'select' schema. This in turn fixes the issue with the nxp,se97b binding.

v4 -> v5:
- added a new patch extending the list of special cases of the compatible property
- added comments explaining the schema for the compatible property
- dropped redundant information from property descriptions (for instance:
there's no need to say "This parameterless property" where it's obvious from the type that the property is a flag)

v5 -> v6:
- common 'compatible' schema prevents non-unique compatible items, so remove that part of the comment
- add missing cs and mac variants to the list of patterns

Bartosz Golaszewski (2):
dt-bindings: at24: convert the binding document to yaml
dt-bindings: at24: add new compatible

 .../devicetree/bindings/eeprom/at24.txt       |  90 +--------
 .../devicetree/bindings/eeprom/at24.yaml      | 188 ++++++++++++++++++
 MAINTAINERS                                   |   2 +-
 3 files changed, 190 insertions(+), 90 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/eeprom/at24.yaml
Signature · 1 line
2.23.0
#1 lore raw

PATCH v6 1/2 dt-bindings: at24: convert the binding document to yaml

From: Bartosz Golaszewski <[email protected]>

Convert the binding document for at24 EEPROMs from txt to yaml. The compatible property uses a regex pattern to address all the possible combinations of "vendor,model" strings.

[robh: rework compatible schema, fix missing allOf for $ref, fix errors in example]
[Bartosz: added comments explaining the compatible property]
---
 .../devicetree/bindings/eeprom/at24.txt       |  90 +--------
 .../devicetree/bindings/eeprom/at24.yaml      | 185 ++++++++++++++++++
 MAINTAINERS                                   |   2 +-
 3 files changed, 187 insertions(+), 90 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/eeprom/at24.yaml
Documentation/devicetree/bindings/eeprom/at24.txt +1 -89
index 22aead844d0f..c94acbb8cb0c 100644
@@ -1,89 +1 @@
-EEPROMs (I2C)
-
-Required properties:
-
-  - compatible: Must be a "<manufacturer>,<model>" pair. The following <model>
-                values are supported (assuming "atmel" as manufacturer):
-
-                "atmel,24c00",
-                "atmel,24c01",
-                "atmel,24cs01",
-                "atmel,24c02",
-                "atmel,24cs02",
-                "atmel,24mac402",
-                "atmel,24mac602",
-                "atmel,spd",
-                "atmel,24c04",
-                "atmel,24cs04",
-                "atmel,24c08",
-                "atmel,24cs08",
-                "atmel,24c16",
-                "atmel,24cs16",
-                "atmel,24c32",
-                "atmel,24cs32",
-                "atmel,24c64",
-                "atmel,24cs64",
-                "atmel,24c128",
-                "atmel,24c256",
-                "atmel,24c512",
-                "atmel,24c1024",
-                "atmel,24c2048",
-
-                If <manufacturer> is not "atmel", then a fallback must be used
-                with the same <model> and "atmel" as manufacturer.
-
-                Example:
-                        compatible = "microchip,24c128", "atmel,24c128";
-
-                Supported manufacturers are:
-
-                "catalyst",
-                "microchip",
-                "nxp",
-                "ramtron",
-                "renesas",
-                "rohm",
-                "st",
-
-                Some vendors use different model names for chips which are just
-                variants of the above. Known such exceptions are listed below:
-
-                "nxp,se97b" - the fallback is "atmel,24c02",
-                "renesas,r1ex24002" - the fallback is "atmel,24c02"
-                "renesas,r1ex24016" - the fallback is "atmel,24c16"
-                "renesas,r1ex24128" - the fallback is "atmel,24c128"
-                "rohm,br24t01" - the fallback is "atmel,24c01"
-
-  - reg: The I2C address of the EEPROM.
-
-Optional properties:
-
-  - pagesize: The length of the pagesize for writing. Please consult the
-              manual of your device, that value varies a lot. A wrong value
-              may result in data loss! If not specified, a safety value of
-              '1' is used which will be very slow.
-
-  - read-only: This parameterless property disables writes to the eeprom.
-
-  - size: Total eeprom size in bytes.
-
-  - no-read-rollover: This parameterless property indicates that the
-                      multi-address eeprom does not automatically roll over
-                      reads to the next slave address. Please consult the
-                      manual of your device.
-
-  - wp-gpios: GPIO to which the write-protect pin of the chip is connected.
-
-  - address-width: number of address bits (one of 8, 16).
-
-  - num-addresses: total number of i2c slave addresses this device takes
-
-Example:
-
-eeprom@52 {
-	compatible = "atmel,24c32";
-	reg = <0x52>;
-	pagesize = <32>;
-	wp-gpios = <&gpio1 3 0>;
-	num-addresses = <8>;
-};
+This file has been moved to at24.yaml.
Documentation/devicetree/bindings/eeprom/at24.yaml new file +185 -0

185 lines not on this page · raw message

MAINTAINERS +1 -1
index 296de2b51c83..320fc8bba872 100644
@@ -2699,7 +2699,7 @@ M:	Bartosz Golaszewski <[email protected]>
 L:	[email protected]
 T:	git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
 S:	Maintained
-F:	Documentation/devicetree/bindings/eeprom/at24.txt
+F:	Documentation/devicetree/bindings/eeprom/at24.yaml
 F:	drivers/misc/eeprom/at24.c
 
 ATA OVER ETHERNET (AOE) DRIVER
Signature · 1 line
2.23.0
maintainer Applied
#2 lore raw

Re: [PATCH v6 1/2] dt-bindings: at24: convert the binding document to yaml

Quoted 11 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Convert the binding document for at24 EEPROMs from txt to yaml. The compatible property uses a regex pattern to address all the possible combinations of "vendor,model" strings.

[robh: rework compatible schema, fix missing allOf for $ref, fix errors in example]
[Bartosz: added comments explaining the compatible property]
Quoted 7 lines
---
 .../devicetree/bindings/eeprom/at24.txt       |  90 +--------
 .../devicetree/bindings/eeprom/at24.yaml      | 185 ++++++++++++++++++
 MAINTAINERS                                   |   2 +-
 3 files changed, 187 insertions(+), 90 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/eeprom/at24.yaml

Applied, thanks.

Rob

#3 lore raw

PATCH v6 2/2 dt-bindings: at24: add new compatible

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

arch/arm/boot/dts/at91-dvk_som60.dt.yaml uses the compatible string 'giantec,gt24c32a' for an at24 EEPROM with a fallback to 'atmel,24c32'.

Add this model as a special case to the binding document.

---
 Documentation/devicetree/bindings/eeprom/at24.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/eeprom/at24.yaml +3 -0
index c56f27fde3b3..e8778560d966 100644
@@ -107,6 +107,9 @@ properties:
       - items:
           - const: renesas,r1ex24016
           - const: atmel,24c16
+      - items:
+          - const: giantec,gt24c32a
+          - const: atmel,24c32
       - items:
           - const: renesas,r1ex24128
           - const: atmel,24c128
Signature · 1 line
2.23.0
maintainer Applied
#4 lore raw

Re: [PATCH v6 2/2] dt-bindings: at24: add new compatible

Quoted 5 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

arch/arm/boot/dts/at91-dvk_som60.dt.yaml uses the compatible string 'giantec,gt24c32a' for an at24 EEPROM with a fallback to 'atmel,24c32'.

Quoted 8 lines

Add this model as a special case to the binding document.

---
 Documentation/devicetree/bindings/eeprom/at24.yaml | 3 +++
 1 file changed, 3 insertions(+)

Applied, thanks.

Rob