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

dt-bindings: cros-ec: Reorganize and enforce property availability

Various properties in the cros-ec binding only apply to different
compatible strings. For example, the interrupts and reg property are
required for all cros-ec devices except for the rpmsg version. Add some
conditions to update the availability of properties so that they can't
be used with compatibles that don't support them.

This reveals that many of the examples in bindings that use cros-ec were
missing the interrupts property. Add the property to make those bindings
whole again.

Reviewed-by: Rob Herring <robh@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: <devicetree@vger.kernel.org>
Cc: <chrome-platform@lists.linux.dev>
Cc: Guenter Roeck <groeck@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Cc: Craig Hesling <hesling@chromium.org>
Cc: Tom Hughes <tomhughes@chromium.org>
Cc: Alexandru M Stan <amstan@chromium.org>
Cc: Tzung-Bi Shih <tzungbi@kernel.org>
Cc: Matthias Kaehlcke <mka@chromium.org>
Cc: Benson Leung <bleung@chromium.org>
Cc: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20221026003641.2688765-2-swboyd@chromium.org

authored by

Stephen Boyd and committed by
Tzung-Bi Shih
7a2f3682 d8cb88f1

+30 -13
+1
Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml
··· 48 48 cros_ec: ec@0 { 49 49 compatible = "google,cros-ec-spi"; 50 50 reg = <0>; 51 + interrupts = <35 0>; 51 52 52 53 typec { 53 54 compatible = "google,cros-ec-typec";
+1
Documentation/devicetree/bindings/chrome/google,cros-kbd-led-backlight.yaml
··· 27 27 cros_ec: ec@0 { 28 28 compatible = "google,cros-ec-spi"; 29 29 reg = <0>; 30 + interrupts = <15 0>; 30 31 31 32 kbd-led-backlight { 32 33 compatible = "google,cros-kbd-led-backlight";
+1
Documentation/devicetree/bindings/extcon/extcon-usbc-cros-ec.yaml
··· 40 40 cros-ec@0 { 41 41 compatible = "google,cros-ec-spi"; 42 42 reg = <0>; 43 + interrupts = <44 0>; 43 44 44 45 usbc_extcon0: extcon0 { 45 46 compatible = "google,extcon-usbc-cros-ec";
+1
Documentation/devicetree/bindings/i2c/google,cros-ec-i2c-tunnel.yaml
··· 47 47 compatible = "google,cros-ec-spi"; 48 48 reg = <0>; 49 49 spi-max-frequency = <5000000>; 50 + interrupts = <99 0>; 50 51 51 52 i2c-tunnel { 52 53 compatible = "google,cros-ec-i2c-tunnel";
+23 -13
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
··· 20 20 compatible: 21 21 oneOf: 22 22 - description: 23 - For implementations of the EC is connected through I2C. 23 + For implementations of the EC connected through I2C. 24 24 const: google,cros-ec-i2c 25 25 - description: 26 - For implementations of the EC is connected through SPI. 26 + For implementations of the EC connected through SPI. 27 27 const: google,cros-ec-spi 28 28 - description: 29 - For implementations of the EC is connected through RPMSG. 29 + For implementations of the EC connected through RPMSG. 30 30 const: google,cros-ec-rpmsg 31 31 32 - controller-data: 33 - description: 34 - SPI controller data, see bindings/spi/samsung,spi-peripheral-props.yaml 35 - type: object 32 + controller-data: true 36 33 37 34 google,cros-ec-spi-pre-delay: 38 35 description: ··· 59 62 the SCP. 60 63 $ref: "/schemas/types.yaml#/definitions/string" 61 64 62 - spi-max-frequency: 63 - description: Maximum SPI frequency of the device in Hz. 65 + spi-max-frequency: true 64 66 65 67 reg: 66 68 maxItems: 1 ··· 151 155 - if: 152 156 properties: 153 157 compatible: 154 - contains: 155 - enum: 156 - - google,cros-ec-i2c 157 - - google,cros-ec-rpmsg 158 + not: 159 + contains: 160 + const: google,cros-ec-spi 158 161 then: 159 162 properties: 163 + controller-data: false 160 164 google,cros-ec-spi-pre-delay: false 161 165 google,cros-ec-spi-msg-delay: false 162 166 spi-max-frequency: false 163 167 else: 164 168 $ref: /schemas/spi/spi-peripheral-props.yaml 169 + 170 + - if: 171 + properties: 172 + compatible: 173 + not: 174 + contains: 175 + const: google,cros-ec-rpmsg 176 + then: 177 + properties: 178 + mediatek,rpmsg-name: false 179 + 180 + required: 181 + - reg 182 + - interrupts 165 183 166 184 additionalProperties: false 167 185
+1
Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.yaml
··· 48 48 cros-ec@0 { 49 49 compatible = "google,cros-ec-spi"; 50 50 reg = <0>; 51 + interrupts = <101 0>; 51 52 52 53 cros_ec_pwm: pwm { 53 54 compatible = "google,cros-ec-pwm";
+1
Documentation/devicetree/bindings/regulator/google,cros-ec-regulator.yaml
··· 41 41 reg = <0>; 42 42 #address-cells = <1>; 43 43 #size-cells = <0>; 44 + interrupts = <99 0>; 44 45 45 46 regulator@0 { 46 47 compatible = "google,cros-ec-regulator";
+1
Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml
··· 57 57 cros-ec@0 { 58 58 compatible = "google,cros-ec-spi"; 59 59 reg = <0>; 60 + interrupts = <93 0>; 60 61 61 62 codecs { 62 63 #address-cells = <2>;