Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp946920imw; Tue, 5 Jul 2022 00:40:58 -0700 (PDT) X-Google-Smtp-Source: AGRyM1st9oAVNt8mujdF64YG8oInYK+NmZwXnzkxzeP0mbdBEtqQylhCjWd0jeaYAf7HgkTyCYMd X-Received: by 2002:a17:906:7c0c:b0:6f9:1fc:ebf3 with SMTP id t12-20020a1709067c0c00b006f901fcebf3mr32137176ejo.403.1657006858724; Tue, 05 Jul 2022 00:40:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657006858; cv=none; d=google.com; s=arc-20160816; b=Y42uHwDtaTS55WF9SK41TLjpiZJQ7dFl4TzILDtB02eO7eSmdMu10lh3lcjdJkzF8b B64pWWTbkRz5W/iHORBgKTFR0opRDPAuPkIrBto1/t/bhNx2DRX411yil8aNNUlgiKYf 5Q211cfTTjhdOVe2r7g+RaXH5owoRMtFlYCMMYM3zqwqOcrVJBAEAc3li8brM2BPzhlf 45vbBJx+85ppnEkLshSl+XtocW7AgJkHi1G0nYGpmXV7e6z+TWc8sSdwvPrQ44ZmjPBl R0J9yD96zt3OkHYa7HmZ2WaW9wmkbjPgA1R4VLdhyk/uNYfeo1xHkUMJtGClBY5P223t ui1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dgzYVIoUF/W7ZZqlkRPUIeh8Y0nkpYJWUmbATvkU2GI=; b=h0xjSiXpxnq0dttR87viLWnybozLJXBnbJL7kYA06Pp4O2C1Nm/WQCx+esvFpCqHxl fYKAnHxFh8hRPfLYMXwm0Ma2s6r8F4H9RZ6v6uFlYY84h33TSYxJSRA+Io2qFb2w/8fS E9G11qzlDGwY/FR4EBU4o457nvK3DYKKV5oEA9ANn2PFJApCGqcHv7XTl7dHAJszggJF fq16NbO39Spv2nW7miQxwXXgbstkbqVf9knp19K7yAPAY0NXGoBH/MJz5TrtBgwAqja5 NoncCOgnj3F5BvwzB0j0yr6Hj3nw2cbPHcZAgQFpUqBZUiJd/4KIc6AP1BTlPmKfTrvf 4TdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yGoD2hye; 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 p8-20020a17090635c800b0072629f000a0si35554509ejb.134.2022.07.05.00.40.34; Tue, 05 Jul 2022 00:40:58 -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=yGoD2hye; 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 S231140AbiGEHB1 (ORCPT + 99 others); Tue, 5 Jul 2022 03:01:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbiGEHBF (ORCPT ); Tue, 5 Jul 2022 03:01:05 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A4AEE0FD for ; Tue, 5 Jul 2022 00:01:04 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id m2so10249755plx.3 for ; Tue, 05 Jul 2022 00:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dgzYVIoUF/W7ZZqlkRPUIeh8Y0nkpYJWUmbATvkU2GI=; b=yGoD2hyeQwWrzlSQ45BdlmoPYQvy4nmu81ti6NYReaSEmCgC/ywl/t1yTm1OjXRVsN L73KTn8aJPM84deNLu74ZtZeeAxa+vMWp0j9RjZ6LH1KV/ZUBNkmQVNm0vTzwTn9FhkW SP7U3nwHJa0z7CR5YdhizAtoCDlh2ZIpAJPdm0mxzsLCFPU3kpVzNI9oQIIEdKs6zCT3 Lrp30aShQy23RRH5poC3xbokeBJc3pEn4m5L0BO3LW/jzoBcXQyVPbwq6mtug2DUFqXf cYBp07jOrzq7lxX+/KyC4Lo3gQfBSyvb7kN5c9At9ZcuirNlTlEcCLiv5IPyo89QDnS4 aWbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dgzYVIoUF/W7ZZqlkRPUIeh8Y0nkpYJWUmbATvkU2GI=; b=3xqjlmtbqsafGPb1BVde4Jcbj1QzotA2CkClxvYNVRnI0EFK9kBnkoNmP6dG2vq6oF 1LdpJg1CwJD3thPAIAFPnWK3aTueqBnAJPfq5j4CSB+EPto7dfpzChOUp5g28dFDchjp 5/UpUeGovlbQ1ULfpzeQ5T55dBsrNDpcFwOx7I3KOREDJgzkMgpPsAk3gQhdmIgl3mw6 faLUmnOm7OCndBqkJ2E6UTbp9YlM85ceDhN5njchKPzE+eayi7QF0PetOExJNcuqBEKG geqouTRc2a8kmvlOT/8LhA57UYV+xfjTHS9KpgzdN36gEA4ddeii0MltSAZHQUHp+hpo kFaw== X-Gm-Message-State: AJIora+2sM4BIua22trK8HGdQL/BmU89CAHyPi1/EgtOvvzp2mwyMV4w SFQjuz7wooUx82Z2UQZzsibcZw== X-Received: by 2002:a17:90b:3648:b0:1ef:7c45:62cb with SMTP id nh8-20020a17090b364800b001ef7c4562cbmr17443339pjb.132.1657004463621; Tue, 05 Jul 2022 00:01:03 -0700 (PDT) Received: from localhost ([122.171.18.80]) by smtp.gmail.com with ESMTPSA id q11-20020a63504b000000b004126f1e48f4sm769229pgl.20.2022.07.05.00.01.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Jul 2022 00:01:03 -0700 (PDT) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , "Rafael J. Wysocki" , Krzysztof Kozlowski , Dmitry Osipenko , linux-kernel@vger.kernel.org Subject: [PATCH V2 11/13] OPP: Allow config_clks helper for single clk case Date: Tue, 5 Jul 2022 12:30:14 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 There is a corner case with Tegra30, where we want to skip clk configuration via dev_pm_opp_set_opp(), but still want the OPP core to read the "opp-hz" property so we can find the right OPP via freq finding helpers. This is the easiest of the ways to make it work, without any special hacks in the OPP core. Allow config_clks to be passed for single clk case. Tested-by: Dmitry Osipenko Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 597f7df3e375..666e1ebf91d1 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -2177,7 +2177,7 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev, count = 1; /* Fail early for invalid configurations */ - if (!count || (config_clks && count == 1) || (!config_clks && count > 1)) + if (!count || (!config_clks && count > 1)) return -EINVAL; /* Another CPU that shares the OPP table has set the clkname ? */ @@ -2203,10 +2203,12 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev, } opp_table->clk_count = count; + opp_table->config_clks = config_clks; /* Set generic single clk set here */ if (count == 1) { - opp_table->config_clks = _opp_config_clk_single; + if (!opp_table->config_clks) + opp_table->config_clks = _opp_config_clk_single; /* * We could have just dropped the "clk" field and used "clks" @@ -2221,8 +2223,6 @@ static int _opp_set_clknames(struct opp_table *opp_table, struct device *dev, * too. */ opp_table->clk = opp_table->clks[0]; - } else { - opp_table->config_clks = config_clks; } return 0; -- 2.31.1.272.g89b43f80a514