lkml.org 
[lkml]   [2009]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: GPIO support for HTC Dream
Pavel Machek wrote:
> Hi!
>
>>> +int gpio_to_irq(unsigned gpio)
>>> +{
>>> + return -EINVAL;
>>> +}
>> This should probably just be an inline function in
>> arch/arm/mach-msm/include/mach/gpio.h
>
> Well, it is not performance critical in any way and it is likely to
> change in future. I'd leave it here.

If this function eventually does do something interesting, it would be
useful to have it as a macro in arch/arm/mach-msm/include/mach/gpio.h
since it can be used for static/define declarations, ie:

#define SOME_GPIO_IRQ gpio_to_irq(SOME_GPIO)

>>> +extern int gpio_to_irq(unsigned gpio);
>> This should probably be an inline as mentioned above.
>>
>> For completeness you should probably also add:
>>
>> static inline int irq_to_gpio(unsigned irq)
>> {
>> return -EINVAL;
>> }
>
> I'd say that would be overdoing it.

You should implement this if you have gpio_to_irq because it is part of
the API, see include/linux/gpio.h

~Ryan

--
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon 5 Amuri Park, 404 Barbadoes St
ryan@bluewatersys.com PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com New Zealand
Phone: +64 3 3779127 Freecall: Australia 1800 148 751
Fax: +64 3 3779135 USA 1800 261 2934


\
 
 \ /
  Last update: 2009-12-15 21:27    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site