Re: [PATCH] provide functions for gpio configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Oct 30, 2008 at 06:13:05PM +0100, Florian Fainelli wrote:
> Le Wednesday 29 October 2008 22:10:46 Phil Sutter, vous avez écrit :
> > Yes it does, but that's not part of gpiolib itself. Accessing them needs
> > a combination of gpio_to_chip() and container_of() to be used, which I
> > doubt makes sense on a device with a single, platform gpio chip.
> 
> Yes, that makes it unexportable the way it is done yet. What I suggest is not 
> overriding the struct rb532_gpio_chip with thoses callbacks, but do like you 
> suggested initially.
> 
> > I'm not sure if this is absolutely true. The original CompactFlash
> > driver e.g. clears interrupt level in cf_irq_handler() and sets it in
> > prepare_cf_irq(). The latter function is called more than once.
> 
> This should be moved the IRQ handler, where a specific check for the IRQ being 
> a GPIO one should set the interrupt status and level accordingly.

Sounds reasonable to me. So I'll prepare a patch which:
* removes the function pointers from rb532_gpio_chip
* exports getters and setters for interrupt status and level

The GPIO config and function registers should indeed only be accessed at
bootup, so the corresponding getters/setters will be only locally
accessible in arch/mips/rb532/gpio.c. Doing it this way also prevents
any driver from breaking others, as the complete GPIO configuration will
be done at a single place (i.e., inside gpio.c). IIRC pata-rb532-cf did
use them only at initialisation state and to prevent the described
situation.

I got the pata driver working by the way. I just wanted to get a
solution for the GPIO problem first, as it needs to access interrupt
level and status at least.

Greetings, Phil


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux