2022-11-23 06:43:29

by Billy Tsai

[permalink] [raw]
Subject: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding

Add device binding for aspeed pwm-tach device which is a multi-function
device include pwm and tach function.

Signed-off-by: Billy Tsai <[email protected]>
---
.../bindings/mfd/aspeed,ast2600-pwm-tach.yaml | 73 +++++++++++++++++++
1 file changed, 73 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml

diff --git a/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml b/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
new file mode 100644
index 000000000000..e2a7be2e0a18
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
@@ -0,0 +1,73 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright (C) 2021 Aspeed, Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/aspeed,ast2600-pwm-tach.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: PWM Tach controller
+
+description: |
+ The PWM Tach controller is represented as a multi-function device which
+ includes:
+ PWM
+ Tach
+
+maintainers:
+ - Billy Tsai <[email protected]>
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - aspeed,ast2600-pwm-tach
+ - const: syscon
+ - const: simple-mfd
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ pwm:
+ type: object
+ $ref: "/schemas/pwm/aspeed,ast2600-pwm.yaml"
+
+ tach:
+ type: object
+ $ref: "/schemas/hwmon/aspeed,ast2600-tach.yaml"
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - resets
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/ast2600-clock.h>
+ pwm_tach: pwm-tach@1e610000 {
+ compatible = "aspeed,ast2600-pwm-tach", "syscon", "simple-mfd";
+ reg = <0x1e610000 0x100>;
+ clocks = <&syscon ASPEED_CLK_AHB>;
+ resets = <&syscon ASPEED_RESET_PWM>;
+
+ pwm: pwm {
+ compatible = "aspeed,ast2600-pwm";
+ #pwm-cells = <3>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pwm0_default>;
+ };
+
+ tach: tach {
+ compatible = "aspeed,ast2600-tach";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_tach0_default>;
+ };
+ };
--
2.25.1


2022-11-23 09:56:00

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding

On 23/11/2022 07:16, Billy Tsai wrote:
> Add device binding for aspeed pwm-tach device which is a multi-function
> device include pwm and tach function.

Subject: drop second, redundant "bindings".
Also use proper PATCH prefix.

>
> Signed-off-by: Billy Tsai <[email protected]>
> ---
> .../bindings/mfd/aspeed,ast2600-pwm-tach.yaml | 73 +++++++++++++++++++
> 1 file changed, 73 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
>
> diff --git a/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml b/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
> new file mode 100644
> index 000000000000..e2a7be2e0a18
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
> @@ -0,0 +1,73 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright (C) 2021 Aspeed, Inc.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/aspeed,ast2600-pwm-tach.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: PWM Tach controller
> +
> +description: |
> + The PWM Tach controller is represented as a multi-function device which
> + includes:
> + PWM
> + Tach
> +
> +maintainers:
> + - Billy Tsai <[email protected]>
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - aspeed,ast2600-pwm-tach
> + - const: syscon
> + - const: simple-mfd
> +
> + reg:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 1
> +
> + resets:
> + maxItems: 1

If this is simple-mfd then it cannot take clocks or resets. Usually the
recommendation for such case is: This is not simple-mfd, drop it. Drop
also syscon and make a proper device.

However I am surprised to see such change, so I have no clue why this
was done.

> +
> + pwm:
> + type: object
> + $ref: "/schemas/pwm/aspeed,ast2600-pwm.yaml"

Drop quotes.

There is no such file. Are you sure you ordered the patches correctly?

> +
> + tach:
> + type: object
> + $ref: "/schemas/hwmon/aspeed,ast2600-tach.yaml"

Drop quotes.

There is no such file.

> +
> +required:
> + - compatible
> + - reg
> + - clocks
> + - resets

Best regards,
Krzysztof

2022-11-23 10:28:12

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding

On 23/11/2022 09:24, Krzysztof Kozlowski wrote:
> On 23/11/2022 07:16, Billy Tsai wrote:
>> Add device binding for aspeed pwm-tach device which is a multi-function
>> device include pwm and tach function.
>
> Subject: drop second, redundant "bindings".
> Also use proper PATCH prefix.
>
>>
>> Signed-off-by: Billy Tsai <[email protected]>
>> ---
>> .../bindings/mfd/aspeed,ast2600-pwm-tach.yaml | 73 +++++++++++++++++++
>> 1 file changed, 73 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml b/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
>> new file mode 100644
>> index 000000000000..e2a7be2e0a18
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
>> @@ -0,0 +1,73 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +# Copyright (C) 2021 Aspeed, Inc.
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/mfd/aspeed,ast2600-pwm-tach.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: PWM Tach controller
>> +
>> +description: |
>> + The PWM Tach controller is represented as a multi-function device which
>> + includes:
>> + PWM
>> + Tach
>> +
>> +maintainers:
>> + - Billy Tsai <[email protected]>
>> +
>> +properties:
>> + compatible:
>> + items:
>> + - enum:
>> + - aspeed,ast2600-pwm-tach
>> + - const: syscon
>> + - const: simple-mfd
>> +
>> + reg:
>> + maxItems: 1
>> +
>> + clocks:
>> + maxItems: 1
>> +
>> + resets:
>> + maxItems: 1
>
> If this is simple-mfd then it cannot take clocks or resets. Usually the
> recommendation for such case is: This is not simple-mfd, drop it. Drop
> also syscon and make a proper device.
>
> However I am surprised to see such change, so I have no clue why this
> was done.

Actually now I see it was like that in previous patch, I just missed it
during previous review. Anyway this must be fixed.

Best regards,
Krzysztof

2022-11-23 15:11:11

by Rob Herring

[permalink] [raw]
Subject: Re: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding


On Wed, 23 Nov 2022 14:16:31 +0800, Billy Tsai wrote:
> Add device binding for aspeed pwm-tach device which is a multi-function
> device include pwm and tach function.
>
> Signed-off-by: Billy Tsai <[email protected]>
> ---
> .../bindings/mfd/aspeed,ast2600-pwm-tach.yaml | 73 +++++++++++++++++++
> 1 file changed, 73 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.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:
./Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml: Unable to find schema file matching $id: http://devicetree.org/schemas/pwm/aspeed,ast2600-pwm.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.example.dtb: pwm-tach@1e610000: pwm: False schema does not allow {'compatible': ['aspeed,ast2600-pwm'], '#pwm-cells': [[3]], 'pinctrl-names': ['default'], 'pinctrl-0': [[4294967295]]}
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.example.dtb: pwm-tach@1e610000: tach: False schema does not allow {'compatible': ['aspeed,ast2600-tach'], 'pinctrl-names': ['default'], 'pinctrl-0': [[4294967295]]}
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.example.dtb:0:0: /example-0/pwm-tach@1e610000/pwm: failed to match any schema with compatible: ['aspeed,ast2600-pwm']
Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.example.dtb:0:0: /example-0/pwm-tach@1e610000/tach: failed to match any schema with compatible: ['aspeed,ast2600-tach']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

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.

2022-12-09 01:21:40

by Billy Tsai

[permalink] [raw]
Subject: Re: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding

On 2022/11/23, 4:27 PM, "Krzysztof Kozlowski" <[email protected]> wrote:

On 23/11/2022 09:24, Krzysztof Kozlowski wrote:
> > On 23/11/2022 07:16, Billy Tsai wrote:
> >> Add device binding for aspeed pwm-tach device which is a multi-function
> >> device include pwm and tach function.
> >
> > Subject: drop second, redundant "bindings".
> > Also use proper PATCH prefix.
> >
> >>
> >> Signed-off-by: Billy Tsai <[email protected]>
> >> ---
> >> .../bindings/mfd/aspeed,ast2600-pwm-tach.yaml | 73 +++++++++++++++++++
> >> 1 file changed, 73 insertions(+)
> >> create mode 100644 Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
> >>
> >> diff --git a/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml b/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
> >> new file mode 100644
> >> index 000000000000..e2a7be2e0a18
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
> >> @@ -0,0 +1,73 @@
> >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> >> +# Copyright (C) 2021 Aspeed, Inc.
> >> +%YAML 1.2
> >> +---
> >> +$id: http://devicetree.org/schemas/mfd/aspeed,ast2600-pwm-tach.yaml#
> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >> +
> >> +title: PWM Tach controller
> >> +
> >> +description: |
> >> + The PWM Tach controller is represented as a multi-function device which
> >> + includes:
> >> + PWM
> >> + Tach
> >> +
> >> +maintainers:
> >> + - Billy Tsai <[email protected]>
> >> +
> >> +properties:
> >> + compatible:
> >> + items:
> >> + - enum:
> >> + - aspeed,ast2600-pwm-tach
> >> + - const: syscon
> >> + - const: simple-mfd
> >> +
> >> + reg:
> >> + maxItems: 1
> >> +
> >> + clocks:
> >> + maxItems: 1
> >> +
> >> + resets:
> >> + maxItems: 1
> >
> > If this is simple-mfd then it cannot take clocks or resets. Usually the
> > recommendation for such case is: This is not simple-mfd, drop it. Drop
> > also syscon and make a proper device.
> >
> > However I am surprised to see such change, so I have no clue why this
> > was done.

> Actually now I see it was like that in previous patch, I just missed it
> during previous review. Anyway this must be fixed.

I have two module (PWM and TACH) but share with the same base address,
The PWM will use the offset (N*0x10) + 0x0 and 0x04.
The TACH will use the offset (N*0x10) + 0x8 and 0x0c.
The range of the N is 0~15.
Can you give me some advice to fix this problem without using simple-mfd?

Thanks

Best Regards,
Billy Tsai


2022-12-09 08:09:19

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding

On 09/12/2022 01:54, Billy Tsai wrote:
> > > However I am surprised to see such change, so I have no clue why this
> > > was done.
>
> > Actually now I see it was like that in previous patch, I just missed it
> > during previous review. Anyway this must be fixed.
>
> I have two module (PWM and TACH) but share with the same base address,
> The PWM will use the offset (N*0x10) + 0x0 and 0x04.
> The TACH will use the offset (N*0x10) + 0x8 and 0x0c.
> The range of the N is 0~15.
> Can you give me some advice to fix this problem without using simple-mfd?


Use regular driver which populates children.

Best regards,
Krzysztof

2023-01-06 03:49:41

by Billy Tsai

[permalink] [raw]
Subject: Re: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding

On 2022/12/9, 3:48 PM, "Krzysztof Kozlowski" <[email protected] <mailto:[email protected]>> wrote:


On 09/12/2022 01:54, Billy Tsai wrote:
> > > > However I am surprised to see such change, so I have no clue why this
> > > > was done.
> >
> > > Actually now I see it was like that in previous patch, I just missed it
> > > during previous review. Anyway this must be fixed.
> >
> > I have two module (PWM and TACH) but share with the same base address,
> > The PWM will use the offset (N*0x10) + 0x0 and 0x04.
> > The TACH will use the offset (N*0x10) + 0x8 and 0x0c.
> > The range of the N is 0~15.
> > Can you give me some advice to fix this problem without using simple-mfd?


> Use regular driver which populates children.

I think that my scenario meets the definition in mfd.txt:
- A range of memory registers containing "miscellaneous system registers" also
known as a system controller "syscon" or any other memory range containing a
mix of unrelated hardware devices.
Can you tell me the considerations for not using simple-mfd?

Thanks

Best Regards,
Billy Tsai



2023-06-08 07:12:57

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding

On 23/11/2022 09:24, Krzysztof Kozlowski wrote:
> On 23/11/2022 07:16, Billy Tsai wrote:
>> Add device binding for aspeed pwm-tach device which is a multi-function
>> device include pwm and tach function.
>
> Subject: drop second, redundant "bindings".

Where did you implement this comment in your v6?

> Also use proper PATCH prefix.

Where did you implement this comment in your v6?

>


Best regards,
Krzysztof


2023-06-08 07:31:38

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding

On 08/06/2023 09:15, Billy Tsai wrote:
> On 23/11/2022 09:24, Krzysztof Kozlowski wrote:
> >> On 23/11/2022 07:16, Billy Tsai wrote:
> >>> Add device binding for aspeed pwm-tach device which is a multi-function
> >>> device include pwm and tach function.
> >>
> >> Subject: drop second, redundant "bindings".
>
> > Where did you implement this comment in your v6?
>
> Sorry, I guess by "Subject: drop second, redundant "bindings"" you meant to remove the second "bindings" string from my subject. So I change the subject from "dt-bindings: hwmon: Add bindings for aspeed tach controller" and "dt-bindings: pwm: Add bindings for aspeed pwm controller" in v4 to "dt-bindings: hwmon: Add ASPEED TACH Control documentation" and "dt-bindings: pwm: Add ASPEED PWM Control documentation" in v6.

A nit, subject: drop second/last, redundant "documentation". The
"dt-bindings" prefix is already stating that these are bindings and
documentation.

> If I have misunderstood your comment, please let me know.

You replaced one redundant with other redundant. I only asked to drop
it, not replace it.


Best regards,
Krzysztof