Commit 0ab8d0f6 authored by Marc Zyngier's avatar Marc Zyngier Committed by Bjorn Helgaas
Browse files

irqdomain: Make of_phandle_args_to_fwspec() generally available

of_phandle_args_to_fwspec() can be generally useful to code extracting a DT
of_phandle and using an irq_fwspec to use the hierarchical irqdomain API.

Make it visible to the rest of the kernel, including modules.

Link: https://lore.kernel.org/r/20210929163847.2807812-2-maz@kernel.org


Tested-by: default avatarAlyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent e4e737bb
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -64,6 +64,10 @@ struct irq_fwspec {
	u32 param[IRQ_DOMAIN_IRQ_SPEC_PARAMS];
	u32 param[IRQ_DOMAIN_IRQ_SPEC_PARAMS];
};
};


/* Conversion function from of_phandle_args fields to fwspec  */
void of_phandle_args_to_fwspec(struct device_node *np, const u32 *args,
			       unsigned int count, struct irq_fwspec *fwspec);

/*
/*
 * Should several domains have the same device node, but serve
 * Should several domains have the same device node, but serve
 * different purposes (for example one domain is for PCI/MSI, and the
 * different purposes (for example one domain is for PCI/MSI, and the
+3 −3
Original line number Original line Diff line number Diff line
@@ -744,9 +744,8 @@ static int irq_domain_translate(struct irq_domain *d,
	return 0;
	return 0;
}
}


static void of_phandle_args_to_fwspec(struct device_node *np, const u32 *args,
void of_phandle_args_to_fwspec(struct device_node *np, const u32 *args,
				      unsigned int count,
			       unsigned int count, struct irq_fwspec *fwspec)
				      struct irq_fwspec *fwspec)
{
{
	int i;
	int i;


@@ -756,6 +755,7 @@ static void of_phandle_args_to_fwspec(struct device_node *np, const u32 *args,
	for (i = 0; i < count; i++)
	for (i = 0; i < count; i++)
		fwspec->param[i] = args[i];
		fwspec->param[i] = args[i];
}
}
EXPORT_SYMBOL_GPL(of_phandle_args_to_fwspec);


unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec)
unsigned int irq_create_fwspec_mapping(struct irq_fwspec *fwspec)
{
{