dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/stm: dw_mipi_dsi-stm: add sleep power management
@ 2019-03-21  8:13 Yannick Fertré
  2019-03-26 12:52 ` Philippe CORNU
  0 siblings, 1 reply; 3+ messages in thread
From: Yannick Fertré @ 2019-03-21  8:13 UTC (permalink / raw)
  To: Yannick Fertre, Philippe Cornu, Thierry Reding, David Airlie,
	Daniel Vetter, dri-devel, linux-kernel, linux-stm32

Implements system sleep power management ops.

Signed-off-by: Yannick Fertré <yannick.fertre@st.com>
---
 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index a672b59..1bef73e 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -356,12 +356,40 @@ static int dw_mipi_dsi_stm_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev)
+{
+	struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
+
+	DRM_DEBUG_DRIVER("\n");
+
+	clk_disable_unprepare(dsi->pllref_clk);
+
+	return 0;
+}
+
+static int __maybe_unused dw_mipi_dsi_stm_resume(struct device *dev)
+{
+	struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
+
+	DRM_DEBUG_DRIVER("\n");
+
+	clk_prepare_enable(dsi->pllref_clk);
+
+	return 0;
+}
+
+static const struct dev_pm_ops dw_mipi_dsi_stm_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(dw_mipi_dsi_stm_suspend,
+				dw_mipi_dsi_stm_resume)
+};
+
 static struct platform_driver dw_mipi_dsi_stm_driver = {
 	.probe		= dw_mipi_dsi_stm_probe,
 	.remove		= dw_mipi_dsi_stm_remove,
 	.driver		= {
 		.of_match_table = dw_mipi_dsi_stm_dt_ids,
 		.name	= "stm32-display-dsi",
+		.pm = &dw_mipi_dsi_stm_pm_ops,
 	},
 };
 
-- 
2.7.4

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/stm: dw_mipi_dsi-stm: add sleep power management
  2019-03-21  8:13 [PATCH] drm/stm: dw_mipi_dsi-stm: add sleep power management Yannick Fertré
@ 2019-03-26 12:52 ` Philippe CORNU
  2019-04-01  9:07   ` Benjamin Gaignard
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe CORNU @ 2019-03-26 12:52 UTC (permalink / raw)
  To: Yannick FERTRE, Thierry Reding, David Airlie, Daniel Vetter,
	dri-devel, linux-kernel, linux-stm32

Dear Yannick,
Many thanks for your patch.

Acked-by: Philippe Cornu <philippe.cornu@st.com>

Philippe :-)


On 3/21/19 9:13 AM, Yannick Fertré wrote:
> Implements system sleep power management ops.
> 
> Signed-off-by: Yannick Fertré <yannick.fertre@st.com>
> ---
>   drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 28 ++++++++++++++++++++++++++++
>   1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> index a672b59..1bef73e 100644
> --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> @@ -356,12 +356,40 @@ static int dw_mipi_dsi_stm_remove(struct platform_device *pdev)
>   	return 0;
>   }
>   
> +static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev)
> +{
> +	struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
> +
> +	DRM_DEBUG_DRIVER("\n");
> +
> +	clk_disable_unprepare(dsi->pllref_clk);
> +
> +	return 0;
> +}
> +
> +static int __maybe_unused dw_mipi_dsi_stm_resume(struct device *dev)
> +{
> +	struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
> +
> +	DRM_DEBUG_DRIVER("\n");
> +
> +	clk_prepare_enable(dsi->pllref_clk);
> +
> +	return 0;
> +}
> +
> +static const struct dev_pm_ops dw_mipi_dsi_stm_pm_ops = {
> +	SET_SYSTEM_SLEEP_PM_OPS(dw_mipi_dsi_stm_suspend,
> +				dw_mipi_dsi_stm_resume)
> +};
> +
>   static struct platform_driver dw_mipi_dsi_stm_driver = {
>   	.probe		= dw_mipi_dsi_stm_probe,
>   	.remove		= dw_mipi_dsi_stm_remove,
>   	.driver		= {
>   		.of_match_table = dw_mipi_dsi_stm_dt_ids,
>   		.name	= "stm32-display-dsi",
> +		.pm = &dw_mipi_dsi_stm_pm_ops,
>   	},
>   };
>   
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/stm: dw_mipi_dsi-stm: add sleep power management
  2019-03-26 12:52 ` Philippe CORNU
@ 2019-04-01  9:07   ` Benjamin Gaignard
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Gaignard @ 2019-04-01  9:07 UTC (permalink / raw)
  To: Philippe CORNU
  Cc: Yannick FERTRE, Thierry Reding, David Airlie, Daniel Vetter,
	dri-devel, linux-kernel, linux-stm32

Le mar. 26 mars 2019 à 13:57, Philippe CORNU <philippe.cornu@st.com> a écrit :
>
> Dear Yannick,
> Many thanks for your patch.
>
> Acked-by: Philippe Cornu <philippe.cornu@st.com>

Applied on drm-misc-next.

Benjamin

>
> Philippe :-)
>
>
> On 3/21/19 9:13 AM, Yannick Fertré wrote:
> > Implements system sleep power management ops.
> >
> > Signed-off-by: Yannick Fertré <yannick.fertre@st.com>
> > ---
> >   drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 28 ++++++++++++++++++++++++++++
> >   1 file changed, 28 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> > index a672b59..1bef73e 100644
> > --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> > +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> > @@ -356,12 +356,40 @@ static int dw_mipi_dsi_stm_remove(struct platform_device *pdev)
> >       return 0;
> >   }
> >
> > +static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev)
> > +{
> > +     struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
> > +
> > +     DRM_DEBUG_DRIVER("\n");
> > +
> > +     clk_disable_unprepare(dsi->pllref_clk);
> > +
> > +     return 0;
> > +}
> > +
> > +static int __maybe_unused dw_mipi_dsi_stm_resume(struct device *dev)
> > +{
> > +     struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data;
> > +
> > +     DRM_DEBUG_DRIVER("\n");
> > +
> > +     clk_prepare_enable(dsi->pllref_clk);
> > +
> > +     return 0;
> > +}
> > +
> > +static const struct dev_pm_ops dw_mipi_dsi_stm_pm_ops = {
> > +     SET_SYSTEM_SLEEP_PM_OPS(dw_mipi_dsi_stm_suspend,
> > +                             dw_mipi_dsi_stm_resume)
> > +};
> > +
> >   static struct platform_driver dw_mipi_dsi_stm_driver = {
> >       .probe          = dw_mipi_dsi_stm_probe,
> >       .remove         = dw_mipi_dsi_stm_remove,
> >       .driver         = {
> >               .of_match_table = dw_mipi_dsi_stm_dt_ids,
> >               .name   = "stm32-display-dsi",
> > +             .pm = &dw_mipi_dsi_stm_pm_ops,
> >       },
> >   };
> >
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-01  9:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-21  8:13 [PATCH] drm/stm: dw_mipi_dsi-stm: add sleep power management Yannick Fertré
2019-03-26 12:52 ` Philippe CORNU
2019-04-01  9:07   ` Benjamin Gaignard

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).