2021-01-22 23:00:20

by Stephen Boyd

[permalink] [raw]
Subject: [PATCH 2/3] dt-bindings: iio: Add cros ec proximity yaml doc

Some cros ECs support a front proximity MKBP event via
'EC_MKBP_FRONT_PROXIMITY'. Add a DT binding to document this feature via
a node that is a child of the main cros_ec device node. Devices that
have this ability will describe this in firmware.

Cc: Dmitry Torokhov <[email protected]>
Cc: Benson Leung <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Douglas Anderson <[email protected]>
Cc: Gwendal Grignou <[email protected]>
Cc: <[email protected]>
Cc: Rob Herring <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
---
.../proximity/google,cros-ec-proximity.yaml | 37 +++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml

diff --git a/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
new file mode 100644
index 000000000000..c0a34bdfe4fd
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+
+$id: http://devicetree.org/schemas/iio/proximity/google,cros-ec-proximity.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ChromeOS EC MKBP Proximity Sensor
+
+maintainers:
+ - Stephen Boyd <[email protected]>
+ - Benson Leung <[email protected]>
+ - Enric Balletbo i Serra <[email protected]>
+
+description: |
+ Google's ChromeOS EC sometimes has the ability to detect user proximity.
+ This is implemented on the EC as near/far logic and exposed to the OS
+ via an MKBP switch bit.
+
+properties:
+ compatible:
+ const: google,cros-ec-proximity
+
+ label:
+ description: Name for proximity sensor
+
+required:
+ - compatible
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ proximity {
+ compatible = "google,cros-ec-proximity";
+ label = "proximity-wifi-lte";
+ };
--
https://chromeos.dev


2021-01-24 17:31:12

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: iio: Add cros ec proximity yaml doc

On Fri, 22 Jan 2021 14:54:42 -0800
Stephen Boyd <[email protected]> wrote:

> Some cros ECs support a front proximity MKBP event via
> 'EC_MKBP_FRONT_PROXIMITY'. Add a DT binding to document this feature via
> a node that is a child of the main cros_ec device node. Devices that
> have this ability will describe this in firmware.
>
> Cc: Dmitry Torokhov <[email protected]>
> Cc: Benson Leung <[email protected]>
> Cc: Guenter Roeck <[email protected]>
> Cc: Douglas Anderson <[email protected]>
> Cc: Gwendal Grignou <[email protected]>
> Cc: <[email protected]>
> Cc: Rob Herring <[email protected]>
> Signed-off-by: Stephen Boyd <[email protected]>
> ---
> .../proximity/google,cros-ec-proximity.yaml | 37 +++++++++++++++++++
> 1 file changed, 37 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
>
> diff --git a/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> new file mode 100644
> index 000000000000..c0a34bdfe4fd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> @@ -0,0 +1,37 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +
> +$id: http://devicetree.org/schemas/iio/proximity/google,cros-ec-proximity.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ChromeOS EC MKBP Proximity Sensor
> +
> +maintainers:
> + - Stephen Boyd <[email protected]>
> + - Benson Leung <[email protected]>
> + - Enric Balletbo i Serra <[email protected]>
> +
> +description: |
> + Google's ChromeOS EC sometimes has the ability to detect user proximity.
> + This is implemented on the EC as near/far logic and exposed to the OS
> + via an MKBP switch bit.
> +
> +properties:
> + compatible:
> + const: google,cros-ec-proximity
> +
> + label:
> + description: Name for proximity sensor
> +
> +required:
> + - compatible
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + proximity {

Can we at least have the example making it clear this is a child of the
cros_ec device?

> + compatible = "google,cros-ec-proximity";
> + label = "proximity-wifi-lte";
> + };

2021-01-24 20:45:19

by Gwendal Grignou

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: iio: Add cros ec proximity yaml doc

