diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2011-01-03 05:20:21 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-01-03 05:20:21 -0500 |
commit | f651ef6575d8816143afbad4492584979589bd46 (patch) | |
tree | 48d8cd0acd54822e7732158ed012caff44dc7100 /arch/arm/plat-s5p | |
parent | c6906c3e29a4a28660f70421935c91cf6b8ab1e1 (diff) | |
parent | 04ea1cc8ab0f1e9db9aeaef79476e5c1a2027f6a (diff) |
Merge branch 'next-samsung-irq_data' into for-next
Diffstat (limited to 'arch/arm/plat-s5p')
-rw-r--r-- | arch/arm/plat-s5p/irq-eint.c | 82 | ||||
-rw-r--r-- | arch/arm/plat-s5p/irq-gpioint.c | 50 | ||||
-rw-r--r-- | arch/arm/plat-s5p/irq-pm.c | 6 |
3 files changed, 70 insertions, 68 deletions
diff --git a/arch/arm/plat-s5p/irq-eint.c b/arch/arm/plat-s5p/irq-eint.c index f2f2e1ccd0e6..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,11 +120,11 @@ 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 | .irq_set_wake = s3c_irqext_wake, | 129 | .irq_set_wake = s3c_irqext_wake, |
129 | #endif | 130 | #endif |
@@ -159,40 +160,41 @@ 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 | .irq_set_wake = s3c_irqext_wake, | 199 | .irq_set_wake = s3c_irqext_wake, |
198 | #endif | 200 | #endif |
diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c index 0e5dc8cbf5e3..3b6bf89d1739 100644 --- a/arch/arm/plat-s5p/irq-gpioint.c +++ b/arch/arm/plat-s5p/irq-gpioint.c | |||
@@ -30,9 +30,9 @@ | |||
30 | 30 | ||
31 | static struct s3c_gpio_chip *irq_chips[S5P_GPIOINT_GROUP_MAXNR]; | 31 | static struct s3c_gpio_chip *irq_chips[S5P_GPIOINT_GROUP_MAXNR]; |
32 | 32 | ||
33 | static int s5p_gpioint_get_group(unsigned int irq) | 33 | static int s5p_gpioint_get_group(struct irq_data *data) |
34 | { | 34 | { |
35 | struct gpio_chip *chip = get_irq_data(irq); | 35 | struct gpio_chip *chip = irq_data_get_irq_data(data); |
36 | struct s3c_gpio_chip *s3c_chip = container_of(chip, | 36 | struct s3c_gpio_chip *s3c_chip = container_of(chip, |
37 | struct s3c_gpio_chip, chip); | 37 | struct s3c_gpio_chip, chip); |
38 | int group; | 38 | int group; |
@@ -44,22 +44,22 @@ static int s5p_gpioint_get_group(unsigned int irq) | |||
44 | return group; | 44 | return group; |
45 | } | 45 | } |
46 | 46 | ||
47 | static int s5p_gpioint_get_offset(unsigned int irq) | 47 | static int s5p_gpioint_get_offset(struct irq_data *data) |
48 | { | 48 | { |
49 | struct gpio_chip *chip = get_irq_data(irq); | 49 | struct gpio_chip *chip = irq_data_get_irq_data(data); |
50 | struct s3c_gpio_chip *s3c_chip = container_of(chip, | 50 | struct s3c_gpio_chip *s3c_chip = container_of(chip, |
51 | struct s3c_gpio_chip, chip); | 51 | struct s3c_gpio_chip, chip); |
52 | 52 | ||
53 | return irq - s3c_chip->irq_base; | 53 | return data->irq - s3c_chip->irq_base; |
54 | } | 54 | } |
55 | 55 | ||
56 | static void s5p_gpioint_ack(unsigned int irq) | 56 | static void s5p_gpioint_ack(struct irq_data *data) |
57 | { | 57 | { |
58 | int group, offset, pend_offset; | 58 | int group, offset, pend_offset; |
59 | unsigned int value; | 59 | unsigned int value; |
60 | 60 | ||
61 | group = s5p_gpioint_get_group(irq); | 61 | group = s5p_gpioint_get_group(data); |
62 | offset = s5p_gpioint_get_offset(irq); | 62 | offset = s5p_gpioint_get_offset(data); |
63 | pend_offset = group << 2; | 63 | pend_offset = group << 2; |
64 | 64 | ||
65 | value = __raw_readl(S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); | 65 | value = __raw_readl(S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); |
@@ -67,13 +67,13 @@ static void s5p_gpioint_ack(unsigned int irq) | |||
67 | __raw_writel(value, S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); | 67 | __raw_writel(value, S5P_GPIOREG(GPIOINT_PEND_OFFSET) + pend_offset); |
68 | } | 68 | } |
69 | 69 | ||
70 | static void s5p_gpioint_mask(unsigned int irq) | 70 | static void s5p_gpioint_mask(struct irq_data *data) |
71 | { | 71 | { |
72 | int group, offset, mask_offset; | 72 | int group, offset, mask_offset; |
73 | unsigned int value; | 73 | unsigned int value; |
74 | 74 | ||
75 | group = s5p_gpioint_get_group(irq); | 75 | group = s5p_gpioint_get_group(data); |
76 | offset = s5p_gpioint_get_offset(irq); | 76 | offset = s5p_gpioint_get_offset(data); |
77 | mask_offset = group << 2; | 77 | mask_offset = group << 2; |
78 | 78 | ||
79 | value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); | 79 | value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); |
@@ -81,13 +81,13 @@ static void s5p_gpioint_mask(unsigned int irq) | |||
81 | __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); | 81 | __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); |
82 | } | 82 | } |
83 | 83 | ||
84 | static void s5p_gpioint_unmask(unsigned int irq) | 84 | static void s5p_gpioint_unmask(struct irq_data *data) |
85 | { | 85 | { |
86 | int group, offset, mask_offset; | 86 | int group, offset, mask_offset; |
87 | unsigned int value; | 87 | unsigned int value; |
88 | 88 | ||
89 | group = s5p_gpioint_get_group(irq); | 89 | group = s5p_gpioint_get_group(data); |
90 | offset = s5p_gpioint_get_offset(irq); | 90 | offset = s5p_gpioint_get_offset(data); |
91 | mask_offset = group << 2; | 91 | mask_offset = group << 2; |
92 | 92 | ||
93 | value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); | 93 | value = __raw_readl(S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); |
@@ -95,19 +95,19 @@ static void s5p_gpioint_unmask(unsigned int irq) | |||
95 | __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); | 95 | __raw_writel(value, S5P_GPIOREG(GPIOINT_MASK_OFFSET) + mask_offset); |
96 | } | 96 | } |
97 | 97 | ||
98 | static void s5p_gpioint_mask_ack(unsigned int irq) | 98 | static void s5p_gpioint_mask_ack(struct irq_data *data) |
99 | { | 99 | { |
100 | s5p_gpioint_mask(irq); | 100 | s5p_gpioint_mask(data); |
101 | s5p_gpioint_ack(irq); | 101 | s5p_gpioint_ack(data); |
102 | } | 102 | } |
103 | 103 | ||
104 | static int s5p_gpioint_set_type(unsigned int irq, unsigned int type) | 104 | static int s5p_gpioint_set_type(struct irq_data *data, unsigned int type) |
105 | { | 105 | { |
106 | int group, offset, con_offset; | 106 | int group, offset, con_offset; |
107 | unsigned int value; | 107 | unsigned int value; |
108 | 108 | ||
109 | group = s5p_gpioint_get_group(irq); | 109 | group = s5p_gpioint_get_group(data); |
110 | offset = s5p_gpioint_get_offset(irq); | 110 | offset = s5p_gpioint_get_offset(data); |
111 | con_offset = group << 2; | 111 | con_offset = group << 2; |
112 | 112 | ||
113 | switch (type) { | 113 | switch (type) { |
@@ -142,11 +142,11 @@ static int s5p_gpioint_set_type(unsigned int irq, unsigned int type) | |||
142 | 142 | ||
143 | struct irq_chip s5p_gpioint = { | 143 | struct irq_chip s5p_gpioint = { |
144 | .name = "s5p_gpioint", | 144 | .name = "s5p_gpioint", |
145 | .ack = s5p_gpioint_ack, | 145 | .irq_ack = s5p_gpioint_ack, |
146 | .mask = s5p_gpioint_mask, | 146 | .irq_mask = s5p_gpioint_mask, |
147 | .mask_ack = s5p_gpioint_mask_ack, | 147 | .irq_mask_ack = s5p_gpioint_mask_ack, |
148 | .unmask = s5p_gpioint_unmask, | 148 | .irq_unmask = s5p_gpioint_unmask, |
149 | .set_type = s5p_gpioint_set_type, | 149 | .irq_set_type = s5p_gpioint_set_type, |
150 | }; | 150 | }; |
151 | 151 | ||
152 | static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc) | 152 | static void s5p_gpioint_handler(unsigned int irq, struct irq_desc *desc) |
diff --git a/arch/arm/plat-s5p/irq-pm.c b/arch/arm/plat-s5p/irq-pm.c index dc33b9ecda45..5259ad458bc8 100644 --- a/arch/arm/plat-s5p/irq-pm.c +++ b/arch/arm/plat-s5p/irq-pm.c | |||
@@ -37,14 +37,14 @@ | |||
37 | unsigned long s3c_irqwake_intallow = 0x00000006L; | 37 | unsigned long s3c_irqwake_intallow = 0x00000006L; |
38 | unsigned long s3c_irqwake_eintallow = 0xffffffffL; | 38 | unsigned long s3c_irqwake_eintallow = 0xffffffffL; |
39 | 39 | ||
40 | int s3c_irq_wake(unsigned int irqno, unsigned int state) | 40 | int s3c_irq_wake(struct irq_data *data, unsigned int state) |
41 | { | 41 | { |
42 | unsigned long irqbit; | 42 | unsigned long irqbit; |
43 | 43 | ||
44 | switch (irqno) { | 44 | switch (data->irq) { |
45 | case IRQ_RTC_TIC: | 45 | case IRQ_RTC_TIC: |
46 | case IRQ_RTC_ALARM: | 46 | case IRQ_RTC_ALARM: |
47 | irqbit = 1 << (irqno + 1 - IRQ_RTC_ALARM); | 47 | irqbit = 1 << (data->irq + 1 - IRQ_RTC_ALARM); |
48 | if (!state) | 48 | if (!state) |
49 | s3c_irqwake_intmask |= irqbit; | 49 | s3c_irqwake_intmask |= irqbit; |
50 | else | 50 | else |