Skip to contentSkip to conversation

dt-bindings: cros-ec: Update for fingerprint devices

PATCH Applied Stephen Boyd 6 participants 17 messages May 12, 2022 – Jun 6, 2022

Subsystems (3)

v5 of 7 Applied 1/3 Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 cover dt-bindings: cros-ec: Update for fingerprint devices

This patch series introduces a DT binding for chromeos fingerprint devices. The first two patches tighten up the existing binding and the final patch introduces the fingerprint binding. As there aren't any driver patches this can probably go directly through the DT binding tree if Lee can ack the patches. Or go through mfd tree if DT maintainers ack/review.

Changes from v4 (https://lore.kernel.org/r/[email protected]):
* Drop last patch that implemented driver logic
* Drop second to last patch because it's not really needed until compatible is used.
* Rolled cros-ec-spi into cros-ec-fp compatible to get all the pieces

Changes from v3 (https://lore.kernel.org/r/[email protected]):
* Drop spi_device_id because it isn't used
* Dropped struct members for gpios
* Picked up tags

Changes from v2 (https://lore.kernel.org/r/[email protected]):
* Dropped cros-ec spi dt properties that aren't of use right now
* Picked up tags

Changes from v1 (https://lore.kernel.org/r/[email protected]):
* Properly do the boot sequence
* Add a message that we're booting and delaying a while
* Fix typo in commit text
* Change binding to not spell out reset-gpios and indicate that boot0
is about asserting boot mode
* Split device id to different patch as it's a different topic from booting

Stephen Boyd (3):
dt-bindings: cros-ec: Fix a typo in description
dt-bindings: cros-ec: Reorganize property availability
dt-bindings: cros-ec: Add ChromeOS fingerprint binding

 .../bindings/mfd/google,cros-ec.yaml          | 121 ++++++++++++++----
 1 file changed, 99 insertions(+), 22 deletions(-)
Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>

base-commit: ffb217a13a2eaf6d5bd974fc83036a53ca69f1e2

Signature · 1 line
https://chromeos.dev
#1 lore raw

PATCH v5 1/3 dt-bindings: cros-ec: Fix a typo in description

A 's/pf/of/' on rpmsg-name description.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>
---
 Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +1 -1
index d1f53bd449f7..99eda9ab0651 100644
@@ -61,7 +61,7 @@ properties:
   mediatek,rpmsg-name:
     description:
       Must be defined if the cros-ec is a rpmsg device for a Mediatek
-      ARM Cortex M4 Co-processor. Contains the name pf the rpmsg
+      ARM Cortex M4 Co-processor. Contains the name of the rpmsg
       device. Used to match the subnode to the rpmsg device announced by
       the SCP.
     $ref: "/schemas/types.yaml#/definitions/string"
Signature · 1 line
https://chromeos.dev
Reviewed-by on v5 1/3
#2 lore raw

Re: [PATCH v5 1/3] dt-bindings: cros-ec: Fix a typo in description

Quoted 17 lines · Stephen Boyd

A 's/pf/of/' on rpmsg-name description.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 20 lines
---
 Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +1 -2
index d1f53bd449f7..99eda9ab0651 100644
@@ -61,7 +61,7 @@ properties:
   mediatek,rpmsg-name:
     description:
       Must be defined if the cros-ec is a rpmsg device for a Mediatek
-      ARM Cortex M4 Co-processor. Contains the name pf the rpmsg
+      ARM Cortex M4 Co-processor. Contains the name of the rpmsg
       device. Used to match the subnode to the rpmsg device announced by
       the SCP.
     $ref: "/schemas/types.yaml#/definitions/string"
--

https://chromeos.dev

maintainer Acked-by on v5 1/3
#3 lore raw

Re: [PATCH v5 1/3] dt-bindings: cros-ec: Fix a typo in description

In reply to Stephen Boyd
Quoted 16 lines · Stephen Boyd

A 's/pf/of/' on rpmsg-name description.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 3 lines
---
 Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Applied
#4 lore raw

Re: [PATCH v5 1/3] dt-bindings: cros-ec: Fix a typo in description

In reply to Stephen Boyd
Quoted 16 lines · Stephen Boyd

A 's/pf/of/' on rpmsg-name description.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 3 lines
---
 Documentation/devicetree/bindings/mfd/google,cros-ec.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Signature · 4 lines
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw

PATCH v5 2/3 dt-bindings: cros-ec: Reorganize property availability

In reply to Stephen Boyd

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.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>
---
 .../bindings/mfd/google,cros-ec.yaml          | 39 +++++++++++++------
 1 file changed, 27 insertions(+), 12 deletions(-)
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +27 -12
index 99eda9ab0651..409ecef967ce 100644
@@ -148,18 +148,33 @@ patternProperties:
 required:
   - compatible
 
-if:
-  properties:
-    compatible:
-      contains:
-        enum:
-          - google,cros-ec-i2c
-          - google,cros-ec-rpmsg
-then:
-  properties:
-    google,cros-ec-spi-pre-delay: false
-    google,cros-ec-spi-msg-delay: false
-    spi-max-frequency: false
+allOf:
+  - if:
+      properties:
+        compatible:
+          not:
+            contains:
+              const: google,cros-ec-spi
+    then:
+      properties:
+        controller-data: false
+        google,cros-ec-spi-pre-delay: false
+        google,cros-ec-spi-msg-delay: false
+        spi-max-frequency: false
+
+  - if:
+      properties:
+        compatible:
+          not:
+            contains:
+              const: google,cros-ec-rpmsg
+    then:
+      properties:
+        mediatek,rpmsg-name: false
+
+      required:
+        - reg
+        - interrupts
 
 additionalProperties: false
 
Signature · 1 line
https://chromeos.dev
Reviewed-by on v5 2/3
#6 lore raw

Re: [PATCH v5 2/3] dt-bindings: cros-ec: Reorganize property availability

Hi,

Quoted 62 lines · Stephen Boyd

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.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>
---
 .../bindings/mfd/google,cros-ec.yaml          | 39 +++++++++++++------
 1 file changed, 27 insertions(+), 12 deletions(-)
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +17 -12
index 99eda9ab0651..409ecef967ce 100644
@@ -148,18 +148,33 @@ patternProperties:
 required:
   - compatible
 
-if:
-  properties:
-    compatible:
-      contains:
-        enum:
-          - google,cros-ec-i2c
-          - google,cros-ec-rpmsg
-then:
-  properties:
-    google,cros-ec-spi-pre-delay: false
-    google,cros-ec-spi-msg-delay: false
-    spi-max-frequency: false
+allOf:
+  - if:
+      properties:
+        compatible:
+          not:
+            contains:
+              const: google,cros-ec-spi
+    then:
+      properties:
+        controller-data: false
+        google,cros-ec-spi-pre-delay: false
+        google,cros-ec-spi-msg-delay: false
+        spi-max-frequency: false
+
+  - if:
+      properties:
+        compatible:

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml patternProperties: · line 177

Quoted 10 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +10 -0
+          not:
+            contains:
+              const: google,cros-ec-rpmsg
+    then:
+      properties:
+        mediatek,rpmsg-name: false
+
+      required:
+        - reg
+        - interrupts

Is it worth having an "else" clause here? to explicitly make "mediatek,rpmsg-name" required for mediatek?

In any case, this seems right from my (albeit) limited yaml knowledge and seems like an improvement.

#7 lore raw

Re: [PATCH v5 2/3] dt-bindings: cros-ec: Reorganize property availability

Quoting Doug Anderson (2022-05-12 16:44:44)

Quoted 10 lines · Stephen Boyd
Quoted 9 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +9 -0
+
+  - if:
+      properties:
+        compatible:
+          not:
+            contains:
+              const: google,cros-ec-rpmsg
+    then:
+      properties:
Quoted 8 lines

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml patternProperties: · line 177

Quoted 5 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +5 -0
+        mediatek,rpmsg-name: false
+
+      required:
+        - reg
+        - interrupts

Is it worth having an "else" clause here? to explicitly make "mediatek,rpmsg-name" required for mediatek?

I don't know if mediatek,rpmsg-name is required for a generic google,cros-ec-rpmsg. I would guess it isn't, because it's a vendor prefixed property. Maybe it could look at the parent node property to see that it is inside a mediatek remoteproc node but I'd rather leave that to future work.

Quoted 5 lines

In any case, this seems right from my (albeit) limited yaml knowledge and seems like an improvement.

Thanks!

maintainer Acked-by on v5 2/3
#8 lore raw

Re: [PATCH v5 2/3] dt-bindings: cros-ec: Reorganize property availability

In reply to Stephen Boyd
Quoted 20 lines · Stephen Boyd

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.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>
Quoted 4 lines
---
 .../bindings/mfd/google,cros-ec.yaml          | 39 +++++++++++++------
 1 file changed, 27 insertions(+), 12 deletions(-)
#9 lore raw

PATCH v5 3/3 dt-bindings: cros-ec: Add ChromeOS fingerprint binding

In reply to Stephen Boyd

Add a binding to describe the fingerprint processor found on Chromebooks with a fingerprint sensor. Previously we've been describing this with the google,cros-ec-spi binding but it lacks gpio and regulator control used during firmware flashing.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>
---
 .../bindings/mfd/google,cros-ec.yaml          | 80 ++++++++++++++++---
 1 file changed, 71 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +71 -9
index 409ecef967ce..e5fe60beb9fe 100644
@@ -19,15 +19,19 @@ description:
 properties:
   compatible:
     oneOf:
-      - description:
-          For implementations of the EC is connected through I2C.
-        const: google,cros-ec-i2c
-      - description:
-          For implementations of the EC is connected through SPI.
-        const: google,cros-ec-spi
-      - description:
-          For implementations of the EC is connected through RPMSG.
-        const: google,cros-ec-rpmsg
+      # For implementations of the EC is connected through I2C.
+      - items:
+          - const: google,cros-ec-i2c
+      # For implementations of the FPMCU connected through SPI.
+      - items:
+          - const: google,cros-ec-fp
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through SPI.
+      - items:
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through RPMSG.
+      - items:
+          - const: google,cros-ec-rpmsg
 
   controller-data:
     description:
@@ -132,6 +136,15 @@ properties:
 
     additionalProperties: false
 
+  reset-gpios:
+    maxItems: 1
+
+  boot0-gpios:
+    maxItems: 1
+    description: Assert for bootloader mode.
+
+  vdd-supply: true
+
 patternProperties:
   "^i2c-tunnel[0-9]*$":
     type: object
@@ -176,6 +189,37 @@ allOf:
         - reg
         - interrupts
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: google,cros-ec-fp
+    then:
+      properties:
+        '#address-cells': false
+        '#size-cells': false
+        typec: false
+        ec-pwm: false
+        keyboard-controller: false
+        proximity: false
+        codecs: false
+        cbas: false
+
+      patternProperties:
+        "^i2c-tunnel[0-9]*$": false
+        "^regulator@[0-9]+$": false
+        "^extcon[0-9]*$": false
+
+      required:
+        - reset-gpios
+        - boot0-gpios
+        - vdd-supply
+    else:
+      properties:
+        reset-gpios: false
+        boot0-gpios: false
+        vdd-supply: false
+
 additionalProperties: false
 
 examples:
@@ -231,4 +275,22 @@ examples:
             compatible = "google,cros-ec-rpmsg";
         };
     };
+
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/gpio/gpio.h>
+    spi {
+      #address-cells = <0x1>;
+      #size-cells = <0x0>;
+      ec@0 {
+        compatible = "google,cros-ec-fp", "google,cros-ec-spi";
+        reg = <0>;
+        interrupt-parent = <&gpio_controller>;
+        interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
+        spi-max-frequency = <3000000>;
+        reset-gpios = <&gpio_controller 5 GPIO_ACTIVE_LOW>;
+        boot0-gpios = <&gpio_controller 10 GPIO_ACTIVE_HIGH>;
+        vdd-supply = <&pp3300_fp_mcu>;
+      };
+    };
 ...
Signature · 1 line
https://chromeos.dev
Reviewed-by on v5 3/3
#10 lore raw

Re: [PATCH v5 3/3] dt-bindings: cros-ec: Add ChromeOS fingerprint binding

Hi,

Quoted 25 lines · Stephen Boyd
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +20 -0
@@ -176,6 +189,37 @@ allOf:
         - reg
         - interrupts
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: google,cros-ec-fp
+    then:
+      properties:
+        '#address-cells': false
+        '#size-cells': false
+        typec: false
+        ec-pwm: false
+        keyboard-controller: false
+        proximity: false
+        codecs: false
+        cbas: false
+
+      patternProperties:
+        "^i2c-tunnel[0-9]*$": false
+        "^regulator@[0-9]+$": false
+        "^extcon[0-9]*$": false

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml allOf: · line 221

Quoted 10 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +10 -0
+
+      required:
+        - reset-gpios
+        - boot0-gpios
+        - vdd-supply
+    else:
+      properties:
+        reset-gpios: false
+        boot0-gpios: false
+        vdd-supply: false

Wow, that's a huge pain to have to specify it this way, but I don't know of any other way to make things happy and still have the "google,cros-ec-spi" fallback that we decided on having in previous versions.

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml examples: · line 279

Quoted 9 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +2 -0
 additionalProperties: false
 
 examples:
@@ -231,4 +275,22 @@ examples:
             compatible = "google,cros-ec-rpmsg";
         };
     };
