Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91221
b: refs/heads/master
c: b9e25ac
h: refs/heads/master
i:
  91219: 70646ea
v: v3
  • Loading branch information
eric miao authored and Russell King committed Apr 19, 2008
1 parent 3996ce3 commit 277fbe6
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 50 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: f6fb7af4768bc1ddc2349f6eaefedd746c8e4913
refs/heads/master: b9e25aced33eeb7279ccbaef198f28370cfb4e93
9 changes: 4 additions & 5 deletions trunk/arch/arm/mach-pxa/generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
* published by the Free Software Foundation.
*/

typedef int (*set_wake_t)(unsigned int, unsigned int);

struct sys_timer;

extern struct sys_timer pxa_timer;
extern void __init pxa_init_irq(int irq_nr);
extern void __init pxa_init_irq_gpio(int gpio_nr);
extern void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int));
extern void __init pxa_init_gpio_set_wake(int (*set_wake)(unsigned int, unsigned int));
extern void __init pxa_init_gpio(int gpio_nr);
extern void __init pxa_init_irq(int irq_nr, set_wake_t fn);
extern void __init pxa_init_gpio(int gpio_nr, set_wake_t fn);
extern void __init pxa25x_init_irq(void);
extern void __init pxa27x_init_irq(void);
extern void __init pxa3xx_init_irq(void);
Expand Down
34 changes: 12 additions & 22 deletions trunk/arch/arm/mach-pxa/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,6 @@ static struct pxa_gpio_chip pxa_gpio_chip[] = {
#endif
};

void __init pxa_init_gpio(int gpio_nr)
{
int i;

/* add a GPIO chip for each register bank.
* the last PXA25x register only contains 21 GPIOs
*/
for (i = 0; i < gpio_nr; i += 32) {
if (i+32 > gpio_nr)
pxa_gpio_chip[i/32].chip.ngpio = gpio_nr - i;
gpiochip_add(&pxa_gpio_chip[i/32].chip);
}
}

/*
* PXA GPIO edge detection for IRQs:
* IRQs are generated on Falling-Edge, Rising-Edge, or both.
Expand Down Expand Up @@ -309,9 +295,9 @@ static struct irq_chip pxa_muxed_gpio_chip = {
.set_type = pxa_gpio_irq_type,
};

void __init pxa_init_irq_gpio(int gpio_nr)
void __init pxa_init_gpio(int gpio_nr, set_wake_t fn)
{
int irq, i;
int irq, i, gpio;

pxa_last_gpio = gpio_nr - 1;

Expand Down Expand Up @@ -340,11 +326,15 @@ void __init pxa_init_irq_gpio(int gpio_nr)
/* Install handler for GPIO>=2 edge detect interrupts */
set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);

pxa_init_gpio(gpio_nr);
}
pxa_low_gpio_chip.set_wake = fn;
pxa_muxed_gpio_chip.set_wake = fn;

void __init pxa_init_gpio_set_wake(int (*set_wake)(unsigned int, unsigned int))
{
pxa_low_gpio_chip.set_wake = set_wake;
pxa_muxed_gpio_chip.set_wake = set_wake;
/* add a GPIO chip for each register bank.
* the last PXA25x register only contains 21 GPIOs
*/
for (gpio = 0, i = 0; gpio < gpio_nr; gpio += 32, i++) {
if (gpio + 32 > gpio_nr)
pxa_gpio_chip[i].chip.ngpio = gpio_nr - gpio;
gpiochip_add(&pxa_gpio_chip[i].chip);
}
}
8 changes: 2 additions & 6 deletions trunk/arch/arm/mach-pxa/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static struct irq_chip pxa_internal_irq_chip = {
.unmask = pxa_unmask_irq,
};

void __init pxa_init_irq(int irq_nr)
void __init pxa_init_irq(int irq_nr, set_wake_t fn)
{
int irq;

Expand All @@ -70,12 +70,8 @@ void __init pxa_init_irq(int irq_nr)
set_irq_handler(irq, handle_level_irq);
set_irq_flags(irq, IRQF_VALID);
}
}

void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int))
{
pxa_internal_irq_chip.set_wake = set_wake;
pxa_init_gpio_set_wake(set_wake);
pxa_internal_irq_chip.set_wake = fn;
}

#ifdef CONFIG_PM
Expand Down
5 changes: 2 additions & 3 deletions trunk/arch/arm/mach-pxa/pxa25x.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,8 @@ static int pxa25x_set_wake(unsigned int irq, unsigned int on)

void __init pxa25x_init_irq(void)
{
pxa_init_irq(32);
pxa_init_irq_gpio(85);
pxa_init_irq_set_wake(pxa25x_set_wake);
pxa_init_irq(32, pxa25x_set_wake);
pxa_init_gpio(85, pxa25x_set_wake);
}

static struct platform_device *pxa25x_devices[] __initdata = {
Expand Down
5 changes: 2 additions & 3 deletions trunk/arch/arm/mach-pxa/pxa27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,8 @@ static int pxa27x_set_wake(unsigned int irq, unsigned int on)

void __init pxa27x_init_irq(void)
{
pxa_init_irq(34);
pxa_init_irq_gpio(128);
pxa_init_irq_set_wake(pxa27x_set_wake);
pxa_init_irq(34, pxa27x_set_wake);
pxa_init_gpio(128, pxa27x_set_wake);
}

/*
Expand Down
13 changes: 3 additions & 10 deletions trunk/arch/arm/mach-pxa/pxa3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,15 +494,9 @@ static int pxa3xx_set_wake(unsigned int irq, unsigned int on)

return 0;
}

static void pxa3xx_init_irq_pm(void)
{
pxa_init_irq_set_wake(pxa3xx_set_wake);
}

#else
static inline void pxa3xx_init_pm(void) {}
static inline void pxa3xx_init_irq_pm(void) {}
#define pxa3xx_set_wake NULL
#endif

void __init pxa3xx_init_irq(void)
Expand All @@ -513,9 +507,8 @@ void __init pxa3xx_init_irq(void)
value |= (1 << 6);
__asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value));

pxa_init_irq(56);
pxa_init_irq_gpio(128);
pxa3xx_init_irq_pm();
pxa_init_irq(56, pxa3xx_set_wake);
pxa_init_gpio(128, NULL);
}

/*
Expand Down

0 comments on commit 277fbe6

Please sign in to comment.