forked from Minki/linux
drm: omapdrm: dss: Pass DSS pointer to dss_sdi_*() functions
This removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
This commit is contained in:
parent
2726099921
commit
d7157dfe04
@ -248,7 +248,7 @@ static int dss_ctrl_pll_set_control_mux(enum dss_clk_source clk_src,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dss_sdi_init(int datapairs)
|
void dss_sdi_init(struct dss_device *dss, int datapairs)
|
||||||
{
|
{
|
||||||
u32 l;
|
u32 l;
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ void dss_sdi_init(int datapairs)
|
|||||||
dss_write_reg(DSS_PLL_CONTROL, l);
|
dss_write_reg(DSS_PLL_CONTROL, l);
|
||||||
}
|
}
|
||||||
|
|
||||||
int dss_sdi_enable(void)
|
int dss_sdi_enable(struct dss_device *dss)
|
||||||
{
|
{
|
||||||
unsigned long timeout;
|
unsigned long timeout;
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ int dss_sdi_enable(void)
|
|||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dss_sdi_disable(void)
|
void dss_sdi_disable(struct dss_device *dss)
|
||||||
{
|
{
|
||||||
dispc_lcd_enable_signal(0);
|
dispc_lcd_enable_signal(0);
|
||||||
|
|
||||||
@ -1150,7 +1150,7 @@ static int dss_init_ports(struct platform_device *pdev)
|
|||||||
dpi_init_port(pdev, port, dss.feat->model);
|
dpi_init_port(pdev, port, dss.feat->model);
|
||||||
break;
|
break;
|
||||||
case OMAP_DISPLAY_TYPE_SDI:
|
case OMAP_DISPLAY_TYPE_SDI:
|
||||||
sdi_init_port(pdev, port);
|
sdi_init_port(&dss, pdev, port);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -312,9 +312,9 @@ void dss_video_pll_uninit(struct dss_pll *pll);
|
|||||||
|
|
||||||
void dss_ctrl_pll_enable(struct dss_pll *pll, bool enable);
|
void dss_ctrl_pll_enable(struct dss_pll *pll, bool enable);
|
||||||
|
|
||||||
void dss_sdi_init(int datapairs);
|
void dss_sdi_init(struct dss_device *dss, int datapairs);
|
||||||
int dss_sdi_enable(void);
|
int dss_sdi_enable(struct dss_device *dss);
|
||||||
void dss_sdi_disable(void);
|
void dss_sdi_disable(struct dss_device *dss);
|
||||||
|
|
||||||
void dss_select_dsi_clk_source(int dsi_module,
|
void dss_select_dsi_clk_source(int dsi_module,
|
||||||
enum dss_clk_source clk_src);
|
enum dss_clk_source clk_src);
|
||||||
@ -335,11 +335,13 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,
|
|||||||
|
|
||||||
/* SDI */
|
/* SDI */
|
||||||
#ifdef CONFIG_OMAP2_DSS_SDI
|
#ifdef CONFIG_OMAP2_DSS_SDI
|
||||||
int sdi_init_port(struct platform_device *pdev, struct device_node *port);
|
int sdi_init_port(struct dss_device *dss, struct platform_device *pdev,
|
||||||
|
struct device_node *port);
|
||||||
void sdi_uninit_port(struct device_node *port);
|
void sdi_uninit_port(struct device_node *port);
|
||||||
#else
|
#else
|
||||||
static inline int sdi_init_port(struct platform_device *pdev,
|
static inline int sdi_init_port(struct dss_device *dss,
|
||||||
struct device_node *port)
|
struct platform_device *pdev,
|
||||||
|
struct device_node *port)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
static struct {
|
static struct {
|
||||||
struct platform_device *pdev;
|
struct platform_device *pdev;
|
||||||
|
struct dss_device *dss;
|
||||||
|
|
||||||
bool update_enabled;
|
bool update_enabled;
|
||||||
struct regulator *vdds_sdi_reg;
|
struct regulator *vdds_sdi_reg;
|
||||||
@ -187,8 +188,8 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)
|
|||||||
*/
|
*/
|
||||||
dispc_mgr_set_clock_div(channel, &sdi.mgr_config.clock_info);
|
dispc_mgr_set_clock_div(channel, &sdi.mgr_config.clock_info);
|
||||||
|
|
||||||
dss_sdi_init(sdi.datapairs);
|
dss_sdi_init(sdi.dss, sdi.datapairs);
|
||||||
r = dss_sdi_enable();
|
r = dss_sdi_enable(sdi.dss);
|
||||||
if (r)
|
if (r)
|
||||||
goto err_sdi_enable;
|
goto err_sdi_enable;
|
||||||
mdelay(2);
|
mdelay(2);
|
||||||
@ -200,7 +201,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err_mgr_enable:
|
err_mgr_enable:
|
||||||
dss_sdi_disable();
|
dss_sdi_disable(sdi.dss);
|
||||||
err_sdi_enable:
|
err_sdi_enable:
|
||||||
err_set_dss_clock_div:
|
err_set_dss_clock_div:
|
||||||
err_calc_clock_div:
|
err_calc_clock_div:
|
||||||
@ -217,7 +218,7 @@ static void sdi_display_disable(struct omap_dss_device *dssdev)
|
|||||||
|
|
||||||
dss_mgr_disable(channel);
|
dss_mgr_disable(channel);
|
||||||
|
|
||||||
dss_sdi_disable();
|
dss_sdi_disable(sdi.dss);
|
||||||
|
|
||||||
dispc_runtime_put();
|
dispc_runtime_put();
|
||||||
|
|
||||||
@ -345,7 +346,8 @@ static void sdi_uninit_output(struct platform_device *pdev)
|
|||||||
omapdss_unregister_output(out);
|
omapdss_unregister_output(out);
|
||||||
}
|
}
|
||||||
|
|
||||||
int sdi_init_port(struct platform_device *pdev, struct device_node *port)
|
int sdi_init_port(struct dss_device *dss, struct platform_device *pdev,
|
||||||
|
struct device_node *port)
|
||||||
{
|
{
|
||||||
struct device_node *ep;
|
struct device_node *ep;
|
||||||
u32 datapairs;
|
u32 datapairs;
|
||||||
@ -362,6 +364,7 @@ int sdi_init_port(struct platform_device *pdev, struct device_node *port)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sdi.datapairs = datapairs;
|
sdi.datapairs = datapairs;
|
||||||
|
sdi.dss = dss;
|
||||||
|
|
||||||
of_node_put(ep);
|
of_node_put(ep);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user