+
+  - |

nit: all the other examples have a little "# For <blah>" comment before them. It's not really necessary, but do we want one here to match?

In any case, it seems OK to me.

maintainer
#11 lore raw

Re: [PATCH v5 3/3] dt-bindings: cros-ec: Add ChromeOS fingerprint binding

In reply to Stephen Boyd
Quoted 31 lines · Stephen Boyd

Add a binding to describe the fingerprint processor found on Chromebooks with a fingerprint sensor. Previously we've been describing this with the google,cros-ec-spi binding but it lacks gpio and regulator control used during firmware flashing.

Cc Rob Herring <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Douglas Anderson <[email protected]>
Cc Craig Hesling <[email protected]>
Cc Tom Hughes <[email protected]>
Cc Alexandru M Stan <[email protected]>
Cc Tzung-Bi Shih <[email protected]>
Cc Matthias Kaehlcke <[email protected]>
Cc Benson Leung <[email protected]>
Cc Lee Jones <[email protected]>
---
 .../bindings/mfd/google,cros-ec.yaml          | 80 ++++++++++++++++---
 1 file changed, 71 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +0 -0
index 409ecef967ce..e5fe60beb9fe 100644
@@ -19,15 +19,19 @@ description:
 properties:
   compatible:
     oneOf:

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml description: · line 22

