diff mbox series

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

Message ID 20210122225443.186184-3-swboyd@chromium.org
State New
Headers show
Series iio: Add a ChromeOS EC MKBP proximity driver | expand

Commit Message

Stephen Boyd Jan. 22, 2021, 10:54 p.m. UTC
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 <dmitry.torokhov@gmail.com>
Cc: Benson Leung <bleung@chromium.org>
Cc: Guenter Roeck <groeck@chromium.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Gwendal Grignou <gwendal@chromium.org>
Cc: <devicetree@vger.kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 .../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

Comments

Jonathan Cameron Jan. 24, 2021, 5:27 p.m. UTC | #1
On Fri, 22 Jan 2021 14:54:42 -0800
Stephen Boyd <swboyd@chromium.org> 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 <dmitry.torokhov@gmail.com>

> Cc: Benson Leung <bleung@chromium.org>

> Cc: Guenter Roeck <groeck@chromium.org>

> Cc: Douglas Anderson <dianders@chromium.org>

> Cc: Gwendal Grignou <gwendal@chromium.org>

> Cc: <devicetree@vger.kernel.org>

> Cc: Rob Herring <robh+dt@kernel.org>

> Signed-off-by: Stephen Boyd <swboyd@chromium.org>

> ---

>  .../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 <swboyd@chromium.org>

> +  - Benson Leung <bleung@chromium.org>

> +  - Enric Balletbo i Serra <enric.balletbo@collabora.com>

> +

> +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";

> +    };
Gwendal Grignou Jan. 24, 2021, 8:42 p.m. UTC | #2
On Sun, Jan 24, 2021 at 9:28 AM Jonathan Cameron <jic23@kernel.org> wrote:
>

> On Fri, 22 Jan 2021 14:54:42 -0800

> Stephen Boyd <swboyd@chromium.org> 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 <dmitry.torokhov@gmail.com>

> > Cc: Benson Leung <bleung@chromium.org>

> > Cc: Guenter Roeck <groeck@chromium.org>

> > Cc: Douglas Anderson <dianders@chromium.org>

> > Cc: Gwendal Grignou <gwendal@chromium.org>

> > Cc: <devicetree@vger.kernel.org>

> > Cc: Rob Herring <robh+dt@kernel.org>

> > Signed-off-by: Stephen Boyd <swboyd@chromium.org>

> > ---

> >  .../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 <swboyd@chromium.org>

> > +  - Benson Leung <bleung@chromium.org>

> > +  - Enric Balletbo i Serra <enric.balletbo@collabora.com>

> > +

> > +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";

> > +    };

>
Rob Herring Jan. 24, 2021, 10:33 p.m. UTC | #3
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 <dmitry.torokhov@gmail.com>

> Cc: Benson Leung <bleung@chromium.org>

> Cc: Guenter Roeck <groeck@chromium.org>

> Cc: Douglas Anderson <dianders@chromium.org>

> Cc: Gwendal Grignou <gwendal@chromium.org>

> Cc: <devicetree@vger.kernel.org>

> Cc: Rob Herring <robh+dt@kernel.org>

> Signed-off-by: Stephen Boyd <swboyd@chromium.org>

> ---

>  .../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.
Rob Herring Jan. 25, 2021, 3:02 p.m. UTC | #4
On Sun, Jan 24, 2021 at 05:27:56PM +0000, Jonathan Cameron wrote:
> On Fri, 22 Jan 2021 14:54:42 -0800

> Stephen Boyd <swboyd@chromium.org> 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 <dmitry.torokhov@gmail.com>

> > Cc: Benson Leung <bleung@chromium.org>

> > Cc: Guenter Roeck <groeck@chromium.org>

> > Cc: Douglas Anderson <dianders@chromium.org>

> > Cc: Gwendal Grignou <gwendal@chromium.org>

> > Cc: <devicetree@vger.kernel.org>

> > Cc: Rob Herring <robh+dt@kernel.org>

> > Signed-off-by: Stephen Boyd <swboyd@chromium.org>

> > ---

> >  .../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 <swboyd@chromium.org>

> > +  - Benson Leung <bleung@chromium.org>

> > +  - Enric Balletbo i Serra <enric.balletbo@collabora.com>

> > +

> > +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";

> > +    };

>
Stephen Boyd Jan. 25, 2021, 6:33 p.m. UTC | #5
Quoting Gwendal Grignou (2021-01-24 12:42:56)
> On Sun, Jan 24, 2021 at 9:28 AM Jonathan Cameron <jic23@kernel.org> wrote:

> > On Fri, 22 Jan 2021 14:54:42 -0800

> > Stephen Boyd <swboyd@chromium.org> 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.
Stephen Boyd Jan. 25, 2021, 6:53 p.m. UTC | #6
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 <swboyd@chromium.org> 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 <dmitry.torokhov@gmail.com>

> > > Cc: Benson Leung <bleung@chromium.org>

> > > Cc: Guenter Roeck <groeck@chromium.org>

> > > Cc: Douglas Anderson <dianders@chromium.org>

> > > Cc: Gwendal Grignou <gwendal@chromium.org>

> > > Cc: <devicetree@vger.kernel.org>

> > > Cc: Rob Herring <robh+dt@kernel.org>

> > > Signed-off-by: Stephen Boyd <swboyd@chromium.org>

> > > ---

> > >  .../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 <swboyd@chromium.org>

> > > +  - Benson Leung <bleung@chromium.org>

> > > +  - Enric Balletbo i Serra <enric.balletbo@collabora.com>

> > > +

> > > +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.
diff mbox series

Patch

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 <swboyd@chromium.org>
+  - Benson Leung <bleung@chromium.org>
+  - Enric Balletbo i Serra <enric.balletbo@collabora.com>
+
+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";
+    };