Commit 9d1ca153 authored by David Brownell's avatar David Brownell Committed by Tony Lindgren

[PATCH] ARM: OMAP: omap_cf works better

Adding a "struct resource" prevented oopsing because of recent changes in
PCMCIA core requirements.

Restore a changes that lost in some kernel.org merge:  don't forget to
unregister the PCMCIA socket when unbinding the driver.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 45610fee
...@@ -67,6 +67,7 @@ struct omap_cf_socket { ...@@ -67,6 +67,7 @@ struct omap_cf_socket {
struct platform_device *pdev; struct platform_device *pdev;
unsigned long phys_cf; unsigned long phys_cf;
u_int irq; u_int irq;
struct resource iomem;
}; };
#define POLL_INTERVAL (2 * HZ) #define POLL_INTERVAL (2 * HZ)
...@@ -112,10 +113,7 @@ static int omap_cf_get_status(struct pcmcia_socket *s, u_int *sp) ...@@ -112,10 +113,7 @@ static int omap_cf_get_status(struct pcmcia_socket *s, u_int *sp)
if (!sp) if (!sp)
return -EINVAL; return -EINVAL;
/* FIXME power management should probably be board-specific: /* NOTE CF is always 3VCARD */
* - 3VCARD vs XVCARD (OSK only handles 3VCARD)
* - POWERON (switched on/off by set_socket)
*/
if (omap_cf_present()) { if (omap_cf_present()) {
struct omap_cf_socket *cf; struct omap_cf_socket *cf;
...@@ -254,6 +252,9 @@ static int __init omap_cf_probe(struct device *dev) ...@@ -254,6 +252,9 @@ static int __init omap_cf_probe(struct device *dev)
default: default:
goto fail1; goto fail1;
} }
cf->iomem.start = cf->phys_cf;
cf->iomem.end = cf->iomem.end + SZ_8K - 1;
cf->iomem.flags = IORESOURCE_MEM;
/* pcmcia layer only remaps "real" memory */ /* pcmcia layer only remaps "real" memory */
cf->socket.io_offset = (unsigned long) cf->socket.io_offset = (unsigned long)
...@@ -297,6 +298,7 @@ static int __init omap_cf_probe(struct device *dev) ...@@ -297,6 +298,7 @@ static int __init omap_cf_probe(struct device *dev)
cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP
| SS_CAP_MEM_ALIGN; | SS_CAP_MEM_ALIGN;
cf->socket.map_size = SZ_2K; cf->socket.map_size = SZ_2K;
cf->socket.io[0].res = &cf->iomem;
status = pcmcia_register_socket(&cf->socket); status = pcmcia_register_socket(&cf->socket);
if (status < 0) if (status < 0)
...@@ -321,6 +323,7 @@ static int __devexit omap_cf_remove(struct device *dev) ...@@ -321,6 +323,7 @@ static int __devexit omap_cf_remove(struct device *dev)
struct omap_cf_socket *cf = dev_get_drvdata(dev); struct omap_cf_socket *cf = dev_get_drvdata(dev);
cf->active = 0; cf->active = 0;
pcmcia_unregister_socket(&cf->socket);
del_timer_sync(&cf->timer); del_timer_sync(&cf->timer);
iounmap((void __iomem *) cf->socket.io_offset); iounmap((void __iomem *) cf->socket.io_offset);
release_mem_region(cf->phys_cf, SZ_8K); release_mem_region(cf->phys_cf, SZ_8K);
...@@ -334,8 +337,8 @@ static struct device_driver omap_cf_driver = { ...@@ -334,8 +337,8 @@ static struct device_driver omap_cf_driver = {
.bus = &platform_bus_type, .bus = &platform_bus_type,
.probe = omap_cf_probe, .probe = omap_cf_probe,
.remove = __devexit_p(omap_cf_remove), .remove = __devexit_p(omap_cf_remove),
.suspend = pcmcia_socket_dev_suspend, .suspend = pcmcia_socket_dev_suspend,
.resume = pcmcia_socket_dev_resume, .resume = pcmcia_socket_dev_resume,
}; };
static int __init omap_cf_init(void) static int __init omap_cf_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment