Re: [patch/rfc 2.6.19-rc5] arch-neutral GPIO calls

Paul Mundt
2006-11-13T18:39:17Z

On Mon, Nov 13, 2006 at 12:19:11PM -0600, Bill Gatliff wrote:
> True, but right now if the "multiple GPIO controllers" are on something
> like i2c/spi, they have the synch/asynch issues that Jamey mentioned and
> so are by definition out of scope for this proposal. If the GPIO lines
> are in an MMIO controller (PLD/FPGA, perhaps), then there's no reason
> that the board implementer couldn't address that in their implementation
> of the proposed functions.
>
They're something that has to be accounted for in any sort of API, or we
just end up throwing it all out and starting over again. I was thinking
more of the SuperIO or mfd device scope, where this _is_ a requirement.

> ... except that I bet David is thinking that the implementations will be
> in arch/arm/irq-at91rm9200.c or something, and not in
> asm/arm/board-xyz.c, so it's the arch implementer's responsibility and
> not the platform author's. Yea, I see your point now.
>
The problem with this is that it gets in to something that's getting
close to static pin state configuration. Setting up the mux from platform
code is brain-damage, since it's ultimately up to the system and driver
inserted at the time to grab and configure the pin as necessary, the
board or CPU code is not going to have any notion of the "preferred" pin
state, especially in the heavily muxed case.

> I say that we go with David's proposal for 2.6.19 anyway, and maybe by
> 2.6.20 we'll have a consensus on how to address that with some
> behind-the-API magic. :) (functions added to the machine descriptor,
> maybe?)
>
This is all too late for 2.6.19 regardless. We've gone this long without
a generic API, I see no reason to merge a temporary hack now if it's not
going to be satisfactory for people and require us to throw it all out
and start over again anyways.

I have a real need for supporting multiple controllers and handling
muxing dynamically from various drivers on various architectures, and
anything that exposes the pin # higher than the controller mapping to
function level is never going to work. Drivers have _zero_ interest in
pin #, only in the desired function.