struct irq_desc *intb_desc)
{
u16 i;
+ struct irq_desc *desc;
for (i = 0; i < MAX_BLACKFIN_GPIOS; i += 16) {
int irq = IRQ_PF0 + i;
while (mask) {
if (mask & 1) {
- struct irq_desc *desc = irq_desc + irq;
+ desc = irq_desc + irq;
desc->handle_irq(irq, desc);
}
irq++;
#define PINT_BIT(x) (1 << (PINT_2_BIT(x)))
static unsigned char irq2pint_lut[NR_PINTS];
-static unsigned short pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS];
+static unsigned char pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS];
struct pin_int_t {
unsigned int mask_set;
irq_base += (bit % 8) + ((bit / 8) & 1 ? 8 : 0);
bit_pos = bit + bank * NR_PINT_BITS;
- pint2irq_lut[bit_pos] = irq_base;
+ pint2irq_lut[bit_pos] = irq_base - SYS_IRQS;
irq2pint_lut[irq_base - SYS_IRQS] = bit_pos;
}
static void bfin_gpio_mask_ack_irq(unsigned int irq)
{
u8 pint_val = irq2pint_lut[irq - SYS_IRQS];
+ u32 pintbit = PINT_BIT(pint_val);
+ u8 bank = PINT_2_BANK(pint_val);
- pint[PINT_2_BANK(pint_val)]->request = PINT_BIT(pint_val);
- pint[PINT_2_BANK(pint_val)]->mask_clear = PINT_BIT(pint_val);
+ pint[bank]->request = pintbit;
+ pint[bank]->mask_clear = pintbit;
SSYNC();
}
static void bfin_gpio_unmask_irq(unsigned int irq)
{
u8 pint_val = irq2pint_lut[irq - SYS_IRQS];
+ u32 pintbit = PINT_BIT(pint_val);
+ u8 bank = PINT_2_BANK(pint_val);
- pint[PINT_2_BANK(pint_val)]->request = PINT_BIT(pint_val);
- pint[PINT_2_BANK(pint_val)]->mask_set = PINT_BIT(pint_val);
+ pint[bank]->request = pintbit;
+ pint[bank]->mask_set = pintbit;
SSYNC();
}
unsigned int ret;
u16 gpionr = irq - IRQ_PA0;
u8 pint_val = irq2pint_lut[irq - SYS_IRQS];
+ u32 pintbit = PINT_BIT(pint_val);
+ u8 bank = PINT_2_BANK(pint_val);
if (pint_val == IRQ_NOT_AVAIL)
return -ENODEV;
gpio_direction_input(gpionr);
if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
- pint[PINT_2_BANK(pint_val)]->edge_set = PINT_BIT(pint_val);
+ pint[bank]->edge_set = pintbit;
} else {
- pint[PINT_2_BANK(pint_val)]->edge_clear = PINT_BIT(pint_val);
+ pint[bank]->edge_clear = pintbit;
}
if ((type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_LEVEL_LOW)))
- pint[PINT_2_BANK(pint_val)]->invert_set = PINT_BIT(pint_val); /* low or falling edge denoted by one */
+ pint[bank]->invert_set = pintbit; /* low or falling edge denoted by one */
else
- pint[PINT_2_BANK(pint_val)]->invert_set = PINT_BIT(pint_val); /* high or rising edge denoted by zero */
+ pint[bank]->invert_set = pintbit; /* high or rising edge denoted by zero */
if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
- pint[PINT_2_BANK(pint_val)]->invert_set = PINT_BIT(pint_val);
+ pint[bank]->invert_set = pintbit;
else
- pint[PINT_2_BANK(pint_val)]->invert_set = PINT_BIT(pint_val);
+ pint[bank]->invert_set = pintbit;
SSYNC();
{
u8 bank, pint_val;
u32 request, irq;
+ struct irq_desc *desc;
switch (intb_irq) {
case IRQ_PINT0:
case IRQ_PINT1:
bank = 1;
break;
+ default:
+ return;
}
pint_val = bank * NR_PINT_BITS;
while (request) {
if (request & 1) {
- irq = pint2irq_lut[pint_val];
- struct irq_desc *desc = irq_desc + irq;
+ irq = pint2irq_lut[pint_val] + SYS_IRQS;
+ desc = irq_desc + irq;
desc->handle_irq(irq, desc);
}
pint_val++;
sic_status[0] = bfin_read_SIC_ISR(0) & bfin_read_SIC_IMASK(0);
sic_status[1] = bfin_read_SIC_ISR(1) & bfin_read_SIC_IMASK(1);
sic_status[2] = bfin_read_SIC_ISR(2) & bfin_read_SIC_IMASK(2);
- SSYNC();
+
+
for (;; ivg++) {
if (ivg >= ivg_stop) {
atomic_inc(&num_spurious);