mbox series

[0/4] Support pwm driver for aspeed ast26xx

Message ID 20210412095457.15095-1-billy_tsai@aspeedtech.com
Headers show
Series Support pwm driver for aspeed ast26xx | expand

Message

Billy Tsai April 12, 2021, 9:54 a.m. UTC
The legacy driver of aspeed pwm is binding with tach controller and it
doesn't follow the pwm framworks usage. In addition, the pwm register
usage of the 6th generation of ast26xx has drastic change. So these
patch serials add the new aspeed pwm driver to fix up the problem above.

Billy Tsai (4):
  dt-bindings: Add bindings for aspeed pwm-tach.
  dt-bindings: Add bindings for aspeed pwm
  pwm: Add Aspeed ast2600 PWM support
  pwm: Add support for aspeed pwm controller

 .../bindings/mfd/aspeed,ast2600-pwm-tach.yaml |  52 ++++
 .../bindings/pwm/aspeed,ast2600-pwm.yaml      |  47 +++
 drivers/pwm/Kconfig                           |   6 +
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-aspeed-g6.c                   | 291 ++++++++++++++++++
 5 files changed, 397 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/aspeed,ast2600-pwm-tach.yaml
 create mode 100644 Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml
 create mode 100644 drivers/pwm/pwm-aspeed-g6.c

Comments

Uwe Kleine-König April 12, 2021, 11:14 a.m. UTC | #1
Hello,

On Mon, Apr 12, 2021 at 05:54:57PM +0800, Billy Tsai wrote:
> Add support for the pwm controller which can be found at aspeed ast2600
> soc. This driver is part function of multi-funciton of device "pwm-tach
> controller".

please squash this into patch 3.

> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> ---
>  drivers/pwm/Kconfig  | 6 ++++++
>  drivers/pwm/Makefile | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig
> index 63be5362fd3a..947ed642debe 100644
> --- a/drivers/pwm/Kconfig
> +++ b/drivers/pwm/Kconfig
> @@ -42,6 +42,12 @@ config PWM_DEBUG
>  	  It is expected to introduce some runtime overhead and diagnostic
>  	  output to the kernel log, so only enable while working on a driver.
>  
> +config PWM_ASPEED_G6
> +	tristate "ASPEEDG6 PWM support"

No depends?

Best regards
Uwe
Rob Herring (Arm) April 12, 2021, 1:20 p.m. UTC | #2
On Mon, 12 Apr 2021 17:54:55 +0800, Billy Tsai wrote:
> This patch adds device bindings for aspeed pwm device which should be
> the sub-node of aspeed,ast2600-pwm-tach.
> 
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> ---
>  .../bindings/pwm/aspeed,ast2600-pwm.yaml      | 47 +++++++++++++++++++
>  1 file changed, 47 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.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/linux-dt-review/Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml: Additional properties are not allowed ('pwm-cells' was unexpected)
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml: Additional properties are not allowed ('pwm-cells' was unexpected)
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml: ignoring, error in schema: 
warning: no schema found in file: ./Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml
Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.example.dt.yaml:0:0: /example-0/pwm_tach@1e610000: failed to match any schema with compatible: ['aspeed,ast2600-pwm-tach', 'simple-mfd', 'syscon']
Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.example.dt.yaml:0:0: /example-0/pwm_tach@1e610000/pwm@0: failed to match any schema with compatible: ['aspeed,ast2600-pwm']

See https://patchwork.ozlabs.org/patch/1465116

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.
Billy Tsai April 13, 2021, 2:11 a.m. UTC | #3
Thanks for your review

Best Regards,
Billy Tsai

On 2021/4/12, 7:14 PM,Uwe Kleine-Königwrote:

    >Hello,


    >On Mon, Apr 12, 2021 at 05:54:57PM +0800, Billy Tsai wrote:

    >> Add support for the pwm controller which can be found at aspeed ast2600

    >> soc. This driver is part function of multi-funciton of device "pwm-tach

    >> controller".


    >please squash this into patch 3.


OK, I will squash it when sending v2.

    >> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>

    >> ---

    >>  drivers/pwm/Kconfig  | 6 ++++++

    >>  drivers/pwm/Makefile | 1 +

    >>  2 files changed, 7 insertions(+)

    >> 

    >> diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig

    >> index 63be5362fd3a..947ed642debe 100644

    >> --- a/drivers/pwm/Kconfig

    >> +++ b/drivers/pwm/Kconfig

    >> @@ -42,6 +42,12 @@ config PWM_DEBUG

    >>  	  It is expected to introduce some runtime overhead and diagnostic

    >>  	  output to the kernel log, so only enable while working on a driver.

    >>  

    >> +config PWM_ASPEED_G6

    >> +	tristate "ASPEEDG6 PWM support"


    >No depends?


I will add "depends on (ARCH_ASPEED || COMPILE_TEST)" for this configure.

    >Best regards

    >Uwe


    >-- 

    >Pengutronix e.K.                           | Uwe Kleine-König            |

    >Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Billy Tsai April 13, 2021, 7:27 a.m. UTC | #4
Hi Rob,

Best Regards,
Billy Tsai

On 2021/4/12, 9:20 PM,Rob Herringwrote:

    On Mon, 12 Apr 2021 17:54:55 +0800, Billy Tsai wrote:
    >> This patch adds device bindings for aspeed pwm device which should be

    >> the sub-node of aspeed,ast2600-pwm-tach.

    >> 

    >> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>

    >> ---

    >>  .../bindings/pwm/aspeed,ast2600-pwm.yaml      | 47 +++++++++++++++++++

    >>  1 file changed, 47 insertions(+)

    >>  create mode 100644 Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.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/linux-dt-review/Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml: Additional properties are not allowed ('pwm-cells' was unexpected)

    > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml: Additional properties are not allowed ('pwm-cells' was unexpected)

    > /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml: ignoring, error in schema: 

    > warning: no schema found in file: ./Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.yaml

    > Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.example.dt.yaml:0:0: /example-0/pwm_tach@1e610000: failed to match any schema with compatible: ['aspeed,ast2600-pwm-tach', 'simple-mfd', 'syscon']

    > Documentation/devicetree/bindings/pwm/aspeed,ast2600-pwm.example.dt.yaml:0:0: /example-0/pwm_tach@1e610000/pwm@0: failed to match any schema with compatible: ['aspeed,ast2600-pwm']


The yaml file have dependencies with the first patch in these series. I will squash them.

    > See https://patchwork.ozlabs.org/patch/1465116


    > 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.