linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
@ 2024-11-08 12:03 Charles Wang
  2024-11-08 12:03 ` [PATCH v3 1/2] " Charles Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Charles Wang @ 2024-11-08 12:03 UTC (permalink / raw)
  To: krzk, hbarnor, dianders, conor.dooley
  Cc: dmitry.torokhov, jikos, bentiss, linux-input, devicetree,
	linux-kernel, Charles Wang

The Goodix GT7986U touch controller report touch data according to the
HID protocol through the SPI bus. However, it is incompatible with
Microsoft's HID-over-SPI protocol.

The patchset introduces the following two changes:
1) Add goodix,gt7986u-spifw.yaml.
2) Drop the 'goodix,hid-report-addr' property.

Signed-off-by: Charles Wang <charles.goodix@gmail.com>
---
Changes in v3:
- Split the commit into two patches.

Changes in v2:
- Change compatible to 'goodix,gt7986u-spifw'.
- Remove 'goodix,hid-report-addr' property.
- Change additionalProperties to unevaluatedProperties.
- v1: https://lore.kernel.org/all/20241025114642.40793-2-charles.goodix@gmail.com/
---
Charles Wang (2):
  dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
  dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property

 .../bindings/input/goodix,gt7986u-spifw.yaml  | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml

-- 
2.43.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3 1/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
  2024-11-08 12:03 [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen Charles Wang
@ 2024-11-08 12:03 ` Charles Wang
  2024-11-08 13:33   ` Rob Herring (Arm)
  2024-11-08 16:10   ` Rob Herring
  2024-11-08 12:03 ` [PATCH v3 2/2] dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property Charles Wang
  2024-11-08 15:11 ` [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen Doug Anderson
  2 siblings, 2 replies; 13+ messages in thread
From: Charles Wang @ 2024-11-08 12:03 UTC (permalink / raw)
  To: krzk, hbarnor, dianders, conor.dooley
  Cc: dmitry.torokhov, jikos, bentiss, linux-input, devicetree,
	linux-kernel, Charles Wang

The Goodix GT7986U touch controller report touch data according to the
HID protocol through the SPI bus. However, it is incompatible with
Microsoft's HID-over-SPI protocol.

NOTE: these bindings are distinct from the bindings used with the
GT7986U when the chip is running I2C firmware. For some background,
see discussion on the mailing lists in the thread:

https://lore.kernel.org/r/20241018020815.3098263-2-charles.goodix@gmail.com

Signed-off-by: Charles Wang <charles.goodix@gmail.com>
---
 .../bindings/input/goodix,gt7986u-spifw.yaml  | 75 +++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml

diff --git a/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
new file mode 100644
index 000000000..8105b9ce2
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
@@ -0,0 +1,75 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/goodix,gt7986u-spifw.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Goodix GT7986U SPI HID Touchscreen
+
+maintainers:
+  - Charles Wang <charles.goodix@gmail.com>
+
+description: Supports the Goodix GT7986U touchscreen.
+  This touch controller reports data packaged according to the HID protocol
+  over the SPI bus, but it is incompatible with Microsoft's HID-over-SPI protocol.
+
+  NOTE: these bindings are distinct from the bindings used with the
+  GT7986U when the chip is running I2C firmware. This is because there's
+  not a single device that talks over both I2C and SPI but rather
+  distinct touchscreens that happen to be built with the same ASIC but
+  that are distinct products running distinct firmware.
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+properties:
+  compatible:
+    enum:
+      - goodix,gt7986u-spifw
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+  goodix,hid-report-addr:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      The register address for retrieving HID report data.
+
+  spi-max-frequency: true
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - reset-gpios
+  - goodix,hid-report-addr
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/gpio/gpio.h>
+
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      touchscreen@0 {
+        compatible = "goodix,gt7986u-spifw";
+        reg = <0>;
+        interrupt-parent = <&gpio>;
+        interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
+        reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
+        spi-max-frequency = <10000000>;
+        goodix,hid-report-addr = <0x22c8c>;
+      };
+    };
+
+...
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH v3 2/2] dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property
  2024-11-08 12:03 [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen Charles Wang
  2024-11-08 12:03 ` [PATCH v3 1/2] " Charles Wang
@ 2024-11-08 12:03 ` Charles Wang
  2024-11-08 13:33   ` Rob Herring (Arm)
  2024-11-08 16:13   ` Rob Herring
  2024-11-08 15:11 ` [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen Doug Anderson
  2 siblings, 2 replies; 13+ messages in thread
From: Charles Wang @ 2024-11-08 12:03 UTC (permalink / raw)
  To: krzk, hbarnor, dianders, conor.dooley
  Cc: dmitry.torokhov, jikos, bentiss, linux-input, devicetree,
	linux-kernel, Charles Wang

Since all boards use the same address, drop the goodix,hid-report-addr
property and hardcode it in the driver as a default value.

Signed-off-by: Charles Wang <charles.goodix@gmail.com>
---
 .../devicetree/bindings/input/goodix,gt7986u-spifw.yaml    | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
index 8105b9ce2..c9e346a60 100644
--- a/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
+++ b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
@@ -36,11 +36,6 @@ properties:
   reset-gpios:
     maxItems: 1
 
-  goodix,hid-report-addr:
-    $ref: /schemas/types.yaml#/definitions/uint32
-    description:
-      The register address for retrieving HID report data.
-
   spi-max-frequency: true
 
 required:
@@ -48,7 +43,6 @@ required:
   - reg
   - interrupts
   - reset-gpios
-  - goodix,hid-report-addr
 
 unevaluatedProperties: false
 
@@ -68,7 +62,6 @@ examples:
         interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
         reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
         spi-max-frequency = <10000000>;
-        goodix,hid-report-addr = <0x22c8c>;
       };
     };
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
  2024-11-08 12:03 ` [PATCH v3 1/2] " Charles Wang
@ 2024-11-08 13:33   ` Rob Herring (Arm)
  2024-11-08 15:13     ` Doug Anderson
  2024-11-08 16:10   ` Rob Herring
  1 sibling, 1 reply; 13+ messages in thread
From: Rob Herring (Arm) @ 2024-11-08 13:33 UTC (permalink / raw)
  To: Charles Wang
  Cc: conor.dooley, linux-input, bentiss, linux-kernel, dmitry.torokhov,
	hbarnor, devicetree, dianders, jikos, krzk


On Fri, 08 Nov 2024 20:03:10 +0800, Charles Wang wrote:
> The Goodix GT7986U touch controller report touch data according to the
> HID protocol through the SPI bus. However, it is incompatible with
> Microsoft's HID-over-SPI protocol.
> 
> NOTE: these bindings are distinct from the bindings used with the
> GT7986U when the chip is running I2C firmware. For some background,
> see discussion on the mailing lists in the thread:
> 
> https://lore.kernel.org/r/20241018020815.3098263-2-charles.goodix@gmail.com
> 
> Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> ---
>  .../bindings/input/goodix,gt7986u-spifw.yaml  | 75 +++++++++++++++++++
>  1 file changed, 75 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> 

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

yamllint warnings/errors:
./Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml:16:7: [error] syntax error: mapping values are not allowed here (syntax)

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml: ignoring, error parsing file
./Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml:16:7: mapping values are not allowed in this context
make[2]: *** Deleting file 'Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.example.dts'
Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml:16:7: mapping values are not allowed in this context
make[2]: *** [Documentation/devicetree/bindings/Makefile:26: Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.example.dts] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1442: dt_binding_check] Error 2
make: *** [Makefile:224: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20241108120311.87795-2-charles.goodix@gmail.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

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 after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 2/2] dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property
  2024-11-08 12:03 ` [PATCH v3 2/2] dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property Charles Wang
@ 2024-11-08 13:33   ` Rob Herring (Arm)
  2024-11-08 16:13   ` Rob Herring
  1 sibling, 0 replies; 13+ messages in thread
From: Rob Herring (Arm) @ 2024-11-08 13:33 UTC (permalink / raw)
  To: Charles Wang
  Cc: bentiss, linux-kernel, conor.dooley, hbarnor, krzk, dianders,
	linux-input, dmitry.torokhov, jikos, devicetree


On Fri, 08 Nov 2024 20:03:11 +0800, Charles Wang wrote:
> Since all boards use the same address, drop the goodix,hid-report-addr
> property and hardcode it in the driver as a default value.
> 
> Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> ---
>  .../devicetree/bindings/input/goodix,gt7986u-spifw.yaml    | 7 -------
>  1 file changed, 7 deletions(-)
> 

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:


doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20241108120311.87795-3-charles.goodix@gmail.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

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 after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
  2024-11-08 12:03 [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen Charles Wang
  2024-11-08 12:03 ` [PATCH v3 1/2] " Charles Wang
  2024-11-08 12:03 ` [PATCH v3 2/2] dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property Charles Wang
@ 2024-11-08 15:11 ` Doug Anderson
  2024-11-11  2:22   ` Charles Wang
  2 siblings, 1 reply; 13+ messages in thread
From: Doug Anderson @ 2024-11-08 15:11 UTC (permalink / raw)
  To: Charles Wang
  Cc: krzk, hbarnor, conor.dooley, dmitry.torokhov, jikos, bentiss,
	linux-input, devicetree, linux-kernel

Hi,

On Fri, Nov 8, 2024 at 4:03 AM Charles Wang <charles.goodix@gmail.com> wrote:
>
> The Goodix GT7986U touch controller report touch data according to the
> HID protocol through the SPI bus. However, it is incompatible with
> Microsoft's HID-over-SPI protocol.
>
> The patchset introduces the following two changes:
> 1) Add goodix,gt7986u-spifw.yaml.
> 2) Drop the 'goodix,hid-report-addr' property.
>
> Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> ---
> Changes in v3:
> - Split the commit into two patches.

