Skip to content

Commit

Permalink
OMAPDSS: HDMI: Split video_enable into video_enable/disable
Browse files Browse the repository at this point in the history
To improve readability, split the video_enable HDMI IP operation
into two separate functions for enabling and disabling video.
The video_enable function is also modified to return an error value.

While there, update these operations for the OMAP4 IP accordingly.

Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
  • Loading branch information
Ricardo Neri authored and Tomi Valkeinen committed May 11, 2012
1 parent 027bdc8 commit c0456be
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions drivers/video/omap2/dss/dss_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ static const struct ti_hdmi_ip_ops omap4_hdmi_functions = {
.pll_enable = ti_hdmi_4xxx_pll_enable,
.pll_disable = ti_hdmi_4xxx_pll_disable,
.video_enable = ti_hdmi_4xxx_wp_video_start,
.video_disable = ti_hdmi_4xxx_wp_video_stop,
.dump_wrapper = ti_hdmi_4xxx_wp_dump,
.dump_core = ti_hdmi_4xxx_core_dump,
.dump_pll = ti_hdmi_4xxx_pll_dump,
Expand Down
11 changes: 7 additions & 4 deletions drivers/video/omap2/dss/hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)

hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data);

hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0);
hdmi.ip_data.ops->video_disable(&hdmi.ip_data);

/* config the PLL and PHY hdmi_set_pll_pwrfirst */
r = hdmi.ip_data.ops->pll_enable(&hdmi.ip_data);
Expand Down Expand Up @@ -358,7 +358,9 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
/* tv size */
dss_mgr_set_timings(dssdev->manager, &dssdev->panel.timings);

hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 1);
r = hdmi.ip_data.ops->video_enable(&hdmi.ip_data);
if (r)
goto err_vid_enable;

r = dss_mgr_enable(dssdev->manager);
if (r)
Expand All @@ -367,7 +369,8 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
return 0;

err_mgr_enable:
hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0);
hdmi.ip_data.ops->video_disable(&hdmi.ip_data);
err_vid_enable:
hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
hdmi.ip_data.ops->pll_disable(&hdmi.ip_data);
err:
Expand All @@ -379,7 +382,7 @@ static void hdmi_power_off(struct omap_dss_device *dssdev)
{
dss_mgr_disable(dssdev->manager);

hdmi.ip_data.ops->video_enable(&hdmi.ip_data, 0);
hdmi.ip_data.ops->video_disable(&hdmi.ip_data);
hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
hdmi.ip_data.ops->pll_disable(&hdmi.ip_data);
hdmi_runtime_put();
Expand Down
7 changes: 5 additions & 2 deletions drivers/video/omap2/dss/ti_hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ struct ti_hdmi_ip_ops {

void (*pll_disable)(struct hdmi_ip_data *ip_data);

void (*video_enable)(struct hdmi_ip_data *ip_data, bool start);
int (*video_enable)(struct hdmi_ip_data *ip_data);

void (*video_disable)(struct hdmi_ip_data *ip_data);

void (*dump_wrapper)(struct hdmi_ip_data *ip_data, struct seq_file *s);

Expand Down Expand Up @@ -175,7 +177,8 @@ int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data);
void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data);
int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data, u8 *edid, int len);
bool ti_hdmi_4xxx_detect(struct hdmi_ip_data *ip_data);
void ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data *ip_data, bool start);
int ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data *ip_data);
void ti_hdmi_4xxx_wp_video_stop(struct hdmi_ip_data *ip_data);
int ti_hdmi_4xxx_pll_enable(struct hdmi_ip_data *ip_data);
void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data);
void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data);
Expand Down
10 changes: 8 additions & 2 deletions drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,15 @@ static void hdmi_wp_init(struct omap_video_timings *timings,

}

void ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data *ip_data, bool start)
int ti_hdmi_4xxx_wp_video_start(struct hdmi_ip_data *ip_data)
{
REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, start, 31, 31);
REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, true, 31, 31);
return 0;
}

void ti_hdmi_4xxx_wp_video_stop(struct hdmi_ip_data *ip_data)
{
REG_FLD_MOD(hdmi_wp_base(ip_data), HDMI_WP_VIDEO_CFG, false, 31, 31);
}

static void hdmi_wp_video_init_format(struct hdmi_video_format *video_fmt,
Expand Down

0 comments on commit c0456be

Please sign in to comment.