aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-10-14 17:24:42 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-10-14 17:24:42 -0400
commitb6825d2df55aa7d7341c715b577b73a6a03dc944 (patch)
treeae4f0f52f4c2ad4e501dd323318486ccdd7fcd93 /drivers
parent6defd90433729c2d795865165cb34d938d8ff07c (diff)
parentaa59e19d05114f9fb7718d6bc8398255476fb4f5 (diff)
Merge branch 'omap-all' into devel
Conflicts: arch/arm/mach-omap2/gpmc.c arch/arm/mach-omap2/irq.c
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/hw_random/omap-rng.c33
-rw-r--r--drivers/i2c/busses/i2c-omap.c12
-rw-r--r--drivers/input/keyboard/omap-keypad.c2
-rw-r--r--drivers/mmc/host/omap.c11
-rw-r--r--drivers/serial/8250.c23
-rw-r--r--drivers/spi/omap2_mcspi.c18
-rw-r--r--drivers/spi/omap_uwire.c23
-rw-r--r--drivers/usb/host/ohci-omap.c14
-rw-r--r--drivers/video/omap/dispc.c21
-rw-r--r--drivers/video/omap/dispc.h2
-rw-r--r--drivers/video/omap/lcd_h4.c4
-rw-r--r--drivers/video/omap/lcdc.c2
-rw-r--r--drivers/video/omap/lcdc.h2
-rw-r--r--drivers/video/omap/omapfb_main.c15
-rw-r--r--drivers/video/omap/rfbi.c9
-rw-r--r--drivers/video/omap/sossi.c8
16 files changed, 149 insertions, 50 deletions
diff --git a/drivers/char/hw_random/omap-rng.c b/drivers/char/hw_random/omap-rng.c
index 51738bdd834e..d4e7dca06e4f 100644
--- a/drivers/char/hw_random/omap-rng.c
+++ b/drivers/char/hw_random/omap-rng.c
@@ -118,18 +118,21 @@ static int __init omap_rng_probe(struct platform_device *pdev)
118 118
119 mem = request_mem_region(res->start, res->end - res->start + 1, 119 mem = request_mem_region(res->start, res->end - res->start + 1,
120 pdev->name); 120 pdev->name);
121 if (mem == NULL) 121 if (mem == NULL) {
122 return -EBUSY; 122 ret = -EBUSY;
123 goto err_region;
124 }
123 125
124 dev_set_drvdata(&pdev->dev, mem); 126 dev_set_drvdata(&pdev->dev, mem);
125 rng_base = (u32 __force __iomem *)io_p2v(res->start); 127 rng_base = ioremap(res->start, res->end - res->start + 1);
128 if (!rng_base) {
129 ret = -ENOMEM;
130 goto err_ioremap;
131 }
126 132
127 ret = hwrng_register(&omap_rng_ops); 133 ret = hwrng_register(&omap_rng_ops);
128 if (ret) { 134 if (ret)
129 release_resource(mem); 135 goto err_register;
130 rng_base = NULL;
131 return ret;
132 }
133 136
134 dev_info(&pdev->dev, "OMAP Random Number Generator ver. %02x\n", 137 dev_info(&pdev->dev, "OMAP Random Number Generator ver. %02x\n",
135 omap_rng_read_reg(RNG_REV_REG)); 138 omap_rng_read_reg(RNG_REV_REG));
@@ -138,6 +141,18 @@ static int __init omap_rng_probe(struct platform_device *pdev)
138 rng_dev = pdev; 141 rng_dev = pdev;
139 142
140 return 0; 143 return 0;
144
145err_register:
146 iounmap(rng_base);
147 rng_base = NULL;
148err_ioremap:
149 release_resource(mem);
150err_region:
151 if (cpu_is_omap24xx()) {
152 clk_disable(rng_ick);
153 clk_put(rng_ick);
154 }
155 return ret;
141} 156}
142 157
143static int __exit omap_rng_remove(struct platform_device *pdev) 158static int __exit omap_rng_remove(struct platform_device *pdev)
@@ -148,6 +163,8 @@ static int __exit omap_rng_remove(struct platform_device *pdev)
148 163
149 omap_rng_write_reg(RNG_MASK_REG, 0x0); 164 omap_rng_write_reg(RNG_MASK_REG, 0x0);
150 165
166 iounmap(rng_base);
167
151 if (cpu_is_omap24xx()) { 168 if (cpu_is_omap24xx()) {
152 clk_disable(rng_ick); 169 clk_disable(rng_ick);
153 clk_put(rng_ick); 170 clk_put(rng_ick);
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index e7eb7bf9ddec..608038d64f81 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -589,11 +589,16 @@ omap_i2c_probe(struct platform_device *pdev)
589 589
590 dev->dev = &pdev->dev; 590 dev->dev = &pdev->dev;
591 dev->irq = irq->start; 591 dev->irq = irq->start;
592 dev->base = (void __iomem *) IO_ADDRESS(mem->start); 592 dev->base = ioremap(mem->start, mem->end - mem->start + 1);
593 if (!dev->base) {
594 r = -ENOMEM;
595 goto err_free_mem;
596 }
597
593 platform_set_drvdata(pdev, dev); 598 platform_set_drvdata(pdev, dev);
594 599
595 if ((r = omap_i2c_get_clocks(dev)) != 0) 600 if ((r = omap_i2c_get_clocks(dev)) != 0)
596 goto err_free_mem; 601 goto err_iounmap;
597 602
598 omap_i2c_unidle(dev); 603 omap_i2c_unidle(dev);
599 604
@@ -640,6 +645,8 @@ err_unuse_clocks:
640 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); 645 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
641 omap_i2c_idle(dev); 646 omap_i2c_idle(dev);
642 omap_i2c_put_clocks(dev); 647 omap_i2c_put_clocks(dev);
648err_iounmap:
649 iounmap(dev->base);
643err_free_mem: 650err_free_mem:
644 platform_set_drvdata(pdev, NULL); 651 platform_set_drvdata(pdev, NULL);
645 kfree(dev); 652 kfree(dev);
@@ -661,6 +668,7 @@ omap_i2c_remove(struct platform_device *pdev)
661 i2c_del_adapter(&dev->adapter); 668 i2c_del_adapter(&dev->adapter);
662 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0); 669 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
663 omap_i2c_put_clocks(dev); 670 omap_i2c_put_clocks(dev);
671 iounmap(dev->base);
664 kfree(dev); 672 kfree(dev);
665 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 673 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
666 release_mem_region(mem->start, (mem->end - mem->start) + 1); 674 release_mem_region(mem->start, (mem->end - mem->start) + 1);
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c
index dcea87a0bc56..039787f81ed8 100644
--- a/drivers/input/keyboard/omap-keypad.c
+++ b/drivers/input/keyboard/omap-keypad.c
@@ -62,7 +62,7 @@ struct omap_kp {
62 unsigned int debounce; 62 unsigned int debounce;
63}; 63};
64 64
65DECLARE_TASKLET_DISABLED(kp_tasklet, omap_kp_tasklet, 0); 65static DECLARE_TASKLET_DISABLED(kp_tasklet, omap_kp_tasklet, 0);
66 66
67static int *keymap; 67static int *keymap;
68static unsigned int *row_gpios; 68static unsigned int *row_gpios;
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index c16028872bbb..1b9fc3c6b875 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -172,7 +172,7 @@ struct mmc_omap_host {
172 struct omap_mmc_platform_data *pdata; 172 struct omap_mmc_platform_data *pdata;
173}; 173};
174 174
175void mmc_omap_fclk_offdelay(struct mmc_omap_slot *slot) 175static void mmc_omap_fclk_offdelay(struct mmc_omap_slot *slot)
176{ 176{
177 unsigned long tick_ns; 177 unsigned long tick_ns;
178 178
@@ -182,7 +182,7 @@ void mmc_omap_fclk_offdelay(struct mmc_omap_slot *slot)
182 } 182 }
183} 183}
184 184
185void mmc_omap_fclk_enable(struct mmc_omap_host *host, unsigned int enable) 185static void mmc_omap_fclk_enable(struct mmc_omap_host *host, unsigned int enable)
186{ 186{
187 unsigned long flags; 187 unsigned long flags;
188 188
@@ -1455,7 +1455,9 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
1455 1455
1456 host->irq = irq; 1456 host->irq = irq;
1457 host->phys_base = host->mem_res->start; 1457 host->phys_base = host->mem_res->start;
1458 host->virt_base = (void __iomem *) IO_ADDRESS(host->phys_base); 1458 host->virt_base = ioremap(res->start, res->end - res->start + 1);
1459 if (!host->virt_base)
1460 goto err_ioremap;
1459 1461
1460 if (cpu_is_omap24xx()) { 1462 if (cpu_is_omap24xx()) {
1461 host->iclk = clk_get(&pdev->dev, "mmc_ick"); 1463 host->iclk = clk_get(&pdev->dev, "mmc_ick");
@@ -1510,6 +1512,8 @@ err_free_iclk:
1510 clk_put(host->iclk); 1512 clk_put(host->iclk);
1511 } 1513 }
1512err_free_mmc_host: 1514err_free_mmc_host:
1515 iounmap(host->virt_base);
1516err_ioremap:
1513 kfree(host); 1517 kfree(host);
1514err_free_mem_region: 1518err_free_mem_region:
1515 release_mem_region(res->start, res->end - res->start + 1); 1519 release_mem_region(res->start, res->end - res->start + 1);
@@ -1536,6 +1540,7 @@ static int mmc_omap_remove(struct platform_device *pdev)
1536 if (host->fclk && !IS_ERR(host->fclk)) 1540 if (host->fclk && !IS_ERR(host->fclk))
1537 clk_put(host->fclk); 1541 clk_put(host->fclk);
1538 1542
1543 iounmap(host->virt_base);
1539 release_mem_region(pdev->resource[0].start, 1544 release_mem_region(pdev->resource[0].start,
1540 pdev->resource[0].end - pdev->resource[0].start + 1); 1545 pdev->resource[0].end - pdev->resource[0].start + 1);
1541 1546
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 9ccc563d8730..8058533f8418 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2211,9 +2211,9 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
2211 serial_outp(up, UART_EFR, efr); 2211 serial_outp(up, UART_EFR, efr);
2212 } 2212 }
2213 2213
2214#ifdef CONFIG_ARCH_OMAP15XX 2214#ifdef CONFIG_ARCH_OMAP
2215 /* Workaround to enable 115200 baud on OMAP1510 internal ports */ 2215 /* Workaround to enable 115200 baud on OMAP1510 internal ports */
2216 if (cpu_is_omap1510() && is_omap_port((unsigned int)up->port.membase)) { 2216 if (cpu_is_omap1510() && is_omap_port(up)) {
2217 if (baud == 115200) { 2217 if (baud == 115200) {
2218 quot = 1; 2218 quot = 1;
2219 serial_out(up, UART_OMAP_OSC_12M_SEL, 1); 2219 serial_out(up, UART_OMAP_OSC_12M_SEL, 1);
@@ -2266,18 +2266,27 @@ serial8250_pm(struct uart_port *port, unsigned int state,
2266 p->pm(port, state, oldstate); 2266 p->pm(port, state, oldstate);
2267} 2267}
2268 2268
2269static unsigned int serial8250_port_size(struct uart_8250_port *pt)
2270{
2271 if (pt->port.iotype == UPIO_AU)
2272 return 0x100000;
2273#ifdef CONFIG_ARCH_OMAP
2274 if (is_omap_port(pt))
2275 return 0x16 << pt->port.regshift;
2276#endif
2277 return 8 << pt->port.regshift;
2278}
2279
2269/* 2280/*
2270 * Resource handling. 2281 * Resource handling.
2271 */ 2282 */
2272static int serial8250_request_std_resource(struct uart_8250_port *up) 2283static int serial8250_request_std_resource(struct uart_8250_port *up)
2273{ 2284{
2274 unsigned int size = 8 << up->port.regshift; 2285 unsigned int size = serial8250_port_size(up);
2275 int ret = 0; 2286 int ret = 0;
2276 2287
2277 switch (up->port.iotype) { 2288 switch (up->port.iotype) {
2278 case UPIO_AU: 2289 case UPIO_AU:
2279 size = 0x100000;
2280 /* fall thru */
2281 case UPIO_TSI: 2290 case UPIO_TSI:
2282 case UPIO_MEM32: 2291 case UPIO_MEM32:
2283 case UPIO_MEM: 2292 case UPIO_MEM:
@@ -2311,12 +2320,10 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
2311 2320
2312static void serial8250_release_std_resource(struct uart_8250_port *up) 2321static void serial8250_release_std_resource(struct uart_8250_port *up)
2313{ 2322{
2314 unsigned int size = 8 << up->port.regshift; 2323 unsigned int size = serial8250_port_size(up);
2315 2324
2316 switch (up->port.iotype) { 2325 switch (up->port.iotype) {
2317 case UPIO_AU: 2326 case UPIO_AU:
2318 size = 0x100000;
2319 /* fall thru */
2320 case UPIO_TSI: 2327 case UPIO_TSI:
2321 case UPIO_MEM32: 2328 case UPIO_MEM32:
2322 case UPIO_MEM: 2329 case UPIO_MEM:
diff --git a/drivers/spi/omap2_mcspi.c b/drivers/spi/omap2_mcspi.c
index 9d2186fd74aa..454a2712e629 100644
--- a/drivers/spi/omap2_mcspi.c
+++ b/drivers/spi/omap2_mcspi.c
@@ -119,12 +119,14 @@ struct omap2_mcspi {
119 struct clk *fck; 119 struct clk *fck;
120 /* Virtual base address of the controller */ 120 /* Virtual base address of the controller */
121 void __iomem *base; 121 void __iomem *base;
122 unsigned long phys;
122 /* SPI1 has 4 channels, while SPI2 has 2 */ 123 /* SPI1 has 4 channels, while SPI2 has 2 */
123 struct omap2_mcspi_dma *dma_channels; 124 struct omap2_mcspi_dma *dma_channels;
124}; 125};
125 126
126struct omap2_mcspi_cs { 127struct omap2_mcspi_cs {
127 void __iomem *base; 128 void __iomem *base;
129 unsigned long phys;
128 int word_len; 130 int word_len;
129}; 131};
130 132
@@ -233,7 +235,7 @@ omap2_mcspi_txrx_dma(struct spi_device *spi, struct spi_transfer *xfer)
233 c = count; 235 c = count;
234 word_len = cs->word_len; 236 word_len = cs->word_len;
235 237
236 base = (unsigned long) io_v2p(cs->base); 238 base = cs->phys;
237 tx_reg = base + OMAP2_MCSPI_TX0; 239 tx_reg = base + OMAP2_MCSPI_TX0;
238 rx_reg = base + OMAP2_MCSPI_RX0; 240 rx_reg = base + OMAP2_MCSPI_RX0;
239 rx = xfer->rx_buf; 241 rx = xfer->rx_buf;
@@ -633,6 +635,7 @@ static int omap2_mcspi_setup(struct spi_device *spi)
633 if (!cs) 635 if (!cs)
634 return -ENOMEM; 636 return -ENOMEM;
635 cs->base = mcspi->base + spi->chip_select * 0x14; 637 cs->base = mcspi->base + spi->chip_select * 0x14;
638 cs->phys = mcspi->phys + spi->chip_select * 0x14;
636 spi->controller_state = cs; 639 spi->controller_state = cs;
637 } 640 }
638 641
@@ -1005,7 +1008,13 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
1005 goto err1; 1008 goto err1;
1006 } 1009 }
1007 1010
1008 mcspi->base = (void __iomem *) io_p2v(r->start); 1011 mcspi->phys = r->start;
1012 mcspi->base = ioremap(r->start, r->end - r->start + 1);
1013 if (!mcspi->base) {
1014 dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");
1015 status = -ENOMEM;
1016 goto err1aa;
1017 }
1009 1018
1010 INIT_WORK(&mcspi->work, omap2_mcspi_work); 1019 INIT_WORK(&mcspi->work, omap2_mcspi_work);
1011 1020
@@ -1055,6 +1064,8 @@ err3:
1055err2: 1064err2:
1056 clk_put(mcspi->ick); 1065 clk_put(mcspi->ick);
1057err1a: 1066err1a:
1067 iounmap(mcspi->base);
1068err1aa:
1058 release_mem_region(r->start, (r->end - r->start) + 1); 1069 release_mem_region(r->start, (r->end - r->start) + 1);
1059err1: 1070err1:
1060 spi_master_put(master); 1071 spi_master_put(master);
@@ -1067,6 +1078,7 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev)
1067 struct omap2_mcspi *mcspi; 1078 struct omap2_mcspi *mcspi;
1068 struct omap2_mcspi_dma *dma_channels; 1079 struct omap2_mcspi_dma *dma_channels;
1069 struct resource *r; 1080 struct resource *r;
1081 void __iomem *base;
1070 1082
1071 master = dev_get_drvdata(&pdev->dev); 1083 master = dev_get_drvdata(&pdev->dev);
1072 mcspi = spi_master_get_devdata(master); 1084 mcspi = spi_master_get_devdata(master);
@@ -1078,7 +1090,9 @@ static int __exit omap2_mcspi_remove(struct platform_device *pdev)
1078 r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1090 r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1079 release_mem_region(r->start, (r->end - r->start) + 1); 1091 release_mem_region(r->start, (r->end - r->start) + 1);
1080 1092
1093 base = mcspi->base;
1081 spi_unregister_master(master); 1094 spi_unregister_master(master);
1095 iounmap(base);
1082 kfree(dma_channels); 1096 kfree(dma_channels);
1083 1097
1084 return 0; 1098 return 0;
diff --git a/drivers/spi/omap_uwire.c b/drivers/spi/omap_uwire.c
index 5515eb97d7c5..bab6ff061e91 100644
--- a/drivers/spi/omap_uwire.c
+++ b/drivers/spi/omap_uwire.c
@@ -59,7 +59,6 @@
59 * and irqs should show there too... 59 * and irqs should show there too...
60 */ 60 */
61#define UWIRE_BASE_PHYS 0xFFFB3000 61#define UWIRE_BASE_PHYS 0xFFFB3000
62#define UWIRE_BASE ((void *__iomem)IO_ADDRESS(UWIRE_BASE_PHYS))
63 62
64/* uWire Registers: */ 63/* uWire Registers: */
65#define UWIRE_IO_SIZE 0x20 64#define UWIRE_IO_SIZE 0x20
@@ -103,16 +102,21 @@ struct uwire_state {
103}; 102};
104 103
105/* REVISIT compile time constant for idx_shift? */ 104/* REVISIT compile time constant for idx_shift? */
105/*
106 * Or, put it in a structure which is used throughout the driver;
107 * that avoids having to issue two loads for each bit of static data.
108 */
106static unsigned int uwire_idx_shift; 109static unsigned int uwire_idx_shift;
110static void __iomem *uwire_base;
107 111
108static inline void uwire_write_reg(int idx, u16 val) 112static inline void uwire_write_reg(int idx, u16 val)
109{ 113{
110 __raw_writew(val, UWIRE_BASE + (idx << uwire_idx_shift)); 114 __raw_writew(val, uwire_base + (idx << uwire_idx_shift));
111} 115}
112 116
113static inline u16 uwire_read_reg(int idx) 117static inline u16 uwire_read_reg(int idx)
114{ 118{
115 return __raw_readw(UWIRE_BASE + (idx << uwire_idx_shift)); 119 return __raw_readw(uwire_base + (idx << uwire_idx_shift));
116} 120}
117 121
118static inline void omap_uwire_configure_mode(u8 cs, unsigned long flags) 122static inline void omap_uwire_configure_mode(u8 cs, unsigned long flags)
@@ -492,6 +496,14 @@ static int __init uwire_probe(struct platform_device *pdev)
492 return -ENODEV; 496 return -ENODEV;
493 497
494 uwire = spi_master_get_devdata(master); 498 uwire = spi_master_get_devdata(master);
499
500 uwire_base = ioremap(UWIRE_BASE_PHYS, UWIRE_IO_SIZE);
501 if (!uwire_base) {
502 dev_dbg(&pdev->dev, "can't ioremap UWIRE\n");
503 spi_master_put(master);
504 return -ENOMEM;
505 }
506
495 dev_set_drvdata(&pdev->dev, uwire); 507 dev_set_drvdata(&pdev->dev, uwire);
496 508
497 uwire->ck = clk_get(&pdev->dev, "armxor_ck"); 509 uwire->ck = clk_get(&pdev->dev, "armxor_ck");
@@ -520,8 +532,10 @@ static int __init uwire_probe(struct platform_device *pdev)
520 uwire->bitbang.txrx_bufs = uwire_txrx; 532 uwire->bitbang.txrx_bufs = uwire_txrx;
521 533
522 status = spi_bitbang_start(&uwire->bitbang); 534 status = spi_bitbang_start(&uwire->bitbang);
523 if (status < 0) 535 if (status < 0) {
524 uwire_off(uwire); 536 uwire_off(uwire);
537 iounmap(uwire_base);
538 }
525 return status; 539 return status;
526} 540}
527 541
@@ -534,6 +548,7 @@ static int __exit uwire_remove(struct platform_device *pdev)
534 548
535 status = spi_bitbang_stop(&uwire->bitbang); 549 status = spi_bitbang_stop(&uwire->bitbang);
536 uwire_off(uwire); 550 uwire_off(uwire);
551 iounmap(uwire_base);
537 return status; 552 return status;
538} 553}
539 554
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c
index 95b3ec89c126..522185629624 100644
--- a/drivers/usb/host/ohci-omap.c
+++ b/drivers/usb/host/ohci-omap.c
@@ -344,7 +344,12 @@ static int usb_hcd_omap_probe (const struct hc_driver *driver,
344 goto err1; 344 goto err1;
345 } 345 }
346 346
347 hcd->regs = (void __iomem *) (int) IO_ADDRESS(hcd->rsrc_start); 347 hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
348 if (!hcd->regs) {
349 dev_err(&pdev->dev, "can't ioremap OHCI HCD\n");
350 retval = -ENOMEM;
351 goto err2;
352 }
348 353
349 ohci = hcd_to_ohci(hcd); 354 ohci = hcd_to_ohci(hcd);
350 ohci_hcd_init(ohci); 355 ohci_hcd_init(ohci);
@@ -355,11 +360,11 @@ static int usb_hcd_omap_probe (const struct hc_driver *driver,
355 irq = platform_get_irq(pdev, 0); 360 irq = platform_get_irq(pdev, 0);
356 if (irq < 0) { 361 if (irq < 0) {
357 retval = -ENXIO; 362 retval = -ENXIO;
358 goto err2; 363 goto err3;
359 } 364 }
360 retval = usb_add_hcd(hcd, irq, IRQF_DISABLED); 365 retval = usb_add_hcd(hcd, irq, IRQF_DISABLED);
361 if (retval) 366 if (retval)
362 goto err2; 367 goto err3;
363 368
364 host_initialized = 1; 369 host_initialized = 1;
365 370
@@ -367,6 +372,8 @@ static int usb_hcd_omap_probe (const struct hc_driver *driver,
367 omap_ohci_clock_power(0); 372 omap_ohci_clock_power(0);
368 373
369 return 0; 374 return 0;
375err3:
376 iounmap(hcd->regs);
370err2: 377err2:
371 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 378 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
372err1: 379err1:
@@ -401,6 +408,7 @@ usb_hcd_omap_remove (struct usb_hcd *hcd, struct platform_device *pdev)
401 } 408 }
402 if (machine_is_omap_osk()) 409 if (machine_is_omap_osk())
403 omap_free_gpio(9); 410 omap_free_gpio(9);
411 iounmap(hcd->regs);
404 release_mem_region(hcd->rsrc_start, hcd->rsrc_len); 412 release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
405 usb_put_hcd(hcd); 413 usb_put_hcd(hcd);
406 clk_put(usb_dc_ck); 414 clk_put(usb_dc_ck);
diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c
index 6efcf89e7fbe..dfb72f5e4c96 100644
--- a/drivers/video/omap/dispc.c
+++ b/drivers/video/omap/dispc.c
@@ -156,7 +156,7 @@ struct resmap {
156}; 156};
157 157
158static struct { 158static struct {
159 u32 base; 159 void __iomem *base;
160 160
161 struct omapfb_mem_desc mem_desc; 161 struct omapfb_mem_desc mem_desc;
162 struct resmap *res_map[DISPC_MEMTYPE_NUM]; 162 struct resmap *res_map[DISPC_MEMTYPE_NUM];
@@ -212,9 +212,9 @@ static void enable_rfbi_mode(int enable)
212 dispc_write_reg(DISPC_CONTROL, l); 212 dispc_write_reg(DISPC_CONTROL, l);
213 213
214 /* Set bypass mode in RFBI module */ 214 /* Set bypass mode in RFBI module */
215 l = __raw_readl(io_p2v(RFBI_CONTROL)); 215 l = __raw_readl(IO_ADDRESS(RFBI_CONTROL));
216 l |= enable ? 0 : (1 << 1); 216 l |= enable ? 0 : (1 << 1);
217 __raw_writel(l, io_p2v(RFBI_CONTROL)); 217 __raw_writel(l, IO_ADDRESS(RFBI_CONTROL));
218} 218}
219 219
220static void set_lcd_data_lines(int data_lines) 220static void set_lcd_data_lines(int data_lines)
@@ -1349,14 +1349,19 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
1349 1349
1350 memset(&dispc, 0, sizeof(dispc)); 1350 memset(&dispc, 0, sizeof(dispc));
1351 1351
1352 dispc.base = io_p2v(DISPC_BASE); 1352 dispc.base = ioremap(DISPC_BASE, SZ_1K);
1353 if (!dispc.base) {
1354 dev_err(fbdev->dev, "can't ioremap DISPC\n");
1355 return -ENOMEM;
1356 }
1357
1353 dispc.fbdev = fbdev; 1358 dispc.fbdev = fbdev;
1354 dispc.ext_mode = ext_mode; 1359 dispc.ext_mode = ext_mode;
1355 1360
1356 init_completion(&dispc.frame_done); 1361 init_completion(&dispc.frame_done);
1357 1362
1358 if ((r = get_dss_clocks()) < 0) 1363 if ((r = get_dss_clocks()) < 0)
1359 return r; 1364 goto fail0;
1360 1365
1361 enable_interface_clocks(1); 1366 enable_interface_clocks(1);
1362 enable_lcd_clocks(1); 1367 enable_lcd_clocks(1);
@@ -1414,7 +1419,7 @@ static int omap_dispc_init(struct omapfb_device *fbdev, int ext_mode,
1414 } 1419 }
1415 1420
1416 /* L3 firewall setting: enable access to OCM RAM */ 1421 /* L3 firewall setting: enable access to OCM RAM */
1417 __raw_writel(0x402000b0, io_p2v(0x680050a0)); 1422 __raw_writel(0x402000b0, IO_ADDRESS(0x680050a0));
1418 1423
1419 if ((r = alloc_palette_ram()) < 0) 1424 if ((r = alloc_palette_ram()) < 0)
1420 goto fail2; 1425 goto fail2;
@@ -1464,7 +1469,8 @@ fail1:
1464 enable_lcd_clocks(0); 1469 enable_lcd_clocks(0);
1465 enable_interface_clocks(0); 1470 enable_interface_clocks(0);
1466 put_dss_clocks(); 1471 put_dss_clocks();
1467 1472fail0:
1473 iounmap(dispc.base);
1468 return r; 1474 return r;
1469} 1475}
1470 1476
@@ -1481,6 +1487,7 @@ static void omap_dispc_cleanup(void)
1481 free_irq(INT_24XX_DSS_IRQ, dispc.fbdev); 1487 free_irq(INT_24XX_DSS_IRQ, dispc.fbdev);
1482 enable_interface_clocks(0); 1488 enable_interface_clocks(0);
1483 put_dss_clocks(); 1489 put_dss_clocks();
1490 iounmap(dispc.base);
1484} 1491}
1485 1492
1486const struct lcd_ctrl omap2_int_ctrl = { 1493const struct lcd_ctrl omap2_int_ctrl = {
diff --git a/drivers/video/omap/dispc.h b/drivers/video/omap/dispc.h
index eb1512b56ce8..ef720a78f6d5 100644
--- a/drivers/video/omap/dispc.h
+++ b/drivers/video/omap/dispc.h
@@ -40,4 +40,6 @@ extern void omap_dispc_enable_digit_out(int enable);
40extern int omap_dispc_request_irq(void (*callback)(void *data), void *data); 40extern int omap_dispc_request_irq(void (*callback)(void *data), void *data);
41extern void omap_dispc_free_irq(void); 41extern void omap_dispc_free_irq(void);
42 42
43extern const struct lcd_ctrl omap2_int_ctrl;
44
43#endif 45#endif
diff --git a/drivers/video/omap/lcd_h4.c b/drivers/video/omap/lcd_h4.c
index 88c19d424ef7..6ff56430341b 100644
--- a/drivers/video/omap/lcd_h4.c
+++ b/drivers/video/omap/lcd_h4.c
@@ -47,7 +47,7 @@ static unsigned long h4_panel_get_caps(struct lcd_panel *panel)
47 return 0; 47 return 0;
48} 48}
49 49
50struct lcd_panel h4_panel = { 50static struct lcd_panel h4_panel = {
51 .name = "h4", 51 .name = "h4",
52 .config = OMAP_LCDC_PANEL_TFT, 52 .config = OMAP_LCDC_PANEL_TFT,
53 53
@@ -91,7 +91,7 @@ static int h4_panel_resume(struct platform_device *pdev)
91 return 0; 91 return 0;
92} 92}
93 93
94struct platform_driver h4_panel_driver = { 94static struct platform_driver h4_panel_driver = {
95 .probe = h4_panel_probe, 95 .probe = h4_panel_probe,
96 .remove = h4_panel_remove, 96 .remove = h4_panel_remove,
97 .suspend = h4_panel_suspend, 97 .suspend = h4_panel_suspend,
diff --git a/drivers/video/omap/lcdc.c b/drivers/video/omap/lcdc.c
index 83514f066712..6e2ea7518761 100644
--- a/drivers/video/omap/lcdc.c
+++ b/drivers/video/omap/lcdc.c
@@ -34,6 +34,8 @@
34 34
35#include <asm/mach-types.h> 35#include <asm/mach-types.h>
36 36
37#include "lcdc.h"
38
37#define MODULE_NAME "lcdc" 39#define MODULE_NAME "lcdc"
38 40
39#define OMAP_LCDC_BASE 0xfffec000 41#define OMAP_LCDC_BASE 0xfffec000
diff --git a/drivers/video/omap/lcdc.h b/drivers/video/omap/lcdc.h
index adb731e5314a..845222270db3 100644
--- a/drivers/video/omap/lcdc.h
+++ b/drivers/video/omap/lcdc.h
@@ -4,4 +4,6 @@
4int omap_lcdc_set_dma_callback(void (*callback)(void *data), void *data); 4int omap_lcdc_set_dma_callback(void (*callback)(void *data), void *data);
5void omap_lcdc_free_dma_callback(void); 5void omap_lcdc_free_dma_callback(void);
6 6
7extern const struct lcd_ctrl omap1_int_ctrl;
8
7#endif 9#endif
diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 51a138bd113c..5a5e407dc45f 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -31,11 +31,14 @@
31#include <mach/dma.h> 31#include <mach/dma.h>
32#include <mach/omapfb.h> 32#include <mach/omapfb.h>
33 33
34#include "lcdc.h"
35#include "dispc.h"
36
34#define MODULE_NAME "omapfb" 37#define MODULE_NAME "omapfb"
35 38
36static unsigned int def_accel; 39static unsigned int def_accel;
37static unsigned long def_vram[OMAPFB_PLANE_NUM]; 40static unsigned long def_vram[OMAPFB_PLANE_NUM];
38static int def_vram_cnt; 41static unsigned int def_vram_cnt;
39static unsigned long def_vxres; 42static unsigned long def_vxres;
40static unsigned long def_vyres; 43static unsigned long def_vyres;
41static unsigned int def_rotate; 44static unsigned int def_rotate;
@@ -84,12 +87,10 @@ static struct caps_table_struct color_caps[] = {
84 * LCD panel 87 * LCD panel
85 * --------------------------------------------------------------------------- 88 * ---------------------------------------------------------------------------
86 */ 89 */
87extern struct lcd_ctrl omap1_int_ctrl;
88extern struct lcd_ctrl omap2_int_ctrl;
89extern struct lcd_ctrl hwa742_ctrl; 90extern struct lcd_ctrl hwa742_ctrl;
90extern struct lcd_ctrl blizzard_ctrl; 91extern struct lcd_ctrl blizzard_ctrl;
91 92
92static struct lcd_ctrl *ctrls[] = { 93static const struct lcd_ctrl *ctrls[] = {
93#ifdef CONFIG_ARCH_OMAP1 94#ifdef CONFIG_ARCH_OMAP1
94 &omap1_int_ctrl, 95 &omap1_int_ctrl,
95#else 96#else
@@ -740,7 +741,7 @@ static int omapfb_update_win(struct fb_info *fbi,
740 int ret; 741 int ret;
741 742
742 omapfb_rqueue_lock(plane->fbdev); 743 omapfb_rqueue_lock(plane->fbdev);
743 ret = omapfb_update_window_async(fbi, win, NULL, 0); 744 ret = omapfb_update_window_async(fbi, win, NULL, NULL);
744 omapfb_rqueue_unlock(plane->fbdev); 745 omapfb_rqueue_unlock(plane->fbdev);
745 746
746 return ret; 747 return ret;
@@ -768,7 +769,7 @@ static int omapfb_update_full_screen(struct fb_info *fbi)
768 win.format = 0; 769 win.format = 0;
769 770
770 omapfb_rqueue_lock(fbdev); 771 omapfb_rqueue_lock(fbdev);
771 r = fbdev->ctrl->update_window(fbi, &win, NULL, 0); 772 r = fbdev->ctrl->update_window(fbi, &win, NULL, NULL);
772 omapfb_rqueue_unlock(fbdev); 773 omapfb_rqueue_unlock(fbdev);
773 774
774 return r; 775 return r;
@@ -1047,7 +1048,7 @@ void omapfb_write_first_pixel(struct omapfb_device *fbdev, u16 pixval)
1047 win.height = 2; 1048 win.height = 2;
1048 win.out_width = 2; 1049 win.out_width = 2;
1049 win.out_height = 2; 1050 win.out_height = 2;
1050 fbdev->ctrl->update_window(fbdev->fb_info[0], &win, NULL, 0); 1051 fbdev->ctrl->update_window(fbdev->fb_info[0], &win, NULL, NULL);
1051 } 1052 }
1052 omapfb_rqueue_unlock(fbdev); 1053 omapfb_rqueue_unlock(fbdev);
1053} 1054}
diff --git a/drivers/video/omap/rfbi.c b/drivers/video/omap/rfbi.c
index 4a6f13d3facf..a13c8dcad2a8 100644
--- a/drivers/video/omap/rfbi.c
+++ b/drivers/video/omap/rfbi.c
@@ -59,7 +59,7 @@
59#define DISPC_CONTROL 0x0040 59#define DISPC_CONTROL 0x0040
60 60
61static struct { 61static struct {
62 u32 base; 62 void __iomem *base;
63 void (*lcdc_callback)(void *data); 63 void (*lcdc_callback)(void *data);
64 void *lcdc_callback_data; 64 void *lcdc_callback_data;
65 unsigned long l4_khz; 65 unsigned long l4_khz;
@@ -518,7 +518,11 @@ static int rfbi_init(struct omapfb_device *fbdev)
518 int r; 518 int r;
519 519
520 rfbi.fbdev = fbdev; 520 rfbi.fbdev = fbdev;
521 rfbi.base = io_p2v(RFBI_BASE); 521 rfbi.base = ioremap(RFBI_BASE, SZ_1K);
522 if (!rfbi.base) {
523 dev_err(fbdev->dev, "can't ioremap RFBI\n");
524 return -ENOMEM;
525 }
522 526
523 if ((r = rfbi_get_clocks()) < 0) 527 if ((r = rfbi_get_clocks()) < 0)
524 return r; 528 return r;
@@ -566,6 +570,7 @@ static void rfbi_cleanup(void)
566{ 570{
567 omap_dispc_free_irq(); 571 omap_dispc_free_irq();
568 rfbi_put_clocks(); 572 rfbi_put_clocks();
573 iounmap(rfbi.base);
569} 574}
570 575
571const struct lcd_ctrl_extif omap2_ext_if = { 576const struct lcd_ctrl_extif omap2_ext_if = {
diff --git a/drivers/video/omap/sossi.c b/drivers/video/omap/sossi.c
index 6359353c2c67..a76946220249 100644
--- a/drivers/video/omap/sossi.c
+++ b/drivers/video/omap/sossi.c
@@ -574,7 +574,12 @@ static int sossi_init(struct omapfb_device *fbdev)
574 struct clk *dpll1out_ck; 574 struct clk *dpll1out_ck;
575 int r; 575 int r;
576 576
577 sossi.base = (void __iomem *)IO_ADDRESS(OMAP_SOSSI_BASE); 577 sossi.base = ioremap(OMAP_SOSSI_BASE, SZ_1K);
578 if (!sossi.base) {
579 dev_err(fbdev->dev, "can't ioremap SoSSI\n");
580 return -ENOMEM;
581 }
582
578 sossi.fbdev = fbdev; 583 sossi.fbdev = fbdev;
579 spin_lock_init(&sossi.lock); 584 spin_lock_init(&sossi.lock);
580 585
@@ -665,6 +670,7 @@ static void sossi_cleanup(void)
665{ 670{
666 omap_lcdc_free_dma_callback(); 671 omap_lcdc_free_dma_callback();
667 clk_put(sossi.fck); 672 clk_put(sossi.fck);
673 iounmap(sossi.base);
668} 674}
669 675
670struct lcd_ctrl_extif omap1_ext_if = { 676struct lcd_ctrl_extif omap1_ext_if = {