Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328453
b: refs/heads/master
c: a3b9308
h: refs/heads/master
i:
  328451: 5f509ff
v: v3
  • Loading branch information
Axel Lin authored and Linus Walleij committed Sep 6, 2012
1 parent ac51819 commit 8be59c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9f77c93ab673d145de46926d676e9f09f7de8eb
refs/heads/master: a3b930815d07e2a8a25e85496839f80facb3654d
24 changes: 6 additions & 18 deletions trunk/drivers/gpio/gpio-sx150x.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,39 +311,32 @@ static int sx150x_gpio_to_irq(struct gpio_chip *gc, unsigned offset)

static void sx150x_irq_mask(struct irq_data *d)
{
struct irq_chip *ic = irq_data_get_irq_chip(d);
struct sx150x_chip *chip;
struct sx150x_chip *chip = irq_data_get_irq_chip_data(d);
unsigned n;

chip = container_of(ic, struct sx150x_chip, irq_chip);
n = d->irq - chip->irq_base;
chip->irq_masked |= (1 << n);
chip->irq_update = n;
}

static void sx150x_irq_unmask(struct irq_data *d)
{
struct irq_chip *ic = irq_data_get_irq_chip(d);
struct sx150x_chip *chip;
struct sx150x_chip *chip = irq_data_get_irq_chip_data(d);
unsigned n;

chip = container_of(ic, struct sx150x_chip, irq_chip);
n = d->irq - chip->irq_base;

chip->irq_masked &= ~(1 << n);
chip->irq_update = n;
}

static int sx150x_irq_set_type(struct irq_data *d, unsigned int flow_type)
{
struct irq_chip *ic = irq_data_get_irq_chip(d);
struct sx150x_chip *chip;
struct sx150x_chip *chip = irq_data_get_irq_chip_data(d);
unsigned n, val = 0;

if (flow_type & (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
return -EINVAL;

chip = container_of(ic, struct sx150x_chip, irq_chip);
n = d->irq - chip->irq_base;

if (flow_type & IRQ_TYPE_EDGE_RISING)
Expand Down Expand Up @@ -391,22 +384,16 @@ static irqreturn_t sx150x_irq_thread_fn(int irq, void *dev_id)

static void sx150x_irq_bus_lock(struct irq_data *d)
{
struct irq_chip *ic = irq_data_get_irq_chip(d);
struct sx150x_chip *chip;

chip = container_of(ic, struct sx150x_chip, irq_chip);
struct sx150x_chip *chip = irq_data_get_irq_chip_data(d);

mutex_lock(&chip->lock);
}

static void sx150x_irq_bus_sync_unlock(struct irq_data *d)
{
struct irq_chip *ic = irq_data_get_irq_chip(d);
struct sx150x_chip *chip;
struct sx150x_chip *chip = irq_data_get_irq_chip_data(d);
unsigned n;

chip = container_of(ic, struct sx150x_chip, irq_chip);

if (chip->irq_update == NO_UPDATE_PENDING)
goto out;

Expand Down Expand Up @@ -551,6 +538,7 @@ static int sx150x_install_irq_chip(struct sx150x_chip *chip,

for (n = 0; n < chip->dev_cfg->ngpios; ++n) {
irq = irq_base + n;
irq_set_chip_data(irq, chip);
irq_set_chip_and_handler(irq, &chip->irq_chip, handle_edge_irq);
irq_set_nested_thread(irq, 1);
#ifdef CONFIG_ARM
Expand Down

0 comments on commit 8be59c9

Please sign in to comment.