From: Stephen Boyd <sboyd@kernel.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Mark Rutland <mark.rutland@arm.com>, Nishanth Menon <nm@ti.com>,
Rob Herring <robh+dt@kernel.org>,
Saravana Kannan <saravanak@google.com>,
Viresh Kumar <vireshk@kernel.org>
Cc: Saravana Kannan <saravanak@google.com>,
Georgi Djakov <georgi.djakov@linaro.org>,
vincent.guittot@linaro.org, seansw@qti.qualcomm.com,
daidavid1@codeaurora.org, adharmap@codeaurora.org,
Rajendra Nayak <rnayak@codeaurora.org>,
sibis@codeaurora.org, bjorn.andersson@linaro.org,
evgreen@chromium.org, kernel-team@android.com,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 3/3] OPP: Add helper function for bandwidth OPP tables
Date: Fri, 16 Aug 2019 11:22:58 -0700 [thread overview]
Message-ID: <20190816182259.538532077C@mail.kernel.org> (raw)
In-Reply-To: <20190807223111.230846-4-saravanak@google.com>
Quoting Saravana Kannan (2019-08-07 15:31:11)
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 3b7ffd0234e9..22dcf22f908f 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -127,6 +127,29 @@ unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
> }
> EXPORT_SYMBOL_GPL(dev_pm_opp_get_freq);
>
> +/**
> + * dev_pm_opp_get_bw() - Gets the bandwidth corresponding to an available opp
> + * @opp: opp for which frequency has to be returned for
s/frequency/bandwidth/ ?
> + * @avg_bw: Pointer where the corresponding average bandwidth is stored.
> + * Can be NULL.
> + *
> + * Return: Peak bandwidth in kBps corresponding to the opp, else
> + * return 0
> + */
> +unsigned long dev_pm_opp_get_bw(struct dev_pm_opp *opp, unsigned long *avg_bw)
> +{
> + if (IS_ERR_OR_NULL(opp) || !opp->available) {
> + pr_err("%s: Invalid parameters\n", __func__);
> + return 0;
> + }
> +
> + if (avg_bw)
> + *avg_bw = opp->avg_bw;
> +
> + return opp->rate;
It deserves a comment if it stays named 'rate'. At a glance it looks
like a bug.
> +}
> +EXPORT_SYMBOL_GPL(dev_pm_opp_get_bw);
> +
> /**
> * dev_pm_opp_get_level() - Gets the level corresponding to an available opp
> * @opp: opp for which level value has to be returned for
> @@ -299,6 +322,34 @@ unsigned long dev_pm_opp_get_suspend_opp_freq(struct device *dev)
> }
> EXPORT_SYMBOL_GPL(dev_pm_opp_get_suspend_opp_freq);
>
> +/**
> + * dev_pm_opp_get_suspend_opp_bw() - Get peak bandwidth of suspend opp in kBps
> + * @dev: device for which we do this operation
> + * @avg_bw: Pointer where the corresponding average bandwidth is stored.
> + * Can be NULL.
> + *
> + * Return: This function returns the peak bandwidth of the OPP marked as
> + * suspend_opp if one is available, else returns 0;
Why a semicolon instead a full stop?
next prev parent reply other threads:[~2019-08-16 18:23 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-07 22:31 [PATCH v5 0/3] Introduce Bandwidth OPPs for interconnects Saravana Kannan
2019-08-07 22:31 ` [PATCH v5 1/3] dt-bindings: opp: Introduce opp-peak-kBps and opp-avg-kBps bindings Saravana Kannan
2019-08-21 20:33 ` Rob Herring
2019-08-26 20:26 ` Saravana Kannan
2019-08-07 22:31 ` [PATCH v5 2/3] OPP: Add support for bandwidth OPP tables Saravana Kannan
2019-08-16 18:21 ` Stephen Boyd
2019-08-20 22:34 ` Saravana Kannan
2019-08-20 6:13 ` Viresh Kumar
2019-08-20 22:27 ` Saravana Kannan
2019-08-20 22:36 ` Saravana Kannan
2019-08-21 5:24 ` Viresh Kumar
2019-08-21 5:26 ` Viresh Kumar
2019-08-21 5:23 ` Viresh Kumar
2019-08-07 22:31 ` [PATCH v5 3/3] OPP: Add helper function " Saravana Kannan
2019-08-16 18:22 ` Stephen Boyd [this message]
2019-08-15 16:19 ` [PATCH v5 0/3] Introduce Bandwidth OPPs for interconnects Georgi Djakov
2019-08-16 1:54 ` Saravana Kannan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190816182259.538532077C@mail.kernel.org \
--to=sboyd@kernel.org \
--cc=adharmap@codeaurora.org \
--cc=bjorn.andersson@linaro.org \
--cc=daidavid1@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=evgreen@chromium.org \
--cc=georgi.djakov@linaro.org \
--cc=kernel-team@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=nm@ti.com \
--cc=rjw@rjwysocki.net \
--cc=rnayak@codeaurora.org \
--cc=robh+dt@kernel.org \
--cc=saravanak@google.com \
--cc=seansw@qti.qualcomm.com \
--cc=sibis@codeaurora.org \
--cc=vincent.guittot@linaro.org \
--cc=vireshk@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).