Message ID | 20221123061635.32025-2-billy_tsai@aspeedtech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2619410wrr; Tue, 22 Nov 2022 22:20:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf4MpLR/Pw7NEcrxW5DJKK3nbw/frNlhGDnSVAXVRALRe8rAIEjrqo6DkP0dvfi9rB9qZAV7 X-Received: by 2002:a63:ef15:0:b0:477:bac4:549b with SMTP id u21-20020a63ef15000000b00477bac4549bmr1518450pgh.170.1669184417273; Tue, 22 Nov 2022 22:20:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669184417; cv=none; d=google.com; s=arc-20160816; b=EIey+EdB7LvgqHnpS/Lz2sZlFIljQCpYfjcUCK8wDvFDnLj5r0p8g0+ieZC9sle+oe 6WFq0mj8c6uMQJHFZiwWa2utZtsEp33zCBETBq37DVb+5ivjjAseR0BL94Qj33OFc4Cq IxJXmqOJtqlhe3jDMtXIa4mnlv8J/JMAjjSO/Wd00SDGND0g/OHMCDvD+VTJman8gcdU 6YP1rgcfWHJLZUjaZE3Lqzw/k0/66bwAWuPyE3FMHgOhm1MQXWX/1DCpDcEA83AY/rFH rZ2X4xKFRMhobixsqicqTa0+Yyzh8zsCVvPb9ztdLGExkpHYFU9RsRSaUF2uVMtAKSlG +e7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=lOa7gR0xvX8uyt1jI7A5PFBo6I3dvRNUy/dtGq73UuU=; b=D8YPEagkB6cWi5cxUyvr4Rfyiwrsbf0NnrSzTqGaLj3GH7rdyUAD91er2/5zBWGe9m 1Heqw4UVrg6N5fDF96UdgatEcA7nHl+PLut5W2OgxfEOImx5SuW6jyt3qhdy7tkRUszp 25vNDee+47GmBlB2KKA6QOOiMyxJdcgVePZSU0zUlYK/5HXJmso7Ja5HXvmQ028Dyst5 /1XLXi1QC/cHFjrssTxMn0PLV7rXjrRDwTAEfixdY5eeElRSlAv/N6gv4OPB7r8Ae8J0 xBL4hH9A3vbRZe8fCfLwdxhNi9VBx5++2+iOgILN7wOgdkQLfILq0udJY/fXCgwgDaY3 X7aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d139-20020a621d91000000b00540d5753591si14459162pfd.299.2022.11.22.22.20.04; Tue, 22 Nov 2022 22:20:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236093AbiKWGTf (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Wed, 23 Nov 2022 01:19:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236020AbiKWGTT (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 23 Nov 2022 01:19:19 -0500 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AEA05C75B; Tue, 22 Nov 2022 22:19:16 -0800 (PST) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 2AN5pU4I081940; Wed, 23 Nov 2022 13:51:30 +0800 (GMT-8) (envelope-from billy_tsai@aspeedtech.com) Received: from BillyTsai-pc.aspeed.com (192.168.2.149) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 23 Nov 2022 14:15:54 +0800 From: Billy Tsai <billy_tsai@aspeedtech.com> To: <jdelvare@suse.com>, <linux@roeck-us.net>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <joel@jms.id.au>, <andrew@aj.id.au>, <lee@kernel.org>, <thierry.reding@gmail.com>, <u.kleine-koenig@pengutronix.de>, <corbet@lwn.net>, <p.zabel@pengutronix.de>, <billy_tsai@aspeedtech.com>, <linux-hwmon@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-aspeed@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>, <linux-pwm@vger.kernel.org>, <linux-doc@vger.kernel.org> Subject: [v4 1/5] dt-bindings: mfd: Add aspeed pwm-tach binding Date: Wed, 23 Nov 2022 14:16:31 +0800 Message-ID: <20221123061635.32025-2-billy_tsai@aspeedtech.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221123061635.32025-1-billy_tsai@aspeedtech.com> References: <20221123061635.32025-1-billy_tsai@aspeedtech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.149] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 2AN5pU4I081940 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750266719104322281?= X-GMAIL-MSGID: =?utf-8?q?1750266719104322281?= |
Series |
Support pwm/tach driver for aspeed ast26xx
|
|
Commit Message
Billy Tsai
Nov. 23, 2022, 6:16 a.m. UTC
Add device binding for aspeed pwm-tach device which is a multi-function
device include pwm and tach function.
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
.../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
Comments
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 <billy_tsai@aspeedtech.com> > --- > .../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 <billy_tsai@aspeedtech.com> > + > +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
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 <billy_tsai@aspeedtech.com> >> --- >> .../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 <billy_tsai@aspeedtech.com> >> + >> +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
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 <billy_tsai@aspeedtech.com> > --- > .../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/20221123061635.32025-2-billy_tsai@aspeedtech.com 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.
On 2022/11/23, 4:27 PM, "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org> 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 <billy_tsai@aspeedtech.com> > >> --- > >> .../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 <billy_tsai@aspeedtech.com> > >> + > >> +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
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
On 2022/12/9, 3:48 PM, "Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org <mailto:krzysztof.kozlowski@linaro.org>> 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
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
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
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 <billy_tsai@aspeedtech.com> + +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>; + }; + };