* [PATCH] drm/bridge: anx7625: use pm_runtime_force_suspend(resume)
@ 2022-06-28 10:46 ` Hsin-Yi Wang
0 siblings, 0 replies; 4+ messages in thread
From: Hsin-Yi Wang @ 2022-06-28 10:46 UTC (permalink / raw)
To: Robert Foss, Xin Ji
Cc: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, David Airlie, Daniel Vetter, Sam Ravnborg,
Thomas Zimmermann, Maxime Ripard, dri-devel, linux-kernel
There's no need to check for IRQ or disable it in suspend.
Use pm_runtime_force_suspend(resume) to make sure anx7625 is powered off
correctly. Make the system suspend/resume and pm runtime suspend/resume
more consistant.
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
drivers/gpu/drm/bridge/analogix/anx7625.c | 33 ++---------------------
1 file changed, 2 insertions(+), 31 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 3710fa9ee0acd..09688a1076037 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -2542,38 +2542,9 @@ 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)) {
- enable_irq(ctx->pdata.intp_irq);
- 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);
- disable_irq(ctx->pdata.intp_irq);
- }
-
- return 0;
-}
-
static const struct dev_pm_ops anx7625_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(anx7625_suspend, anx7625_resume)
+ SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+ pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(anx7625_runtime_pm_suspend,
anx7625_runtime_pm_resume, NULL)
};
--
2.37.0.rc0.161.g10f37bed90-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] drm/bridge: anx7625: use pm_runtime_force_suspend(resume)
@ 2022-06-28 10:46 ` Hsin-Yi Wang
0 siblings, 0 replies; 4+ messages in thread
From: Hsin-Yi Wang @ 2022-06-28 10:46 UTC (permalink / raw)
To: Robert Foss, Xin Ji
Cc: Jonas Karlman, David Airlie, Thomas Zimmermann, dri-devel,
Neil Armstrong, linux-kernel, Jernej Skrabec, Laurent Pinchart,
Andrzej Hajda, Sam Ravnborg, Maxime Ripard
There's no need to check for IRQ or disable it in suspend.
Use pm_runtime_force_suspend(resume) to make sure anx7625 is powered off
correctly. Make the system suspend/resume and pm runtime suspend/resume
more consistant.
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
---
drivers/gpu/drm/bridge/analogix/anx7625.c | 33 ++---------------------
1 file changed, 2 insertions(+), 31 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
index 3710fa9ee0acd..09688a1076037 100644
--- a/drivers/gpu/drm/bridge/analogix/anx7625.c
+++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
@@ -2542,38 +2542,9 @@ 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)) {
- enable_irq(ctx->pdata.intp_irq);
- 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);
- disable_irq(ctx->pdata.intp_irq);
- }
-
- return 0;
-}
-
static const struct dev_pm_ops anx7625_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(anx7625_suspend, anx7625_resume)
+ SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
+ pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(anx7625_runtime_pm_suspend,
anx7625_runtime_pm_resume, NULL)
};
--
2.37.0.rc0.161.g10f37bed90-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: anx7625: use pm_runtime_force_suspend(resume)
2022-06-28 10:46 ` Hsin-Yi Wang
@ 2022-06-29 16:08 ` Hsin-Yi Wang
-1 siblings, 0 replies; 4+ messages in thread
From: Hsin-Yi Wang @ 2022-06-29 16:08 UTC (permalink / raw)
To: Robert Foss, Xin Ji
Cc: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, David Airlie, Daniel Vetter, Sam Ravnborg,
Thomas Zimmermann, Maxime Ripard, dri-devel, linux-kernel
On Tue, Jun 28, 2022 at 6:46 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> There's no need to check for IRQ or disable it in suspend.
>
> Use pm_runtime_force_suspend(resume) to make sure anx7625 is powered off
> correctly. Make the system suspend/resume and pm runtime suspend/resume
> more consistant.
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> ---
The patch is re-sent again with other anx7625 patches in this series:
https://lore.kernel.org/lkml/20220629160550.433980-1-hsinyi@chromium.org/
> drivers/gpu/drm/bridge/analogix/anx7625.c | 33 ++---------------------
> 1 file changed, 2 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 3710fa9ee0acd..09688a1076037 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -2542,38 +2542,9 @@ 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)) {
> - enable_irq(ctx->pdata.intp_irq);
> - 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);
> - disable_irq(ctx->pdata.intp_irq);
> - }
> -
> - return 0;
> -}
> -
> static const struct dev_pm_ops anx7625_pm_ops = {
> - SET_SYSTEM_SLEEP_PM_OPS(anx7625_suspend, anx7625_resume)
> + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
> + pm_runtime_force_resume)
> SET_RUNTIME_PM_OPS(anx7625_runtime_pm_suspend,
> anx7625_runtime_pm_resume, NULL)
> };
> --
> 2.37.0.rc0.161.g10f37bed90-goog
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/bridge: anx7625: use pm_runtime_force_suspend(resume)
@ 2022-06-29 16:08 ` Hsin-Yi Wang
0 siblings, 0 replies; 4+ messages in thread
From: Hsin-Yi Wang @ 2022-06-29 16:08 UTC (permalink / raw)
To: Robert Foss, Xin Ji
Cc: Jonas Karlman, David Airlie, Thomas Zimmermann, dri-devel,
Neil Armstrong, linux-kernel, Jernej Skrabec, Laurent Pinchart,
Andrzej Hajda, Sam Ravnborg, Maxime Ripard
On Tue, Jun 28, 2022 at 6:46 PM Hsin-Yi Wang <hsinyi@chromium.org> wrote:
>
> There's no need to check for IRQ or disable it in suspend.
>
> Use pm_runtime_force_suspend(resume) to make sure anx7625 is powered off
> correctly. Make the system suspend/resume and pm runtime suspend/resume
> more consistant.
>
> Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
> ---
The patch is re-sent again with other anx7625 patches in this series:
https://lore.kernel.org/lkml/20220629160550.433980-1-hsinyi@chromium.org/
> drivers/gpu/drm/bridge/analogix/anx7625.c | 33 ++---------------------
> 1 file changed, 2 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c
> index 3710fa9ee0acd..09688a1076037 100644
> --- a/drivers/gpu/drm/bridge/analogix/anx7625.c
> +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c
> @@ -2542,38 +2542,9 @@ 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)) {
> - enable_irq(ctx->pdata.intp_irq);
> - 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);
> - disable_irq(ctx->pdata.intp_irq);
> - }
> -
> - return 0;
> -}
> -
> static const struct dev_pm_ops anx7625_pm_ops = {
> - SET_SYSTEM_SLEEP_PM_OPS(anx7625_suspend, anx7625_resume)
> + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
> + pm_runtime_force_resume)
> SET_RUNTIME_PM_OPS(anx7625_runtime_pm_suspend,
> anx7625_runtime_pm_resume, NULL)
> };
> --
> 2.37.0.rc0.161.g10f37bed90-goog
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-06-29 16:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-28 10:46 [PATCH] drm/bridge: anx7625: use pm_runtime_force_suspend(resume) Hsin-Yi Wang
2022-06-28 10:46 ` Hsin-Yi Wang
2022-06-29 16:08 ` Hsin-Yi Wang
2022-06-29 16:08 ` Hsin-Yi Wang
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.