From patchwork Thu Jan 28 07:00:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 372526 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp961746jam; Wed, 27 Jan 2021 23:02:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzYQ1ZqSo4oVGpHS8x/BBg2Exsa0ISr9sEwAtVgANMI/q5QLz6RndIIwE2/mBHAoXmr/0Xd X-Received: by 2002:a17:906:6407:: with SMTP id d7mr8308651ejm.133.1611817345297; Wed, 27 Jan 2021 23:02:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611817345; cv=none; d=google.com; s=arc-20160816; b=jPinLQ/D/vEwpxTjzoepW46y/kBm/uC26YFKICX/I82wzJyiI15HVcTcAkkr8ELHJh tvUONA4/rFgcoKzAGOWRFaWza0oYH/UPx70cZ+0IF0VaKseUScN9sQbyAv80hd/KxXha 43wBvCnNm7yHHp5U5YnFY95B3AJ24Jqvx6LL8LsYr8geXbL8XBFsxIdxcPEQ8xMEPzeJ hYI3jLXBUASTVnnFZsuk7FCsKu4NFgyoI5fGWtDrQfo42P0gVMPWCR5fqfLDe11fkl2c nfZg+re5b/ynI0IAofdtjzQDHGmjy+0gTvYTKN7OHpOsWdD6OZaWUw2WyIzyNAPwEOyq W1jg== 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=7qDHxv287So/jBOR+Ptqf3OuXX9lBc2qUnXBXUEn81k=; b=PYjf59QXgSPL30RMUcNAmOuZ0dFjOQAm2S9VRWQHsupvFrwDcRrirXNCkcybbKP8yP hIn281QIyBEmGwqTF6Jsxrpnj8bfwfZ3T0X3cRZ98qwpv1ERQe/YiLvZmp6vHVHYiEYD Wk2jWcuNNWibkgdYIWmcqMunzCSlnL5Oi043Yh3+6vKkxNZ+mJx1YgH2rZ0gcrZwejyI zaq60MTujzryOkPsMSqSRqBsg4XNwP/icve23jYr1U2w0ti4LZGlwzbi5Y4hRPDCJ7g+ PQ1wwofs04RHH8sAN+DLhKDFeW9JUk2zjShg/+MIdtqje2aEhYE2HwFd8g+w23t93Qu5 VRKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yVKAEirq; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bf17si2463212edb.76.2021.01.27.23.02.25; Wed, 27 Jan 2021 23:02:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yVKAEirq; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-pm-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 S231310AbhA1HBP (ORCPT + 7 others); Thu, 28 Jan 2021 02:01:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231314AbhA1HBG (ORCPT ); Thu, 28 Jan 2021 02:01:06 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E0EDC0613D6 for ; Wed, 27 Jan 2021 23:00:25 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id u15so2823312plf.1 for ; Wed, 27 Jan 2021 23:00:25 -0800 (PST) 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=7qDHxv287So/jBOR+Ptqf3OuXX9lBc2qUnXBXUEn81k=; b=yVKAEirqsQAkNwNAY19C20Fw2OP4V8qKO0dJ2PY9EmdjWpFZ3qmIbbWvVJwJVuPvxV ZvvM2v/xE5C9KFSqCS06hLDs2zEuFEbJtbxv8UxbmGmyxFcEwsRrwVpZwCLXnyy6v0sG hlfMZHEMtrBuGZUhvAspBc6nsjghqypSjIbv+OqFRQfcfKECtRq5mapOSPi3qov+c+AA c4GY8Rtw1bnLL3UjGiyI+UsBzzO3Yyp8XXYa7iCDWd8cRFqeMqpzqwu0TwjKHoi0tGnP Ok2ZfGhsiMB6oEGvsENXoT2n2DDtXx5Z0op4JZywtauvPDpfWrYFkt30U8qhVudyeqZl bvHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7qDHxv287So/jBOR+Ptqf3OuXX9lBc2qUnXBXUEn81k=; b=Sqy2fsbXOf7e27dAP3dyzqBQTjZqOQKgtZj5wdNAYhbXJSKSf3irD9uUiKjAimfh87 e1niJuBSZKjPck2p351P+l2rQb1fbSlb66GpmCt4jG7M4B77oYShA/qTetsYT503K3ox sjOD8YP1TU/RsmE3D76urplHGeXtoo/a0WeAC/agph1AR5PeA7XeALrVbwbaZdfJk7H+ G48zGlKtUbHob0NbizZmxfqQsDb77cRromxbEvgqxQ4SU2kHz6Tzn9JVX/hAFtLMRTX2 jkkRI0wHUxPILYoIvQy9oIyD2eNAim+xMALxoZ7GNgOu972fQf0z89F21SPedsnqWP9w t4mQ== X-Gm-Message-State: AOAM53292JnWyfdOPtjJUd5sOGHDE4hfdAWmqZGP4MM62fjD1fW9JD0u j+J+06PpzTst3SUGosf4v2k7VA== X-Received: by 2002:a17:90b:350:: with SMTP id fh16mr9904813pjb.232.1611817225183; Wed, 27 Jan 2021 23:00:25 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id x1sm4709767pgj.37.2021.01.27.23.00.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Jan 2021 23:00:24 -0800 (PST) From: Viresh Kumar To: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Dmitry Osipenko , linux-kernel@vger.kernel.org Subject: [PATCH V2 3/3] opp: Add dev_pm_opp_of_add_table_noclk() Date: Thu, 28 Jan 2021 12:30:09 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: <1b58a72fa4d6aadc9542a66f8150150534752d81.1611817096.git.viresh.kumar@linaro.org> References: <1b58a72fa4d6aadc9542a66f8150150534752d81.1611817096.git.viresh.kumar@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org A few drivers have device's clk but they don't want the OPP core to handle that. Add a new helper for them, dev_pm_opp_of_add_table_noclk(). Signed-off-by: Viresh Kumar --- V2: - Split this into a separate patch. drivers/opp/of.c | 18 ++++++++++++++++++ include/linux/pm_opp.h | 6 ++++++ 2 files changed, 24 insertions(+) -- 2.25.0.rc1.19.g042ed3e048af Tested-by: Dmitry Osipenko diff --git a/drivers/opp/of.c b/drivers/opp/of.c index d4b51b2e384f..a905497c75f8 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -1030,6 +1030,24 @@ int dev_pm_opp_of_add_table_indexed(struct device *dev, int index) } EXPORT_SYMBOL_GPL(dev_pm_opp_of_add_table_indexed); +/** + * dev_pm_opp_of_add_table_noclk() - Initialize indexed opp table from device + * tree without getting clk for device. + * @dev: device pointer used to lookup OPP table. + * @index: Index number. + * + * Register the initial OPP table with the OPP library for given device only + * using the "operating-points-v2" property. Do not try to get the clk for the + * device. + * + * Return: Refer to dev_pm_opp_of_add_table() for return values. + */ +int dev_pm_opp_of_add_table_noclk(struct device *dev, int index) +{ + return _of_add_table_indexed(dev, index, false); +} +EXPORT_SYMBOL_GPL(dev_pm_opp_of_add_table_noclk); + /* CPU device specific helpers */ /** diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h index 979b208bc4a8..158158620dde 100644 --- a/include/linux/pm_opp.h +++ b/include/linux/pm_opp.h @@ -395,6 +395,7 @@ static inline int dev_pm_opp_sync_regulators(struct device *dev) #if defined(CONFIG_PM_OPP) && defined(CONFIG_OF) int dev_pm_opp_of_add_table(struct device *dev); int dev_pm_opp_of_add_table_indexed(struct device *dev, int index); +int dev_pm_opp_of_add_table_noclk(struct device *dev, int index); void dev_pm_opp_of_remove_table(struct device *dev); int dev_pm_opp_of_cpumask_add_table(const struct cpumask *cpumask); void dev_pm_opp_of_cpumask_remove_table(const struct cpumask *cpumask); @@ -419,6 +420,11 @@ static inline int dev_pm_opp_of_add_table_indexed(struct device *dev, int index) return -ENOTSUPP; } +static inline int dev_pm_opp_of_add_table_noclk(struct device *dev, int index) +{ + return -ENOTSUPP; +} + static inline void dev_pm_opp_of_remove_table(struct device *dev) { }