mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
SA1100: make gpio_to_irq and reverse a macro
The function can't be used for static initialisations so convert them to macros.
This commit is contained in:
parent
167c55ef80
commit
cc64717279
1 changed files with 4 additions and 15 deletions
|
@ -49,20 +49,9 @@ static inline void gpio_set_value(unsigned gpio, int value)
|
||||||
|
|
||||||
#define gpio_cansleep __gpio_cansleep
|
#define gpio_cansleep __gpio_cansleep
|
||||||
|
|
||||||
static inline unsigned gpio_to_irq(unsigned gpio)
|
#define gpio_to_irq(gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \
|
||||||
{
|
(IRQ_GPIO11 - 11 + gpio))
|
||||||
if (gpio < 11)
|
#define irq_to_gpio(irq) ((irq < IRQ_GPIO11_27) ? (irq - IRQ_GPIO0) : \
|
||||||
return IRQ_GPIO0 + gpio;
|
(irq - IRQ_GPIO11 + 11))
|
||||||
else
|
|
||||||
return IRQ_GPIO11 - 11 + gpio;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline unsigned irq_to_gpio(unsigned irq)
|
|
||||||
{
|
|
||||||
if (irq < IRQ_GPIO11_27)
|
|
||||||
return irq - IRQ_GPIO0;
|
|
||||||
else
|
|
||||||
return irq - IRQ_GPIO11 + 11;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue