]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: Remove io_p2v, use ioremap and XXX_IO_ADDRESS
authorTony Lindgren <tony@atomide.com>
Thu, 4 Sep 2008 23:19:14 +0000 (16:19 -0700)
committerTony Lindgren <tony@atomide.com>
Thu, 4 Sep 2008 23:46:53 +0000 (16:46 -0700)
In general, drivers should now use ioremap.

Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/board-n800-audio.c
arch/arm/plat-omap/include/mach/sti.h
drivers/bluetooth/brf6150.c
drivers/bluetooth/hci_h4p/core.c
drivers/cbus/cbus.c
drivers/media/video/omap/omap16xxcam.c
drivers/misc/sti/sti.c
drivers/mtd/nand/omap-hw.c

index ebaf21f689f0688c031573a9d4f32e32c4fc4277..e28390e0c195f7599af9b3f80664e1cffa57e076 100644 (file)
@@ -54,13 +54,11 @@ static int eac_mux_disabled = 0;
 static int clkout2_mux_disabled = 0;
 static u32 saved_mux[2];
 
-#define MUX_EAC_IOP2V(x)               (__force void __iomem *)io_p2v(x)
-
 static void n800_enable_eac_mux(void)
 {
        if (!eac_mux_disabled)
                return;
-       __raw_writel(saved_mux[1], MUX_EAC_IOP2V(0x48000124));
+       __raw_writel(saved_mux[1], OMAP2_IO_ADDRESS(0x48000124));
        eac_mux_disabled = 0;
 }
 
@@ -70,8 +68,8 @@ static void n800_disable_eac_mux(void)
                WARN_ON(eac_mux_disabled);
                return;
        }
-       saved_mux[1] = __raw_readl(MUX_EAC_IOP2V(0x48000124));
-       __raw_writel(0x1f1f1f1f, MUX_EAC_IOP2V(0x48000124));
+       saved_mux[1] = __raw_readl(OMAP2_IO_ADDRESS(0x48000124));
+       __raw_writel(0x1f1f1f1f, OMAP2_IO_ADDRESS(0x48000124));
        eac_mux_disabled = 1;
 }
 
@@ -79,7 +77,7 @@ static void n800_enable_clkout2_mux(void)
 {
        if (!clkout2_mux_disabled)
                return;
-       __raw_writel(saved_mux[0], MUX_EAC_IOP2V(0x480000e8));
+       __raw_writel(saved_mux[0], OMAP2_IO_ADDRESS(0x480000e8));
        clkout2_mux_disabled = 0;
 }
 
@@ -91,10 +89,10 @@ static void n800_disable_clkout2_mux(void)
                WARN_ON(clkout2_mux_disabled);
                return;
        }
-       saved_mux[0] = __raw_readl(MUX_EAC_IOP2V(0x480000e8));
+       saved_mux[0] = __raw_readl(OMAP2_IO_ADDRESS(0x480000e8));
        l = saved_mux[0] & ~0xff;
        l |= 0x1f;
-       __raw_writel(l, MUX_EAC_IOP2V(0x480000e8));
+       __raw_writel(l, OMAP2_IO_ADDRESS(0x480000e8));
        clkout2_mux_disabled = 1;
 }
 
index d818dc6552d7bbca683f546bc6c983d29056cef2..af439170eba044f2b123ed004aafc887e67a9533 100644 (file)
@@ -127,7 +127,7 @@ enum {
 #endif
 
 /* arch/arm/plat-omap/sti/sti.c */
-extern unsigned long sti_base, sti_channel_base;
+extern void __iomem *sti_base, *sti_channel_base;
 
 int sti_request_irq(unsigned int irq, void *handler, unsigned long arg);
 void sti_free_irq(unsigned int irq);
index f47b22fd7d0aad6562b69a8d8e1fae525a71d302..476cc6554b9e80c5d2085730f7f9993e5ea7b150 100644 (file)
@@ -952,17 +952,26 @@ static int __init brf6150_init(void)
        case 1:
                irq = INT_UART1;
                info->uart_ck = clk_get(NULL, "uart1_ck");
-               info->uart_base = io_p2v((unsigned long)OMAP_UART1_BASE);
+               /* FIXME: Use platform_get_resource for the port */
+               info->uart_base = ioremap(OMAP_UART1_BASE, 0x16);
+               if (!info->uart_base)
+                       goto cleanup;
                break;
        case 2:
                irq = INT_UART2;
                info->uart_ck = clk_get(NULL, "uart2_ck");
-               info->uart_base = io_p2v((unsigned long)OMAP_UART2_BASE);
+               /* FIXME: Use platform_get_resource for the port */
+               info->uart_base = ioremap(OMAP_UART2_BASE, 0x16);
+               if (!info->uart_base)
+                       goto cleanup;
                break;
        case 3:
                irq = INT_UART3;
                info->uart_ck = clk_get(NULL, "uart3_ck");
-               info->uart_base = io_p2v((unsigned long)OMAP_UART3_BASE);
+               /* FIXME: Use platform_get_resource for the port */
+               info->uart_base = ioremap(OMAP_UART3_BASE, 0x16);
+               if (!info->uart_base)
+                       goto cleanup;
                break;
        default:
                printk(KERN_ERR "No uart defined\n");
index f3337030fc5381ca09e2b2a9db6f2c6de015893e..005e6528a142f8256895960369b77dfd6ceb3321 100644 (file)
@@ -866,7 +866,10 @@ static int hci_h4p_probe(struct platform_device *pdev)
                        info->uart_iclk = clk_get(NULL, "uart1_ick");
                        info->uart_fclk = clk_get(NULL, "uart1_fck");
                }
-               info->uart_base = (void *)io_p2v(OMAP_UART1_BASE);
+               /* FIXME: Use platform_get_resource for the port */
+               info->uart_base = ioremap(OMAP_UART1_BASE, 0x16);
+               if (!info->uart_base)
+                       goto cleanup;
                break;
        case 2:
                if (cpu_is_omap16xx()) {
@@ -877,7 +880,10 @@ static int hci_h4p_probe(struct platform_device *pdev)
                        info->uart_iclk = clk_get(NULL, "uart2_ick");
                        info->uart_fclk = clk_get(NULL, "uart2_fck");
                }
-               info->uart_base = (void *)io_p2v(OMAP_UART2_BASE);
+               /* FIXME: Use platform_get_resource for the port */
+               info->uart_base = ioremap(OMAP_UART2_BASE, 0x16);
+               if (!info->uart_base)
+                       goto cleanup;
                break;
        case 3:
                if (cpu_is_omap16xx()) {
@@ -888,7 +894,10 @@ static int hci_h4p_probe(struct platform_device *pdev)
                        info->uart_iclk = clk_get(NULL, "uart3_ick");
                        info->uart_fclk = clk_get(NULL, "uart3_fck");
                }
-               info->uart_base = (void *)io_p2v(OMAP_UART3_BASE);
+               /* FIXME: Use platform_get_resource for the port */
+               info->uart_base = ioremap(OMAP_UART3_BASE, 0x16);
+               if (!info->uart_base)
+                       goto cleanup;
                break;
        default:
                dev_err(info->dev, "No uart defined\n");
index 289557c4a246030b0086237c8f032dc9dc87c229..d72c49a96547a5dcdc39b9a68fa9f3d6c96645d9 100644 (file)
@@ -141,7 +141,7 @@ static int cbus_transfer(struct cbus_host *host, int dev, int reg, int data)
        u32 base;
 
 #ifdef CONFIG_ARCH_OMAP1
-       base = (u32) io_p2v(OMAP_MPUIO_BASE);
+       base = OMAP1_IO_ADDRESS(OMAP_MPUIO_BASE);
 #else
        base = 0;
 #endif
index 1615fb7ecebf57d27615340ae14d8133a37bccc9..0b5a30236eed862a9faf527a2737ae6872993f48 100644 (file)
@@ -538,7 +538,7 @@ static void *omap16xxcam_init(void)
                        return NULL;
                }
        } else
