aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/gpc.c
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-10-13 07:51:33 -0400
committerThomas Gleixner <tglx@linutronix.de>2015-10-13 13:01:23 -0400
commitf833f57ff25450b7161798dceaf8575a48d80249 (patch)
treed1d8af957f01065cbfbf76c5f4975a0e90d013fb /arch/arm/mach-imx/gpc.c
parent11e4438ee330fab0f216ee7cc1b651cb2ddceb5d (diff)
irqchip: Convert all alloc/xlate users from of_node to fwnode
Since we now have a generic data structure to express an interrupt specifier, convert all hierarchical irqchips that are OF based to use a fwnode_handle as part of their alloc and xlate (which becomes translate) callbacks. As most of these drivers have dependencies (they exchange IRQ specifiers), change them all in a single, massive patch... Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Reviewed-and-tested-by: Hanjun Guo <hanjun.guo@linaro.org> Tested-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: <linux-arm-kernel@lists.infradead.org> Cc: Tomasz Nowicki <tomasz.nowicki@linaro.org> Cc: Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> Cc: Graeme Gregory <graeme@xora.org.uk> Cc: Jake Oshins <jakeo@microsoft.com> Cc: Jiang Liu <jiang.liu@linux.intel.com> Cc: Jason Cooper <jason@lakedaemon.net> Cc: Rafael J. Wysocki <rjw@rjwysocki.net> Link: http://lkml.kernel.org/r/1444737105-31573-6-git-send-email-marc.zyngier@arm.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/gpc.c')
-rw-r--r--arch/arm/mach-imx/gpc.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index 7b32255028fe..10bf7159b27d 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -181,40 +181,42 @@ static struct irq_chip imx_gpc_chip = {
181#endif 181#endif
182}; 182};
183 183
184static int imx_gpc_domain_xlate(struct irq_domain *domain, 184static int imx_gpc_domain_translate(struct irq_domain *d,
185 struct device_node *controller, 185 struct irq_fwspec *fwspec,
186 const u32 *intspec, 186 unsigned long *hwirq,
187 unsigned int intsize, 187 unsigned int *type)
188 unsigned long *out_hwirq,
189 unsigned int *out_type)
190{ 188{
191 if (irq_domain_get_of_node(domain) != controller) 189 if (is_of_node(fwspec->fwnode)) {
192 return -EINVAL; /* Shouldn't happen, really... */ 190 if (fwspec->param_count != 3)
193 if (intsize != 3) 191 return -EINVAL;
194 return -EINVAL; /* Not GIC compliant */
195 if (intspec[0] != 0)
196 return -EINVAL; /* No PPI should point to this domain */
197 192
198 *out_hwirq = intspec[1]; 193 /* No PPI should point to this domain */
199 *out_type = intspec[2]; 194 if (fwspec->param[0] != 0)
200 return 0; 195 return -EINVAL;
196
197 *hwirq = fwspec->param[1];
198 *type = fwspec->param[2];
199 return 0;
200 }
201
202 return -EINVAL;
201} 203}
202 204
203static int imx_gpc_domain_alloc(struct irq_domain *domain, 205static int imx_gpc_domain_alloc(struct irq_domain *domain,
204 unsigned int irq, 206 unsigned int irq,
205 unsigned int nr_irqs, void *data) 207 unsigned int nr_irqs, void *data)
206{ 208{
207 struct of_phandle_args *args = data; 209 struct irq_fwspec *fwspec = data;
208 struct of_phandle_args parent_args; 210 struct irq_fwspec parent_fwspec;
209 irq_hw_number_t hwirq; 211 irq_hw_number_t hwirq;
210 int i; 212 int i;
211 213
212 if (args->args_count != 3) 214 if (fwspec->param_count != 3)
213 return -EINVAL; /* Not GIC compliant */ 215 return -EINVAL; /* Not GIC compliant */
214 if (args->args[0] != 0) 216 if (fwspec->param[0] != 0)
215 return -EINVAL; /* No PPI should point to this domain */ 217 return -EINVAL; /* No PPI should point to this domain */
216 218
217 hwirq = args->args[1]; 219 hwirq = fwspec->param[1];
218 if (hwirq >= GPC_MAX_IRQS) 220 if (hwirq >= GPC_MAX_IRQS)
219 return -EINVAL; /* Can't deal with this */ 221 return -EINVAL; /* Can't deal with this */
220 222
@@ -222,15 +224,16 @@ static int imx_gpc_domain_alloc(struct irq_domain *domain,
222 irq_domain_set_hwirq_and_chip(domain, irq + i, hwirq + i, 224 irq_domain_set_hwirq_and_chip(domain, irq + i, hwirq + i,
223 &imx_gpc_chip, NULL); 225 &imx_gpc_chip, NULL);
224 226
225 parent_args = *args; 227 parent_fwspec = *fwspec;
226 parent_args.np = irq_domain_get_of_node(domain->parent); 228 parent_fwspec.fwnode = domain->parent->fwnode;
227 return irq_domain_alloc_irqs_parent(domain, irq, nr_irqs, &parent_args); 229 return irq_domain_alloc_irqs_parent(domain, irq, nr_irqs,
230 &parent_fwspec);
228} 231}
229 232
230static const struct irq_domain_ops imx_gpc_domain_ops = { 233static const struct irq_domain_ops imx_gpc_domain_ops = {
231 .xlate = imx_gpc_domain_xlate, 234 .translate = imx_gpc_domain_translate,
232 .alloc = imx_gpc_domain_alloc, 235 .alloc = imx_gpc_domain_alloc,
233 .free = irq_domain_free_irqs_common, 236 .free = irq_domain_free_irqs_common,
234}; 237};
235 238
236static int __init imx_gpc_init(struct device_node *node, 239static int __init imx_gpc_init(struct device_node *node,