Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code
@ 2025-11-26  8:17 Baojun Xu
  2025-11-26  8:17 ` [PATCH v3 1/1] platform/x86: serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ missing projects Baojun Xu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Baojun Xu @ 2025-11-26  8:17 UTC (permalink / raw)
  To: tiwai, hansg
  Cc: ilpo.jarvinen, broonie, andriy.shevchenko, alsa-devel,
	shenghao-ding, 13916275206, platform-driver-x86, linux-sound,
	linux-kernel, baojun.xu, letitia.tsai

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

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.
So need to add an exception case for these situations.
BTW, this patch will take effect on both I2C and SPI devices.

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)
    }
}

Signed-off-by: Baojun Xu <baojun.xu@ti.com>

Baojun Xu (1):
  platform/x86: serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ
    missing projects

 drivers/platform/x86/serial-multi-instantiate.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 1/1] platform/x86: serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ missing projects
  2025-11-26  8:17 [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code Baojun Xu
@ 2025-11-26  8:17 ` Baojun Xu
  2025-11-26  9:05 ` [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code Hans de Goede
  2025-11-26 11:43 ` Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Baojun Xu @ 2025-11-26  8:17 UTC (permalink / raw)
  To: tiwai, hansg
  Cc: ilpo.jarvinen, broonie, andriy.shevchenko, alsa-devel,
	shenghao-ding, 13916275206, platform-driver-x86, linux-sound,
	linux-kernel, baojun.xu, letitia.tsai

Add IRQ_RESOURCE_OPT for compatible IRQ missing cases.

Signed-off-by: Baojun Xu <baojun.xu@ti.com>
---
v3:
 - Add IRQ_RESOURCE_OPT for IRQ missing cases.
v2:
 - Remove error ignore, change to AUTO compatible with NONE.
---
 drivers/platform/x86/serial-multi-instantiate.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/serial-multi-instantiate.c b/drivers/platform/x86/serial-multi-instantiate.c
index db030b0f176a..1a369334f9cb 100644
--- a/drivers/platform/x86/serial-multi-instantiate.c
+++ b/drivers/platform/x86/serial-multi-instantiate.c
@@ -22,6 +22,7 @@
 #define IRQ_RESOURCE_GPIO	1
 #define IRQ_RESOURCE_APIC	2
 #define IRQ_RESOURCE_AUTO   3
+#define IRQ_RESOURCE_OPT	BIT(2)
 
 enum smi_bus_type {
 	SMI_I2C,
@@ -64,6 +65,10 @@ static int smi_get_irq(struct platform_device *pdev, struct acpi_device *adev,
 			dev_dbg(&pdev->dev, "Using platform irq\n");
 			break;
 		}
+		if (inst->flags & IRQ_RESOURCE_OPT) {
+			dev_dbg(&pdev->dev, "No irq\n");
+			return 0;
+		}
 		break;
 	case IRQ_RESOURCE_GPIO:
 		ret = acpi_dev_gpio_irq_get(adev, inst->irq_idx);
@@ -386,10 +391,10 @@ static const struct smi_node cs35l57_hda = {
 
 static const struct smi_node tas2781_hda = {
 	.instances = {
-		{ "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
-		{ "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
-		{ "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
-		{ "tas2781-hda", IRQ_RESOURCE_AUTO, 0 },
+		{ "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 },
+		{ "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 },
+		{ "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 },
+		{ "tas2781-hda", IRQ_RESOURCE_AUTO | IRQ_RESOURCE_OPT, 0 },
 		{}
 	},
 	.bus_type = SMI_AUTO_DETECT,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code
  2025-11-26  8:17 [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code Baojun Xu
  2025-11-26  8:17 ` [PATCH v3 1/1] platform/x86: serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ missing projects Baojun Xu
@ 2025-11-26  9:05 ` Hans de Goede
  2025-11-26 11:43 ` Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2025-11-26  9:05 UTC (permalink / raw)
  To: Baojun Xu, tiwai
  Cc: ilpo.jarvinen, broonie, andriy.shevchenko, alsa-devel,
	shenghao-ding, 13916275206, platform-driver-x86, linux-sound,
	linux-kernel, letitia.tsai

Hi Baojun Xu,

On 26-Nov-25 9:17 AM, Baojun Xu wrote:
> The tas2781-hda supports multi-projects, In some projects,
> GpioInt was dropped due to no IRQ connection.
> See the example code below:
> 
> 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.
> So need to add an exception case for these situations.
> BTW, this patch will take effect on both I2C and SPI devices.
> 
> 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)
>     }
> }
> 
> Signed-off-by: Baojun Xu <baojun.xu@ti.com>

Thank you, the patch itself looks good, but the above information
from the cover-letter really should be in the commit message of
the patch itself.

Can you please send a v4 with this info added to the commit
message ?

Regards,

Hans




> 
> Baojun Xu (1):
>   platform/x86: serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ
>     missing projects
> 
>  drivers/platform/x86/serial-multi-instantiate.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code
  2025-11-26  8:17 [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code Baojun Xu
  2025-11-26  8:17 ` [PATCH v3 1/1] platform/x86: serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ missing projects Baojun Xu
  2025-11-26  9:05 ` [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code Hans de Goede
@ 2025-11-26 11:43 ` Andy Shevchenko
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2025-11-26 11:43 UTC (permalink / raw)
  To: Baojun Xu
  Cc: tiwai, hansg, ilpo.jarvinen, broonie, alsa-devel, shenghao-ding,
	13916275206, platform-driver-x86, linux-sound, linux-kernel,
	letitia.tsai

On Wed, Nov 26, 2025 at 04:17:40PM +0800, Baojun Xu wrote:
> The tas2781-hda supports multi-projects, In some projects,
> GpioInt was dropped due to no IRQ connection.

GpioInt()

> See the example code below:
> 
> 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.

smi_probe()

> So need to add an exception case for these situations.
> BTW, this patch will take effect on both I2C and SPI devices.
> 
> 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)
>     }
> }

And as Hans said, please fold this into the patch as part of the commit message.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-11-26 11:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-26  8:17 [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code Baojun Xu
2025-11-26  8:17 ` [PATCH v3 1/1] platform/x86: serial-multi-instantiate: Add IRQ_RESOURCE_OPT for IRQ missing projects Baojun Xu
2025-11-26  9:05 ` [PATCH v3 0/1] platform/x86: serial-multi-instantiate: ACPI example code Hans de Goede
2025-11-26 11:43 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox