Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp726085rwi; Thu, 27 Oct 2022 06:59:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/Ce5+hJBPXp5FsXAfIrTDzX30lseFdnFKpm9kKHF0v4At7yVtKB54mQAY7WMphQDM9pIc X-Received: by 2002:a17:907:2723:b0:79f:9f1f:2fed with SMTP id d3-20020a170907272300b0079f9f1f2fedmr26513552ejl.188.1666879149727; Thu, 27 Oct 2022 06:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666879149; cv=none; d=google.com; s=arc-20160816; b=HYR8Kb1YDSBpmH+FNc77PRsO/de8ds/PHzKmWkzeEc2noOvuCVnLGVBBSScsC6/5Lq bgCvjhS29TOEBnoZ26ng9MQ54vuPqCyOK8ujMVXZ/Q1EI8X/k+zqj+Pykl/cKJ7r9v5b Nd7ehKxIVWfVnshCy1a4WgFlaYq8F50z3QR7a9vtUvOVkDUurNggfQAc1lkUjze70+/x +lSShu1KUKCGoIcfk8l72A8HqYLT9lNkGPHo1JrhEyxFYXtcmanZFZ2kf9HboyzJjWRR yAeEqGHH/OPSzUkMPpPbp6Dlu5eOCgpN90dhxqbJI/TaZFlRub4VJjYX71rc9pHannYJ CPWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:references:cc:to:content-language:subject:reply-to :from:user-agent:mime-version:date:message-id:dkim-signature; bh=Q36OlMnP3Ys/6ybhANV3Apdof3npa1Vh+Mgsx1pBVWU=; b=p9BdA9G0X6r8/PYa2QFx+oq8zgsA6W5dOBGgt7UxOC0KTIOaGgB58D9Pypk7tUZ06/ pyj/HWkHOwnlXcwLRf3X2Mwr3vfjHvur/SrLXBEeG9QMYJ0wx9bXM6smzG4n+qVv8zph mrN1RyoC3MASfVkf04xxvu0lKaNPN3dlgh4tWKrGonGyV7GIuY37K5X/svQsbDXFn0cY Qkzp/mlOMn2lki4rdhoqcmXmY0pxbssOg9NJTRrlcTOr4t9ytLoRcv+sBfFmCzlLWTT8 /z23Io68EAmzFHssxajpPs7yyq3gb8N9BVlQgWTL0URoMxJS70GW0x1f63cEgUSu4eTR cuxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OQyezL4c; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a056402518e00b004511d552be3si2002661edd.4.2022.10.27.06.58.44; Thu, 27 Oct 2022 06:59:09 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=OQyezL4c; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235853AbiJ0MtV (ORCPT + 99 others); Thu, 27 Oct 2022 08:49:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235337AbiJ0MtR (ORCPT ); Thu, 27 Oct 2022 08:49:17 -0400 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2C2416F414 for ; Thu, 27 Oct 2022 05:49:15 -0700 (PDT) Received: by mail-wm1-x335.google.com with SMTP id n14so913072wmq.3 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=W0NmwS8YlvRC7CRLw8fMhAlggkhunQVyZ1NE6OeMEYD0eQ5RFXXt5j0oyd6iLFUHUy cJyc168DRlRRenKpL0yuHNlMsPGu/eAyUmPASEToJm06TH2NwG6bkbGVE9CV5LOjkG6P D4R7ZGLzLDpMK/XZIgv7d1y9YAm7VaoMR48S14UDYsWr76n2iPlPQkggeY3mcPXDQDNN koV+osQyZzfe8z9+sVeTxGUrfr9vSxGr/HKj+1B1zP3BmBYTY5wphH8KDTdWAIopCaBY POFb76BdCvbHtYFDpfvs6tzazu7MEG54mHBi6MC/EiFQ2BuPqpq0/DqPjxPBaODhL0Yx mAWw== X-Gm-Message-State: ACrzQf0/r8N8/WOvAz8vzR7bGYqJyEXlWyWbOCHI/gX2adQMTU2P7Hc2 qz1xAfawN+NGuvUArfCItWydhQ== 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 Reply-To: 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.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