Re: [PATCH] generic gpio: add default level to gpio_direction_output

Haavard Skinnemoen <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Atmel Norway
Message-ID <[email protected]>
On Thu, 1 Mar 2007 13:08:57 -0800
David Brownell <[email protected]> wrote:

> On Thursday 01 March 2007 6:32 am, Milan Svoboda wrote:
> > This patch adds second parameter to gpio_direction_output function.
> > This allows users to specify default output level.
> > 
> > Patch covers pxa and ixp4xx plus driver for pxa2xx_udc.
> > 
> > Patch is agains 2.6.21-rc1
> > 
> > What do you think about this attempt?
> 
> I'd avoid defining new GPIO_DIRECTION_OUT_{LOW,HIGH} symbols, and
> stick to the convention used in gpio_set_value().  If there were
> to be a new symbol, it should work with both functions; so that
> long "_DIRECTION" would be unwise.
> 
> Other than that, it's exactly what I'd want to see.  Andrew, Haavard;
> any comments?  Only PXA/IXP4XX and AT91/AVR32 need paired changes, so
> if there are no problems with those platforms, the rest can almost go
> independently.

I'm fine with this. I agree that no symbolic constants should be
necessary for a parameter called "level", as it should be pretty
obvious what is what.

The only downside I can think of is that this might slow down drivers
that change the direction a lot, like a bitbanging i2c driver. But at
least for i2c that shouldn't really be an issue since it usually needs
to be slowed down using udelay() anyway.

Haavard

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.