Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 231327
b: refs/heads/master
c: 3cdb791
h: refs/heads/master
i:
  231325: 0ee271b
  231323: 5c86218
  231319: 45a162a
  231311: cea7d6b
  231295: 8f669a0
v: v3
  • Loading branch information
Lennert Buytenhek committed Jan 13, 2011
1 parent 456d562 commit a3bfe33
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 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: ee04087add7fa429fd1e4256705479cd1386adec
refs/heads/master: 3cdb791bdabd3771f93522871755ec97a797d0fd
43 changes: 22 additions & 21 deletions trunk/arch/arm/mach-ks8695/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,37 @@
#include <mach/regs-irq.h>
#include <mach/regs-gpio.h>

static void ks8695_irq_mask(unsigned int irqno)
static void ks8695_irq_mask(struct irq_data *d)
{
unsigned long inten;

inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
inten &= ~(1 << irqno);
inten &= ~(1 << d->irq);

__raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
}

static void ks8695_irq_unmask(unsigned int irqno)
static void ks8695_irq_unmask(struct irq_data *d)
{
unsigned long inten;

inten = __raw_readl(KS8695_IRQ_VA + KS8695_INTEN);
inten |= (1 << irqno);
inten |= (1 << d->irq);

__raw_writel(inten, KS8695_IRQ_VA + KS8695_INTEN);
}

static void ks8695_irq_ack(unsigned int irqno)
static void ks8695_irq_ack(struct irq_data *d)
{
__raw_writel((1 << irqno), KS8695_IRQ_VA + KS8695_INTST);
__raw_writel((1 << d->irq), KS8695_IRQ_VA + KS8695_INTST);
}


static struct irq_chip ks8695_irq_level_chip;
static struct irq_chip ks8695_irq_edge_chip;


static int ks8695_irq_set_type(unsigned int irqno, unsigned int type)
static int ks8695_irq_set_type(struct irq_data *d, unsigned int type)
{
unsigned long ctrl, mode;
unsigned short level_triggered = 0;
Expand Down Expand Up @@ -93,7 +93,7 @@ static int ks8695_irq_set_type(unsigned int irqno, unsigned int type)
return -EINVAL;
}

switch (irqno) {
switch (d->irq) {
case KS8695_IRQ_EXTERN0:
ctrl &= ~IOPC_IOEINT0TM;
ctrl |= IOPC_IOEINT0_MODE(mode);
Expand All @@ -115,30 +115,30 @@ static int ks8695_irq_set_type(unsigned int irqno, unsigned int type)
}

if (level_triggered) {
set_irq_chip(irqno, &ks8695_irq_level_chip);
set_irq_handler(irqno, handle_level_irq);
set_irq_chip(d->irq, &ks8695_irq_level_chip);
set_irq_handler(d->irq, handle_level_irq);
}
else {
set_irq_chip(irqno, &ks8695_irq_edge_chip);
set_irq_handler(irqno, handle_edge_irq);
set_irq_chip(d->irq, &ks8695_irq_edge_chip);
set_irq_handler(d->irq, handle_edge_irq);
}

__raw_writel(ctrl, KS8695_GPIO_VA + KS8695_IOPC);
return 0;
}

static struct irq_chip ks8695_irq_level_chip = {
.ack = ks8695_irq_mask,
.mask = ks8695_irq_mask,
.unmask = ks8695_irq_unmask,
.set_type = ks8695_irq_set_type,
.irq_ack = ks8695_irq_mask,
.irq_mask = ks8695_irq_mask,
.irq_unmask = ks8695_irq_unmask,
.irq_set_type = ks8695_irq_set_type,
};

static struct irq_chip ks8695_irq_edge_chip = {
.ack = ks8695_irq_ack,
.mask = ks8695_irq_mask,
.unmask = ks8695_irq_unmask,
.set_type = ks8695_irq_set_type,
.irq_ack = ks8695_irq_ack,
.irq_mask = ks8695_irq_mask,
.irq_unmask = ks8695_irq_unmask,
.irq_set_type = ks8695_irq_set_type,
};

void __init ks8695_init_irq(void)
Expand All @@ -164,7 +164,8 @@ void __init ks8695_init_irq(void)

/* Edge-triggered interrupts */
default:
ks8695_irq_ack(irq); /* clear pending bit */
/* clear pending bit */
ks8695_irq_ack(irq_get_irq_data(irq));
set_irq_chip(irq, &ks8695_irq_edge_chip);
set_irq_handler(irq, handle_edge_irq);
}
Expand Down

0 comments on commit a3bfe33

Please sign in to comment.