Commit b0e41bf2 authored by Dave Gerlach's avatar Dave Gerlach Committed by Mauro Carvalho Chehab

media: am437x-vpfe: Fix suspend path to always handle pinctrl config

Currently if vpfe is not active then it returns immediately in the
suspend and resume handlers. Change this so that it always performs the
pinctrl config so that we can still get proper sleep state configuration
on the pins even if we do not need to worry about fully saving and
restoring context.
Signed-off-by: default avatarDave Gerlach <d-gerlach@ti.com>
Signed-off-by: default avatarJyri Sarha <jsarha@ti.com>
Signed-off-by: default avatarBenoit Parrot <bparrot@ti.com>
Acked-by: default avatarLad Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 2c4414ce
...@@ -2653,10 +2653,8 @@ static int vpfe_suspend(struct device *dev) ...@@ -2653,10 +2653,8 @@ static int vpfe_suspend(struct device *dev)
struct vpfe_device *vpfe = dev_get_drvdata(dev); struct vpfe_device *vpfe = dev_get_drvdata(dev);
struct vpfe_ccdc *ccdc = &vpfe->ccdc; struct vpfe_ccdc *ccdc = &vpfe->ccdc;
/* if streaming has not started we don't care */ /* only do full suspend if streaming has started */
if (!vb2_start_streaming_called(&vpfe->buffer_queue)) if (vb2_start_streaming_called(&vpfe->buffer_queue)) {
return 0;
pm_runtime_get_sync(dev); pm_runtime_get_sync(dev);
vpfe_config_enable(ccdc, 1); vpfe_config_enable(ccdc, 1);
...@@ -2669,6 +2667,7 @@ static int vpfe_suspend(struct device *dev) ...@@ -2669,6 +2667,7 @@ static int vpfe_suspend(struct device *dev)
/* Disable both master and slave clock */ /* Disable both master and slave clock */
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
}
/* Select sleep pin state */ /* Select sleep pin state */
pinctrl_pm_select_sleep_state(dev); pinctrl_pm_select_sleep_state(dev);
...@@ -2710,10 +2709,8 @@ static int vpfe_resume(struct device *dev) ...@@ -2710,10 +2709,8 @@ static int vpfe_resume(struct device *dev)
struct vpfe_device *vpfe = dev_get_drvdata(dev); struct vpfe_device *vpfe = dev_get_drvdata(dev);
struct vpfe_ccdc *ccdc = &vpfe->ccdc; struct vpfe_ccdc *ccdc = &vpfe->ccdc;
/* if streaming has not started we don't care */ /* only do full resume if streaming has started */
if (!vb2_start_streaming_called(&vpfe->buffer_queue)) if (vb2_start_streaming_called(&vpfe->buffer_queue)) {
return 0;
/* Enable both master and slave clock */ /* Enable both master and slave clock */
pm_runtime_get_sync(dev); pm_runtime_get_sync(dev);
vpfe_config_enable(ccdc, 1); vpfe_config_enable(ccdc, 1);
...@@ -2723,6 +2720,7 @@ static int vpfe_resume(struct device *dev) ...@@ -2723,6 +2720,7 @@ static int vpfe_resume(struct device *dev)
vpfe_config_enable(ccdc, 0); vpfe_config_enable(ccdc, 0);
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
}
/* Select default pin state */ /* Select default pin state */
pinctrl_pm_select_default_state(dev); pinctrl_pm_select_default_state(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment