Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7977355imu; Tue, 4 Dec 2018 00:23:32 -0800 (PST) X-Google-Smtp-Source: AFSGD/UAH51Xnojbu2/925OAeEx7BLILv2K3r7uda815SiKTxHpbmnWAwUyqU0vH+bhRqpbENBKt X-Received: by 2002:a63:f811:: with SMTP id n17mr16451169pgh.23.1543911812608; Tue, 04 Dec 2018 00:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543911812; cv=none; d=google.com; s=arc-20160816; b=kfiPCSGjmICVSn/HkGdJfxgEgsshIod5uVCcsO1tX4+qgBpm3hsJmiK0yUwPTHrLLe i5zO+64nvePE10npkrKJxyxxxx1xqfaSlgSYKyNWhG4ACaMClpwTlQsgsTqtdfBwNffB +LgZ41MyGlXC+1py6NZpKvtx/t9Jrivf/N28PFG0j9xsCx4/cxRfAkL73pHsqEHOaXSR 6+rLDqkhIcUYkr8aT9Bslhwm/3kYtI0EcHmtmPPyo1y2wbYzZcLw2ONdv+Qvl+4roeES K1aekGz+RUlrrCuP+rydH20z02U3yJfzAVyPPUzAUtA0PRFawjYsvjZi79ZFrwYEpJaE 3aKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OpYTHvNyAWqgy7nsKPr+g6ey5sLKAIj6db+wtP/ieJ4=; b=nW44cA8OuPUQKspZYtyRiAyC//5gUKl/IO8Omz4OtRbcMDHn40Qs48FkaUvNcYB8FW QrdXI97zj6u+wHO1+heIsBIADfN5Io//xWGwcgPu5bEBt3iQtOPbGi/7AlPy96Eew9Ew xMunBTo1/YDOze/ydPT6E0n/C+2LLtX9WJdXxpwy8tUXJiFG6VykBhn50hl9Ps91kKBu 8A/5+0VdqLtOOVO2dH0EbkkbE3v3jMHmUh70/fO6xpu/AE9XqKQXsJ2KAiY8WU4pFD5g f7oKEftb/K0QDOq8bIhHpD/qsqGadqIcP0YAW4F5NTt2WjxPONRcVCzhYK+XZ8F4YpQ5 hf6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LsLnOp1u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k22si5822834pll.276.2018.12.04.00.23.17; Tue, 04 Dec 2018 00:23:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LsLnOp1u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726075AbeLDIWD (ORCPT + 99 others); Tue, 4 Dec 2018 03:22:03 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:35485 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725983AbeLDIWD (ORCPT ); Tue, 4 Dec 2018 03:22:03 -0500 Received: by mail-pl1-f196.google.com with SMTP id p8so7927367plo.2 for ; Tue, 04 Dec 2018 00:22:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OpYTHvNyAWqgy7nsKPr+g6ey5sLKAIj6db+wtP/ieJ4=; b=LsLnOp1ucxff8wAVDb9EtqHTkoXGmp0WzHM2kMqaSq4KOFwj/mlXAX+PbDtlPnmEs+ fYp1bichE0VrF9NMiuzQQ5SFDOqZmECkGW3SVDVITLgu/TlCCk9NdxglY736HeELlZkZ hoNt/lspVniUxWZqNMKZkenZf8wIQHNYto0vw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=OpYTHvNyAWqgy7nsKPr+g6ey5sLKAIj6db+wtP/ieJ4=; b=HmcDDg+Wi/p0PY5NPN4LCqXdXpgOIiq/tScKDl6n18EoYnlfFCbU2OTHoE70lV3EYN EnhchnzGNnxI+A0i8pEQMxySTD7nyE0FZof+Yv3SohGHuMw50S3MF9kLlgGhYexHd4h9 iqPUlQg4A04xs7G1CRpOMLyiT1AnY/tXXHjYpV9lPGp30uXWhFKSMuouSfGAGWKL6BNY vCwirdbUZQCkPdqpGwfj+IKXMpyCmFRUJF0vfoRsgqtcxJVwwqlcuEzHqHzRhoLkgbzp nq5ywK5KsP1fMFMuZbYQ2QWLJyh3/LzjorqyR43NU5xaoMv4mSmbPnfJyhd8LhxI86U7 oABw== X-Gm-Message-State: AA+aEWabNcUL5Wa03mgffS16ZHoHtyrvCAS8Uv1ZSSQsXThaI4CSacJi bs2J0HygNQdqiRKdQ1+qpVWO4g== X-Received: by 2002:a17:902:708b:: with SMTP id z11mr19041715plk.203.1543911722133; Tue, 04 Dec 2018 00:22:02 -0800 (PST) Received: from localhost ([122.172.23.29]) by smtp.gmail.com with ESMTPSA id i123sm32555829pfg.164.2018.12.04.00.22.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Dec 2018 00:22:01 -0800 (PST) Date: Tue, 4 Dec 2018 13:51:58 +0530 From: Viresh Kumar To: Nick Fan Cc: Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" , Matthias Brugger , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, tfiga@chromium.org, Chiawen.Lee@mediatek.com, erin.lo@mediatek.com Subject: Re: [PATCH] opp: Add API for getting voltage from supplies Message-ID: <20181204082158.rb7uzdiwmcotwoxh@vireshk-i7> References: <1543906760-15631-1-git-send-email-Nick.Fan@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1543906760-15631-1-git-send-email-Nick.Fan@mediatek.com> User-Agent: NeoMutt/20180323-120-3dd1ac Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04-12-18, 14:59, Nick Fan wrote: > Add API to get voltage for multiple supplies from opp table And who needs to use this new API ? It would be better to add the user in the same series to make sure this really gets used. > Signed-off-by: Nick Fan > --- > drivers/opp/core.c | 28 ++++++++++++++++++++++++++++ > include/linux/pm_opp.h | 3 +++ > 2 files changed, 31 insertions(+) > > diff --git a/drivers/opp/core.c b/drivers/opp/core.c > index 2c2df4e..ee73546 100644 > --- a/drivers/opp/core.c > +++ b/drivers/opp/core.c > @@ -113,6 +113,34 @@ unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp) > EXPORT_SYMBOL_GPL(dev_pm_opp_get_voltage); > > /** > + * dev_pm_opp_get_voltage_supply() - Gets the voltage corresponding to an opp > + * with index > + * @opp: opp for which voltage has to be returned for > + * @index: index to specify the returned supplies > + * > + * Return: voltage in micro volt corresponding to the opp with index, else > + * return 0 > + * > + * This is useful for devices with multiple power supplies. > + */ > +unsigned long dev_pm_opp_get_voltage_supply(struct dev_pm_opp *opp, > + unsigned int index) How will the users of this API get the index ? > +{ > + if (IS_ERR_OR_NULL(opp)) { > + pr_err("%s: Invalid parameters\n", __func__); > + return 0; > + } > + > + if (index >= opp->opp_table->regulator_count) { > + pr_err("%s: Invalid supply index: %u\n", __func__, index); > + return 0; > + } > + > + return opp->supplies[index].u_volt; -- viresh