mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-07 15:36:42 +07:00
OMAPDSS: DSI: dsi_runtime_get/put in pll_init
When DPI uses the DSI PLL for pixel clock, the DPI code will call dsi_runtime_get/put to keep the DSI block enabled. A much simpler way to handle this is to do dsi_runtime_get/put in DSI's dsi_pll_init() and dsi_pll_uninit(), thus removing the need for DSI to call the runtime PM functions. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
parent
dbb26e53e5
commit
f76b178a78
@ -402,10 +402,6 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
|
||||
goto err_src_sel;
|
||||
|
||||
if (dpi->dsidev) {
|
||||
r = dsi_runtime_get(dpi->dsidev);
|
||||
if (r)
|
||||
goto err_get_dsi;
|
||||
|
||||
r = dsi_pll_init(dpi->dsidev);
|
||||
if (r)
|
||||
goto err_dsi_pll_init;
|
||||
@ -432,9 +428,6 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
|
||||
if (dpi->dsidev)
|
||||
dsi_pll_uninit(dpi->dsidev, true);
|
||||
err_dsi_pll_init:
|
||||
if (dpi->dsidev)
|
||||
dsi_runtime_put(dpi->dsidev);
|
||||
err_get_dsi:
|
||||
err_src_sel:
|
||||
dispc_runtime_put();
|
||||
err_get_dispc:
|
||||
@ -459,7 +452,6 @@ static void dpi_display_disable(struct omap_dss_device *dssdev)
|
||||
if (dpi->dsidev) {
|
||||
dss_select_lcd_clk_source(mgr->id, OMAP_DSS_CLK_SRC_FCK);
|
||||
dsi_pll_uninit(dpi->dsidev, true);
|
||||
dsi_runtime_put(dpi->dsidev);
|
||||
}
|
||||
|
||||
dispc_runtime_put();
|
||||
@ -554,18 +546,11 @@ static int dpi_verify_dsi_pll(struct platform_device *dsidev)
|
||||
|
||||
/* do initial setup with the PLL to see if it is operational */
|
||||
|
||||
r = dsi_runtime_get(dsidev);
|
||||
r = dsi_pll_init(dsidev);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
r = dsi_pll_init(dsidev);
|
||||
if (r) {
|
||||
dsi_runtime_put(dsidev);
|
||||
return r;
|
||||
}
|
||||
|
||||
dsi_pll_uninit(dsidev, true);
|
||||
dsi_runtime_put(dsidev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1144,7 +1144,7 @@ static u32 dsi_get_errors(struct platform_device *dsidev)
|
||||
return e;
|
||||
}
|
||||
|
||||
int dsi_runtime_get(struct platform_device *dsidev)
|
||||
static int dsi_runtime_get(struct platform_device *dsidev)
|
||||
{
|
||||
int r;
|
||||
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
|
||||
@ -1156,7 +1156,7 @@ int dsi_runtime_get(struct platform_device *dsidev)
|
||||
return r < 0 ? r : 0;
|
||||
}
|
||||
|
||||
void dsi_runtime_put(struct platform_device *dsidev)
|
||||
static void dsi_runtime_put(struct platform_device *dsidev)
|
||||
{
|
||||
struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
|
||||
int r;
|
||||
@ -1674,6 +1674,10 @@ int dsi_pll_init(struct platform_device *dsidev)
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
r = dsi_runtime_get(dsidev);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
dsi_enable_pll_clock(dsidev, 1);
|
||||
/*
|
||||
* Note: SCP CLK is not required on OMAP3, but it is required on OMAP4.
|
||||
@ -1717,6 +1721,7 @@ int dsi_pll_init(struct platform_device *dsidev)
|
||||
err0:
|
||||
dsi_disable_scp_clk(dsidev);
|
||||
dsi_enable_pll_clock(dsidev, 0);
|
||||
dsi_runtime_put(dsidev);
|
||||
return r;
|
||||
}
|
||||
|
||||
@ -1733,6 +1738,7 @@ void dsi_pll_uninit(struct platform_device *dsidev, bool disconnect_lanes)
|
||||
|
||||
dsi_disable_scp_clk(dsidev);
|
||||
dsi_enable_pll_clock(dsidev, 0);
|
||||
dsi_runtime_put(dsidev);
|
||||
|
||||
DSSDBG("PLL uninit done\n");
|
||||
}
|
||||
|
@ -268,9 +268,6 @@ struct file_operations;
|
||||
int dsi_init_platform_driver(void) __init;
|
||||
void dsi_uninit_platform_driver(void) __exit;
|
||||
|
||||
int dsi_runtime_get(struct platform_device *dsidev);
|
||||
void dsi_runtime_put(struct platform_device *dsidev);
|
||||
|
||||
void dsi_dump_clocks(struct seq_file *s);
|
||||
|
||||
void dsi_irq_handler(void);
|
||||
@ -291,13 +288,6 @@ int dsi_pll_init(struct platform_device *dsidev);
|
||||
void dsi_pll_uninit(struct platform_device *dsidev, bool disconnect_lanes);
|
||||
struct platform_device *dsi_get_dsidev_from_id(int module);
|
||||
#else
|
||||
static inline int dsi_runtime_get(struct platform_device *dsidev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline void dsi_runtime_put(struct platform_device *dsidev)
|
||||
{
|
||||
}
|
||||
static inline u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt)
|
||||
{
|
||||
WARN("%s: DSI not compiled in, returning pixel_size as 0\n", __func__);
|
||||
|
Loading…
Reference in New Issue
Block a user