Skip to contentSkip to conversation

platform_get_irq_byname() supported on ACPI?

DISCUSSION Timur Tabi 2 participants 2 messages Feb 8, 2016 ACPI

lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

Is there support for the platform_get_irq_byname() function on ACPI systems?

I'm working on adding ACPI support for a driver that currently only supports device tree. This driver has code like this:

	ret = platform_get_irq_byname(pdev, "core0_irq");

This function works fine on device tree, but it fails on our ACPI system because our ACPI nodes don't appear to have any way to attach a name to an IRQ resource:

Method (_CRS, 0x0, Serialized) {
	Name (RBUF, ResourceTemplate() {
		[snip]
		Interrupt (ResourceConsumer, Level, ActiveHigh,
			Exclusive, , , )
			{0x120, 0x121, 0x122, 0x123}
	})
	Return (RBUF)
}

I would hate to have to do something like this:

ret = platform_get_irq_byname(pdev, "core0_irq");
if (ret)

	/* ACPI doesn't support named resources */
	ret = platform_get_irq(pdev, 0);
Signature · 2 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
#1 lore raw
Quoted 10 lines · Timur Tabi

Is there support for the platform_get_irq_byname() function on ACPI systems?

I'm working on adding ACPI support for a driver that currently only supports device tree. This driver has code like this:

	ret = platform_get_irq_byname(pdev, "core0_irq");

This function works fine on device tree, but it fails on our ACPI system because our ACPI nodes don't appear to have any way to attach a name to an IRQ resource:

That's correct.

Quoted 11 lines
Method (_CRS, 0x0, Serialized) {
	Name (RBUF, ResourceTemplate() {
		[snip]
		Interrupt (ResourceConsumer, Level, ActiveHigh,
			Exclusive, , , )
			{0x120, 0x121, 0x122, 0x123}
	})
	Return (RBUF)
}
Quoted 6 lines

I would hate to have to do something like this:

ret = platform_get_irq_byname(pdev, "core0_irq");
if (ret)

	/* ACPI doesn't support named resources */
	ret = platform_get_irq(pdev, 0);

That's the only way ATM, though.

In theory _DSD might be used to provide a name for the IRQ resource, but that hasn't been explored yet (and there's no support in the code, of course).

Thanks,
Rafael