[U-Boot] [PATCH 1/2] gpio: Add GPIO driver framework for Marvell SoCs

Ajay Bhargav ajay.bhargav at einfochips.com
Fri Jul 22 06:38:02 CEST 2011


Hi Prafulla,

Thank you so much for feedback.

> In this case mvgpio.c is enabling support for gpio framework that will
> be interfaced using asm/gpio.h.
> 
> 1. You can split stuff in mvgpio.h to asm/arch/gpio.h and/or mvgpio.c
> 2. you can move it to drivers/gpio/
> 
> I would recommend first option.
>  
So you mean the first patch will have only mvgpio.c that enables the support
for gpio for Marvell SoCs and then second patch will enable support for Armada
series via gpio.h file. So if anyone want to use mvgpio.c he/she should write a
compatible version of gpio.h in their arch folder. I hope i am getting your right.

> > +static int get_gpio_base(int bank)
> > +{
> > +        switch (bank) {
> > +        case 0:
> > +                return GPIO_BANK0_BASE;
> > +        case 1:
> > +                return GPIO_BANK1_BASE;
> > +        case 2:
> > +                return GPIO_BANK2_BASE;
> > +        case 3:
> > +                return GPIO_BANK3_BASE;
> > +        }
> > +        return 0;
> > +}
> 
> As discussed, this would be preferred macro in gpio.h
> 
I am finding it difficult to fit this as a macro. so i thought to have it as
inline function in gpio.h will that be ok?

Regards,
Ajay Bhargav


More information about the U-Boot mailing list