Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310362
b: refs/heads/master
c: b7dea05
h: refs/heads/master
v: v3
  • Loading branch information
Ricardo Neri authored and Tomi Valkeinen committed May 11, 2012
1 parent 8c25fc3 commit 358d3a2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 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: 24ccfc5541b11f1e6ffcf10f5ce94370440d6c75
refs/heads/master: b7dea05aec8b6421500929d5003866655d6d9dab
41 changes: 21 additions & 20 deletions trunk/drivers/video/omap2/dss/hdmi_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
#include "dss.h"

static struct {
struct mutex hdmi_lock;
/* This protects the panel ops, mainly when accessing the HDMI IP. */
struct mutex lock;
} hdmi;


Expand Down Expand Up @@ -59,7 +60,7 @@ static int hdmi_panel_enable(struct omap_dss_device *dssdev)
int r = 0;
DSSDBG("ENTER hdmi_panel_enable\n");

mutex_lock(&hdmi.hdmi_lock);
mutex_lock(&hdmi.lock);

if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
r = -EINVAL;
Expand All @@ -75,28 +76,28 @@ static int hdmi_panel_enable(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;

err:
mutex_unlock(&hdmi.hdmi_lock);
mutex_unlock(&hdmi.lock);

return r;
}

static void hdmi_panel_disable(struct omap_dss_device *dssdev)
{
mutex_lock(&hdmi.hdmi_lock);
mutex_lock(&hdmi.lock);

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

dssdev->state = OMAP_DSS_DISPLAY_DISABLED;

mutex_unlock(&hdmi.hdmi_lock);
mutex_unlock(&hdmi.lock);
}

static int hdmi_panel_suspend(struct omap_dss_device *dssdev)
{
int r = 0;

mutex_lock(&hdmi.hdmi_lock);
mutex_lock(&hdmi.lock);

if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
r = -EINVAL;
Expand All @@ -108,7 +109,7 @@ static int hdmi_panel_suspend(struct omap_dss_device *dssdev)
omapdss_hdmi_display_disable(dssdev);

err:
mutex_unlock(&hdmi.hdmi_lock);
mutex_unlock(&hdmi.lock);

return r;
}
Expand All @@ -117,7 +118,7 @@ static int hdmi_panel_resume(struct omap_dss_device *dssdev)
{
int r = 0;

mutex_lock(&hdmi.hdmi_lock);
mutex_lock(&hdmi.lock);

if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED) {
r = -EINVAL;
Expand All @@ -133,32 +134,32 @@ static int hdmi_panel_resume(struct omap_dss_device *dssdev)
dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;

err:
mutex_unlock(&hdmi.hdmi_lock);
mutex_unlock(&hdmi.lock);

return r;
}

static void hdmi_get_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
mutex_lock(&hdmi.hdmi_lock);
mutex_lock(&hdmi.lock);

*timings = dssdev->panel.timings;

mutex_unlock(&hdmi.hdmi_lock);
mutex_unlock(&hdmi.lock);
}

static void hdmi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
DSSDBG("hdmi_set_timings\n");

mutex_lock(&hdmi.hdmi_lock);
mutex_lock(&hdmi.lock);

dssdev->panel.timings = *timings;
omapdss_hdmi_display_set_timing(dssdev);

mutex_unlock(&hdmi.hdmi_lock);
mutex_unlock(&hdmi.lock);
}

static int hdmi_check_timings(struct omap_dss_device *dssdev,
Expand All @@ -168,19 +169,19 @@ static int hdmi_check_timings(struct omap_dss_device *dssdev,

DSSDBG("hdmi_check_timings\n");

mutex_lock(&hdmi.hdmi_lock);
mutex_lock(&hdmi.lock);

r = omapdss_hdmi_display_check_timing(dssdev, timings);

mutex_unlock(&hdmi.hdmi_lock);
mutex_unlock(&hdmi.lock);
return r;
}

static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
{
int r;

mutex_lock(&hdmi.hdmi_lock);
mutex_lock(&hdmi.lock);

if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
r = omapdss_hdmi_display_enable(dssdev);
Expand All @@ -194,7 +195,7 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
omapdss_hdmi_display_disable(dssdev);
err:
mutex_unlock(&hdmi.hdmi_lock);
mutex_unlock(&hdmi.lock);

return r;
}
Expand All @@ -203,7 +204,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev)
{
int r;

mutex_lock(&hdmi.hdmi_lock);
mutex_lock(&hdmi.lock);

if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
r = omapdss_hdmi_display_enable(dssdev);
Expand All @@ -217,7 +218,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev)
dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
omapdss_hdmi_display_disable(dssdev);
err:
mutex_unlock(&hdmi.hdmi_lock);
mutex_unlock(&hdmi.lock);

return r;
}
Expand All @@ -242,7 +243,7 @@ static struct omap_dss_driver hdmi_driver = {

int hdmi_panel_init(void)
{
mutex_init(&hdmi.hdmi_lock);
mutex_init(&hdmi.lock);

omap_dss_register_driver(&hdmi_driver);

Expand Down

0 comments on commit 358d3a2

Please sign in to comment.