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

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ missing projects

The tas2781-hda supports multi-projects. In some projects, GpioInt() was
dropped due to no IRQ connection. See the example code below:

Device (SPKR)
{
Name (_ADR, One)
Name (_HID, "TXNW2781")
Method (_CRS, 0, NotSerialized)
{
Name (RBUF, ResourceTemplate ()
{
I2cSerialBusV2 (0x0038, ...)
I2cSerialBusV2 (0x0039, ...)
// GpioInt (Edge, ...) { 0x0000 }
//"GpioInt (...) {}" was commented out due to no IRQ connection.
})
Return (RBUF)
}
}

But in smi_i2c_probe(), smi_spi_probe() (serial-multi-instantiate.c), if
looking for IRQ by smi_get_irq() fails, it will return an error, will not add
new device, and cause smi_probe() to fail:

[ 2.356546] Serial bus multi instantiate pseudo device driver TXNW2781:00:
error -ENXIO: IRQ index 0 not found
[ 2.356561] Serial bus multi instantiate pseudo device driver TXNW2781:00:
error -ENXIO: Error requesting irq at index 0

So, we need to add an exception case for these situations. BTW, this patch
will take effect on both I2C and SPI devices.

Signed-off-by: Baojun Xu <baojun.xu@ti.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20251126141434.11110-1-baojun.xu@ti.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Baojun Xu and committed by
Ilpo Järvinen
1d1b8b07 278ff704

+9 -4
+9 -4
drivers/platform/x86/serial-multi-instantiate.c
··· 22 22 #define IRQ_RESOURCE_GPIO 1 23 23 #define IRQ_RESOURCE_APIC 2 24 24 #define IRQ_RESOURCE_AUTO 3 25 + #define IRQ_RESOURCE_OPT BIT(2) 25 26 26 27 enum smi_bus_type { 27 28 SMI_I2C, ··· 64 63 if (ret > 0) { 65 64 dev_dbg(&pdev->dev, "Using platform irq\n"); 66 65 break; 66 + } 67 + if (inst->flags & IRQ_RESOURCE_OPT) { 68 + dev_dbg(&pdev->dev, "No irq\n"); 69 + return 0; 67 70 } 68 71 break; 69 72 case IRQ_RESOURCE_GPIO: ··· 391 386 392 387 static const struct smi_node tas2781_hda = { 393 388 .instances = { 394 - { "tas2781-hda", IRQ_RESOURCE_AUTO, 0 }, 395 - { "tas2781-hda", IRQ_RESOURCE_AUTO, 0 }, 396 - { "tas2781-hda", IRQ_RESOURCE_AUTO, 0 }, 397 - { "tas2781-hda", IRQ_RESOURCE_AUTO, 0 }, 389 + { "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 }, 390 + { "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 }, 391 + { "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 }, 392 + { "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 }, 398 393 {} 399 394 }, 400 395 .bus_type = SMI_AUTO_DETECT,