Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294350
b: refs/heads/master
c: 8f9c60f
h: refs/heads/master
v: v3
  • Loading branch information
Kuninori Morimoto authored and Florian Tobias Schandinat committed Mar 21, 2012
1 parent b1079b9 commit c5bdeaa
Show file tree
Hide file tree
Showing 4 changed files with 12 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: f363afc168e772a6034ea97b7b213a1b47b8f376
refs/heads/master: 8f9c60f2e29717155227f225b557d3f1fda442bd
12 changes: 9 additions & 3 deletions trunk/arch/arm/mach-shmobile/board-ap4evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -486,20 +486,25 @@ static struct platform_device keysc_device = {
};

/* MIPI-DSI */
#define PHYCTRL 0x0070
static int sh_mipi_set_dot_clock(struct platform_device *pdev,
void __iomem *base,
int enable)
{
struct clk *pck = clk_get(&pdev->dev, "dsip_clk");
void __iomem *phy = base + PHYCTRL;

if (IS_ERR(pck))
return PTR_ERR(pck);

if (enable) {
/*
* DSIPCLK = 24MHz
* D-PHY = DSIPCLK * ((0x6*2)+1) = 312MHz (see .phyctrl)
* HsByteCLK = D-PHY/8 = 39MHz
*
* X * Y * FPS =
* (544+72+600+16) * (961+8+8+2) * 30 = 36.1MHz
*/
clk_set_rate(pck, clk_round_rate(pck, 24000000));
iowrite32(ioread32(phy) | (0xb << 8), phy);
clk_enable(pck);
} else {
clk_disable(pck);
Expand Down Expand Up @@ -530,6 +535,7 @@ static struct sh_mipi_dsi_info mipidsi0_info = {
.lcd_chan = &lcdc_info.ch[0],
.lane = 2,
.vsynw_offset = 17,
.phyctrl = 0x6 << 8,
.flags = SH_MIPI_DSI_SYNC_PULSES_MODE |
SH_MIPI_DSI_HSbyteCLK,
.set_dot_clock = sh_mipi_set_dot_clock,
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/video/sh_mipi_dsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static int __init sh_mipi_setup(struct sh_mipi *mipi,
iowrite32(0x00000001, base + PHYCTRL);
udelay(200);
/* Deassert resets, power on */
iowrite32(0x03070001, base + PHYCTRL);
iowrite32(0x03070001 | pdata->phyctrl, base + PHYCTRL);

/*
* Default = ULPS enable |
Expand Down
1 change: 1 addition & 0 deletions trunk/include/video/sh_mipi_dsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ struct sh_mipi_dsi_info {
int lane;
unsigned long flags;
u32 clksrc;
u32 phyctrl; /* for extra setting */
unsigned int vsynw_offset;
int (*set_dot_clock)(struct platform_device *pdev,
void __iomem *base,
Expand Down

0 comments on commit c5bdeaa

Please sign in to comment.