Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306483
b: refs/heads/master
c: 2fd07a4
h: refs/heads/master
i:
  306481: 58dd015
  306479: 671ccb9
v: v3
  • Loading branch information
Tomasz Stanislawski authored and Mauro Carvalho Chehab committed May 20, 2012
1 parent e94f246 commit 84a6b0d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f468accf2ae2951dacebc04f186a08f495ce92a
refs/heads/master: 2fd07a4a9e0d34fc53443601781ae58b2e8f1649
20 changes: 16 additions & 4 deletions trunk/drivers/media/video/s5p-tv/hdmi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ struct hdmi_device {
struct v4l2_subdev *mhl_sd;
/** configuration of current graphic mode */
const struct hdmi_timings *cur_conf;
/** flag indicating that timings are dirty */
int cur_conf_dirty;
/** current preset */
u32 cur_preset;
/** other resources */
Expand Down Expand Up @@ -253,6 +255,10 @@ static int hdmi_conf_apply(struct hdmi_device *hdmi_dev)

dev_dbg(dev, "%s\n", __func__);

/* skip if conf is already synchronized with HW */
if (!hdmi_dev->cur_conf_dirty)
return 0;

/* reset hdmiphy */
hdmi_write_mask(hdmi_dev, HDMI_PHY_RSTOUT, ~0, HDMI_PHY_SW_RSTOUT);
mdelay(10);
Expand All @@ -278,6 +284,8 @@ static int hdmi_conf_apply(struct hdmi_device *hdmi_dev)
/* setting core registers */
hdmi_timing_apply(hdmi_dev, conf);

hdmi_dev->cur_conf_dirty = 0;

return 0;
}

Expand Down Expand Up @@ -500,6 +508,10 @@ static int hdmi_streamon(struct hdmi_device *hdev)

dev_dbg(dev, "%s\n", __func__);

ret = hdmi_conf_apply(hdev);
if (ret)
return ret;

ret = v4l2_subdev_call(hdev->phy_sd, video, s_stream, 1);
if (ret)
return ret;
Expand Down Expand Up @@ -620,6 +632,7 @@ static int hdmi_s_dv_preset(struct v4l2_subdev *sd,
return -EINVAL;
}
hdev->cur_conf = conf;
hdev->cur_conf_dirty = 1;
hdev->cur_preset = preset->preset;
return 0;
}
Expand Down Expand Up @@ -689,6 +702,8 @@ static int hdmi_runtime_suspend(struct device *dev)
dev_dbg(dev, "%s\n", __func__);
v4l2_subdev_call(hdev->mhl_sd, core, s_power, 0);
hdmi_resource_poweroff(&hdev->res);
/* flag that device context is lost */
hdev->cur_conf_dirty = 1;
return 0;
}

Expand All @@ -702,10 +717,6 @@ static int hdmi_runtime_resume(struct device *dev)

hdmi_resource_poweron(&hdev->res);

ret = hdmi_conf_apply(hdev);
if (ret)
goto fail;

/* starting MHL */
ret = v4l2_subdev_call(hdev->mhl_sd, core, s_power, 1);
if (hdev->mhl_sd && ret)
Expand Down Expand Up @@ -946,6 +957,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev)
hdmi_dev->cur_preset = HDMI_DEFAULT_PRESET;
/* FIXME: missing fail preset is not supported */
hdmi_dev->cur_conf = hdmi_preset2timings(hdmi_dev->cur_preset);
hdmi_dev->cur_conf_dirty = 1;

/* storing subdev for call that have only access to struct device */
dev_set_drvdata(dev, sd);
Expand Down

0 comments on commit 84a6b0d

Please sign in to comment.