diff mbox series

[V3,3/5] dt-bindings: i2c: add bindings for Loongson LS2X I2C

Message ID 57339e73b6c0bfe446e19a7f55a48b7ca640b9ec.1669359515.git.zhoubinbin@loongson.cn
State Superseded
Headers show
Series i2c: ls2x: Add support for the Loongson-2K/LS7A I2C controller | expand

Commit Message

Binbin Zhou Nov. 25, 2022, 8:54 a.m. UTC
Add device tree bindings for the i2c controller on the Loongson-2K Soc
or Loongosn LS7A bridge.

Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
---
 .../bindings/i2c/loongson,ls2x-i2c.yaml       | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml

Comments

Rob Herring (Arm) Nov. 26, 2022, 10:25 p.m. UTC | #1
On Fri, 25 Nov 2022 16:54:13 +0800, Binbin Zhou wrote:
> Add device tree bindings for the i2c controller on the Loongson-2K Soc
> or Loongosn LS7A bridge.
> 
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  .../bindings/i2c/loongson,ls2x-i2c.yaml       | 48 +++++++++++++++++++
>  1 file changed, 48 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.example.dtb: i2c@1fe21000: reg: [[0, 534908928], [0, 8]] is too long
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.example.dtb: i2c@1fe21000: Unevaluated properties are not allowed ('reg' was unexpected)
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/57339e73b6c0bfe446e19a7f55a48b7ca640b9ec.1669359515.git.zhoubinbin@loongson.cn

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 after running the above command.
Krzysztof Kozlowski Nov. 27, 2022, 8:49 p.m. UTC | #2
On 25/11/2022 09:54, Binbin Zhou wrote:
> Add device tree bindings for the i2c controller on the Loongson-2K Soc
> or Loongosn LS7A bridge.

It's a v3 which is for the first time sent to DT maintainers...

Subject: drop second, redundant "bindings for".

> 
> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
> ---
>  .../bindings/i2c/loongson,ls2x-i2c.yaml       | 48 +++++++++++++++++++
>  1 file changed, 48 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
> 
> diff --git a/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml b/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
> new file mode 100644
> index 000000000000..8c785f329d2f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
> @@ -0,0 +1,48 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: "http://devicetree.org/schemas/i2c/loongson,ls2x-i2c.yaml#"
> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"

Drop quotes form both.

> +
> +title: Loongson LS2X I2C Controller
> +
> +maintainers:
> +  - Binbin Zhou <zhoubinbin@loongson.cn>
> +
> +allOf:
> +  - $ref: /schemas/i2c/i2c-controller.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - loongson,ls2k-i2c # Loongson-2K SoCs
> +      - loongson,ls7a-i2c # Loongson LS7A Bridge

Isn't your comment exactly the same as compatible? Where is the
difference? I propose to drop the comment entirely, unless it explains
something.

> +
> +  reg:
> +    maxItems: 1
> +

No clocks? I2C controller without clocks? Are you sure the binding is
complete?

> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +

Best regards,
Krzysztof
Krzysztof Kozlowski Nov. 27, 2022, 8:50 p.m. UTC | #3
On 25/11/2022 09:54, Binbin Zhou wrote:
> Add device tree bindings for the i2c controller on the Loongson-2K Soc
> or Loongosn LS7A bridge.
> 

...


> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    i2c@1fe21000 {
> +        compatible = "loongson,ls2k-i2c";
> +        reg = <0 0x1fe21000 0 0x8>;

Plus what the Rob's robot told you - code testing examples uses 1 for
address/size cells.

Please run `make dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).

Best regards,
Krzysztof
Binbin Zhou Nov. 28, 2022, 12:24 p.m. UTC | #4
Hi Krzysztof:

在 2022/11/28 04:49, Krzysztof Kozlowski 写道:
> On 25/11/2022 09:54, Binbin Zhou wrote:
>> Add device tree bindings for the i2c controller on the Loongson-2K Soc
>> or Loongosn LS7A bridge.
> It's a v3 which is for the first time sent to DT maintainers...
Sorry, it was my mistake, I didn't double check the mail recipients in 
my .git/config.
>
> Subject: drop second, redundant "bindings for".

Ok. I get it.


>
>> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
>> ---
>>   .../bindings/i2c/loongson,ls2x-i2c.yaml       | 48 +++++++++++++++++++
>>   1 file changed, 48 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml b/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
>> new file mode 100644
>> index 000000000000..8c785f329d2f
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
>> @@ -0,0 +1,48 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: "http://devicetree.org/schemas/i2c/loongson,ls2x-i2c.yaml#"
>> +$schema: "http://devicetree.org/meta-schemas/core.yaml#"
> Drop quotes form both.
>
>> +
>> +title: Loongson LS2X I2C Controller
>> +
>> +maintainers:
>> +  - Binbin Zhou <zhoubinbin@loongson.cn>
>> +
>> +allOf:
>> +  - $ref: /schemas/i2c/i2c-controller.yaml#
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - loongson,ls2k-i2c # Loongson-2K SoCs
>> +      - loongson,ls7a-i2c # Loongson LS7A Bridge
> Isn't your comment exactly the same as compatible? Where is the
> difference? I propose to drop the comment entirely, unless it explains
> something.

OK, I will drop the useless comment.

>> +
>> +  reg:
>> +    maxItems: 1
>> +
> No clocks? I2C controller without clocks? Are you sure the binding is
> complete?

We previously set the default CLOCK in the driver. Of course, we also 
provide the path to read the clock-frequency field for redo. In any 
case, I will add the clock-frequency field to the V4 patchset.

Thanks for your review.

Binbin


>
>> +  interrupts:
>> +    maxItems: 1
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - interrupts
>> +
> Best regards,
> Krzysztof
Krzysztof Kozlowski Nov. 28, 2022, 12:37 p.m. UTC | #5
On 28/11/2022 13:24, Binbin Zhou wrote:

> 
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>> No clocks? I2C controller without clocks? Are you sure the binding is
>> complete?
> 
> We previously set the default CLOCK in the driver. Of course, we also 
> provide the path to read the clock-frequency field for redo. In any 
> case, I will add the clock-frequency field to the V4 patchset.

I am not thinking here about the driver. What your bindings said, is
that device does not have any clocks and I have doubts about it...

I also do not say anything about clock-frequency because it is already
there via i2c-controller.yaml.

Best regards,
Krzysztof
Krzysztof Kozlowski Nov. 28, 2022, 2:15 p.m. UTC | #6
On 28/11/2022 13:24, Binbin Zhou wrote:
> Hi Krzysztof:
> 
> 在 2022/11/28 04:49, Krzysztof Kozlowski 写道:
>> On 25/11/2022 09:54, Binbin Zhou wrote:
>>> Add device tree bindings for the i2c controller on the Loongson-2K Soc
>>> or Loongosn LS7A bridge.
>> It's a v3 which is for the first time sent to DT maintainers...
> Sorry, it was my mistake, I didn't double check the mail recipients in 
> my .git/config.
>>
>> Subject: drop second, redundant "bindings for".
> 
> Ok. I get it.

Actually, sending bindings and patches for same devices is a waste of
everyone's time:
https://lore.kernel.org/all/20221117075938.23379-2-zhuyinbo@loongson.cn/

Get your upstream process synchronized. Perform reviews on each other
patches, check mailing lists.

Best regards,
Krzysztof
Binbin Zhou Nov. 29, 2022, 1:24 p.m. UTC | #7
在 2022/11/28 22:15, Krzysztof Kozlowski 写道:
> On 28/11/2022 13:24, Binbin Zhou wrote:
>> Hi Krzysztof:
>>
>> 在 2022/11/28 04:49, Krzysztof Kozlowski 写道:
>>> On 25/11/2022 09:54, Binbin Zhou wrote:
>>>> Add device tree bindings for the i2c controller on the Loongson-2K Soc
>>>> or Loongosn LS7A bridge.
>>> It's a v3 which is for the first time sent to DT maintainers...
>> Sorry, it was my mistake, I didn't double check the mail recipients in
>> my .git/config.
>>> Subject: drop second, redundant "bindings for".
>> Ok. I get it.
> Actually, sending bindings and patches for same devices is a waste of
> everyone's time:
> https://lore.kernel.org/all/20221117075938.23379-2-zhuyinbo@loongson.cn/
>
> Get your upstream process synchronized. Perform reviews on each other
> patches, check mailing lists.

Hi:

Through communication with Yinbo offline, I will continue the series of 
patch set submissions.

There is his reply:

https://lore.kernel.org/all/2e10ae64-3c91-ccf8-a970-eb6e3371b948@loongson.cn/

Thanks.

Binbin

>
> Best regards,
> Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml b/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
new file mode 100644
index 000000000000..8c785f329d2f
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/loongson,ls2x-i2c.yaml
@@ -0,0 +1,48 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/i2c/loongson,ls2x-i2c.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Loongson LS2X I2C Controller
+
+maintainers:
+  - Binbin Zhou <zhoubinbin@loongson.cn>
+
+allOf:
+  - $ref: /schemas/i2c/i2c-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - loongson,ls2k-i2c # Loongson-2K SoCs
+      - loongson,ls7a-i2c # Loongson LS7A Bridge
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c@1fe21000 {
+        compatible = "loongson,ls2k-i2c";
+        reg = <0 0x1fe21000 0 0x8>;
+        interrupts = <22>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        eeprom@57{
+            compatible = "atmel,24c16";
+            reg = <0x57>;
+            pagesize = <16>;
+        };
+    };