Quoted 10 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +1 -9
-      - description:
-          For implementations of the EC is connected through I2C.
-        const: google,cros-ec-i2c
-      - description:
-          For implementations of the EC is connected through SPI.
-        const: google,cros-ec-spi
-      - description:
-          For implementations of the EC is connected through RPMSG.
-        const: google,cros-ec-rpmsg
+      # For implementations of the EC is connected through I2C.

Using 'description' was preferred.

Quoted 45 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +31 -0
+      - items:
+          - const: google,cros-ec-i2c
+      # For implementations of the FPMCU connected through SPI.
+      - items:
+          - const: google,cros-ec-fp
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through SPI.
+      - items:
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through RPMSG.
+      - items:
+          - const: google,cros-ec-rpmsg
 
   controller-data:
     description:
@@ -132,6 +136,15 @@ properties:
 
     additionalProperties: false
 
+  reset-gpios:
+    maxItems: 1
+
+  boot0-gpios:
+    maxItems: 1
+    description: Assert for bootloader mode.
+
+  vdd-supply: true
+
 patternProperties:
   "^i2c-tunnel[0-9]*$":
     type: object
@@ -176,6 +189,37 @@ allOf:
         - reg
         - interrupts
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: google,cros-ec-fp
+    then:
+      properties:
+        '#address-cells': false
+        '#size-cells': false
+        typec: false

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml allOf: · line 211

