diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2010-11-29 05:16:23 -0500 |
---|---|---|
committer | Lennert Buytenhek <buytenh@wantstofly.org> | 2011-01-13 11:19:09 -0500 |
commit | 4d93579f63ca4998284934c43ac03fcee4216f91 (patch) | |
tree | 6458f1d81df9fe99b445873b0842109bfeba7156 | |
parent | b9858efad32ffa8b3e9c2bd1286121824c3cebae (diff) |
ARM: plat-mxc: irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
-rw-r--r-- | arch/arm/plat-mxc/3ds_debugboard.c | 28 | ||||
-rw-r--r-- | arch/arm/plat-mxc/avic.c | 14 | ||||
-rw-r--r-- | arch/arm/plat-mxc/gpio.c | 30 | ||||
-rw-r--r-- | arch/arm/plat-mxc/tzic.c | 38 |
4 files changed, 55 insertions, 55 deletions
diff --git a/arch/arm/plat-mxc/3ds_debugboard.c b/arch/arm/plat-mxc/3ds_debugboard.c index 639c54a07992..c856fa397606 100644 --- a/arch/arm/plat-mxc/3ds_debugboard.c +++ b/arch/arm/plat-mxc/3ds_debugboard.c | |||
@@ -60,7 +60,6 @@ | |||
60 | #define EXPIO_INT_BUTTON_B (MXC_BOARD_IRQ_START + 4) | 60 | #define EXPIO_INT_BUTTON_B (MXC_BOARD_IRQ_START + 4) |
61 | 61 | ||
62 | static void __iomem *brd_io; | 62 | static void __iomem *brd_io; |
63 | static void expio_ack_irq(u32 irq); | ||
64 | 63 | ||
65 | static struct resource smsc911x_resources[] = { | 64 | static struct resource smsc911x_resources[] = { |
66 | { | 65 | { |
@@ -93,7 +92,8 @@ static void mxc_expio_irq_handler(u32 irq, struct irq_desc *desc) | |||
93 | u32 int_valid; | 92 | u32 int_valid; |
94 | u32 expio_irq; | 93 | u32 expio_irq; |
95 | 94 | ||
96 | desc->chip->mask(irq); /* irq = gpio irq number */ | 95 | /* irq = gpio irq number */ |
96 | desc->irq_data.chip->irq_mask(&desc->irq_data); | ||
97 | 97 | ||
98 | imr_val = __raw_readw(brd_io + INTR_MASK_REG); | 98 | imr_val = __raw_readw(brd_io + INTR_MASK_REG); |
99 | int_valid = __raw_readw(brd_io + INTR_STATUS_REG) & ~imr_val; | 99 | int_valid = __raw_readw(brd_io + INTR_STATUS_REG) & ~imr_val; |
@@ -110,37 +110,37 @@ static void mxc_expio_irq_handler(u32 irq, struct irq_desc *desc) | |||
110 | d->handle_irq(expio_irq, d); | 110 | d->handle_irq(expio_irq, d); |
111 | } | 111 | } |
112 | 112 | ||
113 | desc->chip->ack(irq); | 113 | desc->irq_data.chip->irq_ack(&desc->irq_data); |
114 | desc->chip->unmask(irq); | 114 | desc->irq_data.chip->irq_unmask(&desc->irq_data); |
115 | } | 115 | } |
116 | 116 | ||
117 | /* | 117 | /* |
118 | * Disable an expio pin's interrupt by setting the bit in the imr. | 118 | * Disable an expio pin's interrupt by setting the bit in the imr. |
119 | * Irq is an expio virtual irq number | 119 | * Irq is an expio virtual irq number |
120 | */ | 120 | */ |
121 | static void expio_mask_irq(u32 irq) | 121 | static void expio_mask_irq(struct irq_data *d) |
122 | { | 122 | { |
123 | u16 reg; | 123 | u16 reg; |
124 | u32 expio = MXC_IRQ_TO_EXPIO(irq); | 124 | u32 expio = MXC_IRQ_TO_EXPIO(d->irq); |
125 | 125 | ||
126 | reg = __raw_readw(brd_io + INTR_MASK_REG); | 126 | reg = __raw_readw(brd_io + INTR_MASK_REG); |
127 | reg |= (1 << expio); | 127 | reg |= (1 << expio); |
128 | __raw_writew(reg, brd_io + INTR_MASK_REG); | 128 | __raw_writew(reg, brd_io + INTR_MASK_REG); |
129 | } | 129 | } |
130 | 130 | ||
131 | static void expio_ack_irq(u32 irq) | 131 | static void expio_ack_irq(struct irq_data *d) |
132 | { | 132 | { |
133 | u32 expio = MXC_IRQ_TO_EXPIO(irq); | 133 | u32 expio = MXC_IRQ_TO_EXPIO(d->irq); |
134 | 134 | ||
135 | __raw_writew(1 << expio, brd_io + INTR_RESET_REG); | 135 | __raw_writew(1 << expio, brd_io + INTR_RESET_REG); |
136 | __raw_writew(0, brd_io + INTR_RESET_REG); | 136 | __raw_writew(0, brd_io + INTR_RESET_REG); |
137 | expio_mask_irq(irq); | 137 | expio_mask_irq(d); |
138 | } | 138 | } |
139 | 139 | ||
140 | static void expio_unmask_irq(u32 irq) | 140 | static void expio_unmask_irq(struct irq_data *d) |
141 | { | 141 | { |
142 | u16 reg; | 142 | u16 reg; |
143 | u32 expio = MXC_IRQ_TO_EXPIO(irq); | 143 | u32 expio = MXC_IRQ_TO_EXPIO(d->irq); |
144 | 144 | ||
145 | reg = __raw_readw(brd_io + INTR_MASK_REG); | 145 | reg = __raw_readw(brd_io + INTR_MASK_REG); |
146 | reg &= ~(1 << expio); | 146 | reg &= ~(1 << expio); |
@@ -148,9 +148,9 @@ static void expio_unmask_irq(u32 irq) | |||
148 | } | 148 | } |
149 | 149 | ||
150 | static struct irq_chip expio_irq_chip = { | 150 | static struct irq_chip expio_irq_chip = { |
151 | .ack = expio_ack_irq, | 151 | .irq_ack = expio_ack_irq, |
152 | .mask = expio_mask_irq, | 152 | .irq_mask = expio_mask_irq, |
153 | .unmask = expio_unmask_irq, | 153 | .irq_unmask = expio_unmask_irq, |
154 | }; | 154 | }; |
155 | 155 | ||
156 | int __init mxc_expio_init(u32 base, u32 p_irq) | 156 | int __init mxc_expio_init(u32 base, u32 p_irq) |
diff --git a/arch/arm/plat-mxc/avic.c b/arch/arm/plat-mxc/avic.c index 9a4e8a22dd0a..deb284bc7c4b 100644 --- a/arch/arm/plat-mxc/avic.c +++ b/arch/arm/plat-mxc/avic.c | |||
@@ -89,22 +89,22 @@ static int avic_set_irq_fiq(unsigned int irq, unsigned int type) | |||
89 | #endif /* CONFIG_FIQ */ | 89 | #endif /* CONFIG_FIQ */ |
90 | 90 | ||
91 | /* Disable interrupt number "irq" in the AVIC */ | 91 | /* Disable interrupt number "irq" in the AVIC */ |
92 | static void mxc_mask_irq(unsigned int irq) | 92 | static void mxc_mask_irq(struct irq_data *d) |
93 | { | 93 | { |
94 | __raw_writel(irq, avic_base + AVIC_INTDISNUM); | 94 | __raw_writel(d->irq, avic_base + AVIC_INTDISNUM); |
95 | } | 95 | } |
96 | 96 | ||
97 | /* Enable interrupt number "irq" in the AVIC */ | 97 | /* Enable interrupt number "irq" in the AVIC */ |
98 | static void mxc_unmask_irq(unsigned int irq) | 98 | static void mxc_unmask_irq(struct irq_data *d) |
99 | { | 99 | { |
100 | __raw_writel(irq, avic_base + AVIC_INTENNUM); | 100 | __raw_writel(d->irq, avic_base + AVIC_INTENNUM); |
101 | } | 101 | } |
102 | 102 | ||
103 | static struct mxc_irq_chip mxc_avic_chip = { | 103 | static struct mxc_irq_chip mxc_avic_chip = { |
104 | .base = { | 104 | .base = { |
105 | .ack = mxc_mask_irq, | 105 | .irq_ack = mxc_mask_irq, |
106 | .mask = mxc_mask_irq, | 106 | .irq_mask = mxc_mask_irq, |
107 | .unmask = mxc_unmask_irq, | 107 | .irq_unmask = mxc_unmask_irq, |
108 | }, | 108 | }, |
109 | #ifdef CONFIG_MXC_IRQ_PRIOR | 109 | #ifdef CONFIG_MXC_IRQ_PRIOR |
110 | .set_priority = avic_irq_set_priority, | 110 | .set_priority = avic_irq_set_priority, |
diff --git a/arch/arm/plat-mxc/gpio.c b/arch/arm/plat-mxc/gpio.c index bc2c7bc6f10a..d17b3c996b84 100644 --- a/arch/arm/plat-mxc/gpio.c +++ b/arch/arm/plat-mxc/gpio.c | |||
@@ -63,29 +63,29 @@ static void _set_gpio_irqenable(struct mxc_gpio_port *port, u32 index, | |||
63 | __raw_writel(l, port->base + GPIO_IMR); | 63 | __raw_writel(l, port->base + GPIO_IMR); |
64 | } | 64 | } |
65 | 65 | ||
66 | static void gpio_ack_irq(u32 irq) | 66 | static void gpio_ack_irq(struct irq_data *d) |
67 | { | 67 | { |
68 | u32 gpio = irq_to_gpio(irq); | 68 | u32 gpio = irq_to_gpio(d->irq); |
69 | _clear_gpio_irqstatus(&mxc_gpio_ports[gpio / 32], gpio & 0x1f); | 69 | _clear_gpio_irqstatus(&mxc_gpio_ports[gpio / 32], gpio & 0x1f); |
70 | } | 70 | } |
71 | 71 | ||
72 | static void gpio_mask_irq(u32 irq) | 72 | static void gpio_mask_irq(struct irq_data *d) |
73 | { | 73 | { |
74 | u32 gpio = irq_to_gpio(irq); | 74 | u32 gpio = irq_to_gpio(d->irq); |
75 | _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 0); | 75 | _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 0); |
76 | } | 76 | } |
77 | 77 | ||
78 | static void gpio_unmask_irq(u32 irq) | 78 | static void gpio_unmask_irq(struct irq_data *d) |
79 | { | 79 | { |
80 | u32 gpio = irq_to_gpio(irq); | 80 | u32 gpio = irq_to_gpio(d->irq); |
81 | _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 1); | 81 | _set_gpio_irqenable(&mxc_gpio_ports[gpio / 32], gpio & 0x1f, 1); |
82 | } | 82 | } |
83 | 83 | ||
84 | static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset); | 84 | static int mxc_gpio_get(struct gpio_chip *chip, unsigned offset); |
85 | 85 | ||
86 | static int gpio_set_irq_type(u32 irq, u32 type) | 86 | static int gpio_set_irq_type(struct irq_data *d, u32 type) |
87 | { | 87 | { |
88 | u32 gpio = irq_to_gpio(irq); | 88 | u32 gpio = irq_to_gpio(d->irq); |
89 | struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; | 89 | struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; |
90 | u32 bit, val; | 90 | u32 bit, val; |
91 | int edge; | 91 | int edge; |
@@ -211,9 +211,9 @@ static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc) | |||
211 | * @param enable enable as wake-up if equal to non-zero | 211 | * @param enable enable as wake-up if equal to non-zero |
212 | * @return This function returns 0 on success. | 212 | * @return This function returns 0 on success. |
213 | */ | 213 | */ |
214 | static int gpio_set_wake_irq(u32 irq, u32 enable) | 214 | static int gpio_set_wake_irq(struct irq_data *d, u32 enable) |
215 | { | 215 | { |
216 | u32 gpio = irq_to_gpio(irq); | 216 | u32 gpio = irq_to_gpio(d->irq); |
217 | u32 gpio_idx = gpio & 0x1F; | 217 | u32 gpio_idx = gpio & 0x1F; |
218 | struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; | 218 | struct mxc_gpio_port *port = &mxc_gpio_ports[gpio / 32]; |
219 | 219 | ||
@@ -233,11 +233,11 @@ static int gpio_set_wake_irq(u32 irq, u32 enable) | |||
233 | } | 233 | } |
234 | 234 | ||
235 | static struct irq_chip gpio_irq_chip = { | 235 | static struct irq_chip gpio_irq_chip = { |
236 | .ack = gpio_ack_irq, | 236 | .irq_ack = gpio_ack_irq, |
237 | .mask = gpio_mask_irq, | 237 | .irq_mask = gpio_mask_irq, |
238 | .unmask = gpio_unmask_irq, | 238 | .irq_unmask = gpio_unmask_irq, |
239 | .set_type = gpio_set_irq_type, | 239 | .irq_set_type = gpio_set_irq_type, |
240 | .set_wake = gpio_set_wake_irq, | 240 | .irq_set_wake = gpio_set_wake_irq, |
241 | }; | 241 | }; |
242 | 242 | ||
243 | static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset, | 243 | static void _set_gpio_direction(struct gpio_chip *chip, unsigned offset, |
diff --git a/arch/arm/plat-mxc/tzic.c b/arch/arm/plat-mxc/tzic.c index e69ed8a8c203..bc3a6be8a27f 100644 --- a/arch/arm/plat-mxc/tzic.c +++ b/arch/arm/plat-mxc/tzic.c | |||
@@ -69,50 +69,50 @@ static int tzic_set_irq_fiq(unsigned int irq, unsigned int type) | |||
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * tzic_mask_irq() - Disable interrupt number "irq" in the TZIC | 72 | * tzic_mask_irq() - Disable interrupt source "d" in the TZIC |
73 | * | 73 | * |
74 | * @param irq interrupt source number | 74 | * @param d interrupt source |
75 | */ | 75 | */ |
76 | static void tzic_mask_irq(unsigned int irq) | 76 | static void tzic_mask_irq(struct irq_data *d) |
77 | { | 77 | { |
78 | int index, off; | 78 | int index, off; |
79 | 79 | ||
80 | index = irq >> 5; | 80 | index = d->irq >> 5; |
81 | off = irq & 0x1F; | 81 | off = d->irq & 0x1F; |
82 | __raw_writel(1 << off, tzic_base + TZIC_ENCLEAR0(index)); | 82 | __raw_writel(1 << off, tzic_base + TZIC_ENCLEAR0(index)); |
83 | } | 83 | } |
84 | 84 | ||
85 | /** | 85 | /** |
86 | * tzic_unmask_irq() - Enable interrupt number "irq" in the TZIC | 86 | * tzic_unmask_irq() - Enable interrupt source "d" in the TZIC |
87 | * | 87 | * |
88 | * @param irq interrupt source number | 88 | * @param d interrupt source |
89 | */ | 89 | */ |
90 | static void tzic_unmask_irq(unsigned int irq) | 90 | static void tzic_unmask_irq(struct irq_data *d) |
91 | { | 91 | { |
92 | int index, off; | 92 | int index, off; |
93 | 93 | ||
94 | index = irq >> 5; | 94 | index = d->irq >> 5; |
95 | off = irq & 0x1F; | 95 | off = d->irq & 0x1F; |
96 | __raw_writel(1 << off, tzic_base + TZIC_ENSET0(index)); | 96 | __raw_writel(1 << off, tzic_base + TZIC_ENSET0(index)); |
97 | } | 97 | } |
98 | 98 | ||
99 | static unsigned int wakeup_intr[4]; | 99 | static unsigned int wakeup_intr[4]; |
100 | 100 | ||
101 | /** | 101 | /** |
102 | * tzic_set_wake_irq() - Set interrupt number "irq" in the TZIC as a wake-up source. | 102 | * tzic_set_wake_irq() - Set interrupt source "d" in the TZIC as a wake-up source. |
103 | * | 103 | * |
104 | * @param irq interrupt source number | 104 | * @param d interrupt source |
105 | * @param enable enable as wake-up if equal to non-zero | 105 | * @param enable enable as wake-up if equal to non-zero |
106 | * disble as wake-up if equal to zero | 106 | * disble as wake-up if equal to zero |
107 | * | 107 | * |
108 | * @return This function returns 0 on success. | 108 | * @return This function returns 0 on success. |
109 | */ | 109 | */ |
110 | static int tzic_set_wake_irq(unsigned int irq, unsigned int enable) | 110 | static int tzic_set_wake_irq(struct irq_data *d, unsigned int enable) |
111 | { | 111 | { |
112 | unsigned int index, off; | 112 | unsigned int index, off; |
113 | 113 | ||
114 | index = irq >> 5; | 114 | index = d->irq >> 5; |
115 | off = irq & 0x1F; | 115 | off = d->irq & 0x1F; |
116 | 116 | ||
117 | if (index > 3) | 117 | if (index > 3) |
118 | return -EINVAL; | 118 | return -EINVAL; |
@@ -128,10 +128,10 @@ static int tzic_set_wake_irq(unsigned int irq, unsigned int enable) | |||
128 | static struct mxc_irq_chip mxc_tzic_chip = { | 128 | static struct mxc_irq_chip mxc_tzic_chip = { |
129 | .base = { | 129 | .base = { |
130 | .name = "MXC_TZIC", | 130 | .name = "MXC_TZIC", |
131 | .ack = tzic_mask_irq, | 131 | .irq_ack = tzic_mask_irq, |
132 | .mask = tzic_mask_irq, | 132 | .irq_mask = tzic_mask_irq, |
133 | .unmask = tzic_unmask_irq, | 133 | .irq_unmask = tzic_unmask_irq, |
134 | .set_wake = tzic_set_wake_irq, | 134 | .irq_set_wake = tzic_set_wake_irq, |
135 | }, | 135 | }, |
136 | #ifdef CONFIG_FIQ | 136 | #ifdef CONFIG_FIQ |
137 | .set_irq_fiq = tzic_set_irq_fiq, | 137 | .set_irq_fiq = tzic_set_irq_fiq, |