Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310281
b: refs/heads/master
c: 3f521ab
h: refs/heads/master
i:
  310279: ea7c3b4
v: v3
  • Loading branch information
Kuninori Morimoto authored and Florian Tobias Schandinat committed May 13, 2012
1 parent 7f22ff4 commit 92b4781
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 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: 66685aa00bf9970be8be3783dbc3b59f69968214
refs/heads/master: 3f521abd6cf1320d65a49cf9fc327b82168b5ba0
22 changes: 16 additions & 6 deletions trunk/drivers/video/sh_mobile_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,16 @@ static u8 hdmi_read(struct sh_hdmi *hdmi, u8 reg)
return ioread8(hdmi->base + reg);
}

static void hdmi_bit_set(struct sh_hdmi *hdmi, u8 mask, u8 data, u8 reg)
{
u8 val = hdmi_read(hdmi, reg);

val &= ~mask;
val |= (data & mask);

hdmi_write(hdmi, val, reg);
}

/*
* HDMI sound
*/
Expand Down Expand Up @@ -693,11 +703,11 @@ static void sh_hdmi_configure(struct sh_hdmi *hdmi)
msleep(10);

/* PS mode b->d, reset PLLA and PLLB */
hdmi_write(hdmi, 0x4C, HDMI_SYSTEM_CTRL);
hdmi_bit_set(hdmi, 0xFC, 0x4C, HDMI_SYSTEM_CTRL);

udelay(10);

hdmi_write(hdmi, 0x40, HDMI_SYSTEM_CTRL);
hdmi_bit_set(hdmi, 0xFC, 0x40, HDMI_SYSTEM_CTRL);
}

static unsigned long sh_hdmi_rate_error(struct sh_hdmi *hdmi,
Expand Down Expand Up @@ -917,13 +927,13 @@ static irqreturn_t sh_hdmi_hotplug(int irq, void *dev_id)
u8 status1, status2, mask1, mask2;

/* mode_b and PLLA and PLLB reset */
hdmi_write(hdmi, 0x2C, HDMI_SYSTEM_CTRL);
hdmi_bit_set(hdmi, 0xFC, 0x2C, HDMI_SYSTEM_CTRL);

/* How long shall reset be held? */
udelay(10);

/* mode_b and PLLA and PLLB reset release */
hdmi_write(hdmi, 0x20, HDMI_SYSTEM_CTRL);
hdmi_bit_set(hdmi, 0xFC, 0x20, HDMI_SYSTEM_CTRL);

status1 = hdmi_read(hdmi, HDMI_INTERRUPT_STATUS_1);
status2 = hdmi_read(hdmi, HDMI_INTERRUPT_STATUS_2);
Expand Down Expand Up @@ -1001,7 +1011,7 @@ static int sh_hdmi_display_on(struct sh_mobile_lcdc_entity *entity)
*/
if (hdmi->hp_state == HDMI_HOTPLUG_EDID_DONE) {
/* PS mode d->e. All functions are active */
hdmi_write(hdmi, 0x80, HDMI_SYSTEM_CTRL);
hdmi_bit_set(hdmi, 0xFC, 0x80, HDMI_SYSTEM_CTRL);
dev_dbg(hdmi->dev, "HDMI running\n");
}

Expand All @@ -1016,7 +1026,7 @@ static void sh_hdmi_display_off(struct sh_mobile_lcdc_entity *entity)

dev_dbg(hdmi->dev, "%s(%p)\n", __func__, hdmi);
/* PS mode e->a */
hdmi_write(hdmi, 0x10, HDMI_SYSTEM_CTRL);
hdmi_bit_set(hdmi, 0xFC, 0x10, HDMI_SYSTEM_CTRL);
}

static const struct sh_mobile_lcdc_entity_ops sh_hdmi_ops = {
Expand Down

0 comments on commit 92b4781

Please sign in to comment.