Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: at24: convert the binding document to yaml

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.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
[robh: rework compatible schema, fix missing allOf for $ref, fix errors in example]
Signed-off-by: Rob Herring <robh@kernel.org>
[Bartosz: added comments explaining the compatible property]
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Bartosz Golaszewski and committed by
Rob Herring
7f3bf420 951d4885

+187 -90
+1 -89
Documentation/devicetree/bindings/eeprom/at24.txt
··· 1 - EEPROMs (I2C) 2 - 3 - Required properties: 4 - 5 - - compatible: Must be a "<manufacturer>,<model>" pair. The following <model> 6 - values are supported (assuming "atmel" as manufacturer): 7 - 8 - "atmel,24c00", 9 - "atmel,24c01", 10 - "atmel,24cs01", 11 - "atmel,24c02", 12 - "atmel,24cs02", 13 - "atmel,24mac402", 14 - "atmel,24mac602", 15 - "atmel,spd", 16 - "atmel,24c04", 17 - "atmel,24cs04", 18 - "atmel,24c08", 19 - "atmel,24cs08", 20 - "atmel,24c16", 21 - "atmel,24cs16", 22 - "atmel,24c32", 23 - "atmel,24cs32", 24 - "atmel,24c64", 25 - "atmel,24cs64", 26 - "atmel,24c128", 27 - "atmel,24c256", 28 - "atmel,24c512", 29 - "atmel,24c1024", 30 - "atmel,24c2048", 31 - 32 - If <manufacturer> is not "atmel", then a fallback must be used 33 - with the same <model> and "atmel" as manufacturer. 34 - 35 - Example: 36 - compatible = "microchip,24c128", "atmel,24c128"; 37 - 38 - Supported manufacturers are: 39 - 40 - "catalyst", 41 - "microchip", 42 - "nxp", 43 - "ramtron", 44 - "renesas", 45 - "rohm", 46 - "st", 47 - 48 - Some vendors use different model names for chips which are just 49 - variants of the above. Known such exceptions are listed below: 50 - 51 - "nxp,se97b" - the fallback is "atmel,24c02", 52 - "renesas,r1ex24002" - the fallback is "atmel,24c02" 53 - "renesas,r1ex24016" - the fallback is "atmel,24c16" 54 - "renesas,r1ex24128" - the fallback is "atmel,24c128" 55 - "rohm,br24t01" - the fallback is "atmel,24c01" 56 - 57 - - reg: The I2C address of the EEPROM. 58 - 59 - Optional properties: 60 - 61 - - pagesize: The length of the pagesize for writing. Please consult the 62 - manual of your device, that value varies a lot. A wrong value 63 - may result in data loss! If not specified, a safety value of 64 - '1' is used which will be very slow. 65 - 66 - - read-only: This parameterless property disables writes to the eeprom. 67 - 68 - - size: Total eeprom size in bytes. 69 - 70 - - no-read-rollover: This parameterless property indicates that the 71 - multi-address eeprom does not automatically roll over 72 - reads to the next slave address. Please consult the 73 - manual of your device. 74 - 75 - - wp-gpios: GPIO to which the write-protect pin of the chip is connected. 76 - 77 - - address-width: number of address bits (one of 8, 16). 78 - 79 - - num-addresses: total number of i2c slave addresses this device takes 80 - 81 - Example: 82 - 83 - eeprom@52 { 84 - compatible = "atmel,24c32"; 85 - reg = <0x52>; 86 - pagesize = <32>; 87 - wp-gpios = <&gpio1 3 0>; 88 - num-addresses = <8>; 89 - }; 1 + This file has been moved to at24.yaml.
+185
Documentation/devicetree/bindings/eeprom/at24.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + # Copyright 2019 BayLibre SAS 3 + %YAML 1.2 4 + --- 5 + $id: "http://devicetree.org/schemas/eeprom/at24.yaml#" 6 + $schema: "http://devicetree.org/meta-schemas/core.yaml#" 7 + 8 + title: I2C EEPROMs compatible with Atmel's AT24 9 + 10 + maintainers: 11 + - Bartosz Golaszewski <bgolaszewski@baylibre.com> 12 + 13 + select: 14 + properties: 15 + compatible: 16 + contains: 17 + pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$" 18 + required: 19 + - compatible 20 + 21 + properties: 22 + $nodename: 23 + pattern: "^eeprom@[0-9a-f]{1,2}$" 24 + 25 + # There are multiple known vendors who manufacture EEPROM chips compatible 26 + # with Atmel's AT24. The compatible string requires either a single item 27 + # if the memory comes from Atmel (in which case the vendor part must be 28 + # 'atmel') or two items with the same 'model' part where the vendor part of 29 + # the first one is the actual manufacturer and the second item is the 30 + # corresponding 'atmel,<model>' from Atmel. 31 + compatible: 32 + oneOf: 33 + - allOf: 34 + - minItems: 1 35 + maxItems: 2 36 + items: 37 + - pattern: "^(atmel|catalyst|microchip|nxp|ramtron|renesas|rohm|st),(24(c|cs|mac)[0-9]+|spd)$" 38 + - pattern: "^atmel,(24(c|cs|mac)[0-9]+|spd)$" 39 + - oneOf: 40 + - items: 41 + pattern: c00$ 42 + - items: 43 + pattern: c01$ 44 + - items: 45 + pattern: cs01$ 46 + - items: 47 + pattern: c02$ 48 + - items: 49 + pattern: cs02$ 50 + - items: 51 + pattern: mac402$ 52 + - items: 53 + pattern: mac602$ 54 + - items: 55 + pattern: c04$ 56 + - items: 57 + pattern: cs04$ 58 + - items: 59 + pattern: c08$ 60 + - items: 61 + pattern: cs08$ 62 + - items: 63 + pattern: c16$ 64 + - items: 65 + pattern: cs16$ 66 + - items: 67 + pattern: c32$ 68 + - items: 69 + pattern: cs32$ 70 + - items: 71 + pattern: c64$ 72 + - items: 73 + pattern: cs64$ 74 + - items: 75 + pattern: c128$ 76 + - items: 77 + pattern: cs128$ 78 + - items: 79 + pattern: c256$ 80 + - items: 81 + pattern: cs256$ 82 + - items: 83 + pattern: c512$ 84 + - items: 85 + pattern: cs512$ 86 + - items: 87 + pattern: c1024$ 88 + - items: 89 + pattern: cs1024$ 90 + - items: 91 + pattern: c2048$ 92 + - items: 93 + pattern: cs2048$ 94 + - items: 95 + pattern: spd$ 96 + # These are special cases that don't conform to the above pattern. 97 + # Each requires a standard at24 model as fallback. 98 + - items: 99 + - const: rohm,br24t01 100 + - const: atmel,24c01 101 + - items: 102 + - const: nxp,se97b 103 + - const: atmel,24c02 104 + - items: 105 + - const: renesas,r1ex24002 106 + - const: atmel,24c02 107 + - items: 108 + - const: renesas,r1ex24016 109 + - const: atmel,24c16 110 + - items: 111 + - const: renesas,r1ex24128 112 + - const: atmel,24c128 113 + 114 + reg: 115 + maxItems: 1 116 + 117 + pagesize: 118 + allOf: 119 + - $ref: /schemas/types.yaml#/definitions/uint32 120 + description: 121 + The length of the pagesize for writing. Please consult the 122 + manual of your device, that value varies a lot. A wrong value 123 + may result in data loss! If not specified, a safety value of 124 + '1' is used which will be very slow. 125 + enum: [ 1, 8, 16, 32, 64, 128, 258 ] 126 + default: 1 127 + 128 + read-only: 129 + $ref: /schemas/types.yaml#definitions/flag 130 + description: 131 + Disables writes to the eeprom. 132 + 133 + size: 134 + $ref: /schemas/types.yaml#/definitions/uint32 135 + description: 136 + Total eeprom size in bytes. 137 + 138 + no-read-rollover: 139 + $ref: /schemas/types.yaml#definitions/flag 140 + description: 141 + Indicates that the multi-address eeprom does not automatically roll 142 + over reads to the next slave address. Please consult the manual of 143 + your device. 144 + 145 + wp-gpios: 146 + description: 147 + GPIO to which the write-protect pin of the chip is connected. 148 + maxItems: 1 149 + 150 + address-width: 151 + allOf: 152 + - $ref: /schemas/types.yaml#/definitions/uint32 153 + description: 154 + Number of address bits. 155 + default: 8 156 + enum: [ 8, 16 ] 157 + 158 + num-addresses: 159 + allOf: 160 + - $ref: /schemas/types.yaml#/definitions/uint32 161 + description: 162 + Total number of i2c slave addresses this device takes. 163 + default: 1 164 + minimum: 1 165 + maximum: 8 166 + 167 + required: 168 + - compatible 169 + - reg 170 + 171 + examples: 172 + - | 173 + i2c { 174 + #address-cells = <1>; 175 + #size-cells = <0>; 176 + 177 + eeprom@52 { 178 + compatible = "microchip,24c32", "atmel,24c32"; 179 + reg = <0x52>; 180 + pagesize = <32>; 181 + wp-gpios = <&gpio1 3 0>; 182 + num-addresses = <8>; 183 + }; 184 + }; 185 + ...
+1 -1
MAINTAINERS
··· 2699 2699 L: linux-i2c@vger.kernel.org 2700 2700 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git 2701 2701 S: Maintained 2702 - F: Documentation/devicetree/bindings/eeprom/at24.txt 2702 + F: Documentation/devicetree/bindings/eeprom/at24.yaml 2703 2703 F: drivers/misc/eeprom/at24.c 2704 2704 2705 2705 ATA OVER ETHERNET (AOE) DRIVER