Quoted 10 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +10 -0
+        ec-pwm: false
+        keyboard-controller: false
+        proximity: false
+        codecs: false
+        cbas: false
+
+      patternProperties:
+        "^i2c-tunnel[0-9]*$": false
+        "^regulator@[0-9]+$": false
+        "^extcon[0-9]*$": false

Is the list of what's allowed shorter? If so, you could list those properties and use 'additionalProperties: false'.

Or maybe this is a sign that this should be a separate schema document.

Quoted 10 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +10 -0
+
+      required:
+        - reset-gpios
+        - boot0-gpios
+        - vdd-supply
+    else:
+      properties:
+        reset-gpios: false
+        boot0-gpios: false
+        vdd-supply: false
#12 lore raw

Re: [PATCH v5 3/3] dt-bindings: cros-ec: Add ChromeOS fingerprint binding

Quoting Rob Herring (2022-05-16 08:20:03)

Quoted 13 lines · Stephen Boyd
Quoted 12 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +0 -4
index 409ecef967ce..e5fe60beb9fe 100644
@@ -19,15 +19,19 @@ description:
 properties:
   compatible:
     oneOf:
-      - description:
-          For implementations of the EC is connected through I2C.
-        const: google,cros-ec-i2c
-      - description:
Quoted 8 lines

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml description: · line 22

