diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 15:06:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-28 15:06:51 -0400 |
commit | 3c3762957818dc902222733a8184f23102e24472 (patch) | |
tree | 97a17d0923d87108715af32f83a526d24e65fb80 /arch/sh/boards | |
parent | e9f29c9a56ca06d0effa557823a737cbe7ec09f7 (diff) | |
parent | 63111a3a70fb4d80e3b54ed75f13795e98f7a467 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (32 commits)
sh: intc: switch irq_desc iteration to new active IRQ iterator.
sh: fix up cpu hotplug IRQ migration for irq_data changes.
sh: oprofile: Make sure the backtrace op is available for timer-fallback.
sh64: oprofile: Fix up kernel stack pointer size mismatch.
sh: oprofile: Fix up and extend op_name_from_perf_id().
sh: lockless get_user_pages_fast()
sh64: _PAGE_SPECIAL support.
sound: sh: ctrl_in/outX to __raw_read/writeX conversion.
sh: disable deprecated genirq support.
sh: update show_interrupts() for irq_data chip lookup.
sh: intc: irq_data conversion.
sh64: irq_data conversion.
sh64: update for IRQ flag handling naming changes.
rtc: rtc-rs5c313: ctrl_in/outX to __raw_read/writeX conversion.
sh: mach-se: irq_data conversion.
input: hp680_ts_input: ctrl_in/outX to __raw_read/writeX conversion.
input: jornada680_kbd: ctrl_in/outX to __raw_read/writeX conversion.
sh: hd64461: irq_data conversion.
sh: mach-x3proto: irq_data conversion.
sh: mach-systemh: irq_data conversion.
...
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/mach-cayman/irq.c | 16 | ||||
-rw-r--r-- | arch/sh/boards/mach-dreamcast/irq.c | 17 | ||||
-rw-r--r-- | arch/sh/boards/mach-landisk/irq.c | 15 | ||||
-rw-r--r-- | arch/sh/boards/mach-microdev/irq.c | 30 | ||||
-rw-r--r-- | arch/sh/boards/mach-se/7206/irq.c | 20 | ||||
-rw-r--r-- | arch/sh/boards/mach-se/7343/irq.c | 15 | ||||
-rw-r--r-- | arch/sh/boards/mach-se/7722/irq.c | 15 | ||||
-rw-r--r-- | arch/sh/boards/mach-se/7724/irq.c | 13 | ||||
-rw-r--r-- | arch/sh/boards/mach-systemh/irq.c | 57 | ||||
-rw-r--r-- | arch/sh/boards/mach-x3proto/gpio.c | 7 |
10 files changed, 91 insertions, 114 deletions
diff --git a/arch/sh/boards/mach-cayman/irq.c b/arch/sh/boards/mach-cayman/irq.c index 1394b078db36..d7ac5af9d102 100644 --- a/arch/sh/boards/mach-cayman/irq.c +++ b/arch/sh/boards/mach-cayman/irq.c | |||
@@ -55,8 +55,9 @@ static struct irqaction cayman_action_pci2 = { | |||
55 | .flags = IRQF_DISABLED, | 55 | .flags = IRQF_DISABLED, |
56 | }; | 56 | }; |
57 | 57 | ||
58 | static void enable_cayman_irq(unsigned int irq) | 58 | static void enable_cayman_irq(struct irq_data *data) |
59 | { | 59 | { |
60 | unsigned int irq = data->irq; | ||
60 | unsigned long flags; | 61 | unsigned long flags; |
61 | unsigned long mask; | 62 | unsigned long mask; |
62 | unsigned int reg; | 63 | unsigned int reg; |
@@ -72,8 +73,9 @@ static void enable_cayman_irq(unsigned int irq) | |||
72 | local_irq_restore(flags); | 73 | local_irq_restore(flags); |
73 | } | 74 | } |
74 | 75 | ||
75 | void disable_cayman_irq(unsigned int irq) | 76 | static void disable_cayman_irq(struct irq_data *data) |
76 | { | 77 | { |
78 | unsigned int irq = data->irq; | ||
77 | unsigned long flags; | 79 | unsigned long flags; |
78 | unsigned long mask; | 80 | unsigned long mask; |
79 | unsigned int reg; | 81 | unsigned int reg; |
@@ -89,16 +91,10 @@ void disable_cayman_irq(unsigned int irq) | |||
89 | local_irq_restore(flags); | 91 | local_irq_restore(flags); |
90 | } | 92 | } |
91 | 93 | ||
92 | static void ack_cayman_irq(unsigned int irq) | ||
93 | { | ||
94 | disable_cayman_irq(irq); | ||
95 | } | ||
96 | |||
97 | struct irq_chip cayman_irq_type = { | 94 | struct irq_chip cayman_irq_type = { |
98 | .name = "Cayman-IRQ", | 95 | .name = "Cayman-IRQ", |
99 | .unmask = enable_cayman_irq, | 96 | .irq_unmask = enable_cayman_irq, |
100 | .mask = disable_cayman_irq, | 97 | .irq_mask = disable_cayman_irq, |
101 | .mask_ack = ack_cayman_irq, | ||
102 | }; | 98 | }; |
103 | 99 | ||
104 | int cayman_irq_demux(int evt) | 100 | int cayman_irq_demux(int evt) |
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c index d932667410ab..72e7ac9549da 100644 --- a/arch/sh/boards/mach-dreamcast/irq.c +++ b/arch/sh/boards/mach-dreamcast/irq.c | |||
@@ -60,8 +60,9 @@ | |||
60 | */ | 60 | */ |
61 | 61 | ||
62 | /* Disable the hardware event by masking its bit in its EMR */ | 62 | /* Disable the hardware event by masking its bit in its EMR */ |
63 | static inline void disable_systemasic_irq(unsigned int irq) | 63 | static inline void disable_systemasic_irq(struct irq_data *data) |
64 | { | 64 | { |
65 | unsigned int irq = data->irq; | ||
65 | __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2); | 66 | __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2); |
66 | __u32 mask; | 67 | __u32 mask; |
67 | 68 | ||
@@ -71,8 +72,9 @@ static inline void disable_systemasic_irq(unsigned int irq) | |||
71 | } | 72 | } |
72 | 73 | ||
73 | /* Enable the hardware event by setting its bit in its EMR */ | 74 | /* Enable the hardware event by setting its bit in its EMR */ |
74 | static inline void enable_systemasic_irq(unsigned int irq) | 75 | static inline void enable_systemasic_irq(struct irq_data *data) |
75 | { | 76 | { |
77 | unsigned int irq = data->irq; | ||
76 | __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2); | 78 | __u32 emr = EMR_BASE + (LEVEL(irq) << 4) + (LEVEL(irq) << 2); |
77 | __u32 mask; | 79 | __u32 mask; |
78 | 80 | ||
@@ -82,18 +84,19 @@ static inline void enable_systemasic_irq(unsigned int irq) | |||
82 | } | 84 | } |
83 | 85 | ||
84 | /* Acknowledge a hardware event by writing its bit back to its ESR */ | 86 | /* Acknowledge a hardware event by writing its bit back to its ESR */ |
85 | static void mask_ack_systemasic_irq(unsigned int irq) | 87 | static void mask_ack_systemasic_irq(struct irq_data *data) |
86 | { | 88 | { |
89 | unsigned int irq = data->irq; | ||
87 | __u32 esr = ESR_BASE + (LEVEL(irq) << 2); | 90 | __u32 esr = ESR_BASE + (LEVEL(irq) << 2); |
88 | disable_systemasic_irq(irq); | 91 | disable_systemasic_irq(data); |
89 | outl((1 << EVENT_BIT(irq)), esr); | 92 | outl((1 << EVENT_BIT(irq)), esr); |
90 | } | 93 | } |
91 | 94 | ||
92 | struct irq_chip systemasic_int = { | 95 | struct irq_chip systemasic_int = { |
93 | .name = "System ASIC", | 96 | .name = "System ASIC", |
94 | .mask = disable_systemasic_irq, | 97 | .irq_mask = disable_systemasic_irq, |
95 | .mask_ack = mask_ack_systemasic_irq, | 98 | .irq_mask_ack = mask_ack_systemasic_irq, |
96 | .unmask = enable_systemasic_irq, | 99 | .irq_unmask = enable_systemasic_irq, |
97 | }; | 100 | }; |
98 | 101 | ||
99 | /* | 102 | /* |
diff --git a/arch/sh/boards/mach-landisk/irq.c b/arch/sh/boards/mach-landisk/irq.c index 96f38a4187d0..e79412a40490 100644 --- a/arch/sh/boards/mach-landisk/irq.c +++ b/arch/sh/boards/mach-landisk/irq.c | |||
@@ -18,25 +18,24 @@ | |||
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <mach-landisk/mach/iodata_landisk.h> | 19 | #include <mach-landisk/mach/iodata_landisk.h> |
20 | 20 | ||
21 | static void disable_landisk_irq(unsigned int irq) | 21 | static void disable_landisk_irq(struct irq_data *data) |
22 | { | 22 | { |
23 | unsigned char mask = 0xff ^ (0x01 << (irq - 5)); | 23 | unsigned char mask = 0xff ^ (0x01 << (data->irq - 5)); |
24 | 24 | ||
25 | __raw_writeb(__raw_readb(PA_IMASK) & mask, PA_IMASK); | 25 | __raw_writeb(__raw_readb(PA_IMASK) & mask, PA_IMASK); |
26 | } | 26 | } |
27 | 27 | ||
28 | static void enable_landisk_irq(unsigned int irq) | 28 | static void enable_landisk_irq(struct irq_data *data) |
29 | { | 29 | { |
30 | unsigned char value = (0x01 << (irq - 5)); | 30 | unsigned char value = (0x01 << (data->irq - 5)); |
31 | 31 | ||
32 | __raw_writeb(__raw_readb(PA_IMASK) | value, PA_IMASK); | 32 | __raw_writeb(__raw_readb(PA_IMASK) | value, PA_IMASK); |
33 | } | 33 | } |
34 | 34 | ||
35 | static struct irq_chip landisk_irq_chip __read_mostly = { | 35 | static struct irq_chip landisk_irq_chip __read_mostly = { |
36 | .name = "LANDISK", | 36 | .name = "LANDISK", |
37 | .mask = disable_landisk_irq, | 37 | .irq_mask = disable_landisk_irq, |
38 | .unmask = enable_landisk_irq, | 38 | .irq_unmask = enable_landisk_irq, |
39 | .mask_ack = disable_landisk_irq, | ||
40 | }; | 39 | }; |
41 | 40 | ||
42 | /* | 41 | /* |
@@ -50,7 +49,7 @@ void __init init_landisk_IRQ(void) | |||
50 | disable_irq_nosync(i); | 49 | disable_irq_nosync(i); |
51 | set_irq_chip_and_handler_name(i, &landisk_irq_chip, | 50 | set_irq_chip_and_handler_name(i, &landisk_irq_chip, |
52 | handle_level_irq, "level"); | 51 | handle_level_irq, "level"); |
53 | enable_landisk_irq(i); | 52 | enable_landisk_irq(irq_get_irq_data(i)); |
54 | } | 53 | } |
55 | __raw_writeb(0x00, PA_PWRINT_CLR); | 54 | __raw_writeb(0x00, PA_PWRINT_CLR); |
56 | } | 55 | } |
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c index a26d16669aa2..c35001fd9032 100644 --- a/arch/sh/boards/mach-microdev/irq.c +++ b/arch/sh/boards/mach-microdev/irq.c | |||
@@ -65,19 +65,9 @@ static const struct { | |||
65 | # error Inconsistancy in defining the IRQ# for primary IDE! | 65 | # error Inconsistancy in defining the IRQ# for primary IDE! |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | static void enable_microdev_irq(unsigned int irq); | 68 | static void disable_microdev_irq(struct irq_data *data) |
69 | static void disable_microdev_irq(unsigned int irq); | ||
70 | static void mask_and_ack_microdev(unsigned int); | ||
71 | |||
72 | static struct irq_chip microdev_irq_type = { | ||
73 | .name = "MicroDev-IRQ", | ||
74 | .unmask = enable_microdev_irq, | ||
75 | .mask = disable_microdev_irq, | ||
76 | .ack = mask_and_ack_microdev, | ||
77 | }; | ||
78 | |||
79 | static void disable_microdev_irq(unsigned int irq) | ||
80 | { | 69 | { |
70 | unsigned int irq = data->irq; | ||
81 | unsigned int fpgaIrq; | 71 | unsigned int fpgaIrq; |
82 | 72 | ||
83 | if (irq >= NUM_EXTERNAL_IRQS) | 73 | if (irq >= NUM_EXTERNAL_IRQS) |
@@ -91,8 +81,9 @@ static void disable_microdev_irq(unsigned int irq) | |||
91 | __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG); | 81 | __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTDSB_REG); |
92 | } | 82 | } |
93 | 83 | ||
94 | static void enable_microdev_irq(unsigned int irq) | 84 | static void enable_microdev_irq(struct irq_data *data) |
95 | { | 85 | { |
86 | unsigned int irq = data->irq; | ||
96 | unsigned long priorityReg, priorities, pri; | 87 | unsigned long priorityReg, priorities, pri; |
97 | unsigned int fpgaIrq; | 88 | unsigned int fpgaIrq; |
98 | 89 | ||
@@ -116,17 +107,18 @@ static void enable_microdev_irq(unsigned int irq) | |||
116 | __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); | 107 | __raw_writel(MICRODEV_FPGA_INTC_MASK(fpgaIrq), MICRODEV_FPGA_INTENB_REG); |
117 | } | 108 | } |
118 | 109 | ||
110 | static struct irq_chip microdev_irq_type = { | ||
111 | .name = "MicroDev-IRQ", | ||
112 | .irq_unmask = enable_microdev_irq, | ||
113 | .irq_mask = disable_microdev_irq, | ||
114 | }; | ||
115 | |||
119 | /* This function sets the desired irq handler to be a MicroDev type */ | 116 | /* This function sets the desired irq handler to be a MicroDev type */ |
120 | static void __init make_microdev_irq(unsigned int irq) | 117 | static void __init make_microdev_irq(unsigned int irq) |
121 | { | 118 | { |
122 | disable_irq_nosync(irq); | 119 | disable_irq_nosync(irq); |
123 | set_irq_chip_and_handler(irq, µdev_irq_type, handle_level_irq); | 120 | set_irq_chip_and_handler(irq, µdev_irq_type, handle_level_irq); |
124 | disable_microdev_irq(irq); | 121 | disable_microdev_irq(irq_get_irq_data(irq)); |
125 | } | ||
126 | |||
127 | static void mask_and_ack_microdev(unsigned int irq) | ||
128 | { | ||
129 | disable_microdev_irq(irq); | ||
130 | } | 122 | } |
131 | 123 | ||
132 | extern void __init init_microdev_irq(void) | 124 | extern void __init init_microdev_irq(void) |
diff --git a/arch/sh/boards/mach-se/7206/irq.c b/arch/sh/boards/mach-se/7206/irq.c index 8d82175d83ab..883b21eacaa6 100644 --- a/arch/sh/boards/mach-se/7206/irq.c +++ b/arch/sh/boards/mach-se/7206/irq.c | |||
@@ -25,8 +25,9 @@ | |||
25 | #define INTC_IPR01 0xfffe0818 | 25 | #define INTC_IPR01 0xfffe0818 |
26 | #define INTC_ICR1 0xfffe0802 | 26 | #define INTC_ICR1 0xfffe0802 |
27 | 27 | ||
28 | static void disable_se7206_irq(unsigned int irq) | 28 | static void disable_se7206_irq(struct irq_data *data) |
29 | { | 29 | { |
30 | unsigned int irq = data->irq; | ||
30 | unsigned short val; | 31 | unsigned short val; |
31 | unsigned short mask = 0xffff ^ (0x0f << 4 * (3 - (IRQ0_IRQ - irq))); | 32 | unsigned short mask = 0xffff ^ (0x0f << 4 * (3 - (IRQ0_IRQ - irq))); |
32 | unsigned short msk0,msk1; | 33 | unsigned short msk0,msk1; |
@@ -55,8 +56,9 @@ static void disable_se7206_irq(unsigned int irq) | |||
55 | __raw_writew(msk1, INTMSK1); | 56 | __raw_writew(msk1, INTMSK1); |
56 | } | 57 | } |
57 | 58 | ||
58 | static void enable_se7206_irq(unsigned int irq) | 59 | static void enable_se7206_irq(struct irq_data *data) |
59 | { | 60 | { |
61 | unsigned int irq = data->irq; | ||
60 | unsigned short val; | 62 | unsigned short val; |
61 | unsigned short value = (0x0001 << 4 * (3 - (IRQ0_IRQ - irq))); | 63 | unsigned short value = (0x0001 << 4 * (3 - (IRQ0_IRQ - irq))); |
62 | unsigned short msk0,msk1; | 64 | unsigned short msk0,msk1; |
@@ -86,13 +88,14 @@ static void enable_se7206_irq(unsigned int irq) | |||
86 | __raw_writew(msk1, INTMSK1); | 88 | __raw_writew(msk1, INTMSK1); |
87 | } | 89 | } |
88 | 90 | ||
89 | static void eoi_se7206_irq(unsigned int irq) | 91 | static void eoi_se7206_irq(struct irq_data *data) |
90 | { | 92 | { |
91 | unsigned short sts0,sts1; | 93 | unsigned short sts0,sts1; |
94 | unsigned int irq = data->irq; | ||
92 | struct irq_desc *desc = irq_to_desc(irq); | 95 | struct irq_desc *desc = irq_to_desc(irq); |
93 | 96 | ||
94 | if (!(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))) | 97 | if (!(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))) |
95 | enable_se7206_irq(irq); | 98 | enable_se7206_irq(data); |
96 | /* FPGA isr clear */ | 99 | /* FPGA isr clear */ |
97 | sts0 = __raw_readw(INTSTS0); | 100 | sts0 = __raw_readw(INTSTS0); |
98 | sts1 = __raw_readw(INTSTS1); | 101 | sts1 = __raw_readw(INTSTS1); |
@@ -115,10 +118,9 @@ static void eoi_se7206_irq(unsigned int irq) | |||
115 | 118 | ||
116 | static struct irq_chip se7206_irq_chip __read_mostly = { | 119 | static struct irq_chip se7206_irq_chip __read_mostly = { |
117 | .name = "SE7206-FPGA", | 120 | .name = "SE7206-FPGA", |
118 | .mask = disable_se7206_irq, | 121 | .irq_mask = disable_se7206_irq, |
119 | .unmask = enable_se7206_irq, | 122 | .irq_unmask = enable_se7206_irq, |
120 | .mask_ack = disable_se7206_irq, | 123 | .irq_eoi = eoi_se7206_irq, |
121 | .eoi = eoi_se7206_irq, | ||
122 | }; | 124 | }; |
123 | 125 | ||
124 | static void make_se7206_irq(unsigned int irq) | 126 | static void make_se7206_irq(unsigned int irq) |
@@ -126,7 +128,7 @@ static void make_se7206_irq(unsigned int irq) | |||
126 | disable_irq_nosync(irq); | 128 | disable_irq_nosync(irq); |
127 | set_irq_chip_and_handler_name(irq, &se7206_irq_chip, | 129 | set_irq_chip_and_handler_name(irq, &se7206_irq_chip, |
128 | handle_level_irq, "level"); | 130 | handle_level_irq, "level"); |
129 | disable_se7206_irq(irq); | 131 | disable_se7206_irq(irq_get_irq_data(irq)); |
130 | } | 132 | } |
131 | 133 | ||
132 | /* | 134 | /* |
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c index d4305c26e9f7..76255a19417f 100644 --- a/arch/sh/boards/mach-se/7343/irq.c +++ b/arch/sh/boards/mach-se/7343/irq.c | |||
@@ -18,23 +18,22 @@ | |||
18 | 18 | ||
19 | unsigned int se7343_fpga_irq[SE7343_FPGA_IRQ_NR] = { 0, }; | 19 | unsigned int se7343_fpga_irq[SE7343_FPGA_IRQ_NR] = { 0, }; |
20 | 20 | ||
21 | static void disable_se7343_irq(unsigned int irq) | 21 | static void disable_se7343_irq(struct irq_data *data) |
22 | { | 22 | { |
23 | unsigned int bit = (unsigned int)get_irq_chip_data(irq); | 23 | unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data); |
24 | __raw_writew(__raw_readw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK); | 24 | __raw_writew(__raw_readw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK); |
25 | } | 25 | } |
26 | 26 | ||
27 | static void enable_se7343_irq(unsigned int irq) | 27 | static void enable_se7343_irq(struct irq_data *data) |
28 | { | 28 | { |
29 | unsigned int bit = (unsigned int)get_irq_chip_data(irq); | 29 | unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data); |
30 | __raw_writew(__raw_readw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK); | 30 | __raw_writew(__raw_readw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK); |
31 | } | 31 | } |
32 | 32 | ||
33 | static struct irq_chip se7343_irq_chip __read_mostly = { | 33 | static struct irq_chip se7343_irq_chip __read_mostly = { |
34 | .name = "SE7343-FPGA", | 34 | .name = "SE7343-FPGA", |
35 | .mask = disable_se7343_irq, | 35 | .irq_mask = disable_se7343_irq, |
36 | .unmask = enable_se7343_irq, | 36 | .irq_unmask = enable_se7343_irq, |
37 | .mask_ack = disable_se7343_irq, | ||
38 | }; | 37 | }; |
39 | 38 | ||
40 | static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc) | 39 | static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc) |
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c index 61605db04ee6..c013f95628ed 100644 --- a/arch/sh/boards/mach-se/7722/irq.c +++ b/arch/sh/boards/mach-se/7722/irq.c | |||
@@ -18,23 +18,22 @@ | |||
18 | 18 | ||
19 | unsigned int se7722_fpga_irq[SE7722_FPGA_IRQ_NR] = { 0, }; | 19 | unsigned int se7722_fpga_irq[SE7722_FPGA_IRQ_NR] = { 0, }; |
20 | 20 | ||
21 | static void disable_se7722_irq(unsigned int irq) | 21 | static void disable_se7722_irq(struct irq_data *data) |
22 | { | 22 | { |
23 | unsigned int bit = (unsigned int)get_irq_chip_data(irq); | 23 | unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data); |
24 | __raw_writew(__raw_readw(IRQ01_MASK) | 1 << bit, IRQ01_MASK); | 24 | __raw_writew(__raw_readw(IRQ01_MASK) | 1 << bit, IRQ01_MASK); |
25 | } | 25 | } |
26 | 26 | ||
27 | static void enable_se7722_irq(unsigned int irq) | 27 | static void enable_se7722_irq(struct irq_data *data) |
28 | { | 28 | { |
29 | unsigned int bit = (unsigned int)get_irq_chip_data(irq); | 29 | unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data); |
30 | __raw_writew(__raw_readw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK); | 30 | __raw_writew(__raw_readw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK); |
31 | } | 31 | } |
32 | 32 | ||
33 | static struct irq_chip se7722_irq_chip __read_mostly = { | 33 | static struct irq_chip se7722_irq_chip __read_mostly = { |
34 | .name = "SE7722-FPGA", | 34 | .name = "SE7722-FPGA", |
35 | .mask = disable_se7722_irq, | 35 | .irq_mask = disable_se7722_irq, |
36 | .unmask = enable_se7722_irq, | 36 | .irq_unmask = enable_se7722_irq, |
37 | .mask_ack = disable_se7722_irq, | ||
38 | }; | 37 | }; |
39 | 38 | ||
40 | static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc) | 39 | static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc) |
diff --git a/arch/sh/boards/mach-se/7724/irq.c b/arch/sh/boards/mach-se/7724/irq.c index 0942be2daef6..5bd87c22b65b 100644 --- a/arch/sh/boards/mach-se/7724/irq.c +++ b/arch/sh/boards/mach-se/7724/irq.c | |||
@@ -68,25 +68,26 @@ static struct fpga_irq get_fpga_irq(unsigned int irq) | |||
68 | return set; | 68 | return set; |
69 | } | 69 | } |
70 | 70 | ||
71 | static void disable_se7724_irq(unsigned int irq) | 71 | static void disable_se7724_irq(struct irq_data *data) |
72 | { | 72 | { |
73 | unsigned int irq = data->irq; | ||
73 | struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); | 74 | struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); |
74 | unsigned int bit = irq - set.base; | 75 | unsigned int bit = irq - set.base; |
75 | __raw_writew(__raw_readw(set.mraddr) | 0x0001 << bit, set.mraddr); | 76 | __raw_writew(__raw_readw(set.mraddr) | 0x0001 << bit, set.mraddr); |
76 | } | 77 | } |
77 | 78 | ||
78 | static void enable_se7724_irq(unsigned int irq) | 79 | static void enable_se7724_irq(struct irq_data *data) |
79 | { | 80 | { |
81 | unsigned int irq = data->irq; | ||
80 | struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); | 82 | struct fpga_irq set = get_fpga_irq(fpga2irq(irq)); |
81 | unsigned int bit = irq - set.base; | 83 | unsigned int bit = irq - set.base; |
82 | __raw_writew(__raw_readw(set.mraddr) & ~(0x0001 << bit), set.mraddr); | 84 | __raw_writew(__raw_readw(set.mraddr) & ~(0x0001 << bit), set.mraddr); |
83 | } | 85 | } |
84 | 86 | ||
85 | static struct irq_chip se7724_irq_chip __read_mostly = { | 87 | static struct irq_chip se7724_irq_chip __read_mostly = { |
86 | .name = "SE7724-FPGA", | 88 | .name = "SE7724-FPGA", |
87 | .mask = disable_se7724_irq, | 89 | .irq_mask = disable_se7724_irq, |
88 | .unmask = enable_se7724_irq, | 90 | .irq_unmask = enable_se7724_irq, |
89 | .mask_ack = disable_se7724_irq, | ||
90 | }; | 91 | }; |
91 | 92 | ||
92 | static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc) | 93 | static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc) |
diff --git a/arch/sh/boards/mach-systemh/irq.c b/arch/sh/boards/mach-systemh/irq.c index 523aea5dc94e..e5ee13adeff4 100644 --- a/arch/sh/boards/mach-systemh/irq.c +++ b/arch/sh/boards/mach-systemh/irq.c | |||
@@ -23,54 +23,39 @@ | |||
23 | static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004; | 23 | static unsigned long *systemh_irq_mask_register = (unsigned long *)0xB3F10004; |
24 | static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000; | 24 | static unsigned long *systemh_irq_request_register = (unsigned long *)0xB3F10000; |
25 | 25 | ||
26 | /* forward declaration */ | 26 | static void disable_systemh_irq(struct irq_data *data) |
27 | static void enable_systemh_irq(unsigned int irq); | ||
28 | static void disable_systemh_irq(unsigned int irq); | ||
29 | static void mask_and_ack_systemh(unsigned int); | ||
30 | |||
31 | static struct irq_chip systemh_irq_type = { | ||
32 | .name = " SystemH Register", | ||
33 | .unmask = enable_systemh_irq, | ||
34 | .mask = disable_systemh_irq, | ||
35 | .ack = mask_and_ack_systemh, | ||
36 | }; | ||
37 | |||
38 | static void disable_systemh_irq(unsigned int irq) | ||
39 | { | 27 | { |
40 | if (systemh_irq_mask_register) { | 28 | unsigned long val, mask = 0x01 << 1; |
41 | unsigned long val, mask = 0x01 << 1; | ||
42 | 29 | ||
43 | /* Clear the "irq"th bit in the mask and set it in the request */ | 30 | /* Clear the "irq"th bit in the mask and set it in the request */ |
44 | val = __raw_readl((unsigned long)systemh_irq_mask_register); | 31 | val = __raw_readl((unsigned long)systemh_irq_mask_register); |
45 | val &= ~mask; | 32 | val &= ~mask; |
46 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); | 33 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); |
47 | 34 | ||
48 | val = __raw_readl((unsigned long)systemh_irq_request_register); | 35 | val = __raw_readl((unsigned long)systemh_irq_request_register); |
49 | val |= mask; | 36 | val |= mask; |
50 | __raw_writel(val, (unsigned long)systemh_irq_request_register); | 37 | __raw_writel(val, (unsigned long)systemh_irq_request_register); |
51 | } | ||
52 | } | 38 | } |
53 | 39 | ||
54 | static void enable_systemh_irq(unsigned int irq) | 40 | static void enable_systemh_irq(struct irq_data *data) |
55 | { | 41 | { |
56 | if (systemh_irq_mask_register) { | 42 | unsigned long val, mask = 0x01 << 1; |
57 | unsigned long val, mask = 0x01 << 1; | ||
58 | 43 | ||
59 | /* Set "irq"th bit in the mask register */ | 44 | /* Set "irq"th bit in the mask register */ |
60 | val = __raw_readl((unsigned long)systemh_irq_mask_register); | 45 | val = __raw_readl((unsigned long)systemh_irq_mask_register); |
61 | val |= mask; | 46 | val |= mask; |
62 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); | 47 | __raw_writel(val, (unsigned long)systemh_irq_mask_register); |
63 | } | ||
64 | } | 48 | } |
65 | 49 | ||
66 | static void mask_and_ack_systemh(unsigned int irq) | 50 | static struct irq_chip systemh_irq_type = { |
67 | { | 51 | .name = "SystemH Register", |
68 | disable_systemh_irq(irq); | 52 | .irq_unmask = enable_systemh_irq, |
69 | } | 53 | .irq_mask = disable_systemh_irq, |
54 | }; | ||
70 | 55 | ||
71 | void make_systemh_irq(unsigned int irq) | 56 | void make_systemh_irq(unsigned int irq) |
72 | { | 57 | { |
73 | disable_irq_nosync(irq); | 58 | disable_irq_nosync(irq); |
74 | set_irq_chip_and_handler(irq, &systemh_irq_type, handle_level_irq); | 59 | set_irq_chip_and_handler(irq, &systemh_irq_type, handle_level_irq); |
75 | disable_systemh_irq(irq); | 60 | disable_systemh_irq(irq_get_irq_data(irq)); |
76 | } | 61 | } |
diff --git a/arch/sh/boards/mach-x3proto/gpio.c b/arch/sh/boards/mach-x3proto/gpio.c index 594adf76e46a..239e74066253 100644 --- a/arch/sh/boards/mach-x3proto/gpio.c +++ b/arch/sh/boards/mach-x3proto/gpio.c | |||
@@ -54,18 +54,19 @@ static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) | |||
54 | 54 | ||
55 | static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 55 | static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) |
56 | { | 56 | { |
57 | struct irq_chip *chip = get_irq_desc_chip(desc); | 57 | struct irq_data *data = irq_get_irq_data(irq); |
58 | struct irq_chip *chip = irq_data_get_irq_chip(data); | ||
58 | unsigned long mask; | 59 | unsigned long mask; |
59 | int pin; | 60 | int pin; |
60 | 61 | ||
61 | chip->mask_ack(irq); | 62 | chip->irq_mask_ack(data); |
62 | 63 | ||
63 | mask = __raw_readw(KEYDETR); | 64 | mask = __raw_readw(KEYDETR); |
64 | 65 | ||
65 | for_each_set_bit(pin, &mask, NR_BASEBOARD_GPIOS) | 66 | for_each_set_bit(pin, &mask, NR_BASEBOARD_GPIOS) |
66 | generic_handle_irq(x3proto_gpio_to_irq(NULL, pin)); | 67 | generic_handle_irq(x3proto_gpio_to_irq(NULL, pin)); |
67 | 68 | ||
68 | chip->unmask(irq); | 69 | chip->irq_unmask(data); |
69 | } | 70 | } |
70 | 71 | ||
71 | struct gpio_chip x3proto_gpio_chip = { | 72 | struct gpio_chip x3proto_gpio_chip = { |