ARM: 8229/1: sa1100: replace irq numbers with names in irq driver

In preparation for further changes replace direct IRQ numbers with
pre-defined names. This imposes no real code changes.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Dmitry Eremin-Solenikov 2014-11-28 15:56:13 +01:00 коммит произвёл Russell King
Родитель ff7f6d0bc5
Коммит 0fea30c63e
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -37,14 +37,14 @@ static int GPIO_IRQ_mask = (1 << 11) - 1;
/*
* To get the GPIO number from an IRQ number
*/
#define GPIO_11_27_IRQ(i) ((i) - 21)
#define GPIO_11_27_IRQ(i) ((i) + 11 - IRQ_GPIO11)
#define GPIO11_27_MASK(irq) (1 << GPIO_11_27_IRQ(irq))
static int sa1100_gpio_type(struct irq_data *d, unsigned int type)
{
unsigned int mask;
if (d->irq <= 10)
if (d->irq <= IRQ_GPIO10)
mask = 1 << d->irq;
else
mask = GPIO11_27_MASK(d->irq);
@ -71,7 +71,7 @@ static int sa1100_gpio_type(struct irq_data *d, unsigned int type)
}
/*
* GPIO IRQs must be acknowledged. This is for IRQs from 0 to 10.
* GPIO IRQs must be acknowledged. This is for IRQs from GPIO0 to 10.
*/
static void sa1100_low_gpio_ack(struct irq_data *d)
{
@ -189,7 +189,7 @@ static struct irq_chip sa1100_high_gpio_chip = {
/*
* We don't need to ACK IRQs on the SA1100 unless they're GPIOs
* this is for internal IRQs i.e. from 11 to 31.
* this is for internal IRQs i.e. from IRQ LCD to RTCAlrm.
*/
static void sa1100_mask_irq(struct irq_data *d)
{
@ -332,19 +332,19 @@ void __init sa1100_init_irq(void)
*/
ICCR = 1;
for (irq = 0; irq <= 10; irq++) {
for (irq = IRQ_GPIO0; irq <= IRQ_GPIO10; irq++) {
irq_set_chip_and_handler(irq, &sa1100_low_gpio_chip,
handle_edge_irq);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
}
for (irq = 12; irq <= 31; irq++) {
for (irq = IRQ_LCD; irq <= IRQ_RTCAlrm; irq++) {
irq_set_chip_and_handler(irq, &sa1100_normal_chip,
handle_level_irq);
set_irq_flags(irq, IRQF_VALID);
}
for (irq = 32; irq <= 48; irq++) {
for (irq = IRQ_GPIO11; irq <= IRQ_GPIO27; irq++) {
irq_set_chip_and_handler(irq, &sa1100_high_gpio_chip,
handle_edge_irq);
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);