Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310283
b: refs/heads/master
c: db6668d
h: refs/heads/master
i:
  310281: 92b4781
  310279: ea7c3b4
v: v3
  • Loading branch information
Kuninori Morimoto authored and Florian Tobias Schandinat committed May 13, 2012
1 parent e8ee3dd commit 6f8ef7a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 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: e0defc86423d1b5652826c9317c36dfb6af1cd48
refs/heads/master: db6668d83a265a15ffd79dbc8432598808b34bb4
38 changes: 36 additions & 2 deletions trunk/drivers/video/sh_mobile_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,20 +222,45 @@ struct sh_hdmi {
struct delayed_work edid_work;
struct fb_videomode mode;
struct fb_monspecs monspec;

/* register access functions */
void (*write)(struct sh_hdmi *hdmi, u8 data, u8 reg);
u8 (*read)(struct sh_hdmi *hdmi, u8 reg);
};

#define entity_to_sh_hdmi(e) container_of(e, struct sh_hdmi, entity)

static void hdmi_write(struct sh_hdmi *hdmi, u8 data, u8 reg)
static void __hdmi_write8(struct sh_hdmi *hdmi, u8 data, u8 reg)
{
iowrite8(data, hdmi->base + reg);
}

static u8 hdmi_read(struct sh_hdmi *hdmi, u8 reg)
static u8 __hdmi_read8(struct sh_hdmi *hdmi, u8 reg)
{
return ioread8(hdmi->base + reg);
}

static void __hdmi_write32(struct sh_hdmi *hdmi, u8 data, u8 reg)
{
iowrite32((u32)data, hdmi->base + (reg * 4));
udelay(100);
}

static u8 __hdmi_read32(struct sh_hdmi *hdmi, u8 reg)
{
return (u8)ioread32(hdmi->base + (reg * 4));
}

static void hdmi_write(struct sh_hdmi *hdmi, u8 data, u8 reg)
{
hdmi->write(hdmi, data, reg);
}

static u8 hdmi_read(struct sh_hdmi *hdmi, u8 reg)
{
return hdmi->read(hdmi, reg);
}

static void hdmi_bit_set(struct sh_hdmi *hdmi, u8 mask, u8 data, u8 reg)
{
u8 val = hdmi_read(hdmi, reg);
Expand Down Expand Up @@ -1148,6 +1173,15 @@ static int __init sh_hdmi_probe(struct platform_device *pdev)
goto egetclk;
}

/* select register access functions */
if (pdata->flags & HDMI_32BIT_REG) {
hdmi->write = __hdmi_write32;
hdmi->read = __hdmi_read32;
} else {
hdmi->write = __hdmi_write8;
hdmi->read = __hdmi_read8;
}

/* An arbitrary relaxed pixclock just to get things started: from standard 480p */
rate = clk_round_rate(hdmi->hdmi_clk, PICOS2KHZ(37037));
if (rate > 0)
Expand Down
5 changes: 4 additions & 1 deletion trunk/include/video/sh_mobile_hdmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ struct clk;
/*
* flags format
*
* 0x000000BA
* 0x00000CBA
*
* A: Audio source select
* B: Int output option
* C: Chip specific option
*/

/* Audio source select */
Expand All @@ -35,6 +36,8 @@ struct clk;
#define HDMI_OUTPUT_PUSH_PULL (1 << 4) /* System control : output mode */
#define HDMI_OUTPUT_POLARITY_HI (1 << 5) /* System control : output polarity */

/* Chip specific option */
#define HDMI_32BIT_REG (1 << 8)

struct sh_mobile_hdmi_info {
unsigned int flags;
Expand Down

0 comments on commit 6f8ef7a

Please sign in to comment.