From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19E19FA3740 for ; Thu, 27 Oct 2022 12:50:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:Reply-To:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:Cc:To:Subject: From:MIME-Version:Date:Message-ID:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pVw4sz1hSN+9YcmxG7L+AI4PANfRzHMoRT17OPu1t7A=; b=wzWNSlLJ+4Qq9+hHYOxvAIKPq0 qArZ/zien48m65fnd++AeKfL3Y6qmrzgcG2IX31YdxjzTHFN7gX5nqNsSCwTXpP0iadmO348pft11 oCEk5ejlRno8xZbFd0Nmh0aPm928SV8eiTj87UVJdy7f2pfkhyUVmSBxI1rX4BjGBpiMfwuu9MQBn ssgN9rDRjImyy00smZRZnUDmXQrqboxt2t9izwkVBX8lFRK8VWP+yR5U+f95F4pg+2OhNHhFZJ2De vuZz+/3VaoT47rvMStqUKI5pCno7KluGIAgvYaHrJBmxIV3sjAQllKEfp2L3j+faP4viKavdp/3at he84u90g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo2Jz-00DEAT-AY; Thu, 27 Oct 2022 12:49:19 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo2Jw-00DE9M-9Y for linux-arm-kernel@lists.infradead.org; Thu, 27 Oct 2022 12:49:17 +0000 Received: by mail-wm1-x329.google.com with SMTP id i5-20020a1c3b05000000b003cf47dcd316so4100819wma.4 for ; Thu, 27 Oct 2022 05:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=Q36OlMnP3Ys/6ybhANV3Apdof3npa1Vh+Mgsx1pBVWU=; b=OQyezL4cGU1S6Th8YVxCSmmKg8MDodYMD5HBV7ElzJz4DtRh+iegPU5J4dVfdCItuH dH97BHd68JdE3Jo/G/zHfYvNNSReIHiHCRWAFXj8kofujxZxdQnVrTmj28ukfotkS3MN HCvGo5DIIw9WZcsyGtfu66qsxa1g6nBLzRhprzhByHv8I7+eMkYkxlU1B5D3xq3I4KOf /28vnmmORF0AvfXt4fvhe9ftj7JGy12h86+fvleBteEpTJrSSCwPNZW1SuahFhQyjGJu Cv4MvPWxyx1NHB3qoqVJeBCgSm0DwTbCnQCRHfUpV2PaPjloUpfwAxtiC3iz5FqnGXB7 6YrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:references:cc:to :content-language:subject:reply-to:from:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Q36OlMnP3Ys/6ybhANV3Apdof3npa1Vh+Mgsx1pBVWU=; b=lH/mH3r+qCB531bVEj01fYlxBbnuEiuQSiBrh0AgWHWl5Rxdi9nxdUTkwL4hQMqALJ 59rhDg54FmhL23/ahdLwlI/Pyyo7ro0wFD0kuuz2IA7lO0mviM0CKfzS6st9CR10YNNA TPiQpsO0NZJGQViDlLH0u1D8oRfC4bTRpvPpM7v5SjF0EJDI/h08l7ogpoN5y27rcu4R DK9o+D0NxfWjcEVl5VLcus3nV6gR0URV1rA8eZPud6y59LziwRec4lSglvjlBN2cvWhn yXdZBMOGDxdIcydt5tGY71BIbS4KXABCHmROnNak1FBPZMbPTz/DnvlAAAjswyahArSR TCtw== X-Gm-Message-State: ACrzQf3+Pm0KWJE5NQy+/U44IbWeg+sSQneE1WsGtO8OoxPKIQsVZ4Qq noikUhC/7MlyHiihJWi48mRTQA== X-Google-Smtp-Source: AMsMyM7H83+TH22aHNQ6HRVyJaoDi39AW5Sf28cYzigPPM7qK21FcZrwDuemt/vdFqzRpl+/R7UhNg== X-Received: by 2002:a05:600c:4f45:b0:3c7:176b:2505 with SMTP id m5-20020a05600c4f4500b003c7176b2505mr5771448wmq.185.1666874954196; Thu, 27 Oct 2022 05:49:14 -0700 (PDT) Received: from ?IPV6:2a01:e0a:898:f380:1cb7:f7ba:a36e:de10? ([2a01:e0a:898:f380:1cb7:f7ba:a36e:de10]) by smtp.gmail.com with ESMTPSA id bg33-20020a05600c3ca100b003b49bd61b19sm4977299wmb.15.2022.10.27.05.49.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Oct 2022 05:49:13 -0700 (PDT) Message-ID: <18ae0876-2d37-cde9-183f-894dfcdf4be9@linaro.org> Date: Thu, 27 Oct 2022 14:49:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 From: neil.armstrong@linaro.org Subject: Re: [PATCHv3] arm64: dts: meson: Enable active coling using gpio-fan on Odroid N2/N2+ Content-Language: en-US To: Anand Moon Cc: Martin Blumenstingl , Rob Herring , Krzysztof Kozlowski , Kevin Hilman , Jerome Brunet , Dan Johansen , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org References: <20221022084737.1028-1-linux.amoon@gmail.com> <5d2ffeca-b41c-20b4-454b-703c39bbb29e@linaro.org> Organization: Linaro Developer Services In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_054916_369756_49855F3E X-CRM114-Status: GOOD ( 19.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: neil.armstrong@linaro.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On 26/10/2022 18:02, Anand Moon wrote: > Hi Neil, > > 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 { > > +&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