Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'irqdomain-04-08-25' into irq/cleanups

Merge to get the latest updates for the irqdomain cleanup series.

+65 -9
+9 -9
include/linux/irqdomain.h
··· 571 571 int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr, 572 572 const u32 *intspec, unsigned int intsize, 573 573 irq_hw_number_t *out_hwirq, unsigned int *out_type); 574 + int irq_domain_xlate_twothreecell(struct irq_domain *d, struct device_node *ctrlr, 575 + const u32 *intspec, unsigned int intsize, 576 + irq_hw_number_t *out_hwirq, unsigned int *out_type); 574 577 575 - int irq_domain_translate_twocell(struct irq_domain *d, 576 - struct irq_fwspec *fwspec, 577 - unsigned long *out_hwirq, 578 - unsigned int *out_type); 579 - 580 - int irq_domain_translate_onecell(struct irq_domain *d, 581 - struct irq_fwspec *fwspec, 582 - unsigned long *out_hwirq, 583 - unsigned int *out_type); 578 + int irq_domain_translate_onecell(struct irq_domain *d, struct irq_fwspec *fwspec, 579 + unsigned long *out_hwirq, unsigned int *out_type); 580 + int irq_domain_translate_twocell(struct irq_domain *d, struct irq_fwspec *fwspec, 581 + unsigned long *out_hwirq, unsigned int *out_type); 582 + int irq_domain_translate_twothreecell(struct irq_domain *d, struct irq_fwspec *fwspec, 583 + unsigned long *out_hwirq, unsigned int *out_type); 584 584 585 585 /* IPI functions */ 586 586 int irq_reserve_ipi(struct irq_domain *domain, const struct cpumask *dest);
+56
kernel/irq/irqdomain.c
··· 1133 1133 EXPORT_SYMBOL_GPL(irq_domain_xlate_twocell); 1134 1134 1135 1135 /** 1136 + * irq_domain_xlate_twothreecell() - Generic xlate for direct two or three cell bindings 1137 + * @d: Interrupt domain involved in the translation 1138 + * @ctrlr: The device tree node for the device whose interrupt is translated 1139 + * @intspec: The interrupt specifier data from the device tree 1140 + * @intsize: The number of entries in @intspec 1141 + * @out_hwirq: Pointer to storage for the hardware interrupt number 1142 + * @out_type: Pointer to storage for the interrupt type 1143 + * 1144 + * Device Tree interrupt specifier translation function for two or three 1145 + * cell bindings, where the cell values map directly to the hardware 1146 + * interrupt number and the type specifier. 1147 + */ 1148 + int irq_domain_xlate_twothreecell(struct irq_domain *d, struct device_node *ctrlr, 1149 + const u32 *intspec, unsigned int intsize, 1150 + irq_hw_number_t *out_hwirq, unsigned int *out_type) 1151 + { 1152 + struct irq_fwspec fwspec; 1153 + 1154 + of_phandle_args_to_fwspec(ctrlr, intspec, intsize, &fwspec); 1155 + 1156 + return irq_domain_translate_twothreecell(d, &fwspec, out_hwirq, out_type); 1157 + } 1158 + EXPORT_SYMBOL_GPL(irq_domain_xlate_twothreecell); 1159 + 1160 + /** 1136 1161 * irq_domain_xlate_onetwocell() - Generic xlate for one or two cell bindings 1137 1162 * @d: Interrupt domain involved in the translation 1138 1163 * @ctrlr: The device tree node for the device whose interrupt is translated ··· 1240 1215 return 0; 1241 1216 } 1242 1217 EXPORT_SYMBOL_GPL(irq_domain_translate_twocell); 1218 + 1219 + /** 1220 + * irq_domain_translate_twothreecell() - Generic translate for direct two or three cell 1221 + * bindings 1222 + * @d: Interrupt domain involved in the translation 1223 + * @fwspec: The firmware interrupt specifier to translate 1224 + * @out_hwirq: Pointer to storage for the hardware interrupt number 1225 + * @out_type: Pointer to storage for the interrupt type 1226 + * 1227 + * Firmware interrupt specifier translation function for two or three cell 1228 + * specifications, where the parameter values map directly to the hardware 1229 + * interrupt number and the type specifier. 1230 + */ 1231 + int irq_domain_translate_twothreecell(struct irq_domain *d, struct irq_fwspec *fwspec, 1232 + unsigned long *out_hwirq, unsigned int *out_type) 1233 + { 1234 + if (fwspec->param_count == 2) { 1235 + *out_hwirq = fwspec->param[0]; 1236 + *out_type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK; 1237 + return 0; 1238 + } 1239 + 1240 + if (fwspec->param_count == 3) { 1241 + *out_hwirq = fwspec->param[1]; 1242 + *out_type = fwspec->param[2] & IRQ_TYPE_SENSE_MASK; 1243 + return 0; 1244 + } 1245 + 1246 + return -EINVAL; 1247 + } 1248 + EXPORT_SYMBOL_GPL(irq_domain_translate_twothreecell); 1243 1249 1244 1250 int irq_domain_alloc_descs(int virq, unsigned int cnt, irq_hw_number_t hwirq, 1245 1251 int node, const struct irq_affinity_desc *affinity)