Skip to content

Commit

Permalink
OMAPDSS: SDI: Create a function to set timings
Browse files Browse the repository at this point in the history
Create function omapdss_sdi_set_timings(). Configuring new timings is done the
same way as before, SDI is disabled, and re-enabled with the new timings in
dssdev. This just moves the code from the panel drivers to the SDI driver.

The panel drivers shouldn't be aware of how SDI manages to configure a new set
of timings. This should be taken care of by the SDI driver itself.

Signed-off-by: Archit Taneja <archit@ti.com>
  • Loading branch information
Archit Taneja committed Aug 15, 2012
1 parent ed1aa90 commit c7833f7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
13 changes: 1 addition & 12 deletions drivers/video/omap2/displays/panel-acx565akm.c
Original file line number Diff line number Diff line change
Expand Up @@ -731,18 +731,7 @@ static int acx_panel_resume(struct omap_dss_device *dssdev)
static void acx_panel_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
int r;

if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
omapdss_sdi_display_disable(dssdev);

dssdev->panel.timings = *timings;

if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
r = omapdss_sdi_display_enable(dssdev);
if (r)
dev_err(&dssdev->dev, "%s enable failed\n", __func__);
}
omapdss_sdi_set_timings(dssdev, timings);
}

static int acx_panel_check_timings(struct omap_dss_device *dssdev,
Expand Down
17 changes: 17 additions & 0 deletions drivers/video/omap2/dss/sdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,23 @@ void omapdss_sdi_display_disable(struct omap_dss_device *dssdev)
}
EXPORT_SYMBOL(omapdss_sdi_display_disable);

void omapdss_sdi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
int r;

dssdev->panel.timings = *timings;

if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
omapdss_sdi_display_disable(dssdev);

r = omapdss_sdi_display_enable(dssdev);
if (r)
DSSERR("failed to set new timings\n");
}
}
EXPORT_SYMBOL(omapdss_sdi_set_timings);

static int __init sdi_init_display(struct omap_dss_device *dssdev)
{
DSSDBG("SDI init\n");
Expand Down
2 changes: 2 additions & 0 deletions include/video/omapdss.h
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,8 @@ int dpi_check_timings(struct omap_dss_device *dssdev,

int omapdss_sdi_display_enable(struct omap_dss_device *dssdev);
void omapdss_sdi_display_disable(struct omap_dss_device *dssdev);
void omapdss_sdi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings);

int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev);
void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev);
Expand Down

0 comments on commit c7833f7

Please sign in to comment.