]> Pileus Git - ~andy/linux/commitdiff
OMAPDSS: Use only "omapdss_dss" platform device to get context lost count
authorArchit Taneja <archit@ti.com>
Wed, 28 Nov 2012 11:31:39 +0000 (17:01 +0530)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 29 Nov 2012 10:48:49 +0000 (12:48 +0200)
When enabling a hwmod, omap_hwmod refers to the register mentioned in the
hwmod struct's member 'prcm.omap4.context_offs' to see whether context was
lost or not. It increments the context lost count for the hwmod and then clears
the register.

All the DSS hwmods have the same register(RM_DSS_DSS_CONTEXT) as context_offs.
When DSS is enabled, the first hwmod to be enabled is the "dss_core" hwmod since
it's corresponding platform device is the parent platform device("omapdss_dss").
The dss_core hwmod updates it's context lost count correctly and clears the
register. When the hwmods corresponding to the children platform devices are
enabled, they see that the register is clear, and don't increment their context
lost count. Therefore, all the children platform devices never report a loss in
context.

The DISPC driver currently gets the context lost count for DSS power domain from
it's corresponding platform device instance("omapdss_dispc"). The DISPC platform
device is one of the child devices, and it's corresponding hwmod("dss_dispc")
doesn't report the context lost count correctly.

Modify dss_get_ctx_loss_count() such that it always takes the "omapdss_dss"
platform device as it's input, move the function to dss.c so that it has access
to that platform device.

Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/core.c
drivers/video/omap2/dss/dispc.c
drivers/video/omap2/dss/dss.c
drivers/video/omap2/dss/dss.h

index 8c308317a19f6292a9064dada45ea7c645c1dd2c..5c5e59190586587971b923771e41ee5b6f469fc6 100644 (file)
@@ -101,21 +101,6 @@ struct regulator *dss_get_vdds_sdi(void)
        return reg;
 }
 
-int dss_get_ctx_loss_count(struct device *dev)
-{
-       struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;
-       int cnt;
-
-       if (!board_data->get_context_loss_count)
-               return -ENOENT;
-
-       cnt = board_data->get_context_loss_count(dev);
-
-       WARN_ONCE(cnt < 0, "get_context_loss_count failed: %d\n", cnt);
-
-       return cnt;
-}
-
 int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask)
 {
        struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;
index ce594a1d860cdb8b3c30b9b7baf54bc223a2e3be..f7df523067884fb05062d109370ebe5600a46a9c 100644 (file)
@@ -382,7 +382,7 @@ static void dispc_save_context(void)
        if (dss_has_feature(FEAT_CORE_CLK_DIV))
                SR(DIVISOR);
 
-       dispc.ctx_loss_cnt = dss_get_ctx_loss_count(&dispc.pdev->dev);
+       dispc.ctx_loss_cnt = dss_get_ctx_loss_count();
        dispc.ctx_valid = true;
 
        DSSDBG("context saved, ctx_loss_count %d\n", dispc.ctx_loss_cnt);
@@ -397,7 +397,7 @@ static void dispc_restore_context(void)
        if (!dispc.ctx_valid)
                return;
 
-       ctx = dss_get_ctx_loss_count(&dispc.pdev->dev);
+       ctx = dss_get_ctx_loss_count();
 
        if (ctx >= 0 && ctx == dispc.ctx_loss_cnt)
                return;
index 6ca69d55cf57e42ba111b481bf55996a4949e14d..833f1627dc76a1809c7890c7357a155057d213cf 100644 (file)
@@ -154,6 +154,21 @@ static void dss_restore_context(void)
 #undef SR
 #undef RR
 
+int dss_get_ctx_loss_count(void)
+{
+       struct omap_dss_board_info *board_data = dss.pdev->dev.platform_data;
+       int cnt;
+
+       if (!board_data->get_context_loss_count)
+               return -ENOENT;
+
+       cnt = board_data->get_context_loss_count(&dss.pdev->dev);
+
+       WARN_ONCE(cnt < 0, "get_context_loss_count failed: %d\n", cnt);
+
+       return cnt;
+}
+
 void dss_sdi_init(int datapairs)
 {
        u32 l;
index 9ee3c881d1c0e51edf4669df5e6ce9e09effb498..4d6f325cee840677f8b9e2a77807f04e9cdb15e2 100644 (file)
@@ -164,7 +164,6 @@ struct platform_device *dss_get_core_pdev(void);
 struct bus_type *dss_get_bus(void);
 struct regulator *dss_get_vdds_dsi(void);
 struct regulator *dss_get_vdds_sdi(void);
-int dss_get_ctx_loss_count(struct device *dev);
 int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask);
 void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask);
 int dss_set_min_bus_tput(struct device *dev, unsigned long tput);
@@ -284,6 +283,8 @@ void dss_dump_clocks(struct seq_file *s);
 void dss_debug_dump_clocks(struct seq_file *s);
 #endif
 
+int dss_get_ctx_loss_count(void);
+
 void dss_sdi_init(int datapairs);
 int dss_sdi_enable(void);
 void dss_sdi_disable(void);