diff options
Diffstat (limited to 'drivers/sh/intc')
-rw-r--r-- | drivers/sh/intc/chip.c | 11 | ||||
-rw-r--r-- | drivers/sh/intc/core.c | 2 | ||||
-rw-r--r-- | drivers/sh/intc/dynamic.c | 1 | ||||
-rw-r--r-- | drivers/sh/intc/userimask.c | 1 | ||||
-rw-r--r-- | drivers/sh/intc/virq.c | 1 |
5 files changed, 13 insertions, 3 deletions
diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c index 33b2ed451e09..7b246efa94ea 100644 --- a/drivers/sh/intc/chip.c +++ b/drivers/sh/intc/chip.c @@ -186,7 +186,7 @@ static unsigned char intc_irq_sense_table[IRQ_TYPE_SENSE_MASK + 1] = { !defined(CONFIG_CPU_SUBTYPE_SH7709) [IRQ_TYPE_LEVEL_HIGH] = VALID(3), #endif -#if defined(CONFIG_ARCH_SH7372) +#if defined(CONFIG_ARM) /* all recent SH-Mobile / R-Mobile ARM support this */ [IRQ_TYPE_EDGE_BOTH] = VALID(4), #endif }; @@ -202,11 +202,16 @@ static int intc_set_type(struct irq_data *data, unsigned int type) if (!value) return -EINVAL; + value &= ~SENSE_VALID_FLAG; + ihp = intc_find_irq(d->sense, d->nr_sense, irq); if (ihp) { + /* PINT has 2-bit sense registers, should fail on EDGE_BOTH */ + if (value >= (1 << _INTC_WIDTH(ihp->handle))) + return -EINVAL; + addr = INTC_REG(d, _INTC_ADDR_E(ihp->handle), 0); - intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle, - value & ~SENSE_VALID_FLAG); + intc_reg_fns[_INTC_FN(ihp->handle)](addr, ihp->handle, value); } return 0; diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c index c6ca115c71df..8b7a141ff35e 100644 --- a/drivers/sh/intc/core.c +++ b/drivers/sh/intc/core.c @@ -22,6 +22,7 @@ #include <linux/irq.h> #include <linux/io.h> #include <linux/slab.h> +#include <linux/stat.h> #include <linux/interrupt.h> #include <linux/sh_intc.h> #include <linux/sysdev.h> @@ -29,6 +30,7 @@ #include <linux/list.h> #include <linux/spinlock.h> #include <linux/radix-tree.h> +#include <linux/export.h> #include "internals.h" LIST_HEAD(intc_list); diff --git a/drivers/sh/intc/dynamic.c b/drivers/sh/intc/dynamic.c index a3677c9dfe36..5fea1ee8799a 100644 --- a/drivers/sh/intc/dynamic.c +++ b/drivers/sh/intc/dynamic.c @@ -14,6 +14,7 @@ #include <linux/irq.h> #include <linux/bitmap.h> #include <linux/spinlock.h> +#include <linux/module.h> #include "internals.h" /* only for activate_irq() damage.. */ /* diff --git a/drivers/sh/intc/userimask.c b/drivers/sh/intc/userimask.c index e32304b66cf1..56bf9336b92b 100644 --- a/drivers/sh/intc/userimask.c +++ b/drivers/sh/intc/userimask.c @@ -13,6 +13,7 @@ #include <linux/sysdev.h> #include <linux/init.h> #include <linux/io.h> +#include <linux/stat.h> #include <asm/sizes.h> #include "internals.h" diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c index 1e6e2d0353ea..c7ec49ffd9f6 100644 --- a/drivers/sh/intc/virq.c +++ b/drivers/sh/intc/virq.c @@ -14,6 +14,7 @@ #include <linux/list.h> #include <linux/radix-tree.h> #include <linux/spinlock.h> +#include <linux/export.h> #include "internals.h" static struct intc_map_entry intc_irq_xlate[NR_IRQS]; |