LOL, this isn't what I meant. You should have one patch adding the
proper bindings, but you need a second patch to _the "driver_. Right
now the driver (AKA the file "drivers/hid/hid-goodix-spi.c" in Linux)
is still looking for "goodix,hid-report-addr". The driver needs to be
updated and that was what I was saying should be patch #2. You'll also
need to fix the driver to update the compatible string it's looking
for.

-Doug

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
  2024-11-08 13:33   ` Rob Herring (Arm)
@ 2024-11-08 15:13     ` Doug Anderson
  2024-11-11  3:03       ` Charles Wang
  0 siblings, 1 reply; 13+ messages in thread
From: Doug Anderson @ 2024-11-08 15:13 UTC (permalink / raw)
  To: Rob Herring (Arm)
  Cc: Charles Wang, conor.dooley, linux-input, bentiss, linux-kernel,
	dmitry.torokhov, hbarnor, devicetree, jikos, krzk

Hi,

On Fri, Nov 8, 2024 at 5:33 AM Rob Herring (Arm) <robh@kernel.org> wrote:
>
>
> On Fri, 08 Nov 2024 20:03:10 +0800, Charles Wang wrote:
> > The Goodix GT7986U touch controller report touch data according to the
> > HID protocol through the SPI bus. However, it is incompatible with
> > Microsoft's HID-over-SPI protocol.
> >
> > NOTE: these bindings are distinct from the bindings used with the
> > GT7986U when the chip is running I2C firmware. For some background,
> > see discussion on the mailing lists in the thread:
> >
> > https://lore.kernel.org/r/20241018020815.3098263-2-charles.goodix@gmail.com
> >
> > Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> > ---
> >  .../bindings/input/goodix,gt7986u-spifw.yaml  | 75 +++++++++++++++++++
> >  1 file changed, 75 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> >
>
> My bot found errors running 'make dt_binding_check' on your patch:
>
> yamllint warnings/errors:
> ./Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml:16:7: [error] syntax error: mapping values are not allowed here (syntax)

FWIW, I think it's objecting to the "NOTE: " in the description
looking like yaml. Maybe just change it to "Note that". It's also a
good idea to get yourself setup to validate your bindings _before_
posting them to the list.

-Doug

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
  2024-11-08 12:03 ` [PATCH v3 1/2] " Charles Wang
  2024-11-08 13:33   ` Rob Herring (Arm)
@ 2024-11-08 16:10   ` Rob Herring
  2024-11-11  3:07     ` Charles Wang
  1 sibling, 1 reply; 13+ messages in thread
From: Rob Herring @ 2024-11-08 16:10 UTC (permalink / raw)
  To: Charles Wang
  Cc: krzk, hbarnor, dianders, conor.dooley, dmitry.torokhov, jikos,
	bentiss, linux-input, devicetree, linux-kernel

On Fri, Nov 08, 2024 at 08:03:10PM +0800, Charles Wang wrote:
> The Goodix GT7986U touch controller report touch data according to the
> HID protocol through the SPI bus. However, it is incompatible with
> Microsoft's HID-over-SPI protocol.
> 
> NOTE: these bindings are distinct from the bindings used with the
> GT7986U when the chip is running I2C firmware. For some background,
> see discussion on the mailing lists in the thread:
> 
> https://lore.kernel.org/r/20241018020815.3098263-2-charles.goodix@gmail.com
> 
> Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> ---
>  .../bindings/input/goodix,gt7986u-spifw.yaml  | 75 +++++++++++++++++++
>  1 file changed, 75 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> 
> diff --git a/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> new file mode 100644
> index 000000000..8105b9ce2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> @@ -0,0 +1,75 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/goodix,gt7986u-spifw.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Goodix GT7986U SPI HID Touchscreen
> +
> +maintainers:
> +  - Charles Wang <charles.goodix@gmail.com>
> +
> +description: Supports the Goodix GT7986U touchscreen.

Move to next line.

> +  This touch controller reports data packaged according to the HID protocol
> +  over the SPI bus, but it is incompatible with Microsoft's HID-over-SPI protocol.
> +

If you want to maintain paragraphs you need '>' or '|' after 
'description:'. IIRC, it has to be '|' due to the "NOTE: " here:

> +  NOTE: these bindings are distinct from the bindings used with the
> +  GT7986U when the chip is running I2C firmware. This is because there's
> +  not a single device that talks over both I2C and SPI but rather
> +  distinct touchscreens that happen to be built with the same ASIC but
> +  that are distinct products running distinct firmware.
> +
> +allOf:
> +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - goodix,gt7986u-spifw
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  reset-gpios:
> +    maxItems: 1
> +
> +  goodix,hid-report-addr:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      The register address for retrieving HID report data.
> +
> +  spi-max-frequency: true
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - reset-gpios
> +  - goodix,hid-report-addr
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/irq.h>
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    spi {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +
> +      touchscreen@0 {
> +        compatible = "goodix,gt7986u-spifw";
> +        reg = <0>;
> +        interrupt-parent = <&gpio>;
> +        interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
> +        reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
> +        spi-max-frequency = <10000000>;
> +        goodix,hid-report-addr = <0x22c8c>;
> +      };
> +    };
> +
> +...
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 2/2] dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property
  2024-11-08 12:03 ` [PATCH v3 2/2] dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property Charles Wang
  2024-11-08 13:33   ` Rob Herring (Arm)
@ 2024-11-08 16:13   ` Rob Herring
  2024-11-11  3:32     ` Charles Wang
  1 sibling, 1 reply; 13+ messages in thread
From: Rob Herring @ 2024-11-08 16:13 UTC (permalink / raw)
  To: Charles Wang
  Cc: krzk, hbarnor, dianders, conor.dooley, dmitry.torokhov, jikos,
	bentiss, linux-input, devicetree, linux-kernel

On Fri, Nov 08, 2024 at 08:03:11PM +0800, Charles Wang wrote:
> Since all boards use the same address, drop the goodix,hid-report-addr
> property and hardcode it in the driver as a default value.

Where's the driver change?

I don't see the point in defining this and then removing it in the next 
patch.

> 
> Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> ---
>  .../devicetree/bindings/input/goodix,gt7986u-spifw.yaml    | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> index 8105b9ce2..c9e346a60 100644
> --- a/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> +++ b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> @@ -36,11 +36,6 @@ properties:
>    reset-gpios:
>      maxItems: 1
>  
> -  goodix,hid-report-addr:
> -    $ref: /schemas/types.yaml#/definitions/uint32
> -    description:
> -      The register address for retrieving HID report data.
> -
>    spi-max-frequency: true
>  
>  required:
> @@ -48,7 +43,6 @@ required:
>    - reg
>    - interrupts
>    - reset-gpios
> -  - goodix,hid-report-addr

Dropping a required property is an ABI break.

A devicetree that passes with the schema will not work on current 
kernels that require this property.

>  
>  unevaluatedProperties: false
>  
> @@ -68,7 +62,6 @@ examples:
>          interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
>          reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
>          spi-max-frequency = <10000000>;
> -        goodix,hid-report-addr = <0x22c8c>;
>        };
>      };
>  
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
  2024-11-08 15:11 ` [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen Doug Anderson
@ 2024-11-11  2:22   ` Charles Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Charles Wang @ 2024-11-11  2:22 UTC (permalink / raw)
  To: Doug Anderson
  Cc: krzk, hbarnor, conor.dooley, dmitry.torokhov, jikos, bentiss,
	linux-input, devicetree, linux-kernel

Hi Doug,

On Fri, Nov 08, 2024 at 07:11:27AM -0800, Doug Anderson wrote:
> Hi,
> 
> On Fri, Nov 8, 2024 at 4:03 AM Charles Wang <charles.goodix@gmail.com> wrote:
> >
> > The Goodix GT7986U touch controller report touch data according to the
> > HID protocol through the SPI bus. However, it is incompatible with
> > Microsoft's HID-over-SPI protocol.
> >
> > The patchset introduces the following two changes:
> > 1) Add goodix,gt7986u-spifw.yaml.
> > 2) Drop the 'goodix,hid-report-addr' property.
> >
> > Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> > ---
> > Changes in v3:
> > - Split the commit into two patches.
> 
> LOL, this isn't what I meant. You should have one patch adding the
> proper bindings, but you need a second patch to _the "driver_. Right
> now the driver (AKA the file "drivers/hid/hid-goodix-spi.c" in Linux)
> is still looking for "goodix,hid-report-addr". The driver needs to be
> updated and that was what I was saying should be patch #2. You'll also
> need to fix the driver to update the compatible string it's looking
> for.
> 

Oops, my apologies for the misunderstanding!

Thanks,
Charles

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
  2024-11-08 15:13     ` Doug Anderson
@ 2024-11-11  3:03       ` Charles Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Charles Wang @ 2024-11-11  3:03 UTC (permalink / raw)
  To: Doug Anderson
  Cc: Charles Wang, conor.dooley, linux-input, bentiss, linux-kernel,
	dmitry.torokhov, hbarnor, devicetree, jikos, krzk

Hi Doug,

On Fri, Nov 08, 2024 at 07:13:53AM -0800, Doug Anderson wrote:
> Hi,
> 
> On Fri, Nov 8, 2024 at 5:33 AM Rob Herring (Arm) <robh@kernel.org> wrote:
> >
> >
> > On Fri, 08 Nov 2024 20:03:10 +0800, Charles Wang wrote:
> > > The Goodix GT7986U touch controller report touch data according to the
> > > HID protocol through the SPI bus. However, it is incompatible with
> > > Microsoft's HID-over-SPI protocol.
> > >
> > > NOTE: these bindings are distinct from the bindings used with the
> > > GT7986U when the chip is running I2C firmware. For some background,
> > > see discussion on the mailing lists in the thread:
> > >
> > > https://lore.kernel.org/r/20241018020815.3098263-2-charles.goodix@gmail.com
> > >
> > > Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> > > ---
> > >  .../bindings/input/goodix,gt7986u-spifw.yaml  | 75 +++++++++++++++++++
> > >  1 file changed, 75 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> > >
> >
> > My bot found errors running 'make dt_binding_check' on your patch:
> >
> > yamllint warnings/errors:
> > ./Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml:16:7: [error] syntax error: mapping values are not allowed here (syntax)
> 
> FWIW, I think it's objecting to the "NOTE: " in the description
> looking like yaml. Maybe just change it to "Note that". It's also a
> good idea to get yourself setup to validate your bindings _before_
> posting them to the list.
> 

Change to 'description: |' fixed the issue.

Thanks,
Charles

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 1/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen
  2024-11-08 16:10   ` Rob Herring
@ 2024-11-11  3:07     ` Charles Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Charles Wang @ 2024-11-11  3:07 UTC (permalink / raw)
  To: Rob Herring
  Cc: krzk, hbarnor, dianders, conor.dooley, dmitry.torokhov, jikos,
	bentiss, linux-input, devicetree, linux-kernel

Hi Rob,

On Fri, Nov 08, 2024 at 10:10:00AM -0600, Rob Herring wrote:
> On Fri, Nov 08, 2024 at 08:03:10PM +0800, Charles Wang wrote:
> > The Goodix GT7986U touch controller report touch data according to the
> > HID protocol through the SPI bus. However, it is incompatible with
> > Microsoft's HID-over-SPI protocol.
> > 
> > NOTE: these bindings are distinct from the bindings used with the
> > GT7986U when the chip is running I2C firmware. For some background,
> > see discussion on the mailing lists in the thread:
> > 
> > https://lore.kernel.org/r/20241018020815.3098263-2-charles.goodix@gmail.com
> > 
> > Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> > ---
> >  .../bindings/input/goodix,gt7986u-spifw.yaml  | 75 +++++++++++++++++++
> >  1 file changed, 75 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> > new file mode 100644
> > index 000000000..8105b9ce2
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> > @@ -0,0 +1,75 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/input/goodix,gt7986u-spifw.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Goodix GT7986U SPI HID Touchscreen
> > +
> > +maintainers:
> > +  - Charles Wang <charles.goodix@gmail.com>
> > +
> > +description: Supports the Goodix GT7986U touchscreen.
> 
> Move to next line.
> 

Ack,

>
> > +  This touch controller reports data packaged according to the HID protocol
> > +  over the SPI bus, but it is incompatible with Microsoft's HID-over-SPI protocol.
> > +
> 
> If you want to maintain paragraphs you need '>' or '|' after 
> 'description:'. IIRC, it has to be '|' due to the "NOTE: " here:
> 

Ack, using '|' works.

Best regars,
Charles

>
> > +  NOTE: these bindings are distinct from the bindings used with the
> > +  GT7986U when the chip is running I2C firmware. This is because there's
> > +  not a single device that talks over both I2C and SPI but rather
> > +  distinct touchscreens that happen to be built with the same ASIC but
> > +  that are distinct products running distinct firmware.
> > +
> > +allOf:
> > +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - goodix,gt7986u-spifw
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  reset-gpios:
> > +    maxItems: 1
> > +
> > +  goodix,hid-report-addr:
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    description:
> > +      The register address for retrieving HID report data.
> > +
> > +  spi-max-frequency: true
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - reset-gpios
> > +  - goodix,hid-report-addr
> > +
> > +unevaluatedProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/irq.h>
> > +    #include <dt-bindings/gpio/gpio.h>
> > +
> > +    spi {
> > +      #address-cells = <1>;
> > +      #size-cells = <0>;
> > +
> > +      touchscreen@0 {
> > +        compatible = "goodix,gt7986u-spifw";
> > +        reg = <0>;
> > +        interrupt-parent = <&gpio>;
> > +        interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
> > +        reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
> > +        spi-max-frequency = <10000000>;
> > +        goodix,hid-report-addr = <0x22c8c>;
> > +      };
> > +    };
> > +
> > +...
> > -- 
> > 2.43.0
> > 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3 2/2] dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property
  2024-11-08 16:13   ` Rob Herring
@ 2024-11-11  3:32     ` Charles Wang
  0 siblings, 0 replies; 13+ messages in thread
From: Charles Wang @ 2024-11-11  3:32 UTC (permalink / raw)
  To: Rob Herring
  Cc: krzk, hbarnor, dianders, conor.dooley, dmitry.torokhov, jikos,
	bentiss, linux-input, devicetree, linux-kernel

Hi Rob,

On Fri, Nov 08, 2024 at 10:13:50AM -0600, Rob Herring wrote:
> On Fri, Nov 08, 2024 at 08:03:11PM +0800, Charles Wang wrote:
> > Since all boards use the same address, drop the goodix,hid-report-addr
> > property and hardcode it in the driver as a default value.
> 
> Where's the driver change?
> 
> I don't see the point in defining this and then removing it in the next 
> patch.
>

Apologies for the confusion. The driver changes will be included in the next version.

>
> > 
> > Signed-off-by: Charles Wang <charles.goodix@gmail.com>
> > ---
> >  .../devicetree/bindings/input/goodix,gt7986u-spifw.yaml    | 7 -------
> >  1 file changed, 7 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> > index 8105b9ce2..c9e346a60 100644
> > --- a/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> > +++ b/Documentation/devicetree/bindings/input/goodix,gt7986u-spifw.yaml
> > @@ -36,11 +36,6 @@ properties:
> >    reset-gpios:
> >      maxItems: 1
> >  
> > -  goodix,hid-report-addr:
> > -    $ref: /schemas/types.yaml#/definitions/uint32
> > -    description:
> > -      The register address for retrieving HID report data.
> > -
> >    spi-max-frequency: true
> >  
> >  required:
> > @@ -48,7 +43,6 @@ required:
> >    - reg
> >    - interrupts
> >    - reset-gpios
> > -  - goodix,hid-report-addr
> 
> Dropping a required property is an ABI break.
> 
> A devicetree that passes with the schema will not work on current 
> kernels that require this property.
> 

Thank you for pointing this out. The next version will include the
necessary driver modifications.

> >  
> >  unevaluatedProperties: false
> >  
> > @@ -68,7 +62,6 @@ examples:
> >          interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
> >          reset-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
> >          spi-max-frequency = <10000000>;
> > -        goodix,hid-report-addr = <0x22c8c>;
> >        };
> >      };
> >  
> > -- 
> > 2.43.0
> > 

Best regards,
Charles

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-11-11  3:33 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 12:03 [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen Charles Wang
2024-11-08 12:03 ` [PATCH v3 1/2] " Charles Wang
2024-11-08 13:33   ` Rob Herring (Arm)
2024-11-08 15:13     ` Doug Anderson
2024-11-11  3:03       ` Charles Wang
2024-11-08 16:10   ` Rob Herring
2024-11-11  3:07     ` Charles Wang
2024-11-08 12:03 ` [PATCH v3 2/2] dt-bindings: input: gt7986u-spifw: Remove hid-report-addr property Charles Wang
2024-11-08 13:33   ` Rob Herring (Arm)
2024-11-08 16:13   ` Rob Herring
2024-11-11  3:32     ` Charles Wang
2024-11-08 15:11 ` [PATCH v3 0/2] dt-bindings: input: Goodix GT7986U SPI HID Touchscreen Doug Anderson
2024-11-11  2:22   ` Charles Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).