-               cam_iobase = io_p2v(CAMERA_BASE);
+               cam_iobase = OMAP1_IO_ADDRESS(CAMERA_BASE);
 
        /* Set the base address of the camera registers */
        hardware_data.camera_regs = (camera_regs_t *) cam_iobase;
index 28fac623313658ce6c42ed131626caa708d99d39..518298bb3b58717326194be5351b33ca08934b59 100644 (file)
@@ -26,7 +26,7 @@
 #include <asm/byteorder.h>
 
 static struct clk *sti_ck;
-unsigned long sti_base, sti_channel_base;
+void __iomem *sti_base, *sti_channel_base;
 static unsigned long sti_kern_mask = STIEn;
 static unsigned long sti_irq_mask = STI_IRQSTATUS_MASK;
 static DEFINE_SPINLOCK(sti_lock);
@@ -326,6 +326,7 @@ static DEVICE_ATTR(imask, S_IRUGO | S_IWUSR, sti_imask_show, sti_imask_store);
 static int __devinit sti_probe(struct platform_device *pdev)
 {
        struct resource *res, *cres;
+       unsigned int size;
        int ret;
 
        if (pdev->num_resources != 3) {
@@ -356,23 +357,19 @@ static int __devinit sti_probe(struct platform_device *pdev)
        if (unlikely(ret != 0))
                goto err;
 
-       sti_base = io_p2v(res->start);
+       size = res->end - res->start + 1;
+       sti_base = ioremap(res->start, size);
+       if (!sti_base) {
+               ret = -ENOMEM;
+               goto err_badremap;
+       }
 
-       /*
-        * OMAP 16xx keeps channels in a relatively sane location,
-        * whereas 24xx maps them much further out, and so they must be
-        * remapped.
-        */
-       if (cpu_is_omap16xx())
-               sti_channel_base = io_p2v(cres->start);
-       else if (cpu_is_omap24xx()) {
-               unsigned int size = cres->end - cres->start;
-
-               sti_channel_base = (unsigned long)ioremap(cres->start, size);
-               if (unlikely(!sti_channel_base)) {
-                       ret = -ENODEV;
-                       goto err_badremap;
-               }
+       size = cres->end - cres->start + 1;
+       sti_channel_base = ioremap(cres->start, size);
+       if (!sti_channel_base) {
+               iounmap(sti_base);
+               ret = -ENOMEM;
+               goto err_badremap;
        }
 
        ret = request_irq(platform_get_irq(pdev, 0), sti_interrupt,
@@ -383,7 +380,8 @@ static int __devinit sti_probe(struct platform_device *pdev)
        return sti_init();
 
 err_badirq:
-       iounmap((void *)sti_channel_base);
+       iounmap(sti_channel_base);
+       iounmap(sti_base);
 err_badremap:
        device_remove_file(&pdev->dev, &dev_attr_imask);
 err:
@@ -396,8 +394,8 @@ static int __devexit sti_remove(struct platform_device *pdev)
 {
        unsigned int irq = platform_get_irq(pdev, 0);
 
-       if (cpu_is_omap24xx())
-               iounmap((void *)sti_channel_base);
+       iounmap(sti_channel_base);
+       iounmap(sti_base);
 
        device_remove_file(&pdev->dev, &dev_attr_trace);
        device_remove_file(&pdev->dev, &dev_attr_imask);
index c598d9d58b7951c1292793c579d6f0ee882bc534..1eb19ce0a0b6bad744111a8d9a475db5801efc40 100644 (file)
@@ -165,7 +165,7 @@ static struct mtd_info *omap_mtd;
 static struct clk *omap_nand_clk;
 static int omap_nand_dma_ch;
 static struct completion omap_nand_dma_comp;
-static unsigned long omap_nand_base = io_p2v(NAND_BASE);
+static unsigned long omap_nand_base = OMAP1_IO_ADDRESS(NAND_BASE);
 
 static inline u32 nand_read_reg(int idx)
 {