On Sun, Jan 24, 2021 at 9:28 AM Jonathan Cameron <[email protected]> wrote:
>
> On Fri, 22 Jan 2021 14:54:42 -0800
> Stephen Boyd <[email protected]> wrote:
>
> > Some cros ECs support a front proximity MKBP event via
> > 'EC_MKBP_FRONT_PROXIMITY'. Add a DT binding to document this feature via
> > a node that is a child of the main cros_ec device node. Devices that
> > have this ability will describe this in firmware.
> >
> > Cc: Dmitry Torokhov <[email protected]>
> > Cc: Benson Leung <[email protected]>
> > Cc: Guenter Roeck <[email protected]>
> > Cc: Douglas Anderson <[email protected]>
> > Cc: Gwendal Grignou <[email protected]>
> > Cc: <[email protected]>
> > Cc: Rob Herring <[email protected]>
> > Signed-off-by: Stephen Boyd <[email protected]>
> > ---
> > .../proximity/google,cros-ec-proximity.yaml | 37 +++++++++++++++++++
> > 1 file changed, 37 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> > new file mode 100644
> > index 000000000000..c0a34bdfe4fd
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> > @@ -0,0 +1,37 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +
> > +$id: http://devicetree.org/schemas/iio/proximity/google,cros-ec-proximity.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: ChromeOS EC MKBP Proximity Sensor
> > +
> > +maintainers:
> > + - Stephen Boyd <[email protected]>
> > + - Benson Leung <[email protected]>
> > + - Enric Balletbo i Serra <[email protected]>
> > +
> > +description: |
> > + Google's ChromeOS EC sometimes has the ability to detect user proximity.
> > + This is implemented on the EC as near/far logic and exposed to the OS
> > + via an MKBP switch bit.
> > +
> > +properties:
> > + compatible:
> > + const: google,cros-ec-proximity
Given we have proximity detection in cros_ec via specific sensor (si
1141) or algorithm (on-body/off-body via
MOTIONSENSE_ACTIVITY_BODY_DETECTION), can we name the property
cros-ec-mkbp-proximity?
> > +
> > + label:
> > + description: Name for proximity sensor
> > +
> > +required:
> > + - compatible
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > + - |
> > + proximity {
>
> Can we at least have the example making it clear this is a child of the
> cros_ec device?
>
> > + compatible = "google,cros-ec-proximity";
> > + label = "proximity-wifi-lte";
> > + };
>

2021-01-24 22:35:55

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: iio: Add cros ec proximity yaml doc

On Fri, 22 Jan 2021 14:54:42 -0800, Stephen Boyd wrote:
> Some cros ECs support a front proximity MKBP event via
> 'EC_MKBP_FRONT_PROXIMITY'. Add a DT binding to document this feature via
> a node that is a child of the main cros_ec device node. Devices that
> have this ability will describe this in firmware.
>
> Cc: Dmitry Torokhov <[email protected]>
> Cc: Benson Leung <[email protected]>
> Cc: Guenter Roeck <[email protected]>
> Cc: Douglas Anderson <[email protected]>
> Cc: Gwendal Grignou <[email protected]>
> Cc: <[email protected]>
> Cc: Rob Herring <[email protected]>
> Signed-off-by: Stephen Boyd <[email protected]>
> ---
> .../proximity/google,cros-ec-proximity.yaml | 37 +++++++++++++++++++
> 1 file changed, 37 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
>

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml: 'additionalProperties' is a required property
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml: ignoring, error in schema:
warning: no schema found in file: ./Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml

See https://patchwork.ozlabs.org/patch/1430611

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.

2021-01-25 18:37:12

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: iio: Add cros ec proximity yaml doc

Quoting Gwendal Grignou (2021-01-24 12:42:56)
> On Sun, Jan 24, 2021 at 9:28 AM Jonathan Cameron <[email protected]> wrote:
> > On Fri, 22 Jan 2021 14:54:42 -0800
> > Stephen Boyd <[email protected]> wrote:
> > > +
> > > +properties:
> > > + compatible:
> > > + const: google,cros-ec-proximity
> Given we have proximity detection in cros_ec via specific sensor (si
> 1141) or algorithm (on-body/off-body via
> MOTIONSENSE_ACTIVITY_BODY_DETECTION), can we name the property
> cros-ec-mkbp-proximity?

Sure that works for me.

2021-01-26 06:59:26

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: iio: Add cros ec proximity yaml doc

