Skip to content

Commit

Permalink
OMAPDSS: remove uses of dss_runtime_get/put
Browse files Browse the repository at this point in the history
Now that the omapdss_core device is the parent for all other dss
devices, we don't need to use the dss_runtime_get/put anymore. Instead,
enabling omapdss_core will happen automatically when a child device is
enabled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
  • Loading branch information
Tomi Valkeinen committed May 11, 2012
1 parent a57dd4f commit 852f083
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 99 deletions.
7 changes: 0 additions & 7 deletions drivers/video/omap2/dss/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3571,19 +3571,12 @@ static int omap_dispchw_remove(struct platform_device *pdev)
static int dispc_runtime_suspend(struct device *dev)
{
dispc_save_context();
dss_runtime_put();

return 0;
}

static int dispc_runtime_resume(struct device *dev)
{
int r;

r = dss_runtime_get();
if (r < 0)
return r;

dispc_restore_context();

return 0;
Expand Down
16 changes: 1 addition & 15 deletions drivers/video/omap2/dss/dpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,6 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
goto err_reg_enable;
}

r = dss_runtime_get();
if (r)
goto err_get_dss;

r = dispc_runtime_get();
if (r)
goto err_get_dispc;
Expand Down Expand Up @@ -244,8 +240,6 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
err_get_dsi:
dispc_runtime_put();
err_get_dispc:
dss_runtime_put();
err_get_dss:
if (cpu_is_omap34xx())
regulator_disable(dpi.vdds_dsi_reg);
err_reg_enable:
Expand All @@ -266,7 +260,6 @@ void omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
}

dispc_runtime_put();
dss_runtime_put();

if (cpu_is_omap34xx())
regulator_disable(dpi.vdds_dsi_reg);
Expand All @@ -283,20 +276,13 @@ void dpi_set_timings(struct omap_dss_device *dssdev,
DSSDBG("dpi_set_timings\n");
dssdev->panel.timings = *timings;
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
r = dss_runtime_get();
if (r)
return;

r = dispc_runtime_get();
if (r) {
dss_runtime_put();
if (r)
return;
}

dpi_set_mode(dssdev);

dispc_runtime_put();
dss_runtime_put();
} else {
dss_mgr_set_timings(dssdev->manager, timings);
}
Expand Down
12 changes: 1 addition & 11 deletions drivers/video/omap2/dss/dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -4767,7 +4767,6 @@ static int omap_dsihw_remove(struct platform_device *dsidev)
static int dsi_runtime_suspend(struct device *dev)
{
dispc_runtime_put();
dss_runtime_put();

return 0;
}
Expand All @@ -4776,20 +4775,11 @@ static int dsi_runtime_resume(struct device *dev)
{
int r;

r = dss_runtime_get();
if (r)
goto err_get_dss;

r = dispc_runtime_get();
if (r)
goto err_get_dispc;
return r;

return 0;

err_get_dispc:
dss_runtime_put();
err_get_dss:
return r;
}

static const struct dev_pm_ops dsi_pm_ops = {
Expand Down
7 changes: 5 additions & 2 deletions drivers/video/omap2/dss/dss.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ struct dss_reg {
#define REG_FLD_MOD(idx, val, start, end) \
dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))

static int dss_runtime_get(void);
static void dss_runtime_put(void);

static struct {
struct platform_device *pdev;
void __iomem *base;
Expand Down Expand Up @@ -707,7 +710,7 @@ static void dss_put_clocks(void)
clk_put(dss.dss_clk);
}

int dss_runtime_get(void)
static int dss_runtime_get(void)
{
int r;

Expand All @@ -718,7 +721,7 @@ int dss_runtime_get(void)
return r < 0 ? r : 0;
}

void dss_runtime_put(void)
static void dss_runtime_put(void)
{
int r;

Expand Down
3 changes: 0 additions & 3 deletions drivers/video/omap2/dss/dss.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,6 @@ int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,
int dss_init_platform_driver(void);
void dss_uninit_platform_driver(void);

int dss_runtime_get(void);
void dss_runtime_put(void);

void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select);
enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);
const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
Expand Down
34 changes: 2 additions & 32 deletions drivers/video/omap2/dss/hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,12 @@ static int hdmi_runtime_get(void)

