From: WeiYong Bi Date: Mon, 10 Jul 2017 08:30:02 +0000 (+0800) Subject: drm/rockchip: lvds: add loader protect X-Git-Tag: release-20171130_firefly~4^2~154 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e289a149fbda6a83db5a9022a874e42c918d467d;p=firefly-linux-kernel-4.4.55.git drm/rockchip: lvds: add loader protect Change-Id: Ia0866cb9125a98ffb4ce99be26be9e0ccd665765 Signed-off-by: WeiYong Bi --- diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c index 4accad3f2d5b..245b773c1864 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -427,11 +427,28 @@ static enum drm_mode_status rockchip_lvds_connector_mode_valid( return MODE_OK; } +static int rockchip_lvds_loader_protect(struct drm_connector *connector, + bool on) +{ + struct rockchip_lvds *lvds = connector_to_lvds(connector); + + if (lvds->panel) + drm_panel_loader_protect(lvds->panel, on); + + if (on) + pm_runtime_get_sync(lvds->dev); + else + pm_runtime_put(lvds->dev); + + return 0; +} + static struct drm_connector_helper_funcs rockchip_lvds_connector_helper_funcs = { .get_modes = rockchip_lvds_connector_get_modes, .mode_valid = rockchip_lvds_connector_mode_valid, .best_encoder = rockchip_lvds_connector_best_encoder, + .loader_protect = rockchip_lvds_loader_protect, }; static void rockchip_lvds_encoder_dpms(struct drm_encoder *encoder, int mode)