aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2007-10-17 02:26:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:48 -0400
commit2b571a066a2fee14189a297ce8adc5212c58074c (patch)
tree742ac4893aa8beef1a6975fed5c9bb7530423547 /arch
parent4975e45ff66845c9acc6c8619e80ef15eadf785e (diff)
pcmcia: CompactFlash driver for PA Semi Electra boards
Driver for the CompactFlash slot on the PA Semi Electra eval board. It's a simple device sitting on localbus, with interrupts and detect/voltage control over GPIO. The driver is implemented as an of_platform driver, and adds localbus as a bus being probed by the of_platform framework. [akpm@linux-foundation.org: cleanups] [olof@lixom.net: fix build] Signed-off-by: Olof Johansson <olof@lixom.net> Cc: Christoph Hellwig <hch@infradead.org> Cc: Milton Miller <miltonm@bga.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/pasemi/setup.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c
index 5ddf40a66ae8..3a5d112af5e0 100644
--- a/arch/powerpc/platforms/pasemi/setup.c
+++ b/arch/powerpc/platforms/pasemi/setup.c
@@ -37,6 +37,10 @@
37#include <asm/time.h> 37#include <asm/time.h>
38#include <asm/of_platform.h> 38#include <asm/of_platform.h>
39 39
40#include <pcmcia/ss.h>
41#include <pcmcia/cistpl.h>
42#include <pcmcia/ds.h>
43
40#include "pasemi.h" 44#include "pasemi.h"
41 45
42/* SDC reset register, must be pre-mapped at reset time */ 46/* SDC reset register, must be pre-mapped at reset time */
@@ -308,7 +312,57 @@ static void __init pas_init_early(void)
308 iommu_init_early_pasemi(); 312 iommu_init_early_pasemi();
309} 313}
310 314
315#ifdef CONFIG_PCMCIA
316static int pcmcia_notify(struct notifier_block *nb, unsigned long action,
317 void *data)
318{
319 struct device *dev = data;
320 struct device *parent;
321 struct pcmcia_device *pdev = to_pcmcia_dev(dev);
322
323 /* We are only intereted in device addition */
324 if (action != BUS_NOTIFY_ADD_DEVICE)
325 return 0;
326
327 parent = pdev->socket->dev.parent;
328
329 /* We know electra_cf devices will always have of_node set, since
330 * electra_cf is an of_platform driver.
331 */
332 if (!parent->archdata.of_node)
333 return 0;
334
335 if (!of_device_is_compatible(parent->archdata.of_node, "electra-cf"))
336 return 0;
337
338 /* We use the direct ops for localbus */
339 dev->archdata.dma_ops = &dma_direct_ops;
340
341 return 0;
342}
343
344static struct notifier_block pcmcia_notifier = {
345 .notifier_call = pcmcia_notify,
346};
347
348static inline void pasemi_pcmcia_init(void)
349{
350 extern struct bus_type pcmcia_bus_type;
351
352 bus_register_notifier(&pcmcia_bus_type, &pcmcia_notifier);
353}
354
355#else
356
357static inline void pasemi_pcmcia_init(void)
358{
359}
360
361#endif
362
363
311static struct of_device_id pasemi_bus_ids[] = { 364static struct of_device_id pasemi_bus_ids[] = {
365 { .type = "localbus", },
312 { .type = "sdc", }, 366 { .type = "sdc", },
313 {}, 367 {},
314}; 368};
@@ -318,6 +372,8 @@ static int __init pasemi_publish_devices(void)
318 if (!machine_is(pasemi)) 372 if (!machine_is(pasemi))
319 return 0; 373 return 0;
320 374
375 pasemi_pcmcia_init();
376
321 /* Publish OF platform devices for SDC and other non-PCI devices */ 377 /* Publish OF platform devices for SDC and other non-PCI devices */
322 of_platform_bus_probe(NULL, pasemi_bus_ids, NULL); 378 of_platform_bus_probe(NULL, pasemi_bus_ids, NULL);
323 379