From: Matthias Brugger <matthias.bgg@gmail.com>
To: "Bernhard Rosenkränzer" <bero@baylibre.com>,
daniel.lezcano@linaro.org,
angelogioacchino.delregno@collabora.com, rafael@kernel.org,
amitk@kernel.org, rui.zhang@intel.com, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, rdunlap@infradead.org,
ye.xingchen@zte.com.cn, p.zabel@pengutronix.de
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org,
wenst@chromium.org, james.lo@mediatek.com,
rex-bc.chen@mediatek.com, nfraprado@collabora.com,
abailon@baylibre.com, amergnat@baylibre.com,
khilman@baylibre.com
Subject: Re: [PATCH v3 2/5] thermal/drivers/mediatek/lvts_thermal: Add suspend and resume
Date: Tue, 30 May 2023 09:09:15 +0200 [thread overview]
Message-ID: <8b1cd982-2b49-7dd8-8037-7a362aa4305c@gmail.com> (raw)
In-Reply-To: <20230529164605.3552619-3-bero@baylibre.com>
On 29/05/2023 18:46, Bernhard Rosenkränzer wrote:
> From: Balsam CHIHI <bchihi@baylibre.com>
>
> Add suspend and resume support to LVTS driver.
>
> Signed-off-by: Balsam CHIHI <bchihi@baylibre.com>
> Signed-off-by: Bernhard Rosenkränzer <bero@baylibre.com>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
> ---
> drivers/thermal/mediatek/lvts_thermal.c | 34 +++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
>
> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
> index d0a3f95b7884b..5ea8a9d569ea6 100644
> --- a/drivers/thermal/mediatek/lvts_thermal.c
> +++ b/drivers/thermal/mediatek/lvts_thermal.c
> @@ -1169,6 +1169,38 @@ static int lvts_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static int lvts_suspend(struct platform_device *pdev, pm_message_t state)
> +{
> + struct lvts_domain *lvts_td;
> + int i;
> +
> + lvts_td = platform_get_drvdata(pdev);
> +
> + for (i = 0; i < lvts_td->num_lvts_ctrl; i++)
> + lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], false);
> +
> + clk_disable_unprepare(lvts_td->clk);
> +
> + return 0;
> +}
> +
> +static int lvts_resume(struct platform_device *pdev)
> +{
> + struct lvts_domain *lvts_td;
> + int i, ret;
> +
> + lvts_td = platform_get_drvdata(pdev);
> +
> + ret = clk_prepare_enable(lvts_td->clk);
> + if (ret)
> + return ret;
> +
> + for (i = 0; i < lvts_td->num_lvts_ctrl; i++)
> + lvts_ctrl_set_enable(&lvts_td->lvts_ctrl[i], true);
> +
> + return 0;
> +}
> +
> static const struct lvts_ctrl_data mt8195_lvts_mcu_data_ctrl[] = {
> {
> .cal_offset = { 0x04, 0x07 },
> @@ -1268,6 +1300,8 @@ MODULE_DEVICE_TABLE(of, lvts_of_match);
> static struct platform_driver lvts_driver = {
> .probe = lvts_probe,
> .remove = lvts_remove,
> + .suspend = lvts_suspend,
> + .resume = lvts_resume,
> .driver = {
> .name = "mtk-lvts-thermal",
> .of_match_table = lvts_of_match,
next prev parent reply other threads:[~2023-05-30 7:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-29 16:46 [PATCH v3 0/5] Add LVTS support for mt8192 Bernhard Rosenkränzer
2023-05-29 16:46 ` [PATCH v3 1/5] dt-bindings: thermal: mediatek: Add LVTS thermal controller definition " Bernhard Rosenkränzer
2023-05-30 7:02 ` Matthias Brugger
2023-05-29 16:46 ` [PATCH v3 2/5] thermal/drivers/mediatek/lvts_thermal: Add suspend and resume Bernhard Rosenkränzer
2023-05-30 7:09 ` Matthias Brugger [this message]
2023-05-29 16:46 ` [PATCH v3 3/5] thermal/drivers/mediatek/lvts_thermal: Add mt8192 support Bernhard Rosenkränzer
2023-05-30 7:12 ` Matthias Brugger
2023-05-29 16:46 ` [PATCH v3 4/5] arm64: dts: mediatek: mt8192: Add thermal nodes and thermal zones Bernhard Rosenkränzer
2023-05-30 6:59 ` AngeloGioacchino Del Regno
2023-05-29 16:46 ` [PATCH v3 5/5] thermal/drivers/mediatek/lvts_thermal: Update calibration data documentation Bernhard Rosenkränzer
2023-05-30 7:00 ` AngeloGioacchino Del Regno
-- strict thread matches above, loose matches on Subject: below --
2023-05-29 15:35 [PATCH v3 0/5] Bernhard Rosenkränzer
2023-05-29 15:35 ` [PATCH v3 2/5] thermal/drivers/mediatek/lvts_thermal: Add suspend and resume Bernhard Rosenkränzer
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=8b1cd982-2b49-7dd8-8037-7a362aa4305c@gmail.com \
--to=matthias.bgg@gmail.com \
--cc=abailon@baylibre.com \
--cc=amergnat@baylibre.com \
--cc=amitk@kernel.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bero@baylibre.com \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=james.lo@mediatek.com \
--cc=khilman@baylibre.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=nfraprado@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=rafael@kernel.org \
--cc=rdunlap@infradead.org \
--cc=rex-bc.chen@mediatek.com \
--cc=robh+dt@kernel.org \
--cc=rui.zhang@intel.com \
--cc=wenst@chromium.org \
--cc=ye.xingchen@zte.com.cn \
/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
all inboxes | Powered by JetHome®