Skip to content

Commit

Permalink
ARM: plat-nomadik: irq_data conversion.
Browse files Browse the repository at this point in the history
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
Acked-by: Rabin Vincent <rabin.vincent@stericsson.com>
  • Loading branch information
Lennert Buytenhek committed Jan 13, 2011
1 parent 4d93579 commit f272c00
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions arch/arm/plat-nomadik/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,13 @@ static inline int nmk_gpio_get_bitmask(int gpio)
return 1 << (gpio % 32);
}

static void nmk_gpio_irq_ack(unsigned int irq)
static void nmk_gpio_irq_ack(struct irq_data *d)
{
int gpio;
struct nmk_gpio_chip *nmk_chip;

gpio = NOMADIK_IRQ_TO_GPIO(irq);
nmk_chip = get_irq_chip_data(irq);
gpio = NOMADIK_IRQ_TO_GPIO(d->irq);
nmk_chip = irq_data_get_irq_chip_data(d);
if (!nmk_chip)
return;
writel(nmk_gpio_get_bitmask(gpio), nmk_chip->addr + NMK_GPIO_IC);
Expand Down Expand Up @@ -401,16 +401,16 @@ static void __nmk_gpio_irq_modify(struct nmk_gpio_chip *nmk_chip,
}
}

static int nmk_gpio_irq_modify(unsigned int irq, enum nmk_gpio_irq_type which,
static int nmk_gpio_irq_modify(struct irq_data *d, enum nmk_gpio_irq_type which,
bool enable)
{
int gpio;
struct nmk_gpio_chip *nmk_chip;
unsigned long flags;
u32 bitmask;

gpio = NOMADIK_IRQ_TO_GPIO(irq);
nmk_chip = get_irq_chip_data(irq);
gpio = NOMADIK_IRQ_TO_GPIO(d->irq);
nmk_chip = irq_data_get_irq_chip_data(d);
bitmask = nmk_gpio_get_bitmask(gpio);
if (!nmk_chip)
return -EINVAL;
Expand All @@ -422,24 +422,24 @@ static int nmk_gpio_irq_modify(unsigned int irq, enum nmk_gpio_irq_type which,
return 0;
}

static void nmk_gpio_irq_mask(unsigned int irq)
static void nmk_gpio_irq_mask(struct irq_data *d)
{
nmk_gpio_irq_modify(irq, NORMAL, false);
nmk_gpio_irq_modify(d, NORMAL, false);
}

static void nmk_gpio_irq_unmask(unsigned int irq)
static void nmk_gpio_irq_unmask(struct irq_data *d)
{
nmk_gpio_irq_modify(irq, NORMAL, true);
nmk_gpio_irq_modify(d, NORMAL, true);
}

static int nmk_gpio_irq_set_wake(unsigned int irq, unsigned int on)
static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
{
struct nmk_gpio_chip *nmk_chip;
unsigned long flags;
int gpio;

gpio = NOMADIK_IRQ_TO_GPIO(irq);
nmk_chip = get_irq_chip_data(irq);
gpio = NOMADIK_IRQ_TO_GPIO(d->irq);
nmk_chip = irq_data_get_irq_chip_data(d);
if (!nmk_chip)
return -EINVAL;

Expand All @@ -457,18 +457,18 @@ static int nmk_gpio_irq_set_wake(unsigned int irq, unsigned int on)
return 0;
}

static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type)
{
struct irq_desc *desc = irq_to_desc(irq);
struct irq_desc *desc = irq_to_desc(d->irq);
bool enabled = !(desc->status & IRQ_DISABLED);
bool wake = desc->wake_depth;
int gpio;
struct nmk_gpio_chip *nmk_chip;
unsigned long flags;
u32 bitmask;

gpio = NOMADIK_IRQ_TO_GPIO(irq);
nmk_chip = get_irq_chip_data(irq);
gpio = NOMADIK_IRQ_TO_GPIO(d->irq);
nmk_chip = irq_data_get_irq_chip_data(d);
bitmask = nmk_gpio_get_bitmask(gpio);
if (!nmk_chip)
return -EINVAL;
Expand Down Expand Up @@ -507,11 +507,11 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)

static struct irq_chip nmk_gpio_irq_chip = {
.name = "Nomadik-GPIO",
.ack = nmk_gpio_irq_ack,
.mask = nmk_gpio_irq_mask,
.unmask = nmk_gpio_irq_unmask,
.set_type = nmk_gpio_irq_set_type,
.set_wake = nmk_gpio_irq_set_wake,
.irq_ack = nmk_gpio_irq_ack,
.irq_mask = nmk_gpio_irq_mask,
.irq_unmask = nmk_gpio_irq_unmask,
.irq_set_type = nmk_gpio_irq_set_type,
.irq_set_wake = nmk_gpio_irq_set_wake,
};

static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
Expand All @@ -522,12 +522,12 @@ static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
u32 pending;
unsigned int first_irq;

if (host_chip->mask_ack)
host_chip->mask_ack(irq);
if (host_chip->irq_mask_ack)
host_chip->irq_mask_ack(&desc->irq_data);
else {
host_chip->mask(irq);
if (host_chip->ack)
host_chip->ack(irq);
host_chip->irq_mask(&desc->irq_data);
if (host_chip->irq_ack)
host_chip->irq_ack(&desc->irq_data);
}

nmk_chip = get_irq_data(irq);
Expand All @@ -537,7 +537,7 @@ static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
generic_handle_irq(gpio_irq);
}

host_chip->unmask(irq);
host_chip->irq_unmask(&desc->irq_data);
}

static int nmk_gpio_init_irq(struct nmk_gpio_chip *nmk_chip)
Expand Down

0 comments on commit f272c00

Please sign in to comment.