]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vc4: hdmi: Rework power up
authorMaxime Ripard <maxime@cerno.tech>
Wed, 29 Jun 2022 12:34:37 +0000 (14:34 +0200)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 18 Aug 2022 15:15:18 +0000 (17:15 +0200)
commit1f0a851caa2432ab462a281ea2f8d396cb23abe9
treede0499c9d332b92054175e0fa5176641dade7752
parent0588b64d2f2d27272bf8a06285c6370e42c35834
drm/vc4: hdmi: Rework power up

The current code tries to handle the case where CONFIG_PM isn't selected
by first calling our runtime_resume implementation and then properly
report the power state to the runtime_pm core.

This allows to have a functionning device even if pm_runtime_get_*
functions are nops.

However, the device power state if CONFIG_PM is enabled is
RPM_SUSPENDED, and thus our vc4_hdmi_write() and vc4_hdmi_read() calls
in the runtime_pm hooks will now report a warning since the device might
not be properly powered.

Even more so, we need CONFIG_PM enabled since the previous RaspberryPi
have a power domain that needs to be powered up for the HDMI controller
to be usable.

The previous patch has created a dependency on CONFIG_PM, now we can
just assume it's there and only call pm_runtime_resume_and_get() to make
sure our device is powered in bind.

Link: https://lore.kernel.org/r/20220629123510.1915022-39-maxime@cerno.tech
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
(cherry picked from commit 53565c28e6af2cef6bbf438c34250135e3564459)
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/vc4/vc4_hdmi.c