Skip to content

Commit 1d1b8b0

Browse files
jimxbj-dotij-intel
authored andcommitted
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>
1 parent 278ff70 commit 1d1b8b0

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/platform/x86/serial-multi-instantiate.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#define IRQ_RESOURCE_GPIO 1
2323
#define IRQ_RESOURCE_APIC 2
2424
#define IRQ_RESOURCE_AUTO 3
25+
#define IRQ_RESOURCE_OPT BIT(2)
2526

2627
enum smi_bus_type {
2728
SMI_I2C,
@@ -64,6 +65,10 @@ static int smi_get_irq(struct platform_device *pdev, struct acpi_device *adev,
6465
dev_dbg(&pdev->dev, "Using platform irq\n");
6566
break;
6667
}
68+
if (inst->flags & IRQ_RESOURCE_OPT) {
69+
dev_dbg(&pdev->dev, "No irq\n");
70+
return 0;
71+
}
6772
break;
6873
case IRQ_RESOURCE_GPIO:
6974
ret = acpi_dev_gpio_irq_get(adev, inst->irq_idx);
@@ -386,10 +391,10 @@ static const struct smi_node cs35l57_hda = {
386391

387392
static const struct smi_node tas2781_hda = {
388393
.instances = {
389-
{ "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
390-
{ "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
391-
{ "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
392-
{ "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
394+
{ "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 },
395+
{ "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 },
396+
{ "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 },
397+
{ "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 },
393398
{}
394399
},
395400
.bus_type = SMI_AUTO_DETECT,

0 commit comments

Comments
 (0)