OMAPDSS: DPI: Maintain our own timings field in driver data
The DPI driver currently relies on the timings in omap_dss_device struct to configure the DISPC accordingly. This makes the DPI interface driver dependent on the omap_dss_device struct. Make the DPI driver data maintain it's own timings field. The panel driver is expected to call dpi_set_timings()(renamed to omapdss_dpi_set_timings) to set these timings before the panel is enabled. In the set_timings() op, we still ensure that the omap_dss_device timings (dssdev->panel.timings) are configured. This will later be configured only by the DPI panel drivers. Signed-off-by: Archit Taneja <archit@ti.com>
This commit is contained in:
parent
e19d659bbf
commit
c499144c3b
@ -565,6 +565,8 @@ static int generic_dpi_panel_power_on(struct omap_dss_device *dssdev)
|
|||||||
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
|
||||||
|
|
||||||
r = omapdss_dpi_display_enable(dssdev);
|
r = omapdss_dpi_display_enable(dssdev);
|
||||||
if (r)
|
if (r)
|
||||||
goto err0;
|
goto err0;
|
||||||
@ -726,7 +728,7 @@ static void generic_dpi_panel_set_timings(struct omap_dss_device *dssdev,
|
|||||||
|
|
||||||
mutex_lock(&drv_data->lock);
|
mutex_lock(&drv_data->lock);
|
||||||
|
|
||||||
dpi_set_timings(dssdev, timings);
|
omapdss_dpi_set_timings(dssdev, timings);
|
||||||
|
|
||||||
mutex_unlock(&drv_data->lock);
|
mutex_unlock(&drv_data->lock);
|
||||||
}
|
}
|
||||||
|
@ -55,6 +55,8 @@ static int lb035q02_panel_power_on(struct omap_dss_device *dssdev)
|
|||||||
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
|
||||||
|
|
||||||
r = omapdss_dpi_display_enable(dssdev);
|
r = omapdss_dpi_display_enable(dssdev);
|
||||||
if (r)
|
if (r)
|
||||||
goto err0;
|
goto err0;
|
||||||
|
@ -175,6 +175,8 @@ static int nec_8048_panel_power_on(struct omap_dss_device *dssdev)
|
|||||||
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
|
||||||
|
|
||||||
r = omapdss_dpi_display_enable(dssdev);
|
r = omapdss_dpi_display_enable(dssdev);
|
||||||
if (r)
|
if (r)
|
||||||
goto err0;
|
goto err0;
|
||||||
|
@ -377,6 +377,9 @@ static int picodlp_panel_power_on(struct omap_dss_device *dssdev)
|
|||||||
* then only i2c commands can be successfully sent to dpp2600
|
* then only i2c commands can be successfully sent to dpp2600
|
||||||
*/
|
*/
|
||||||
msleep(1000);
|
msleep(1000);
|
||||||
|
|
||||||
|
omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
|
||||||
|
|
||||||
r = omapdss_dpi_display_enable(dssdev);
|
r = omapdss_dpi_display_enable(dssdev);
|
||||||
if (r) {
|
if (r) {
|
||||||
dev_err(&dssdev->dev, "failed to enable DPI\n");
|
dev_err(&dssdev->dev, "failed to enable DPI\n");
|
||||||
|
@ -142,6 +142,8 @@ static int sharp_ls_power_on(struct omap_dss_device *dssdev)
|
|||||||
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
|
||||||
|
|
||||||
r = omapdss_dpi_display_enable(dssdev);
|
r = omapdss_dpi_display_enable(dssdev);
|
||||||
if (r)
|
if (r)
|
||||||
goto err0;
|
goto err0;
|
||||||
|
@ -65,6 +65,8 @@ static int tfp410_power_on(struct omap_dss_device *dssdev)
|
|||||||
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
|
||||||
|
|
||||||
r = omapdss_dpi_display_enable(dssdev);
|
r = omapdss_dpi_display_enable(dssdev);
|
||||||
if (r)
|
if (r)
|
||||||
goto err0;
|
goto err0;
|
||||||
@ -231,7 +233,7 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev,
|
|||||||
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev);
|
struct panel_drv_data *ddata = dev_get_drvdata(&dssdev->dev);
|
||||||
|
|
||||||
mutex_lock(&ddata->lock);
|
mutex_lock(&ddata->lock);
|
||||||
dpi_set_timings(dssdev, timings);
|
omapdss_dpi_set_timings(dssdev, timings);
|
||||||
mutex_unlock(&ddata->lock);
|
mutex_unlock(&ddata->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,6 +337,8 @@ static int tpo_td043_enable_dss(struct omap_dss_device *dssdev)
|
|||||||
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
omapdss_dpi_set_timings(dssdev, &dssdev->panel.timings);
|
||||||
|
|
||||||
r = omapdss_dpi_display_enable(dssdev);
|
r = omapdss_dpi_display_enable(dssdev);
|
||||||
if (r)
|
if (r)
|
||||||
goto err0;
|
goto err0;
|
||||||
@ -480,7 +482,7 @@ static void tpo_td043_remove(struct omap_dss_device *dssdev)
|
|||||||
static void tpo_td043_set_timings(struct omap_dss_device *dssdev,
|
static void tpo_td043_set_timings(struct omap_dss_device *dssdev,
|
||||||
struct omap_video_timings *timings)
|
struct omap_video_timings *timings)
|
||||||
{
|
{
|
||||||
dpi_set_timings(dssdev, timings);
|
omapdss_dpi_set_timings(dssdev, timings);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tpo_td043_check_timings(struct omap_dss_device *dssdev,
|
static int tpo_td043_check_timings(struct omap_dss_device *dssdev,
|
||||||
|
@ -41,6 +41,7 @@ static struct {
|
|||||||
|
|
||||||
struct mutex lock;
|
struct mutex lock;
|
||||||
|
|
||||||
|
struct omap_video_timings timings;
|
||||||
struct dss_lcd_mgr_config mgr_config;
|
struct dss_lcd_mgr_config mgr_config;
|
||||||
} dpi;
|
} dpi;
|
||||||
|
|
||||||
@ -123,7 +124,7 @@ static int dpi_set_dispc_clk(struct omap_dss_device *dssdev,
|
|||||||
|
|
||||||
static int dpi_set_mode(struct omap_dss_device *dssdev)
|
static int dpi_set_mode(struct omap_dss_device *dssdev)
|
||||||
{
|
{
|
||||||
struct omap_video_timings *t = &dssdev->panel.timings;
|
struct omap_video_timings *t = &dpi.timings;
|
||||||
int lck_div = 0, pck_div = 0;
|
int lck_div = 0, pck_div = 0;
|
||||||
unsigned long fck = 0;
|
unsigned long fck = 0;
|
||||||
unsigned long pck;
|
unsigned long pck;
|
||||||
@ -272,7 +273,7 @@ void omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
|
|||||||
}
|
}
|
||||||
EXPORT_SYMBOL(omapdss_dpi_display_disable);
|
EXPORT_SYMBOL(omapdss_dpi_display_disable);
|
||||||
|
|
||||||
void dpi_set_timings(struct omap_dss_device *dssdev,
|
void omapdss_dpi_set_timings(struct omap_dss_device *dssdev,
|
||||||
struct omap_video_timings *timings)
|
struct omap_video_timings *timings)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
@ -281,7 +282,9 @@ void dpi_set_timings(struct omap_dss_device *dssdev,
|
|||||||
|
|
||||||
mutex_lock(&dpi.lock);
|
mutex_lock(&dpi.lock);
|
||||||
|
|
||||||
|
dpi.timings = *timings;
|
||||||
dssdev->panel.timings = *timings;
|
dssdev->panel.timings = *timings;
|
||||||
|
|
||||||
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
|
if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
|
||||||
r = dispc_runtime_get();
|
r = dispc_runtime_get();
|
||||||
if (r)
|
if (r)
|
||||||
@ -296,7 +299,7 @@ void dpi_set_timings(struct omap_dss_device *dssdev,
|
|||||||
|
|
||||||
mutex_unlock(&dpi.lock);
|
mutex_unlock(&dpi.lock);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(dpi_set_timings);
|
EXPORT_SYMBOL(omapdss_dpi_set_timings);
|
||||||
|
|
||||||
int dpi_check_timings(struct omap_dss_device *dssdev,
|
int dpi_check_timings(struct omap_dss_device *dssdev,
|
||||||
struct omap_video_timings *timings)
|
struct omap_video_timings *timings)
|
||||||
|
@ -734,7 +734,7 @@ void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
|
|||||||
|
|
||||||
int omapdss_dpi_display_enable(struct omap_dss_device *dssdev);
|
int omapdss_dpi_display_enable(struct omap_dss_device *dssdev);
|
||||||
void omapdss_dpi_display_disable(struct omap_dss_device *dssdev);
|
void omapdss_dpi_display_disable(struct omap_dss_device *dssdev);
|
||||||
void dpi_set_timings(struct omap_dss_device *dssdev,
|
void omapdss_dpi_set_timings(struct omap_dss_device *dssdev,
|
||||||
struct omap_video_timings *timings);
|
struct omap_video_timings *timings);
|
||||||
int dpi_check_timings(struct omap_dss_device *dssdev,
|
int dpi_check_timings(struct omap_dss_device *dssdev,
|
||||||
struct omap_video_timings *timings);
|
struct omap_video_timings *timings);
|
||||||
|
Loading…
Reference in New Issue
Block a user