Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 36636
b: refs/heads/master
c: 4196dd6
h: refs/heads/master
v: v3
  • Loading branch information
Tony Lindgren committed Sep 25, 2006
1 parent 291c37d commit 378889b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 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: eaca33df44c0d00bc12b16e72b728ade25adf14d
refs/heads/master: 4196dd6baabccdef3786c1d51d75e041313af848
25 changes: 21 additions & 4 deletions trunk/arch/arm/plat-omap/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,14 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
}
}

static void _reset_gpio(struct gpio_bank *bank, int gpio)
{
_set_gpio_direction(bank, get_gpio_index(gpio), 1);
_set_gpio_irqenable(bank, gpio, 0);
_clear_gpio_irqstatus(bank, gpio);
_set_gpio_triggering(bank, get_gpio_index(gpio), IRQT_NOEDGE);
}

/* Use disable_irq_wake() and enable_irq_wake() functions from drivers */
static int gpio_wake_enable(unsigned int irq, unsigned int enable)
{
Expand Down Expand Up @@ -696,7 +704,9 @@ int omap_request_gpio(int gpio)
}
bank->reserved_map |= (1 << get_gpio_index(gpio));

/* Set trigger to none. You need to enable the trigger after request_irq */
/* Set trigger to none. You need to enable the desired trigger with
* request_irq() or set_irq_type().
*/
_set_gpio_triggering(bank, get_gpio_index(gpio), IRQT_NOEDGE);

#ifdef CONFIG_ARCH_OMAP15XX
Expand Down Expand Up @@ -756,9 +766,7 @@ void omap_free_gpio(int gpio)
}
#endif
bank->reserved_map &= ~(1 << get_gpio_index(gpio));
_set_gpio_direction(bank, get_gpio_index(gpio), 1);
_set_gpio_irqenable(bank, gpio, 0);
_clear_gpio_irqstatus(bank, gpio);
_reset_gpio(bank, gpio);
spin_unlock(&bank->lock);
}

Expand Down Expand Up @@ -898,6 +906,14 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,

}

static void gpio_irq_shutdown(unsigned int irq)
{
unsigned int gpio = irq - IH_GPIO_BASE;
struct gpio_bank *bank = get_gpio_bank(gpio);

_reset_gpio(bank, gpio);
}

static void gpio_ack_irq(unsigned int irq)
{
unsigned int gpio = irq - IH_GPIO_BASE;
Expand Down Expand Up @@ -946,6 +962,7 @@ static void mpuio_unmask_irq(unsigned int irq)

static struct irq_chip gpio_irq_chip = {
.name = "GPIO",
.shutdown = gpio_irq_shutdown,
.ack = gpio_ack_irq,
.mask = gpio_mask_irq,
.unmask = gpio_unmask_irq,
Expand Down

0 comments on commit 378889b

Please sign in to comment.