From: Hsin-Yi Wang <hsinyi@chromium.org>
To: Pi-Hsun Shih <pihsun@chromium.org>
Cc: Tzung-Bi Shih <tzungbi@google.com>,
Andrzej Hajda <a.hajda@samsung.com>,
Neil Armstrong <narmstrong@baylibre.com>,
Robert Foss <robert.foss@linaro.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@siol.net>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Xin Ji <xji@analogixsemi.com>, Sam Ravnborg <sam@ravnborg.org>,
"open list:DRM DRIVERS" <dri-devel@lists.freedesktop.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] drm/bridge: anx7625: add suspend / resume hooks
Date: Tue, 11 May 2021 12:34:09 +0800 [thread overview]
Message-ID: <CAJMQK-jYb_0+AA_bBrvkJ4JaT1mQTr6uGZQbbpnyA1CJ_NLKuw@mail.gmail.com> (raw)
In-Reply-To: <20210510053125.1595659-2-pihsun@chromium.org>
On Mon, May 10, 2021 at 1:31 PM Pi-Hsun Shih <pihsun@chromium.org> wrote:
>
> Add suspend / resume hooks for anx7625 driver, that power off the device
> on suspend and power on the device on resume if it was previously
> powered.
>
> Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Tested-by: Hsin-Yi Wang <hsinyi@chromium.org>
Tested on a mt8183 juniper device.
> ---
>
> Changes from v2:
> * No change.
>
> ---
> drivers/gpu/drm/bridge/analogix/anx7625.c | 27 +++++++++++++++++++++++
> 1 file changed, 27 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index e1bf31eafe22..b165ef71e00f 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -1705,7 +1705,34 @@ static int __maybe_unused anx7625_runtime_pm_resume(struct device *dev)
> return 0;
> }
>
> +static int __maybe_unused anx7625_resume(struct device *dev)
> +{
> + struct anx7625_data *ctx = dev_get_drvdata(dev);
> +
> + if (!ctx->pdata.intp_irq)
> + return 0;
> +
> + if (!pm_runtime_enabled(dev) || !pm_runtime_suspended(dev))
> + anx7625_runtime_pm_resume(dev);
> +
> + return 0;
> +}
> +
> +static int __maybe_unused anx7625_suspend(struct device *dev)
> +{
> + struct anx7625_data *ctx = dev_get_drvdata(dev);
> +
> + if (!ctx->pdata.intp_irq)
> + return 0;
> +
> + if (!pm_runtime_enabled(dev) || !pm_runtime_suspended(dev))
> + anx7625_runtime_pm_suspend(dev);
> +
> + return 0;
> +}
> +
> static const struct dev_pm_ops anx7625_pm_ops = {
> + SET_SYSTEM_SLEEP_PM_OPS(anx7625_suspend, anx7625_resume)
> SET_RUNTIME_PM_OPS(anx7625_runtime_pm_suspend,
> anx7625_runtime_pm_resume, NULL)
> };
> --
> 2.31.1.607.g51e8a6a459-goog
>
next prev parent reply other threads:[~2021-05-11 4:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-10 5:30 [PATCH v3 1/2] drm/bridge: anx7625: refactor power control to use runtime PM framework Pi-Hsun Shih
2021-05-10 5:30 ` [PATCH v3 2/2] drm/bridge: anx7625: add suspend / resume hooks Pi-Hsun Shih
2021-05-11 4:34 ` Hsin-Yi Wang [this message]
2021-05-11 4:33 ` [PATCH v3 1/2] drm/bridge: anx7625: refactor power control to use runtime PM framework Hsin-Yi Wang
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=CAJMQK-jYb_0+AA_bBrvkJ4JaT1mQTr6uGZQbbpnyA1CJ_NLKuw@mail.gmail.com \
--to=hsinyi@chromium.org \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=narmstrong@baylibre.com \
--cc=pihsun@chromium.org \
--cc=robert.foss@linaro.org \
--cc=sam@ravnborg.org \
--cc=tzungbi@google.com \
--cc=xji@analogixsemi.com \
/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).