[PATCH v7 2/3] dt-bindings: iio: proximity: Add TYHX HX9023S

Yasin Lee posted 3 patches 1 year, 5 months ago
There is a newer version of this series
[PATCH v7 2/3] dt-bindings: iio: proximity: Add TYHX HX9023S
Posted by Yasin Lee 1 year, 5 months ago
A capacitive proximity sensor

Acked-by: Conor Dooley <conor@kernel.org>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reported-by: "Rob Herring (Arm)" <robh@kernel.org>
Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
---
 .../bindings/iio/proximity/tyhx,hx9023s.yaml       | 107 +++++++++++++++++++++
 1 file changed, 107 insertions(+)

diff --git a/Documentation/devicetree/bindings/iio/proximity/tyhx,hx9023s.yaml b/Documentation/devicetree/bindings/iio/proximity/tyhx,hx9023s.yaml
new file mode 100644
index 000000000000..6f338308664c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/proximity/tyhx,hx9023s.yaml
@@ -0,0 +1,107 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/proximity/tyhx,hx9023s.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TYHX HX9023S capacitive proximity sensor
+
+maintainers:
+  - Yasin Lee <yasin.lee.x@gmail.com>
+
+description: |
+  TYHX HX9023S proximity sensor. Datasheet can be found here:
+    http://www.tianyihexin.com/ueditor/php/upload/file/20240614/1718336303992081.pdf
+
+properties:
+  compatible:
+    const: tyhx,hx9023s
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    description:
+      Generated by device to announce preceding read request has finished
+      and data is available or that a close/far proximity event has happened.
+    maxItems: 1
+
+  vdd-supply: true
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  "^channel@[0-4]$":
+    $ref: /schemas/iio/adc/adc.yaml
+    type: object
+
+    properties:
+      reg:
+        minimum: 0
+        maximum: 4
+        description: The channel number.
+
+      single-channel: true
+
+      diff-channels: true
+
+    oneOf:
+      - required:
+          - single-channel
+      - required:
+          - diff-channels
+
+    required:
+      - reg
+
+    additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - vdd-supply
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      proximity@2a {
+        compatible = "tyhx,hx9023s";
+        reg = <0x2a>;
+        interrupt-parent = <&pio>;
+        interrupts = <16 IRQ_TYPE_EDGE_FALLING>;
+        vdd-supply = <&pp1800_prox>;
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        channel@0 {
+          reg = <0>;
+          single-channel = <0>;
+        };
+        channel@1 {
+          reg = <1>;
+          single-channel = <1>;
+        };
+        channel@2 {
+          reg = <2>;
+          single-channel = <2>;
+        };
+        channel@3 {
+          reg = <3>;
+          diff-channels = <1 0>;
+        };
+        channel@4 {
+          reg = <4>;
+          diff-channels = <2 0>;
+        };
+      };
+    };

-- 
2.25.1

Re: [PATCH v7 2/3] dt-bindings: iio: proximity: Add TYHX HX9023S
Posted by Krzysztof Kozlowski 1 year, 5 months ago
On 25/06/2024 04:15, Yasin Lee wrote:
> A capacitive proximity sensor
> 
> Acked-by: Conor Dooley <conor@kernel.org>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

What? How did this happen? Where - provide lore links to prove it?

NAK

> Reported-by: "Rob Herring (Arm)" <robh@kernel.org>

No, drop.

> Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>


> +
> +patternProperties:
> +  "^channel@[0-4]$":
> +    $ref: /schemas/iio/adc/adc.yaml
> +    type: object
> +
> +    properties:
> +      reg:
> +        minimum: 0
> +        maximum: 4
> +        description: The channel number.
> +
> +      single-channel: true
> +
> +      diff-channels: true
> +
> +    oneOf:
> +      - required:
> +          - single-channel
> +      - required:
> +          - diff-channels
> +
> +    required:
> +      - reg

... and now you should see that you duplicated adc.yaml. This should be
just:

+patternProperties:
+  "^channel@[0-4]$":
+    $ref: /schemas/iio/adc/adc.yaml
+    type: object
+    unevaluatedProperties: false
+
+    properties:
+      reg:
+        minimum: 0
+        maximum: 4
+        description: The channel number.



Best regards,
Krzysztof

Re: [PATCH v7 2/3] dt-bindings: iio: proximity: Add TYHX HX9023S
Posted by Yasin Lee 1 year, 5 months ago
On 2024/6/25 13:48, Krzysztof Kozlowski wrote:
> On 25/06/2024 04:15, Yasin Lee wrote:
>> A capacitive proximity sensor
>>
>> Acked-by: Conor Dooley <conor@kernel.org>
>> Acked-by: Jonathan Cameron <jic23@kernel.org>
>> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> What? How did this happen? Where - provide lore links to prove it?
>
> NAK
>

My mistake.  I will remove all of them.


>> Reported-by: "Rob Herring (Arm)" <robh@kernel.org>
> No, drop.


Got it.


