diff options
Diffstat (limited to 'drivers/pcmcia/omap_cf.c')
-rw-r--r-- | drivers/pcmcia/omap_cf.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index 420e10aec0ae..01be47e72730 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c | |||
@@ -67,6 +67,7 @@ struct omap_cf_socket { | |||
67 | struct platform_device *pdev; | 67 | struct platform_device *pdev; |
68 | unsigned long phys_cf; | 68 | unsigned long phys_cf; |
69 | u_int irq; | 69 | u_int irq; |
70 | struct resource iomem; | ||
70 | }; | 71 | }; |
71 | 72 | ||
72 | #define POLL_INTERVAL (2 * HZ) | 73 | #define POLL_INTERVAL (2 * HZ) |
@@ -112,16 +113,14 @@ static int omap_cf_get_status(struct pcmcia_socket *s, u_int *sp) | |||
112 | if (!sp) | 113 | if (!sp) |
113 | return -EINVAL; | 114 | return -EINVAL; |
114 | 115 | ||
115 | /* FIXME power management should probably be board-specific: | 116 | /* NOTE CF is always 3VCARD */ |
116 | * - 3VCARD vs XVCARD (OSK only handles 3VCARD) | ||
117 | * - POWERON (switched on/off by set_socket) | ||
118 | */ | ||
119 | if (omap_cf_present()) { | 117 | if (omap_cf_present()) { |
120 | struct omap_cf_socket *cf; | 118 | struct omap_cf_socket *cf; |
121 | 119 | ||
122 | *sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD; | 120 | *sp = SS_READY | SS_DETECT | SS_POWERON | SS_3VCARD; |
123 | cf = container_of(s, struct omap_cf_socket, socket); | 121 | cf = container_of(s, struct omap_cf_socket, socket); |
124 | s->irq.AssignedIRQ = cf->irq; | 122 | s->irq.AssignedIRQ = 0; |
123 | s->pci_irq = cf->irq; | ||
125 | } else | 124 | } else |
126 | *sp = 0; | 125 | *sp = 0; |
127 | return 0; | 126 | return 0; |
@@ -132,7 +131,7 @@ omap_cf_set_socket(struct pcmcia_socket *sock, struct socket_state_t *s) | |||
132 | { | 131 | { |
133 | u16 control; | 132 | u16 control; |
134 | 133 | ||
135 | /* FIXME some non-OSK boards will support power switching */ | 134 | /* REVISIT some non-OSK boards may support power switching */ |
136 | switch (s->Vcc) { | 135 | switch (s->Vcc) { |
137 | case 0: | 136 | case 0: |
138 | case 33: | 137 | case 33: |
@@ -204,7 +203,7 @@ static struct pccard_operations omap_cf_ops = { | |||
204 | * "what chipselect is used". Boards could want more. | 203 | * "what chipselect is used". Boards could want more. |
205 | */ | 204 | */ |
206 | 205 | ||
207 | static int __init omap_cf_probe(struct device *dev) | 206 | static int __devinit omap_cf_probe(struct device *dev) |
208 | { | 207 | { |
209 | unsigned seg; | 208 | unsigned seg; |
210 | struct omap_cf_socket *cf; | 209 | struct omap_cf_socket *cf; |
@@ -253,6 +252,9 @@ static int __init omap_cf_probe(struct device *dev) | |||
253 | default: | 252 | default: |
254 | goto fail1; | 253 | goto fail1; |
255 | } | 254 | } |
255 | cf->iomem.start = cf->phys_cf; | ||
256 | cf->iomem.end = cf->iomem.end + SZ_8K - 1; | ||
257 | cf->iomem.flags = IORESOURCE_MEM; | ||
256 | 258 | ||
257 | /* pcmcia layer only remaps "real" memory */ | 259 | /* pcmcia layer only remaps "real" memory */ |
258 | cf->socket.io_offset = (unsigned long) | 260 | cf->socket.io_offset = (unsigned long) |
@@ -296,6 +298,7 @@ static int __init omap_cf_probe(struct device *dev) | |||
296 | cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP | 298 | cf->socket.features = SS_CAP_PCCARD | SS_CAP_STATIC_MAP |
297 | | SS_CAP_MEM_ALIGN; | 299 | | SS_CAP_MEM_ALIGN; |
298 | cf->socket.map_size = SZ_2K; | 300 | cf->socket.map_size = SZ_2K; |
301 | cf->socket.io[0].res = &cf->iomem; | ||
299 | 302 | ||
300 | status = pcmcia_register_socket(&cf->socket); | 303 | status = pcmcia_register_socket(&cf->socket); |
301 | if (status < 0) | 304 | if (status < 0) |
@@ -334,15 +337,15 @@ static struct device_driver omap_cf_driver = { | |||
334 | .bus = &platform_bus_type, | 337 | .bus = &platform_bus_type, |
335 | .probe = omap_cf_probe, | 338 | .probe = omap_cf_probe, |
336 | .remove = __devexit_p(omap_cf_remove), | 339 | .remove = __devexit_p(omap_cf_remove), |
337 | .suspend = pcmcia_socket_dev_suspend, | 340 | .suspend = pcmcia_socket_dev_suspend, |
338 | .resume = pcmcia_socket_dev_resume, | 341 | .resume = pcmcia_socket_dev_resume, |
339 | }; | 342 | }; |
340 | 343 | ||
341 | static int __init omap_cf_init(void) | 344 | static int __init omap_cf_init(void) |
342 | { | 345 | { |
343 | if (cpu_is_omap16xx()) | 346 | if (cpu_is_omap16xx()) |
344 | driver_register(&omap_cf_driver); | 347 | return driver_register(&omap_cf_driver); |
345 | return 0; | 348 | return -ENODEV; |
346 | } | 349 | } |
347 | 350 | ||
348 | static void __exit omap_cf_exit(void) | 351 | static void __exit omap_cf_exit(void) |