@@ -1132,6 +1132,31 @@ int irq_domain_xlate_twocell(struct irq_domain *d, struct device_node *ctrlr,
11321132}
11331133EXPORT_SYMBOL_GPL (irq_domain_xlate_twocell );
11341134
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+
11351160/**
11361161 * irq_domain_xlate_onetwocell() - Generic xlate for one or two cell bindings
11371162 * @d: Interrupt domain involved in the translation
@@ -1216,6 +1241,37 @@ int irq_domain_translate_twocell(struct irq_domain *d,
12161241}
12171242EXPORT_SYMBOL_GPL (irq_domain_translate_twocell );
12181243
1244+ /**
1245+ * irq_domain_translate_twothreecell() - Generic translate for direct two or three cell
1246+ * bindings
1247+ * @d: Interrupt domain involved in the translation
1248+ * @fwspec: The firmware interrupt specifier to translate
1249+ * @out_hwirq: Pointer to storage for the hardware interrupt number
1250+ * @out_type: Pointer to storage for the interrupt type
1251+ *
1252+ * Firmware interrupt specifier translation function for two or three cell
1253+ * specifications, where the parameter values map directly to the hardware
1254+ * interrupt number and the type specifier.
1255+ */
1256+ int irq_domain_translate_twothreecell (struct irq_domain * d , struct irq_fwspec * fwspec ,
1257+ unsigned long * out_hwirq , unsigned int * out_type )
1258+ {
1259+ if (fwspec -> param_count == 2 ) {
1260+ * out_hwirq = fwspec -> param [0 ];
1261+ * out_type = fwspec -> param [1 ] & IRQ_TYPE_SENSE_MASK ;
1262+ return 0 ;
1263+ }
1264+
1265+ if (fwspec -> param_count == 3 ) {
1266+ * out_hwirq = fwspec -> param [1 ];
1267+ * out_type = fwspec -> param [2 ] & IRQ_TYPE_SENSE_MASK ;
1268+ return 0 ;
1269+ }
1270+
1271+ return - EINVAL ;
1272+ }
1273+ EXPORT_SYMBOL_GPL (irq_domain_translate_twothreecell );
1274+
12191275int irq_domain_alloc_descs (int virq , unsigned int cnt , irq_hw_number_t hwirq ,
12201276 int node , const struct irq_affinity_desc * affinity )
12211277{
0 commit comments