drm/rockchip: dw-mipi: add power protect for loader logo
authorMark Yao <mark.yao@rock-chips.com>
Fri, 31 Mar 2017 10:07:55 +0000 (18:07 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Sat, 1 Apr 2017 10:25:28 +0000 (18:25 +0800)
Change-Id: I3bdd70d357324c8f526122dcab1bc44fe0ae0ff2
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/gpu/drm/rockchip/dw-mipi-dsi.c

index 0190bfb..1931247 100644 (file)
@@ -1046,7 +1046,20 @@ static struct drm_encoder *dw_mipi_dsi_connector_best_encoder(
        return &dsi->encoder;
 }
 
+static int dw_mipi_loader_protect(struct drm_connector *connector, bool on)
+{
+       struct dw_mipi_dsi *dsi = con_to_dsi(connector);
+
+       if (on)
+               pm_runtime_get_sync(dsi->dev);
+       else
+               pm_runtime_put(dsi->dev);
+
+       return 0;
+}
+
 static struct drm_connector_helper_funcs dw_mipi_dsi_connector_helper_funcs = {
+       .loader_protect = dw_mipi_loader_protect,
        .get_modes = dw_mipi_dsi_connector_get_modes,
        .mode_valid = dw_mipi_dsi_mode_valid,
        .best_encoder = dw_mipi_dsi_connector_best_encoder,