>
>> Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
>
>> +
>> +patternProperties:
>> +  "^channel@[0-4]$":
>> +    $ref: /schemas/iio/adc/adc.yaml
>> +    type: object
>> +
>> +    properties:
>> +      reg:
>> +        minimum: 0
>> +        maximum: 4
>> +        description: The channel number.
>> +
>> +      single-channel: true
>> +
>> +      diff-channels: true
>> +
>> +    oneOf:
>> +      - required:
>> +          - single-channel
>> +      - required:
>> +          - diff-channels
>> +
>> +    required:
>> +      - reg
> ... and now you should see that you duplicated adc.yaml. This should be
> just:
>
> +patternProperties:
> +  "^channel@[0-4]$":
> +    $ref: /schemas/iio/adc/adc.yaml
> +    type: object
> +    unevaluatedProperties: false
> +
> +    properties:
> +      reg:
> +        minimum: 0
> +        maximum: 4
> +        description: The channel number.
>
>
>
> Best regards,
> Krzysztof


Hi Krzysztof,

Thanks for your reply.

I have done the verification. "single-channel: true"and "diff-channels: 
true" are necessary. Removing them will cause dt_binding_check to report 
an error. Only oneOf can be removed. The de-duplicated code is as follows:

patternProperties:
   "^channel@[0-4]$":
     $ref: /schemas/iio/adc/adc.yaml
     type: object
     unevaluatedProperties: false

     properties:
       reg:
         minimum: 0
         maximum: 4
         description: The channel number.

       single-channel: true

       diff-channels: true

     required:
       - reg

     additionalProperties: false


Best regards,

Yasin

Re: [PATCH v7 2/3] dt-bindings: iio: proximity: Add TYHX HX9023S
Posted by Conor Dooley 1 year, 5 months ago
On Tue, Jun 25, 2024 at 07:48:52AM +0200, Krzysztof Kozlowski wrote:
> On 25/06/2024 04:15, Yasin Lee wrote:
> > A capacitive proximity sensor
> > 
> > Acked-by: Conor Dooley <conor@kernel.org>

And I _never_ provide tags with my kernel.org address in them, so this
didn't happen either :)

> > Acked-by: Jonathan Cameron <jic23@kernel.org>
> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> What? How did this happen? Where - provide lore links to prove it?
> 
> NAK
> 
> > Reported-by: "Rob Herring (Arm)" <robh@kernel.org>
> 
> No, drop.
> 
> > Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
Re: [PATCH v7 2/3] dt-bindings: iio: proximity: Add TYHX HX9023S
Posted by Yasin Lee 1 year, 5 months ago
On 2024/6/25 14:53, Conor Dooley wrote:
> On Tue, Jun 25, 2024 at 07:48:52AM +0200, Krzysztof Kozlowski wrote:
>> On 25/06/2024 04:15, Yasin Lee wrote:
>>> A capacitive proximity sensor
>>>
>>> Acked-by: Conor Dooley <conor@kernel.org>
> And I _never_ provide tags with my kernel.org address in them, so this
> didn't happen either :)
>

Sorry,  I misunderstood the meaning of these tags. I will remove all of 
them.


>>> Acked-by: Jonathan Cameron <jic23@kernel.org>
>>> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> What? How did this happen? Where - provide lore links to prove it?
>>
>> NAK
>>
>>> Reported-by: "Rob Herring (Arm)" <robh@kernel.org>
>> No, drop.
>>
>>> Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
Re: [PATCH v7 2/3] dt-bindings: iio: proximity: Add TYHX HX9023S
Posted by Rob Herring (Arm) 1 year, 5 months ago
On Tue, 25 Jun 2024 10:15:11 +0800, Yasin Lee wrote:
> A capacitive proximity sensor
> 
> Acked-by: Conor Dooley <conor@kernel.org>
> Acked-by: Jonathan Cameron <jic23@kernel.org>
> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Reported-by: "Rob Herring (Arm)" <robh@kernel.org>
> Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
> ---
>  .../bindings/iio/proximity/tyhx,hx9023s.yaml       | 107 +++++++++++++++++++++
>  1 file changed, 107 insertions(+)
> 

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/proximity/tyhx,hx9023s.yaml: single-channel: missing type definition

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240625-add-tyhx-hx9023s-sensor-driver-v7-2-b1d65b221811@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.

Re: [PATCH v7 2/3] dt-bindings: iio: proximity: Add TYHX HX9023S
Posted by Yasin Lee 1 year, 5 months ago
On 2024/6/25 11:48, Rob Herring (Arm) wrote:
> On Tue, 25 Jun 2024 10:15:11 +0800, Yasin Lee wrote:
>> A capacitive proximity sensor
>>
>> Acked-by: Conor Dooley <conor@kernel.org>
>> Acked-by: Jonathan Cameron <jic23@kernel.org>
>> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Reported-by: "Rob Herring (Arm)" <robh@kernel.org>
>> Signed-off-by: Yasin Lee <yasin.lee.x@gmail.com>
>> ---
>>   .../bindings/iio/proximity/tyhx,hx9023s.yaml       | 107 +++++++++++++++++++++
>>   1 file changed, 107 insertions(+)
>>
> My bot found errors running 'make dt_binding_check' on your patch:
>
> yamllint warnings/errors:
>
> dtschema/dtc warnings/errors:
> /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/proximity/tyhx,hx9023s.yaml: single-channel: missing type definition
>
> doc reference errors (make refcheckdocs):
>
> See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240625-add-tyhx-hx9023s-sensor-driver-v7-2-b1d65b221811@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.

Hi Conor,

Thanks for your reply.

The testing for this version needs to be based on the linux-next branch 
because the referenced `single-channel` only exists in linux-next.

Best regards,

Yasin