Skip to contentSkip to conversation

pasemi: Electra CF driver

PATCH In review Olof Johansson 2 participants 2 messages May 15, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pasemi: Electra CF driver

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.

---

Updated based on review comments from Russell, as well as retooled for the I/O space changes (as discussed with Arnd/BenH).

This patch depends on the PCMCIA pcmcia_bus_type export to compile:

http://lists.infradead.org/pipermail/linux-pcmcia/2007-May/004628.html

and on the ioaddr_t change to work at runtime:

http://patchwork.ozlabs.org/linuxppc/patch?id=11147

Also, had to switch to bool config option since the iospace functions aren't exported (starting with .23 we should be able to switch back to tristate). Keep all the module init/remove calls for now.

drivers/pcmcia/Kconfig +7 -0
Index: powerpc/drivers/pcmcia/Kconfig
===================================================================
@@ -270,6 +270,13 @@ config AT91_CF
 	  Say Y here to support the CompactFlash controller on AT91 chips.
 	  Or choose M to compile the driver as a module named "at91_cf".
 
+config ELECTRA_CF
+	bool "Electra CompactFlash Controller"
+	depends on PCMCIA=y && PPC_PASEMI
+	help
+	  Say Y here to support the CompactFlash controller on the
+	  PA Semi Electra eval board.
+
 config PCCARD_NONSTATIC
 	tristate
 
drivers/pcmcia/Makefile +1 -0
Index: powerpc/drivers/pcmcia/Makefile
===================================================================
@@ -37,6 +37,7 @@ obj-$(CONFIG_PCMCIA_VRC4171)			+= vrc417
 obj-$(CONFIG_PCMCIA_VRC4173)			+= vrc4173_cardu.o
 obj-$(CONFIG_OMAP_CF)				+= omap_cf.o
 obj-$(CONFIG_AT91_CF)				+= at91_cf.o
+obj-$(CONFIG_ELECTRA_CF)			+= electra_cf.o
 
 sa11xx_core-y					+= soc_common.o sa11xx_base.o
 pxa2xx_core-y					+= soc_common.o pxa2xx_base.o
drivers/pcmcia/electra_cf.c new file +382 -0

382 lines not on this page · raw message

arch/powerpc/platforms/pasemi/setup.c +1 -0
Index: powerpc/arch/powerpc/platforms/pasemi/setup.c
===================================================================
@@ -205,6 +205,7 @@ static void __init pas_init_early(void)
 }
 
 static struct of_device_id pasemi_bus_ids[] = {
+	{ .type = "localbus", },
 	{ .type = "sdc", },
 	{},
 };
#1 lore raw
Quoted 3 lines · Olof Johansson

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 looks really good, there is nothing for me to complain about.

Quoted 2 lines

The driver is implemented as an of_platform driver, and adds localbus as a bus being probed by the of_platform framework.

I supposed "localbus" is what the current firmware ships with in the device tree, right? If you still have the choice on how this is represented it might be better not to invent another device-type but rather make this "soc" or whatever existing type we know about.

	Arnd <><