[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200428075346.xjzmmvios64emg5z@gilmour.lan>
Date: Tue, 28 Apr 2020 09:53:46 +0200
From: Maxime Ripard <maxime@...no.tech>
To: Peter Vasil <peter.vasil@...il.com>
Cc: Rob Herring <robh+dt@...nel.org>, Chen-Yu Tsai <wens@...e.org>,
Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pwm@...r.kernel.org
Subject: Re: [PATCH] pwm: sun4i: direct clock output support for Allwinner A64
Hi,
On Sun, Apr 26, 2020 at 12:11:22PM +0200, Peter Vasil wrote:
> Allwinner A64 is capable of a direct clock output on PWM (see A64
> User Manual chapter 3.10). Add support for this in the sun4i PWM
> driver and adjust compatibility in sun50i-a64 base device tree.
>
> Signed-off-by: Peter Vasil <peter.vasil@...il.com>
> ---
> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 ++----
> drivers/pwm/pwm-sun4i.c | 9 +++++++++
> 2 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index 31143fe64d91..c334fd106854 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -1069,8 +1069,7 @@ gic: interrupt-controller@...1000 {
> };
>
> pwm: pwm@...1400 {
> - compatible = "allwinner,sun50i-a64-pwm",
> - "allwinner,sun5i-a13-pwm";
> + compatible = "allwinner,sun50i-a64-pwm";
> reg = <0x01c21400 0x400>;
> clocks = <&osc24M>;
> pinctrl-names = "default";
> @@ -1252,8 +1251,7 @@ r_ir: ir@...2000 {
> };
>
> r_pwm: pwm@...3800 {
> - compatible = "allwinner,sun50i-a64-pwm",
> - "allwinner,sun5i-a13-pwm";
> + compatible = "allwinner,sun50i-a64-pwm";
There's no need to remove that compatible, it's actually working as intended..
> reg = <0x01f03800 0x400>;
> clocks = <&osc24M>;
> pinctrl-names = "default";
> diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.c
> index 5c677c563349..18fbbe3277d0 100644
> --- a/drivers/pwm/pwm-sun4i.c
> +++ b/drivers/pwm/pwm-sun4i.c
> @@ -352,6 +352,12 @@ static const struct sun4i_pwm_data sun4i_pwm_single_bypass = {
> .npwm = 1,
> };
>
> +static const struct sun4i_pwm_data sun50i_a64_pwm_data = {
> + .has_prescaler_bypass = true,
> + .has_direct_mod_clk_output = true,
> + .npwm = 1,
> +};
> +
> static const struct sun4i_pwm_data sun50i_h6_pwm_data = {
> .has_prescaler_bypass = true,
> .has_direct_mod_clk_output = true,
> @@ -374,6 +380,9 @@ static const struct of_device_id sun4i_pwm_dt_ids[] = {
> }, {
> .compatible = "allwinner,sun8i-h3-pwm",
> .data = &sun4i_pwm_single_bypass,
> + }, {
> + .compatible = "allwinner,sun50i-a64-pwm",
> + .data = &sun50i_a64_pwm_data,
Ie, if the OS only has support for the A13, then it will use it as an A13, and
if it has support for the A64 variant, then it can use some more advanced
features.
Maxime
Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)
Powered by blists - more mailing lists