linux/drivers/gpu/drm/mxsfb
Marek Vasut 172695f145 drm/lcdif: Do not disable clocks on already suspended hardware
In case the LCDIF is enabled in DT but unused, the clocks used by the
LCDIF are not enabled. Those clocks may even have a use count of 0 in
case there are no other users of those clocks. This can happen e.g. in
case the LCDIF drives HDMI bridge which has no panel plugged into the
HDMI connector.

Do not attempt to disable clocks in the suspend callback and re-enable
clocks in the resume callback unless the LCDIF is enabled and was in
use before the system entered suspend, otherwise the driver might end
up trying to disable clocks which are already disabled with use count
0, and would trigger a warning from clock core about this condition.

Note that the lcdif_rpm_suspend() and lcdif_rpm_resume() functions
internally perform the clocks disable and enable operations and act
as runtime PM hooks too.

Reviewed-by: Liu Ying <victor.liu@nxp.com>
Fixes: 9db35bb349 ("drm: lcdif: Add support for i.MX8MP LCDIF variant")
Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240226082644.32603-1-marex@denx.de
2024-03-20 04:32:55 +01:00
..
Kconfig drm: mxsfb: DRM_MXSFB should depend on ARCH_MXS || ARCH_MXC 2022-11-25 22:47:34 +01:00
lcdif_drv.c drm/lcdif: Do not disable clocks on already suspended hardware 2024-03-20 04:32:55 +01:00
lcdif_drv.h drm: lcdif: Add multiple encoders and first bridges support 2023-05-26 19:07:32 +02:00
lcdif_kms.c drm: lcdif: Add multiple encoders and first bridges support 2023-05-26 19:07:32 +02:00
lcdif_regs.h drm: lcdif: Set and enable FIFO Panic threshold 2022-11-09 01:31:45 +01:00
Makefile drm: lcdif: Add support for i.MX8MP LCDIF variant 2022-06-29 01:44:48 +02:00
mxsfb_drv.c drm/mxsfb: Switch to drmm_mode_config_init 2024-02-26 08:33:25 +01:00
mxsfb_drv.h drm: mxsfb: Implement LCDIF scanout CRC32 support 2022-05-05 01:03:49 +02:00
mxsfb_kms.c drm/mxsfb: Disable overlay plane in mxsfb_plane_overlay_atomic_disable() 2023-06-25 14:51:35 +02:00
mxsfb_regs.h drm: mxsfb: Implement LCDIF scanout CRC32 support 2022-05-05 01:03:49 +02:00