提交 01f8e34c 编写于 作者: M Mike Frysinger

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: NMike Frysinger <vapier@gentoo.org>
上级 85c2737a
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
#define PERIPHERAL_USAGE 1 #define PERIPHERAL_USAGE 1
#define GPIO_USAGE 0 #define GPIO_USAGE 0
#ifndef BFIN_GPIO_PINT
# define BFIN_GPIO_PINT 0
#endif
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/compiler.h> #include <linux/compiler.h>
...@@ -40,7 +44,7 @@ ...@@ -40,7 +44,7 @@
* MODIFICATION HISTORY : * MODIFICATION HISTORY :
**************************************************************/ **************************************************************/
#ifndef CONFIG_BF54x #if !BFIN_GPIO_PINT
void set_gpio_dir(unsigned, unsigned short); void set_gpio_dir(unsigned, unsigned short);
void set_gpio_inen(unsigned, unsigned short); void set_gpio_inen(unsigned, unsigned short);
void set_gpio_polar(unsigned, unsigned short); void set_gpio_polar(unsigned, unsigned short);
...@@ -133,7 +137,7 @@ static inline void bfin_pm_standby_restore(void) ...@@ -133,7 +137,7 @@ static inline void bfin_pm_standby_restore(void)
void bfin_gpio_pm_hibernate_restore(void); void bfin_gpio_pm_hibernate_restore(void);
void bfin_gpio_pm_hibernate_suspend(void); void bfin_gpio_pm_hibernate_suspend(void);
#ifndef CONFIG_BF54x # if !BFIN_GPIO_PINT
int gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl); int gpio_pm_wakeup_ctrl(unsigned gpio, unsigned ctrl);
struct gpio_port_s { struct gpio_port_s {
...@@ -150,8 +154,9 @@ struct gpio_port_s { ...@@ -150,8 +154,9 @@ struct gpio_port_s {
unsigned short reserved; unsigned short reserved;
unsigned short mux; unsigned short mux;
}; };
#endif /*CONFIG_BF54x*/ # endif
#endif /*CONFIG_PM*/ #endif /*CONFIG_PM*/
/*********************************************************** /***********************************************************
* *
* FUNCTIONS: Blackfin GPIO Driver * FUNCTIONS: Blackfin GPIO Driver
......
...@@ -170,6 +170,8 @@ ...@@ -170,6 +170,8 @@
#define MAX_BLACKFIN_GPIOS 160 #define MAX_BLACKFIN_GPIOS 160
#define BFIN_GPIO_PINT 1
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
struct gpio_port_t { struct gpio_port_t {
......
...@@ -444,7 +444,7 @@ static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle) ...@@ -444,7 +444,7 @@ static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle)
static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS); static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS);
extern void bfin_gpio_irq_prepare(unsigned gpio); extern void bfin_gpio_irq_prepare(unsigned gpio);
#if !defined(CONFIG_BF54x) #if !BFIN_GPIO_PINT
static void bfin_gpio_ack_irq(struct irq_data *d) static void bfin_gpio_ack_irq(struct irq_data *d)
{ {
...@@ -633,7 +633,7 @@ void bfin_demux_gpio_irq(unsigned int inta_irq, ...@@ -633,7 +633,7 @@ void bfin_demux_gpio_irq(unsigned int inta_irq,
bfin_demux_gpio_block(irq); bfin_demux_gpio_block(irq);
} }
#else /* CONFIG_BF54x */ #else
#define NR_PINT_SYS_IRQS 4 #define NR_PINT_SYS_IRQS 4
#define NR_PINT_BITS 32 #define NR_PINT_BITS 32
...@@ -968,7 +968,7 @@ int __init init_arch_irq(void) ...@@ -968,7 +968,7 @@ int __init init_arch_irq(void)
local_irq_disable(); local_irq_disable();
#ifdef CONFIG_BF54x #if BFIN_GPIO_PINT
# ifdef CONFIG_PINTx_REASSIGN # ifdef CONFIG_PINTx_REASSIGN
pint[0]->assign = CONFIG_PINT0_ASSIGN; pint[0]->assign = CONFIG_PINT0_ASSIGN;
pint[1]->assign = CONFIG_PINT1_ASSIGN; pint[1]->assign = CONFIG_PINT1_ASSIGN;
...@@ -986,16 +986,16 @@ int __init init_arch_irq(void) ...@@ -986,16 +986,16 @@ int __init init_arch_irq(void)
irq_set_chip(irq, &bfin_internal_irqchip); irq_set_chip(irq, &bfin_internal_irqchip);
switch (irq) { switch (irq) {
#if defined(BF537_FAMILY) #if BFIN_GPIO_PINT
case IRQ_PH_INTA_MAC_RX:
case IRQ_PF_INTA_PG_INTA:
#elif defined(BF533_FAMILY)
case IRQ_PROG_INTA:
#elif defined(CONFIG_BF54x)
case IRQ_PINT0: case IRQ_PINT0:
case IRQ_PINT1: case IRQ_PINT1:
case IRQ_PINT2: case IRQ_PINT2:
case IRQ_PINT3: case IRQ_PINT3:
#elif defined(BF537_FAMILY)
case IRQ_PH_INTA_MAC_RX:
case IRQ_PF_INTA_PG_INTA:
#elif defined(BF533_FAMILY)
case IRQ_PROG_INTA:
#elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x) #elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
case IRQ_PORTF_INTA: case IRQ_PORTF_INTA:
case IRQ_PORTG_INTA: case IRQ_PORTG_INTA:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册