Quoted 6 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +1 -5
-          For implementations of the EC is connected through SPI.
-        const: google,cros-ec-spi
-      - description:
-          For implementations of the EC is connected through RPMSG.
-        const: google,cros-ec-rpmsg
+      # For implementations of the EC is connected through I2C.

Using 'description' was preferred.

I just learned that I should use anyOf instead of oneOf. Confusing!

Quoted 35 lines
Quoted 35 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +27 -0
+      - items:
+          - const: google,cros-ec-i2c
+      # For implementations of the FPMCU connected through SPI.
+      - items:
+          - const: google,cros-ec-fp
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through SPI.
+      - items:
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through RPMSG.
+      - items:
+          - const: google,cros-ec-rpmsg
 
   controller-data:
     description:
@@ -176,6 +189,37 @@ allOf:
         - reg
         - interrupts
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: google,cros-ec-fp
+    then:
+      properties:
+        '#address-cells': false
+        '#size-cells': false
+        typec: false
+        ec-pwm: false
+        keyboard-controller: false
+        proximity: false
+        codecs: false
+        cbas: false
Quoted 8 lines

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml allOf: · line 211

Quoted 5 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +5 -0
+
+      patternProperties:
+        "^i2c-tunnel[0-9]*$": false
+        "^regulator@[0-9]+$": false
+        "^extcon[0-9]*$": false

Is the list of what's allowed shorter? If so, you could list those properties and use 'additionalProperties: false'.

Yes.

Quoted 2 lines

Or maybe this is a sign that this should be a separate schema document.

I couldn't figure that out. I tried to add new properties here but it didn't work. And then when I tried to make a different schema document it complained that the example for google,cros-ec-spi in here had a problem. Can properties be defined in this section? Or only listed and then additionalProperties be marked false?

maintainer
#13 lore raw

Re: [PATCH v5 3/3] dt-bindings: cros-ec: Add ChromeOS fingerprint binding

Quoted 23 lines · Stephen Boyd

Quoting Rob Herring (2022-05-16 08:20:03)

Quoted 13 lines · Stephen Boyd
Quoted 12 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +0 -4
index 409ecef967ce..e5fe60beb9fe 100644
@@ -19,15 +19,19 @@ description:
 properties:
   compatible:
     oneOf:
-      - description:
-          For implementations of the EC is connected through I2C.
-        const: google,cros-ec-i2c
-      - description:
Quoted 8 lines

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml description: · line 22

Quoted 6 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +1 -5
-          For implementations of the EC is connected through SPI.
-        const: google,cros-ec-spi
-      - description:
-          For implementations of the EC is connected through RPMSG.
-        const: google,cros-ec-rpmsg
+      # For implementations of the EC is connected through I2C.

Using 'description' was preferred.

Quoted 1 line

I just learned that I should use anyOf instead of oneOf. Confusing!

Uhh, no. It can only be one of these entries at a time.

Quoted 44 lines
Quoted 35 lines
Quoted 35 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +27 -0
+      - items:
+          - const: google,cros-ec-i2c
+      # For implementations of the FPMCU connected through SPI.
+      - items:
+          - const: google,cros-ec-fp
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through SPI.
+      - items:
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through RPMSG.
+      - items:
+          - const: google,cros-ec-rpmsg
 
   controller-data:
     description:
@@ -176,6 +189,37 @@ allOf:
         - reg
         - interrupts
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: google,cros-ec-fp
+    then:
+      properties:
+        '#address-cells': false
+        '#size-cells': false
+        typec: false
+        ec-pwm: false
+        keyboard-controller: false
+        proximity: false
+        codecs: false
+        cbas: false
Quoted 8 lines

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml allOf: · line 211

Quoted 5 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +5 -0
+
+      patternProperties:
+        "^i2c-tunnel[0-9]*$": false
+        "^regulator@[0-9]+$": false
+        "^extcon[0-9]*$": false