DSSDBG("hdmi_runtime_get\n");

/*
* HACK: Add dss_runtime_get() to ensure DSS clock domain is enabled.
* This should be removed later.
*/
r = dss_runtime_get();
if (r < 0)
goto err_get_dss;

r = pm_runtime_get_sync(&hdmi.pdev->dev);
WARN_ON(r < 0);
if (r < 0)
goto err_get_hdmi;
return r;

return 0;

err_get_hdmi:
dss_runtime_put();
err_get_dss:
return r;
}

static void hdmi_runtime_put(void)
Expand All @@ -158,12 +145,6 @@ static void hdmi_runtime_put(void)

r = pm_runtime_put_sync(&hdmi.pdev->dev);
WARN_ON(r < 0);

/*
* HACK: This is added to complement the dss_runtime_get() call in
* hdmi_runtime_get(). This should be removed later.
*/
dss_runtime_put();
}

int hdmi_init_display(struct omap_dss_device *dssdev)
Expand Down Expand Up @@ -866,7 +847,6 @@ static int hdmi_runtime_suspend(struct device *dev)
clk_disable(hdmi.sys_clk);

dispc_runtime_put();
dss_runtime_put();

return 0;
}
Expand All @@ -875,23 +855,13 @@ static int hdmi_runtime_resume(struct device *dev)
{
int r;

r = dss_runtime_get();
if (r < 0)
goto err_get_dss;

r = dispc_runtime_get();
if (r < 0)
goto err_get_dispc;

return r;

clk_enable(hdmi.sys_clk);

return 0;

err_get_dispc:
dss_runtime_put();
err_get_dss:
return r;
}

static const struct dev_pm_ops hdmi_pm_ops = {
Expand Down
12 changes: 1 addition & 11 deletions drivers/video/omap2/dss/rfbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,6 @@ static int omap_rfbihw_remove(struct platform_device *pdev)
static int rfbi_runtime_suspend(struct device *dev)
{
dispc_runtime_put();
dss_runtime_put();

return 0;
}
Expand All @@ -1001,20 +1000,11 @@ static int rfbi_runtime_resume(struct device *dev)
{
int r;

r = dss_runtime_get();
if (r < 0)
goto err_get_dss;

r = dispc_runtime_get();
if (r < 0)
goto err_get_dispc;
return r;

return 0;

err_get_dispc:
dss_runtime_put();
err_get_dss:
return r;
}

static const struct dev_pm_ops rfbi_pm_ops = {
Expand Down
7 changes: 0 additions & 7 deletions drivers/video/omap2/dss/sdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
if (r)
goto err_reg_enable;

r = dss_runtime_get();
if (r)
goto err_get_dss;

r = dispc_runtime_get();
if (r)
goto err_get_dispc;
Expand Down Expand Up @@ -138,8 +134,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
err_calc_clock_div:
dispc_runtime_put();
err_get_dispc:
dss_runtime_put();
err_get_dss:
regulator_disable(sdi.vdds_sdi_reg);
err_reg_enable:
omap_dss_stop_device(dssdev);
Expand All @@ -155,7 +149,6 @@ void omapdss_sdi_display_disable(struct omap_dss_device *dssdev)
dss_sdi_disable();

dispc_runtime_put();
dss_runtime_put();

regulator_disable(sdi.vdds_sdi_reg);

Expand Down
12 changes: 1 addition & 11 deletions drivers/video/omap2/dss/venc.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,6 @@ static int venc_runtime_suspend(struct device *dev)
clk_disable(venc.tv_dac_clk);

dispc_runtime_put();
dss_runtime_put();

return 0;
}
Expand All @@ -912,23 +911,14 @@ static int venc_runtime_resume(struct device *dev)
{
int r;

r = dss_runtime_get();
if (r < 0)
goto err_get_dss;

r = dispc_runtime_get();
if (r < 0)
goto err_get_dispc;
return r;

if (venc.tv_dac_clk)
clk_enable(venc.tv_dac_clk);

return 0;

err_get_dispc:
dss_runtime_put();
err_get_dss:
return r;
}

static const struct dev_pm_ops venc_pm_ops = {
Expand Down

0 comments on commit 852f083

Please sign in to comment.