diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-06-26 13:56:23 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-07-23 01:18:27 -0400 |
commit | 01f8e34c9855e5aa4f56a73b8d5ea8f7613dbb7e (patch) | |
tree | c02d7f45381f478d6e0181584080a8d6704663e4 /arch/blackfin | |
parent | 85c2737ae7c2b64c35862da3757b185e822a259b (diff) |
Blackfin: gpio/ints: generalize pint logic
Have the logic that uses peripheral interrupt blocks key off of pint
defines rather than CPU names so that things are generalized across
families.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r-- | arch/blackfin/include/asm/gpio.h | 11 | ||||
-rw-r--r-- | arch/blackfin/mach-bf548/include/mach/gpio.h | 2 | ||||
-rw-r--r-- | arch/blackfin/mach-common/ints-priority.c | 18 |
3 files changed, 19 insertions, 12 deletions
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h index 9b8d1867b259..d06162029c69 100644 --- a/arch/blackfin/include/asm/gpio.h +++ b/arch/blackfin/include/asm/gpio.h | |||
@@ -19,6 +19,10 @@ | |||
19 | #define PERIPHERAL_USAGE 1 | 19 | #define PERIPHERAL_USAGE 1 |
20 | #define GPIO_USAGE 0 | 20 | #define GPIO_USAGE 0 |
21 | 21 | ||
22 | #ifndef BFIN_GPIO_PINT | ||
23 | # define BFIN_GPIO_PINT 0 | ||
24 | #endif | ||
25 | |||
22 | #ifndef __ASSEMBLY__ | 26 | #ifndef __ASSEMBLY__ |
23 | 27 | ||
24 | #include <linux/compiler.h> | 28 | #include <linux/compiler.h> |
@@ -40,7 +44,7 @@ | |||
40 | * MODIFICATION HISTORY : | 44 | * MODIFICATION HISTORY : |
41 | **************************************************************/ | 45 | **************************************************************/ |
42 | 46 | ||
43 | #ifndef CONFIG_BF54x | 47 | #if !BFIN_GPIO_PINT |
44 | void set_gpio_dir(unsigned, unsigned short); | 48 | void set_gpio_dir(unsigned, unsigned short); |
45 | void set_gpio_inen(unsigned, unsigned short); | 49 | void set_gpio_inen(unsigned, unsigned short); |
46 | void set_gpio_polar(unsigned, unsigned short); | 50 | void set_gpio_polar(unsigned, unsigned short); |
@@ -133,7 +137,7 @@ static inline void bfin_pm_standby_restore(void) | |||
133 | void bfin_gpio_pm_hibernate_restore(void); | 137 | void bfin_gpio_pm_hibernate_restore(void); |
134 | void bfin_gpio_pm_hibernate_suspend(void); | 138 | void bfin_gpio_pm_hibernate_suspend(void); |
135 | 139 | ||
136 | #ifndef CONFIG_BF54x | 140 | # if !BFIN_GPIO_PINT |
137 | int gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl); | 141 | int gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl); |
138 | 142 | ||
139 | struct gpio_port_s { | 143 | struct gpio_port_s { |
@@ -150,8 +154,9 @@ struct gpio_port_s { | |||
150 | unsigned short reserved; | 154 | unsigned short reserved; |
151 | unsigned short mux; | 155 | unsigned short mux; |
152 | }; | 156 | }; |
153 | #endif /*CONFIG_BF54x*/ | 157 | # endif |
154 | #endif /*CONFIG_PM*/ | 158 | #endif /*CONFIG_PM*/ |
159 | |||
155 | /*********************************************************** | 160 | /*********************************************************** |
156 | * | 161 | * |
157 | * FUNCTIONS: Blackfin GPIO Driver | 162 | * FUNCTIONS: Blackfin GPIO Driver |
diff --git a/arch/blackfin/mach-bf548/include/mach/gpio.h b/arch/blackfin/mach-bf548/include/mach/gpio.h index 7db433514e3f..35c8ced46158 100644 --- a/arch/blackfin/mach-bf548/include/mach/gpio.h +++ b/arch/blackfin/mach-bf548/include/mach/gpio.h | |||
@@ -170,6 +170,8 @@ | |||
170 | 170 | ||
171 | #define MAX_BLACKFIN_GPIOS 160 | 171 | #define MAX_BLACKFIN_GPIOS 160 |
172 | 172 | ||
173 | #define BFIN_GPIO_PINT 1 | ||
174 | |||
173 | #ifndef __ASSEMBLY__ | 175 | #ifndef __ASSEMBLY__ |
174 | 176 | ||
175 | struct gpio_port_t { | 177 | struct gpio_port_t { |
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index 72ca67e48d81..332dace6af34 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c | |||
@@ -444,7 +444,7 @@ static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle) | |||
444 | static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS); | 444 | static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS); |
445 | extern void bfin_gpio_irq_prepare(unsigned gpio); | 445 | extern void bfin_gpio_irq_prepare(unsigned gpio); |
446 | 446 | ||
447 | #if !defined(CONFIG_BF54x) | 447 | #if !BFIN_GPIO_PINT |
448 | 448 | ||
449 | static void bfin_gpio_ack_irq(struct irq_data *d) | 449 | static void bfin_gpio_ack_irq(struct irq_data *d) |
450 | { | 450 | { |
@@ -633,7 +633,7 @@ void bfin_demux_gpio_irq(unsigned int inta_irq, | |||
633 | bfin_demux_gpio_block(irq); | 633 | bfin_demux_gpio_block(irq); |
634 | } | 634 | } |
635 | 635 | ||
636 | #else /* CONFIG_BF54x */ | 636 | #else |
637 | 637 | ||
638 | #define NR_PINT_SYS_IRQS 4 | 638 | #define NR_PINT_SYS_IRQS 4 |
639 | #define NR_PINT_BITS 32 | 639 | #define NR_PINT_BITS 32 |
@@ -968,7 +968,7 @@ int __init init_arch_irq(void) | |||
968 | 968 | ||
969 | local_irq_disable(); | 969 | local_irq_disable(); |
970 | 970 | ||
971 | #ifdef CONFIG_BF54x | 971 | #if BFIN_GPIO_PINT |
972 | # ifdef CONFIG_PINTx_REASSIGN | 972 | # ifdef CONFIG_PINTx_REASSIGN |
973 | pint[0]->assign = CONFIG_PINT0_ASSIGN; | 973 | pint[0]->assign = CONFIG_PINT0_ASSIGN; |
974 | pint[1]->assign = CONFIG_PINT1_ASSIGN; | 974 | pint[1]->assign = CONFIG_PINT1_ASSIGN; |
@@ -986,16 +986,16 @@ int __init init_arch_irq(void) | |||
986 | irq_set_chip(irq, &bfin_internal_irqchip); | 986 | irq_set_chip(irq, &bfin_internal_irqchip); |
987 | 987 | ||
988 | switch (irq) { | 988 | switch (irq) { |
989 | #if defined(BF537_FAMILY) | 989 | #if BFIN_GPIO_PINT |
990 | case IRQ_PH_INTA_MAC_RX: | ||
991 | case IRQ_PF_INTA_PG_INTA: | ||
992 | #elif defined(BF533_FAMILY) | ||
993 | case IRQ_PROG_INTA: | ||
994 | #elif defined(CONFIG_BF54x) | ||
995 | case IRQ_PINT0: | 990 | case IRQ_PINT0: |
996 | case IRQ_PINT1: | 991 | case IRQ_PINT1: |
997 | case IRQ_PINT2: | 992 | case IRQ_PINT2: |
998 | case IRQ_PINT3: | 993 | case IRQ_PINT3: |
994 | #elif defined(BF537_FAMILY) | ||
995 | case IRQ_PH_INTA_MAC_RX: | ||
996 | case IRQ_PF_INTA_PG_INTA: | ||
997 | #elif defined(BF533_FAMILY) | ||
998 | case IRQ_PROG_INTA: | ||
999 | #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x) | 999 | #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x) |
1000 | case IRQ_PORTF_INTA: | 1000 | case IRQ_PORTF_INTA: |
1001 | case IRQ_PORTG_INTA: | 1001 | case IRQ_PORTG_INTA: |