Skip to content

Commit

Permalink
omap: Use ioremap in dispc.c
Browse files Browse the repository at this point in the history
Use ioremap in dispc.c

Cc: Imre Deak <imre.deak@nokia.com>
Cc: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Tony Lindgren committed Oct 19, 2009
1 parent e4e7a13 commit b0002e0
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions drivers/video/omap/dispc.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ static u32 inline dispc_read_reg(int idx)
/* Select RFBI or bypass mode */
static void enable_rfbi_mode(int enable)
{
void __iomem *rfbi_control;
u32 l;

l = dispc_read_reg(DISPC_CONTROL);
Expand All @@ -216,9 +217,15 @@ static void enable_rfbi_mode(int enable)
dispc_write_reg(DISPC_CONTROL, l);

/* Set bypass mode in RFBI module */
l = __raw_readl(OMAP2_IO_ADDRESS(RFBI_CONTROL));
rfbi_control = ioremap(RFBI_CONTROL, SZ_1K);
if (!rfbi_control) {
pr_err("Unable to ioremap rfbi_control\n");
return;
}
l = __raw_readl(rfbi_control);
l |= enable ? 0 : (1 << 1);
__raw_writel(l, OMAP2_IO_ADDRESS(RFBI_CONTROL));
__raw_writel(l, rfbi_control);
iounmap(rfbi_control);
}

static void set_lcd_data_lines(int data_lines)
Expand Down Expand Up @@ -1367,6 +1374,7 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
int r;
u32 l;
struct lcd_panel *panel = fbdev->panel;
void __iomem *ram_fw_base;
int tmo = 10000;
int skip_init = 0;
int i;
Expand Down Expand Up @@ -1441,7 +1449,13 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
}

/* L3 firewall setting: enable access to OCM RAM */
__raw_writel(0x402000b0, OMAP2_IO_ADDRESS(0x680050a0));
ram_fw_base = ioremap(0x68005000, SZ_1K);
if (!ram_fw_base) {
dev_err(dispc.fbdev->dev, "Cannot ioremap to enable OCM RAM\n");
goto fail1;
}
__raw_writel(0x402000b0, ram_fw_base + 0xa0);
iounmap(ram_fw_base);

if ((r = alloc_palette_ram()) < 0)
goto fail2;
Expand Down

0 comments on commit b0002e0

Please sign in to comment.