Is the list of what's allowed shorter? If so, you could list those properties and use 'additionalProperties: false'.

Quoted 7 lines

Yes.

Quoted 2 lines

Or maybe this is a sign that this should be a separate schema document.

I couldn't figure that out. I tried to add new properties here but it didn't work.

Like this?:

then:
properties:
allowed-prop-1: true
allowed-prop-2: true
allowed-prop-3: true
additionalProperties: false

Quoted 3 lines

And then when I tried to make a different schema document it complained that the example for google,cros-ec-spi in here had a problem.

You probably need a custom 'select' so that both schemas aren't matching. Otherwise a schema is applied if any of the compatible strings match.

Quoted 1 line

Can properties be defined in this section?

Yes, but discouraged for vendor specific properties. The if/then should really be just additional constraints.

Rob

#14 lore raw

Re: [PATCH v5 3/3] dt-bindings: cros-ec: Add ChromeOS fingerprint binding

Quoting Rob Herring (2022-05-18 09:13:48)

Quoted 58 lines · Stephen Boyd
Quoted 49 lines

Quoting Rob Herring (2022-05-16 08:20:03)

Quoted 39 lines · Stephen Boyd
Quoted 38 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +27 -0
index 409ecef967ce..e5fe60beb9fe 100644
+      - items:
+          - const: google,cros-ec-i2c
+      # For implementations of the FPMCU connected through SPI.
+      - items:
+          - const: google,cros-ec-fp
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through SPI.
+      - items:
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through RPMSG.
+      - items:
+          - const: google,cros-ec-rpmsg
 
   controller-data:
     description:
@@ -176,6 +189,37 @@ allOf:
         - reg
         - interrupts
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: google,cros-ec-fp
+    then:
+      properties:
+        '#address-cells': false
+        '#size-cells': false
+        typec: false
+        ec-pwm: false
+        keyboard-controller: false
+        proximity: false
+        codecs: false
+        cbas: false
Quoted 8 lines

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml allOf: · line 211

Quoted 5 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +5 -0
+
+      patternProperties:
+        "^i2c-tunnel[0-9]*$": false
+        "^regulator@[0-9]+$": false
+        "^extcon[0-9]*$": false

Is the list of what's allowed shorter? If so, you could list those properties and use 'additionalProperties: false'.

Quoted 7 lines

Yes.

Quoted 2 lines

Or maybe this is a sign that this should be a separate schema document.

I couldn't figure that out. I tried to add new properties here but it didn't work.

Quoted 8 lines

Like this?:

then:
properties:
allowed-prop-1: true
allowed-prop-2: true
allowed-prop-3: true
additionalProperties: false

It doesn't seem to combine constraints?

I get this error:

Documentation/devicetree/bindings/mfd/google,cros-ec.example.dt.yaml:
ec@0: Additional properties are not allowed ('$nodename' was unexpected)

with this interdiff. I added the spi properties to reduce the additional properties that aren't allowed.

---8<----

(quoted diff) +0 -0

b/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml index 04b847fd5070..d47c7a273026 100644

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +13 -21
@@ -18,24 +18,21 @@ description:
 
 properties:
   compatible:
-    anyOf:
+    oneOf:
       - description:
           For implementations of the EC connected through I2C.
-      - items:
-          - const: google,cros-ec-i2c
+        const: google,cros-ec-i2c
       - description:
           For implementations of the FPMCU connected through SPI.
-      - items:
+        items:
           - const: google,cros-ec-fp
           - const: google,cros-ec-spi
       - description:
           For implementations of the EC connected through SPI.
-      - items:
-          - const: google,cros-ec-spi
+        const: google,cros-ec-spi
       - description:
           For implementations of the EC connected through RPMSG.
-      - items:
-          - const: google,cros-ec-rpmsg
+        const: google,cros-ec-rpmsg
 
   controller-data:
     description:
@@ -200,19 +197,14 @@ allOf:
             const: google,cros-ec-fp
     then:
       properties:
-        '#address-cells': false
-        '#size-cells': false
-        typec: false
-        ec-pwm: false
-        keyboard-controller: false
-        proximity: false
-        codecs: false
-        cbas: false
-
-      patternProperties:
-        "^i2c-tunnel[0-9]*$": false
-        "^regulator@[0-9]+$": false
-        "^extcon[0-9]*$": false
+        reset-gpios: true
+        boot0-gpios: true
+        vdd-supply: true
+        interrupts: true
+        compatible: true
+        reg: true
+        spi-max-frequency: true
+      additionalProperties: false
 
       required:
         - reset-gpios
