diff options
Diffstat (limited to 'arch/arm/plat-s5p/irq-eint.c')
-rw-r--r-- | arch/arm/plat-s5p/irq-eint.c | 86 |
1 files changed, 44 insertions, 42 deletions
diff --git a/arch/arm/plat-s5p/irq-eint.c b/arch/arm/plat-s5p/irq-eint.c index 752f1a645f9d..225aa25405db 100644 --- a/arch/arm/plat-s5p/irq-eint.c +++ b/arch/arm/plat-s5p/irq-eint.c | |||
@@ -28,39 +28,40 @@ | |||
28 | #include <plat/gpio-cfg.h> | 28 | #include <plat/gpio-cfg.h> |
29 | #include <mach/regs-gpio.h> | 29 | #include <mach/regs-gpio.h> |
30 | 30 | ||
31 | static inline void s5p_irq_eint_mask(unsigned int irq) | 31 | static inline void s5p_irq_eint_mask(struct irq_data *data) |
32 | { | 32 | { |
33 | u32 mask; | 33 | u32 mask; |
34 | 34 | ||
35 | mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); | 35 | mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); |
36 | mask |= eint_irq_to_bit(irq); | 36 | mask |= eint_irq_to_bit(data->irq); |
37 | __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); | 37 | __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); |
38 | } | 38 | } |
39 | 39 | ||
40 | static void s5p_irq_eint_unmask(unsigned int irq) | 40 | static void s5p_irq_eint_unmask(struct irq_data *data) |
41 | { | 41 | { |
42 | u32 mask; | 42 | u32 mask; |
43 | 43 | ||
44 | mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(irq))); | 44 | mask = __raw_readl(S5P_EINT_MASK(EINT_REG_NR(data->irq))); |
45 | mask &= ~(eint_irq_to_bit(irq)); | 45 | mask &= ~(eint_irq_to_bit(data->irq)); |
46 | __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(irq))); | 46 | __raw_writel(mask, S5P_EINT_MASK(EINT_REG_NR(data->irq))); |
47 | } | 47 | } |
48 | 48 | ||
49 | static inline void s5p_irq_eint_ack(unsigned int irq) | 49 | static inline void s5p_irq_eint_ack(struct irq_data *data) |
50 | { | 50 | { |
51 | __raw_writel(eint_irq_to_bit(irq), S5P_EINT_PEND(EINT_REG_NR(irq))); | 51 | __raw_writel(eint_irq_to_bit(data->irq), |
52 | S5P_EINT_PEND(EINT_REG_NR(data->irq))); | ||
52 | } | 53 | } |
53 | 54 | ||
54 | static void s5p_irq_eint_maskack(unsigned int irq) | 55 | static void s5p_irq_eint_maskack(struct irq_data *data) |
55 | { | 56 | { |
56 | /* compiler should in-line these */ | 57 | /* compiler should in-line these */ |
57 | s5p_irq_eint_mask(irq); | 58 | s5p_irq_eint_mask(data); |
58 | s5p_irq_eint_ack(irq); | 59 | s5p_irq_eint_ack(data); |
59 | } | 60 | } |
60 | 61 | ||
61 | static int s5p_irq_eint_set_type(unsigned int irq, unsigned int type) | 62 | static int s5p_irq_eint_set_type(struct irq_data *data, unsigned int type) |
62 | { | 63 | { |
63 | int offs = EINT_OFFSET(irq); | 64 | int offs = EINT_OFFSET(data->irq); |
64 | int shift; | 65 | int shift; |
65 | u32 ctrl, mask; | 66 | u32 ctrl, mask; |
66 | u32 newvalue = 0; | 67 | u32 newvalue = 0; |
@@ -94,10 +95,10 @@ static int s5p_irq_eint_set_type(unsigned int irq, unsigned int type) | |||
94 | shift = (offs & 0x7) * 4; | 95 | shift = (offs & 0x7) * 4; |
95 | mask = 0x7 << shift; | 96 | mask = 0x7 << shift; |
96 | 97 | ||
97 | ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(irq))); | 98 | ctrl = __raw_readl(S5P_EINT_CON(EINT_REG_NR(data->irq))); |
98 | ctrl &= ~mask; | 99 | ctrl &= ~mask; |
99 | ctrl |= newvalue << shift; | 100 | ctrl |= newvalue << shift; |
100 | __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(irq))); | 101 | __raw_writel(ctrl, S5P_EINT_CON(EINT_REG_NR(data->irq))); |
101 | 102 | ||
102 | if ((0 <= offs) && (offs < 8)) | 103 | if ((0 <= offs) && (offs < 8)) |
103 | s3c_gpio_cfgpin(EINT_GPIO_0(offs & 0x7), EINT_MODE); | 104 | s3c_gpio_cfgpin(EINT_GPIO_0(offs & 0x7), EINT_MODE); |
@@ -119,13 +120,13 @@ static int s5p_irq_eint_set_type(unsigned int irq, unsigned int type) | |||
119 | 120 | ||
120 | static struct irq_chip s5p_irq_eint = { | 121 | static struct irq_chip s5p_irq_eint = { |
121 | .name = "s5p-eint", | 122 | .name = "s5p-eint", |
122 | .mask = s5p_irq_eint_mask, | 123 | .irq_mask = s5p_irq_eint_mask, |
123 | .unmask = s5p_irq_eint_unmask, | 124 | .irq_unmask = s5p_irq_eint_unmask, |
124 | .mask_ack = s5p_irq_eint_maskack, | 125 | .irq_mask_ack = s5p_irq_eint_maskack, |
125 | .ack = s5p_irq_eint_ack, | 126 | .irq_ack = s5p_irq_eint_ack, |
126 | .set_type = s5p_irq_eint_set_type, | 127 | .irq_set_type = s5p_irq_eint_set_type, |
127 | #ifdef CONFIG_PM | 128 | #ifdef CONFIG_PM |
128 | .set_wake = s3c_irqext_wake, | 129 | .irq_set_wake = s3c_irqext_wake, |
129 | #endif | 130 | #endif |
130 | }; | 131 | }; |
131 | 132 | ||
@@ -159,42 +160,43 @@ static void s5p_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc) | |||
159 | s5p_irq_demux_eint(IRQ_EINT(24)); | 160 | s5p_irq_demux_eint(IRQ_EINT(24)); |
160 | } | 161 | } |
161 | 162 | ||
162 | static inline void s5p_irq_vic_eint_mask(unsigned int irq) | 163 | static inline void s5p_irq_vic_eint_mask(struct irq_data *data) |
163 | { | 164 | { |
164 | void __iomem *base = get_irq_chip_data(irq); | 165 | void __iomem *base = irq_data_get_irq_chip_data(data); |
165 | 166 | ||
166 | s5p_irq_eint_mask(irq); | 167 | s5p_irq_eint_mask(data); |
167 | writel(1 << EINT_OFFSET(irq), base + VIC_INT_ENABLE_CLEAR); | 168 | writel(1 << EINT_OFFSET(data->irq), base + VIC_INT_ENABLE_CLEAR); |
168 | } | 169 | } |
169 | 170 | ||
170 | static void s5p_irq_vic_eint_unmask(unsigned int irq) | 171 | static void s5p_irq_vic_eint_unmask(struct irq_data *data) |
171 | { | 172 | { |
172 | void __iomem *base = get_irq_chip_data(irq); | 173 | void __iomem *base = irq_data_get_irq_chip_data(data); |
173 | 174 | ||
174 | s5p_irq_eint_unmask(irq); | 175 | s5p_irq_eint_unmask(data); |
175 | writel(1 << EINT_OFFSET(irq), base + VIC_INT_ENABLE); | 176 | writel(1 << EINT_OFFSET(data->irq), base + VIC_INT_ENABLE); |
176 | } | 177 | } |
177 | 178 | ||
178 | static inline void s5p_irq_vic_eint_ack(unsigned int irq) | 179 | static inline void s5p_irq_vic_eint_ack(struct irq_data *data) |
179 | { | 180 | { |
180 | __raw_writel(eint_irq_to_bit(irq), S5P_EINT_PEND(EINT_REG_NR(irq))); | 181 | __raw_writel(eint_irq_to_bit(data->irq), |
182 | S5P_EINT_PEND(EINT_REG_NR(data->irq))); | ||
181 | } | 183 | } |
182 | 184 | ||
183 | static void s5p_irq_vic_eint_maskack(unsigned int irq) | 185 | static void s5p_irq_vic_eint_maskack(struct irq_data *data) |
184 | { | 186 | { |
185 | s5p_irq_vic_eint_mask(irq); | 187 | s5p_irq_vic_eint_mask(data); |
186 | s5p_irq_vic_eint_ack(irq); | 188 | s5p_irq_vic_eint_ack(data); |
187 | } | 189 | } |
188 | 190 | ||
189 | static struct irq_chip s5p_irq_vic_eint = { | 191 | static struct irq_chip s5p_irq_vic_eint = { |
190 | .name = "s5p_vic_eint", | 192 | .name = "s5p_vic_eint", |
191 | .mask = s5p_irq_vic_eint_mask, | 193 | .irq_mask = s5p_irq_vic_eint_mask, |
192 | .unmask = s5p_irq_vic_eint_unmask, | 194 | .irq_unmask = s5p_irq_vic_eint_unmask, |
193 | .mask_ack = s5p_irq_vic_eint_maskack, | 195 | .irq_mask_ack = s5p_irq_vic_eint_maskack, |
194 | .ack = s5p_irq_vic_eint_ack, | 196 | .irq_ack = s5p_irq_vic_eint_ack, |
195 | .set_type = s5p_irq_eint_set_type, | 197 | .irq_set_type = s5p_irq_eint_set_type, |
196 | #ifdef CONFIG_PM | 198 | #ifdef CONFIG_PM |
197 | .set_wake = s3c_irqext_wake, | 199 | .irq_set_wake = s3c_irqext_wake, |
198 | #endif | 200 | #endif |
199 | }; | 201 | }; |
200 | 202 | ||