Messages in this thread | | | Date | Mon, 23 May 2011 15:27:18 +0100 (BST) | From | Paul Parsons <> | Subject | Re: [PATCH] mfd: Add ASIC3 PCMCIA/CF support |
| |
Hi Samuel,
> Why is this driver linked to the pxa2 pcmcia driver ? Can't > we make it just > asic3 specific and enable it from the board asic3 platform > data ?
This driver isn't the actual driver! This patch merely provides the platform_data for the asic3 pcmcia platform_device. This is then linked to the existing pxa2xx-pcmcia platform_driver, which is the actual driver.
In the case of pcmcia, the platform_data provides callbacks (struct pcmcia_low_level) rather than simple static data, and thus needs to reside in drivers/pcmcia where those callbacks are declared.
In the case of asic3, the pcmcia platform_device also needs to provide a parent link back to the asic3 platform_device because the callbacks need to access asic3 registers (in addition to GPIOs).
Thus either the pcmcia platform_data or the asic3 platform_device need to be made global if both are to be referenced by the pcmcia platform_device. I chose the former, simply because the pcmcia platform_device was already defined in arch/arm/mach-pxa/hx4700.c
Agreed this arrangement seems somewhat untidy. I am keen to hear if someone can improve upon it.
Paul
| |