Commit dcb9c392 authored by David Brownell's avatar David Brownell Committed by Linus Torvalds

[PATCH] omap_cf works again (sync with linux-omap tree)

This syncs the omap_cf driver with the one from the linux-omap tree.  Changes
include fixing build warnings (section mismatch, unused return value) and
coping with various pcmcia core changes related to managing i/o memory and irq
resources.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 391b1fe6
...@@ -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,16 +113,14 @@ static int omap_cf_get_status(struct pcmcia_socket *s, u_int *sp) ...@@ -112,16 +113,14 @@ 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;
*sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD; *sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD;
cf = container_of(s, struct omap_cf_socket, socket); cf = container_of(s, struct omap_cf_socket, socket);
s->irq.AssignedIRQ = cf->irq; s->irq.AssignedIRQ = 0;
s->pci_irq = cf->irq;
} else } else
*sp = 0; *sp = 0;
return 0; return 0;
...@@ -132,7 +131,7 @@ omap_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s) ...@@ -132,7 +131,7 @@ omap_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s)
{ {
u16 control; u16 control;
/* FIXME some non-OSK boards will support power switching */ /* REVISIT some non-OSK boards may support power switching */
switch (s->Vcc) { switch (s->Vcc) {
case 0: case 0:
case 33: case 33:
...@@ -204,7 +203,7 @@ static struct pccard_operations omap_cf_ops = { ...@@ -204,7 +203,7 @@ static struct pccard_operations omap_cf_ops = {
* "what chipselect is used". Boards could want more. * "what chipselect is used". Boards could want more.
*/ */
static int __init omap_cf_probe(struct device *dev) static int __devinit omap_cf_probe(struct device *dev)
{ {
unsigned seg; unsigned seg;
struct omap_cf_socket *cf; struct omap_cf_socket *cf;
...@@ -253,6 +252,9 @@ static int __init omap_cf_probe(struct device *dev) ...@@ -253,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)
...@@ -296,6 +298,7 @@ static int __init omap_cf_probe(struct device *dev) ...@@ -296,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)
...@@ -341,8 +344,8 @@ static struct device_driver omap_cf_driver = { ...@@ -341,8 +344,8 @@ static struct device_driver omap_cf_driver = {
static int __init omap_cf_init(void) static int __init omap_cf_init(void)
{ {
if (cpu_is_omap16xx()) if (cpu_is_omap16xx())
driver_register(&omap_cf_driver); return driver_register(&omap_cf_driver);
return 0; return -ENODEV;
} }
static void __exit omap_cf_exit(void) static void __exit omap_cf_exit(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