drm: omapdrm: dss: Pass DSS private structure to runtime PM functions
To prepare for the removal of the global variable storing DSS private data, pass its pointer to the dss_runtime_{get,put}() functions. As this requires getting hold of the dss_device structure in the callers, we add a new dss_get_device() function to retrieve it. The function currently returns a pointer to the global data structure, and will later be updated to get the pointer from device driver data when the DSS private structure will be allocated dynamically. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
This commit is contained in:

committed by
Tomi Valkeinen

parent
0e546dfd3f
commit
7b295257a1
@@ -64,7 +64,7 @@ static int dss_video_pll_enable(struct dss_pll *pll)
|
||||
struct dss_video_pll *vpll = container_of(pll, struct dss_video_pll, pll);
|
||||
int r;
|
||||
|
||||
r = dss_runtime_get();
|
||||
r = dss_runtime_get(pll->dss);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
@@ -83,7 +83,7 @@ static int dss_video_pll_enable(struct dss_pll *pll)
|
||||
err_reset:
|
||||
dss_dpll_disable_scp_clk(vpll);
|
||||
dss_ctrl_pll_enable(pll->id, false);
|
||||
dss_runtime_put();
|
||||
dss_runtime_put(pll->dss);
|
||||
|
||||
return r;
|
||||
}
|
||||
@@ -98,7 +98,7 @@ static void dss_video_pll_disable(struct dss_pll *pll)
|
||||
|
||||
dss_ctrl_pll_enable(pll->id, false);
|
||||
|
||||
dss_runtime_put();
|
||||
dss_runtime_put(pll->dss);
|
||||
}
|
||||
|
||||
static const struct dss_pll_ops dss_pll_ops = {
|
||||
@@ -136,8 +136,9 @@ static const struct dss_pll_hw dss_dra7_video_pll_hw = {
|
||||
.errata_i886 = true,
|
||||
};
|
||||
|
||||
struct dss_pll *dss_video_pll_init(struct platform_device *pdev, int id,
|
||||
struct regulator *regulator)
|
||||
struct dss_pll *dss_video_pll_init(struct dss_device *dss,
|
||||
struct platform_device *pdev, int id,
|
||||
struct regulator *regulator)
|
||||
{
|
||||
const char * const reg_name[] = { "pll1", "pll2" };
|
||||
const char * const clkctrl_name[] = { "pll1_clkctrl", "pll2_clkctrl" };
|
||||
@@ -189,6 +190,7 @@ struct dss_pll *dss_video_pll_init(struct platform_device *pdev, int id,
|
||||
pll->base = pll_base;
|
||||
pll->hw = &dss_dra7_video_pll_hw;
|
||||
pll->ops = &dss_pll_ops;
|
||||
pll->dss = dss;
|
||||
|
||||
r = dss_pll_register(pll);
|
||||
if (r)
|
||||
|
Reference in New Issue
Block a user