From: Taniya Das <quic_tdas@quicinc.com>
To: Abel Vesa <abel.vesa@linaro.org>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Kevin Hilman <khilman@kernel.org>,
Ulf Hansson <ulf.hansson@linaro.org>, avel Machek <pavel@ucw.cz>,
Len Brown <len.brown@intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Bjorn Andersson" <andersson@kernel.org>,
Andy Gross <agross@kernel.org>,
"Konrad Dybcio" <konrad.dybcio@linaro.org>,
Mike Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Taniya Das <tdas@qti.qualcomm.com>
Cc: <linux-pm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
<linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH 2/2] clk: qcom: gdsc: Add support for set_hwmode_dev
Date: Mon, 10 Jul 2023 09:41:55 +0530 [thread overview]
Message-ID: <74dcd80b-547c-af5a-5a02-2e8d75ecca50@quicinc.com> (raw)
In-Reply-To: <20230628105652.1670316-3-abel.vesa@linaro.org>
On 6/28/2023 4:26 PM, Abel Vesa wrote:
> Implement the GDSC specific genpd set_hwmode_dev callback in order to
> switch the HW control on or off. For any GDSC that supports HW control
> set this callback in order to allow its consumers to control it.
>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
> drivers/clk/qcom/gdsc.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
> index 5358e28122ab..9a04bf2e4379 100644
> --- a/drivers/clk/qcom/gdsc.c
> +++ b/drivers/clk/qcom/gdsc.c
> @@ -314,6 +314,26 @@ static int gdsc_enable(struct generic_pm_domain *domain)
> return 0;
> }
>
> +static int gdsc_set_hwmode_dev(struct generic_pm_domain *domain,
> + struct device *dev, bool enable)
> +{
> + int ret = gdsc_hwctrl(domain_to_gdsc(domain), enable);
> +
> + if (ret)
> + goto out;
> +
> + /*
> + * Wait for the GDSC to go through a power down and
> + * up cycle. In case there is a status polling going on
> + * before the power cycle is completed it might read an
> + * wrong status value.
> + */
> + udelay(1);
> +
> +out:
> + return ret;
> +}
> +
> static int gdsc_disable(struct generic_pm_domain *domain)
> {
> struct gdsc *sc = domain_to_gdsc(domain);
> @@ -451,6 +471,8 @@ static int gdsc_init(struct gdsc *sc)
> sc->pd.power_off = gdsc_disable;
> if (!sc->pd.power_on)
> sc->pd.power_on = gdsc_enable;
> + if (sc->flags & HW_CTRL)
> + sc->pd.set_hwmode_dev = gdsc_set_hwmode_dev;
>
Forgot to add the get_mode.
+ if (sc->flags & HW_CTRL_TRIGGER) {
+ sc->pd.set_hwmode_dev = gdsc_set_mode;
+ sc->pd.get_hwmode_dev = gdsc_get_mode;
+ }
+
> ret = pm_genpd_init(&sc->pd, NULL, !on);
> if (ret)
--
Thanks & Regards,
Taniya Das.
next prev parent reply other threads:[~2023-07-10 4:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-28 10:56 [PATCH 0/2] PM: domains: Add control for switching back and forth to HW control Abel Vesa
2023-06-28 10:56 ` [PATCH 1/2] PM: domains: Allow devices attached to genpd to be managed by HW Abel Vesa
2023-06-28 10:56 ` [PATCH 2/2] clk: qcom: gdsc: Add support for set_hwmode_dev Abel Vesa
2023-06-28 17:18 ` Konrad Dybcio
2023-07-10 4:10 ` Taniya Das
2023-07-17 11:08 ` Abel Vesa
2023-07-10 4:11 ` Taniya Das [this message]
2023-06-28 17:15 ` [PATCH 0/2] PM: domains: Add control for switching back and forth to HW control Rafael J. Wysocki
2023-06-28 21:55 ` Ulf Hansson
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=74dcd80b-547c-af5a-5a02-2e8d75ecca50@quicinc.com \
--to=quic_tdas@quicinc.com \
--cc=abel.vesa@linaro.org \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@kernel.org \
--cc=konrad.dybcio@linaro.org \
--cc=len.brown@intel.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=pavel@ucw.cz \
--cc=rafael@kernel.org \
--cc=sboyd@kernel.org \
--cc=tdas@qti.qualcomm.com \
--cc=ulf.hansson@linaro.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