Quoted 8 lines
Quoted 4 lines

And then when I tried to make a different schema document it complained that the example for google,cros-ec-spi in here had a problem.

You probably need a custom 'select' so that both schemas aren't matching. Otherwise a schema is applied if any of the compatible strings match.

I see. Maybe that's better vs. jamming it all into one file.

Quoted 5 lines
Quoted 2 lines

Can properties be defined in this section?

Yes, but discouraged for vendor specific properties. The if/then should really be just additional constraints.

Ok.

maintainer
#15 lore raw

Re: [PATCH v5 3/3] dt-bindings: cros-ec: Add ChromeOS fingerprint binding

Quoted 68 lines · Stephen Boyd

Quoting Rob Herring (2022-05-18 09:13:48)

Quoted 58 lines · Stephen Boyd
Quoted 49 lines

Quoting Rob Herring (2022-05-16 08:20:03)

Quoted 39 lines · Stephen Boyd
Quoted 38 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +27 -0
index 409ecef967ce..e5fe60beb9fe 100644
+      - items:
+          - const: google,cros-ec-i2c
+      # For implementations of the FPMCU connected through SPI.
+      - items:
+          - const: google,cros-ec-fp
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through SPI.
+      - items:
+          - const: google,cros-ec-spi
+      # For implementations of the EC is connected through RPMSG.
+      - items:
+          - const: google,cros-ec-rpmsg
 
   controller-data:
     description:
@@ -176,6 +189,37 @@ allOf:
         - reg
         - interrupts
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: google,cros-ec-fp
+    then:
+      properties:
+        '#address-cells': false
+        '#size-cells': false
+        typec: false
+        ec-pwm: false
+        keyboard-controller: false
+        proximity: false
+        codecs: false
+        cbas: false
Quoted 8 lines

Documentation/devicetree/bindings/mfd/google,cros-ec.yaml allOf: · line 211

Quoted 5 lines
Documentation/devicetree/bindings/mfd/google,cros-ec.yaml +5 -0
+
+      patternProperties:
+        "^i2c-tunnel[0-9]*$": false
+        "^regulator@[0-9]+$": false
+        "^extcon[0-9]*$": false

Is the list of what's allowed shorter? If so, you could list those properties and use 'additionalProperties: false'.

Quoted 7 lines

Yes.

Quoted 2 lines

Or maybe this is a sign that this should be a separate schema document.

I couldn't figure that out. I tried to add new properties here but it didn't work.

Quoted 8 lines

Like this?:

then:
properties:
allowed-prop-1: true
allowed-prop-2: true
allowed-prop-3: true
additionalProperties: false

Quoted 6 lines

It doesn't seem to combine constraints?

I get this error:

Documentation/devicetree/bindings/mfd/google,cros-ec.example.dt.yaml:
ec@0: Additional properties are not allowed ('$nodename' was unexpected)

That would be a bug or limitation in the tools. We would need to add all the other properties we automatically add as well... I think either leaving it as-is or a separate file is going to be the better route here.

Rob

#16 lore raw
In reply to Stephen Boyd
This series was applied to chrome-platform/linux.git (for-next) by Lee Jones <[email protected]>:

Hello:

This series was applied to chrome-platform/linux.git (for-next) by Lee Jones <[email protected]>:

Quoted 8 lines · On Wed, 11 May 2022 18:39:18 -0700 you wrote:

This patch series introduces a DT binding for chromeos fingerprint devices. The first two patches tighten up the existing binding and the final patch introduces the fingerprint binding. As there aren't any driver patches this can probably go directly through the DT binding tree if Lee can ack the patches. Or go through mfd tree if DT maintainers ack/review.

[...]

Here is the summary with links:
- [v5,1/3] dt-bindings: cros-ec: Fix a typo in description

    https://git.kernel.org/chrome-platform/c/f93afd8e7567

- [v5,2/3] dt-bindings: cros-ec: Reorganize property availability (no matching commit)
- [v5,3/3] dt-bindings: cros-ec: Add ChromeOS fingerprint binding (no matching commit)

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html