On Wed, Jul 20, 2011 at 3:29 PM, Ajay Bhargav <ajay.bhar...@einfochips.com> wrote: > Hi Lei, > >> I am not mixing those two concept together, and in our pratice, we >> also do as you said, >> use mfp to set that pin to GPIO state, and use gpio function to >> manupulate the gpio. >> So there is no need checking MFP setting for gpio requreset. Directly >> set would be ok. > > exactly... so here is code snip from my patch and Prafulla's reply. > --- >> > +int gpio_request(int gp, const char *label) >> > +{ >> > + /* >> > + * Assumes corresponding MFP is configured peoperly >> > + * for use as GPIO >> > + */ >> >> NAK, you should check here, respective MFP is being configured as GPIO, if >> not you should return error >> >> > + return 0; >> > +} >> > + > --- > >> BTW, why there is need the gpio_request function? >> > You can request a pin as GPIO for using within your code. In Linux Kernel > source this function checks for valid number and if requested pin is in use > or not. To check this they have used a very simple logic. > ..pseudo code.. > if(pin_label == NULL) > pin is free > else > pin in use > > I think I should do the same thing in my request function rather than going > for > complicated stuff, what you say? >
I mean why there has to be one request() function call is need? Is this mandatory for the gpio general framwork as you said? Best regards, Lei _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot