All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-tegra@vger.kernel.org,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 5/9] drm/tegra: sor: Implement system suspend/resume
Date: Mon, 9 Dec 2019 03:40:25 +0300	[thread overview]
Message-ID: <8b789b1c-c44e-f169-d0ca-fff333608c28@gmail.com> (raw)
In-Reply-To: <20191203161914.1312555-5-thierry.reding@gmail.com>

03.12.2019 19:19, Thierry Reding пишет:
> From: Thierry Reding <treding@nvidia.com>
> 
> Upon system suspend, make sure the +5V HDMI regulator is disabled. This
> avoids potentially leaking current to the HDMI connector. This also
> makes sure that upon resume the regulator is enabled again, which in
> some cases is necessary to properly restore the state of the supply on
> resume.
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  drivers/gpu/drm/tegra/sor.c | 24 +++++++++++++++++++-----
>  1 file changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
> index 615cb319fa8b..2200f4cd397a 100644
> --- a/drivers/gpu/drm/tegra/sor.c
> +++ b/drivers/gpu/drm/tegra/sor.c
> @@ -3912,8 +3912,7 @@ static int tegra_sor_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM
> -static int tegra_sor_suspend(struct device *dev)
> +static int tegra_sor_runtime_suspend(struct device *dev)
>  {
>  	struct tegra_sor *sor = dev_get_drvdata(dev);
>  	int err;
> @@ -3935,7 +3934,7 @@ static int tegra_sor_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int tegra_sor_resume(struct device *dev)
> +static int tegra_sor_runtime_resume(struct device *dev)
>  {
>  	struct tegra_sor *sor = dev_get_drvdata(dev);
>  	int err;
> @@ -3967,10 +3966,25 @@ static int tegra_sor_resume(struct device *dev)
>  
>  	return 0;
>  }
> -#endif
> +
> +static int tegra_sor_suspend(struct device *dev)
> +{
> +	struct tegra_sor *sor = dev_get_drvdata(dev);
> +
> +	return regulator_disable(sor->hdmi_supply);
> +}
> +
> +static int tegra_sor_resume(struct device *dev)
> +{
> +	struct tegra_sor *sor = dev_get_drvdata(dev);
> +
> +	return regulator_enable(sor->hdmi_supply);
> +}

These functions should be annotated with __maybe_unused attribute.

>  static const struct dev_pm_ops tegra_sor_pm_ops = {
> -	SET_RUNTIME_PM_OPS(tegra_sor_suspend, tegra_sor_resume, NULL)
> +	SET_RUNTIME_PM_OPS(tegra_sor_runtime_suspend, tegra_sor_runtime_resume,
> +			   NULL)
> +	SET_SYSTEM_SLEEP_PM_OPS(tegra_sor_suspend, tegra_sor_resume)
>  };
>  
>  struct platform_driver tegra_sor_driver = {
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2019-12-09  0:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03 16:19 [PATCH v2 1/9] drm/tegra: hub: Remove bogus connection mutex check Thierry Reding
2019-12-03 16:19 ` [PATCH v2 2/9] drm/tegra: gem: Properly pin imported buffers Thierry Reding
2019-12-03 16:19 ` [PATCH v2 3/9] drm/tegra: gem: Remove premature import restrictions Thierry Reding
2019-12-03 16:19 ` [PATCH v2 4/9] drm/tegra: Use proper IOVA address for cursor image Thierry Reding
2019-12-03 16:19 ` [PATCH v2 5/9] drm/tegra: sor: Implement system suspend/resume Thierry Reding
2019-12-09  0:40   ` Dmitry Osipenko [this message]
2019-12-03 16:19 ` [PATCH v2 6/9] drm/tegra: vic: Export module device table Thierry Reding
2019-12-03 16:19 ` [PATCH v2 7/9] drm/tegra: Silence expected errors on IOMMU attach Thierry Reding
2019-12-03 16:19 ` [PATCH v2 8/9] drm/tegra: sor: Make the +5V HDMI supply optional Thierry Reding
2019-12-03 16:19 ` [PATCH v2 9/9] drm/tegra: Run hub cleanup on ->remove() Thierry Reding

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=8b789b1c-c44e-f169-d0ca-fff333608c28@gmail.com \
    --to=digetx@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.