]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ALSA: hda/tas2781: Add compatible for hardware id TIAS2781 and TXNW2781
authorBaojun Xu <baojun.xu@ti.com>
Mon, 16 Jun 2025 03:56:07 +0000 (11:56 +0800)
committerTakashi Iwai <tiwai@suse.de>
Mon, 16 Jun 2025 06:30:37 +0000 (08:30 +0200)
TIAS2781 is unofficial hardware id in ACPI for tas2781 in HDA,
has been used for several projects. TXNW is the official hardware
id for TI, will be used in new projects, including device on SPI bus,
which was enumerated by drivers/acpi/scan.c, and probed by smi_probe()
in drivers/platform/x86/serial-multi-instantiate.c.
This patch will support both TIAS2781 and TXNW2781 in ACPI with
tas2781 under HDA.
As our I2C driver will handle all of slaver devices, so we probe
first device only: "TXNW2781:00-tas2781-hda.0"

Signed-off-by: Baojun Xu <baojun.xu@ti.com>
Link: https://patch.msgid.link/20250616035607.2569-1-baojun.xu@ti.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_realtek.c
sound/pci/hda/tas2781_hda_i2c.c

index 7db62477b7857237347d440a66448a45fca7e2a7..84a68c7d65b7441090bdfc874d41d40e5c08cdaf 100644 (file)
@@ -7328,7 +7328,7 @@ static void alc285_fixup_asus_ga403u(struct hda_codec *cdc, const struct hda_fix
                alc_fixup_inv_dmic(cdc, fix, action);
 }
 
-static void tas2781_fixup_i2c(struct hda_codec *cdc,
+static void tas2781_fixup_tias_i2c(struct hda_codec *cdc,
        const struct hda_fixup *fix, int action)
 {
        comp_generic_fixup(cdc, action, "i2c", "TIAS2781", "-%s:00", 1);
@@ -7339,6 +7339,12 @@ static void tas2781_fixup_spi(struct hda_codec *cdc, const struct hda_fixup *fix
        comp_generic_fixup(cdc, action, "spi", "TXNW2781", "-%s:00-tas2781-hda.%d", 2);
 }
 
+static void tas2781_fixup_txnw_i2c(struct hda_codec *cdc,
+       const struct hda_fixup *fix, int action)
+{
+       comp_generic_fixup(cdc, action, "i2c", "TXNW2781", "-%s:00-tas2781-hda.%d", 1);
+}
+
 static void yoga7_14arb7_fixup_i2c(struct hda_codec *cdc,
        const struct hda_fixup *fix, int action)
 {
@@ -8007,6 +8013,7 @@ enum {
        ALC287_FIXUP_CS35L41_I2C_2_THINKPAD_ACPI,
        ALC287_FIXUP_TAS2781_I2C,
        ALC245_FIXUP_TAS2781_SPI_2,
+       ALC287_FIXUP_TXNW2781_I2C,
        ALC287_FIXUP_YOGA7_14ARB7_I2C,
        ALC245_FIXUP_HP_MUTE_LED_COEFBIT,
        ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT,
@@ -10261,7 +10268,7 @@ static const struct hda_fixup alc269_fixups[] = {
        },
        [ALC287_FIXUP_TAS2781_I2C] = {
                .type = HDA_FIXUP_FUNC,
-               .v.func = tas2781_fixup_i2c,
+               .v.func = tas2781_fixup_tias_i2c,
                .chained = true,
                .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
        },
@@ -10271,6 +10278,12 @@ static const struct hda_fixup alc269_fixups[] = {
                .chained = true,
                .chain_id = ALC285_FIXUP_HP_GPIO_LED,
        },
+       [ALC287_FIXUP_TXNW2781_I2C] = {
+               .type = HDA_FIXUP_FUNC,
+               .v.func = tas2781_fixup_txnw_i2c,
+               .chained = true,
+               .chain_id = ALC285_FIXUP_THINKPAD_HEADSET_JACK,
+       },
        [ALC287_FIXUP_YOGA7_14ARB7_I2C] = {
                .type = HDA_FIXUP_FUNC,
                .v.func = yoga7_14arb7_fixup_i2c,
@@ -11329,8 +11342,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
        SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
        SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
        SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
-       SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TAS2781_I2C),
-       SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TAS2781_I2C),
+       SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TXNW2781_I2C),
+       SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TXNW2781_I2C),
        SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
        SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
        SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
index eb2295b490d94e145bffc32b3a9f2327f7dfb57d..b9cdbca951e4ebdd9f04f220cd131457845875a5 100644 (file)
@@ -587,6 +587,11 @@ static int tas2781_hda_i2c_probe(struct i2c_client *clt)
                device_name = "TIAS2781";
                hda_priv->save_calibration = tas2781_save_calibration;
                tas_hda->priv->global_addr = TAS2781_GLOBAL_ADDR;
+       } else if (strstarts(dev_name(&clt->dev),
+                            "TXNW2781:00-tas2781-hda.0")) {
+               device_name = "TXNW2781";
+               hda_priv->save_calibration = tas2781_save_calibration;
+               tas_hda->priv->global_addr = TAS2781_GLOBAL_ADDR;
        } else if (strstr(dev_name(&clt->dev), "INT8866")) {
                device_name = "INT8866";
                hda_priv->save_calibration = tas2563_save_calibration;
@@ -725,6 +730,7 @@ static const struct i2c_device_id tas2781_hda_i2c_id[] = {
 static const struct acpi_device_id tas2781_acpi_hda_match[] = {
        {"INT8866", 0 },
        {"TIAS2781", 0 },
+       {"TXNW2781", 0 },
        {}
 };
 MODULE_DEVICE_TABLE(acpi, tas2781_acpi_hda_match);