linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: neil.armstrong@linaro.org
To: Anand Moon <linux.amoon@gmail.com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Dan Johansen <strit@manjaro.org>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCHv3] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+
Date: Thu, 27 Oct 2022 14:49:12 +0200	[thread overview]
Message-ID: <18ae0876-2d37-cde9-183f-894dfcdf4be9@linaro.org> (raw)
In-Reply-To: <CANAwSgR1CN=Gho6NGMoM1bH92KyeGqoAphmT6NqtnL=+3Zg_jQ@mail.gmail.com>

Hi,

On 26/10/2022 18:02, Anand Moon wrote:
> Hi Neil,

<snip>

> 
> When I try to use pwm_AO_cd,,
> Either one of the PWM binds will fail to get the following error.
> 
>   &pwm_AO_cd {
> -       pinctrl-0 = <&pwm_ao_d_e_pins>;
> +       pinctrl-0 = <&pwm_ao_d_e_pins>, <&pwm_ao_d_10_pins>;
>          pinctrl-names = "default";
>          clocks = <&xtal>;
>          clock-names = "clkin1";
> 
> [    3.941700] pwm-regulator regulator-vddcpu-b: error -EBUSY: Failed to get PWM
> [    3.943198] pwm-regulator: probe of regulator-vddcpu-b failed with error -16
> 
> [    3.956356] pwm-fan pwm-fan: error -EBUSY: Could not get PWM
> [    3.956396] pwm-fan: probe of pwm-fan failed with error -16

Yeah because PWM "D" is already used by the "pwm_AO_ab" controller, so you can't use it for the FAN.

> 
> Below are my changes with  pwm_AO_ab
> ---------------------------------------------------------------------------------------------
> alarm@odroid-n2:~/linux-amlogic-5.y-devel$ git diff
> arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> index fd3fa82e4c33..d038ba1e2453 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dtsi
> @@ -39,6 +39,14 @@ emmc_pwrseq: emmc-pwrseq {
>                  reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
>          };
> 
> +       fan: pwm-fan {
> +               compatible = "pwm-fan";
> +               pwms = <&pwm_AO_ab 1 1250 0>;

Here you use the "B" PWM signal, not the D.

> +               fan-supply = <&vcc_5v>;
> +               #cooling-cells = <2>;
> +               cooling-levels = <0 100 170 230>;
> +       };
> +
>          leds {

<snip>

> 
> +&pwm_AO_ab {
> +       pinctrl-0 = <&pwm_ao_d_10_pins>;

The "pwm_AO_ab" controller only controls the PWM "A" & "B signals, not the "D" !

This basically enables the PWM "D" pin function to GPIOAO_10, it doesn't assign it to the "pwm_AO_ab" controller.

So by enabling this pinctrl, it will duplicate the pwm_ao_d_e_pins signal to pwm_ao_d_10_pins, this is why the FAN spins non-stop.

> +       pinctrl-names = "default";
> +       clocks = <&xtal>;
> +       clock-names = "clkin1";
> +       status = "okay";
> +};
> +
>   &pwm_AO_cd {
>          pinctrl-0 = <&pwm_ao_d_e_pins>;
>          pinctrl-names = "default";
> -------------------------------------------------------------------------------------------
>>>
>>> Thanks
>>>
>>> -Anand
>>
>> Neil

Neil

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2022-10-27 12:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22  8:47 [PATCHv3] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ Anand Moon
2022-10-22 10:17 ` Martin Blumenstingl
2022-10-22 11:27   ` Anand Moon
2022-10-22 11:52     ` Martin Blumenstingl
2022-10-25 18:06       ` Anand Moon
2022-10-26  8:02         ` Neil Armstrong
2022-10-26 16:02           ` Anand Moon
2022-10-27 12:49             ` neil.armstrong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=18ae0876-2d37-cde9-183f-894dfcdf4be9@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux.amoon@gmail.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=robh+dt@kernel.org \
    --cc=strit@manjaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).