Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91217
b: refs/heads/master
c: dfa1067
h: refs/heads/master
i:
  91215: c5745b0
v: v3
  • Loading branch information
eric miao authored and Russell King committed Apr 19, 2008
1 parent c9980d0 commit 9b7a766
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 23 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: a7bf4dbabac2a1ccd56527a56c82af720e7a00d1
refs/heads/master: dfa1067996390dfd4b1ce449676500fab4980ce2
42 changes: 20 additions & 22 deletions trunk/arch/arm/mach-pxa/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,39 +121,37 @@ static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
gpio = IRQ_TO_GPIO(irq);
idx = gpio >> 5;

if (type == IRQT_PROBE) {
/* Don't mess with enabled GPIOs using preconfigured edges or
GPIOs set to alternate function or to output during probe */
if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx] | GPDR(gpio)) &
GPIO_bit(gpio))
if (type == IRQ_TYPE_PROBE) {
/* Don't mess with enabled GPIOs using preconfigured edges or
* GPIOs set to alternate function or to output during probe
*/
if ((GPIO_IRQ_rising_edge[idx] |
GPIO_IRQ_falling_edge[idx] |
GPDR(gpio)) & GPIO_bit(gpio))
return 0;
if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2)))
return 0;
type = __IRQT_RISEDGE | __IRQT_FALEDGE;
type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
}

/* printk(KERN_DEBUG "IRQ%d (GPIO%d): ", irq, gpio); */

pxa_gpio_mode(gpio | GPIO_IN);

if (type & __IRQT_RISEDGE) {
/* printk("rising "); */
__set_bit (gpio, GPIO_IRQ_rising_edge);
} else {
__clear_bit (gpio, GPIO_IRQ_rising_edge);
}
if (type & IRQ_TYPE_EDGE_RISING)
__set_bit(gpio, GPIO_IRQ_rising_edge);
else
__clear_bit(gpio, GPIO_IRQ_rising_edge);

if (type & __IRQT_FALEDGE) {
/* printk("falling "); */
__set_bit (gpio, GPIO_IRQ_falling_edge);
} else {
__clear_bit (gpio, GPIO_IRQ_falling_edge);
}

/* printk("edges\n"); */
if (type & IRQ_TYPE_EDGE_FALLING)
__set_bit(gpio, GPIO_IRQ_falling_edge);
else
__clear_bit(gpio, GPIO_IRQ_falling_edge);

GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];

pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio,
((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""),
((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : ""));
return 0;
}

Expand Down

0 comments on commit 9b7a766

Please sign in to comment.