On Sun, Jan 24, 2021 at 05:27:56PM +0000, Jonathan Cameron wrote:
> On Fri, 22 Jan 2021 14:54:42 -0800
> Stephen Boyd <[email protected]> wrote:
>
> > Some cros ECs support a front proximity MKBP event via
> > 'EC_MKBP_FRONT_PROXIMITY'. Add a DT binding to document this feature via
> > a node that is a child of the main cros_ec device node. Devices that
> > have this ability will describe this in firmware.
> >
> > Cc: Dmitry Torokhov <[email protected]>
> > Cc: Benson Leung <[email protected]>
> > Cc: Guenter Roeck <[email protected]>
> > Cc: Douglas Anderson <[email protected]>
> > Cc: Gwendal Grignou <[email protected]>
> > Cc: <[email protected]>
> > Cc: Rob Herring <[email protected]>
> > Signed-off-by: Stephen Boyd <[email protected]>
> > ---
> > .../proximity/google,cros-ec-proximity.yaml | 37 +++++++++++++++++++
> > 1 file changed, 37 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> > new file mode 100644
> > index 000000000000..c0a34bdfe4fd
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> > @@ -0,0 +1,37 @@
> > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +
> > +$id: http://devicetree.org/schemas/iio/proximity/google,cros-ec-proximity.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: ChromeOS EC MKBP Proximity Sensor
> > +
> > +maintainers:
> > + - Stephen Boyd <[email protected]>
> > + - Benson Leung <[email protected]>
> > + - Enric Balletbo i Serra <[email protected]>
> > +
> > +description: |
> > + Google's ChromeOS EC sometimes has the ability to detect user proximity.
> > + This is implemented on the EC as near/far logic and exposed to the OS
> > + via an MKBP switch bit.
> > +
> > +properties:
> > + compatible:
> > + const: google,cros-ec-proximity
> > +
> > + label:
> > + description: Name for proximity sensor
> > +
> > +required:
> > + - compatible
> > +
> > +unevaluatedProperties: false

additionalProperties: false

> > +
> > +examples:
> > + - |
> > + proximity {
>
> Can we at least have the example making it clear this is a child of the
> cros_ec device?

Move this to the core Cros EC binding. The core binding needs to define
'proximity' and reference this binding ($ref).

>
> > + compatible = "google,cros-ec-proximity";
> > + label = "proximity-wifi-lte";
> > + };
>

2021-01-26 10:04:38

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: iio: Add cros ec proximity yaml doc

Quoting Rob Herring (2021-01-25 07:02:03)
> On Sun, Jan 24, 2021 at 05:27:56PM +0000, Jonathan Cameron wrote:
> > On Fri, 22 Jan 2021 14:54:42 -0800
> > Stephen Boyd <[email protected]> wrote:
> >
> > > Some cros ECs support a front proximity MKBP event via
> > > 'EC_MKBP_FRONT_PROXIMITY'. Add a DT binding to document this feature via
> > > a node that is a child of the main cros_ec device node. Devices that
> > > have this ability will describe this in firmware.
> > >
> > > Cc: Dmitry Torokhov <[email protected]>
> > > Cc: Benson Leung <[email protected]>
> > > Cc: Guenter Roeck <[email protected]>
> > > Cc: Douglas Anderson <[email protected]>
> > > Cc: Gwendal Grignou <[email protected]>
> > > Cc: <[email protected]>
> > > Cc: Rob Herring <[email protected]>
> > > Signed-off-by: Stephen Boyd <[email protected]>
> > > ---
> > > .../proximity/google,cros-ec-proximity.yaml | 37 +++++++++++++++++++
> > > 1 file changed, 37 insertions(+)
> > > create mode 100644 Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> > > new file mode 100644
> > > index 000000000000..c0a34bdfe4fd
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/iio/proximity/google,cros-ec-proximity.yaml
> > > @@ -0,0 +1,37 @@
> > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +
> > > +$id: http://devicetree.org/schemas/iio/proximity/google,cros-ec-proximity.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: ChromeOS EC MKBP Proximity Sensor
> > > +
> > > +maintainers:
> > > + - Stephen Boyd <[email protected]>
> > > + - Benson Leung <[email protected]>
> > > + - Enric Balletbo i Serra <[email protected]>
> > > +
> > > +description: |
> > > + Google's ChromeOS EC sometimes has the ability to detect user proximity.
> > > + This is implemented on the EC as near/far logic and exposed to the OS
> > > + via an MKBP switch bit.
> > > +
> > > +properties:
> > > + compatible:
> > > + const: google,cros-ec-proximity
> > > +
> > > + label:
> > > + description: Name for proximity sensor
> > > +
> > > +required:
> > > + - compatible
> > > +
> > > +unevaluatedProperties: false
>
> additionalProperties: false
>
> > > +
> > > +examples:
> > > + - |
> > > + proximity {
> >
> > Can we at least have the example making it clear this is a child of the
> > cros_ec device?
>
> Move this to the core Cros EC binding. The core binding needs to define
> 'proximity' and reference this binding ($ref).

Will do.