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 X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D767FC433E0 for ; Thu, 28 Jan 2021 07:01:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 795B764DD6 for ; Thu, 28 Jan 2021 07:01:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231371AbhA1HBl (ORCPT ); Thu, 28 Jan 2021 02:01:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbhA1HBk (ORCPT ); Thu, 28 Jan 2021 02:01:40 -0500 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FE9DC0613ED for ; Wed, 27 Jan 2021 23:00:25 -0800 (PST) Received: by mail-pl1-x635.google.com with SMTP id d4so2812069plh.5 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=TR6OmzdaS1NM+ef0N+/JlxLfCQLZeMapiwmbtKHnJVY88JDxTyZbYimBaiYN4G2NuH Npthr60OSthyKe41T2+qW3TfvSk+yvUz+sxBVjKMln/rPG2xjokmdSHZKDAtiXqK72fM SKn8mom3rwtnRybZOVm+t6ntVHAZXJdWjTDnkhy2pEqa4DfzXq06XJblLTLsAfW2Yp6F XubTgHrQie6jxIKG3iCu5tHVpD7JWLKYTFt2pSgg02qSnA1RhLrMUpf4b0gxWlSZI+Y4 sn+xzCpEkzYJOJWm1W1mmaHulcGxaflECUmiOYxMvo6OkdnJu/aJVJsAeeJl4rW5mZAl 73eQ== X-Gm-Message-State: AOAM533WY47rLh1+lMkrOSW7cOFl7Ww4Ao6CSgoqk3LHeOGX2qRt/wrP Id6cBB9vWFnlL5s2Zkv76qfVpQ== X-Google-Smtp-Source: ABdhPJzg0KUYOvi84y4/budGUi316+JwGNAzBfsjKs7Ts4mX4McGKT6+8bP7rXaSHM2LnS/DMOtkQQ== 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(+) 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) { } -- 2.25.0.rc1.19.g042ed3e048af