Skip to content

Commit 12ed4bb

Browse files
committed
ALSA: hda: add AW88399 side codec support
Link: https://github.com/nadimkobeissi/16iax10h-linux-sound-saga Signed-off-by: Eric Naim <dnaim@cachyos.org>
1 parent 303ce1a commit 12ed4bb

10 files changed

Lines changed: 732 additions & 16 deletions

File tree

drivers/acpi/scan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,6 +1750,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
17501750
* by the drivers/platform/x86/serial-multi-instantiate.c driver, which
17511751
* knows which client device id to use for each resource.
17521752
*/
1753+
{"AWDZ8399", },
17531754
{"BSG1160", },
17541755
{"BSG2150", },
17551756
{"CSC3551", },

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,21 @@ static const struct smi_node max98390_hda = {
411411
.bus_type = SMI_I2C,
412412
};
413413

414+
static const struct smi_node aw88399_hda = {
415+
.instances = {
416+
{ "aw88399-hda", IRQ_RESOURCE_AUTO, 0 },
417+
{ "aw88399-hda", IRQ_RESOURCE_AUTO, 0 },
418+
{}
419+
},
420+
.bus_type = SMI_AUTO_DETECT,
421+
};
422+
414423
/*
415424
* Note new device-ids must also be added to ignore_serial_bus_ids in
416425
* drivers/acpi/scan.c: acpi_device_enumeration_by_parent().
417426
*/
418427
static const struct acpi_device_id smi_acpi_ids[] = {
428+
{ "AWDZ8399", (unsigned long)&aw88399_hda },
419429
{ "BSG1160", (unsigned long)&bsg1160_data },
420430
{ "BSG2150", (unsigned long)&bsg2150_data },
421431
{ "CSC3551", (unsigned long)&cs35l41_hda },

sound/hda/codecs/realtek/alc269.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3254,6 +3254,16 @@ static void find_cirrus_companion_amps(struct hda_codec *cdc)
32543254
comp_generic_fixup(cdc, HDA_FIXUP_ACT_PRE_PROBE, bus, acpi_ids[i].hid, match, count);
32553255
}
32563256

3257+
static void aw88399_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
3258+
{
3259+
comp_generic_fixup(cdc, action, "i2c", "AWDZ8399", "-%s:00-aw88399-hda.%d", 2);
3260+
}
3261+
3262+
static void alc287_fixup_legion_16iax_aw88399(struct hda_codec *codec,
3263+
const struct hda_fixup *fix, int action)
3264+
{
3265+
}
3266+
32573267
static void cs35l41_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
32583268
{
32593269
comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
@@ -4130,6 +4140,8 @@ enum {
41304140
ALC245_FIXUP_ACER_MICMUTE_LED,
41314141
ALC245_FIXUP_CS35L41_I2C_2_MUTE_LED,
41324142
ALC236_FIXUP_HP_DMIC,
4143+
ALC287_FIXUP_AW88399_I2C_2,
4144+
ALC287_FIXUP_LENOVO_LEGION_AW88399,
41334145
};
41344146

41354147
/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -6676,6 +6688,15 @@ static const struct hda_fixup alc269_fixups[] = {
66766688
{ 0x12, 0x90a60160 }, /* use as internal mic */
66776689
{ }
66786690
},
6691+
[ALC287_FIXUP_AW88399_I2C_2] = {
6692+
.type = HDA_FIXUP_FUNC,
6693+
.v.func = aw88399_fixup_i2c_two,
6694+
},
6695+
[ALC287_FIXUP_LENOVO_LEGION_AW88399] = {
6696+
.type = HDA_FIXUP_FUNC,
6697+
.v.func = alc287_fixup_legion_16iax_aw88399,
6698+
.chained = true,
6699+
.chain_id = ALC287_FIXUP_AW88399_I2C_2,
66796700
}
66806701
};
66816702

@@ -7694,13 +7715,16 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
76947715
SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
76957716
SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C),
76967717
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7718+
SND_PCI_QUIRK(0x17aa, 0x3906, "Lenovo Legion Pro 7 16IAX10H", ALC287_FIXUP_LENOVO_LEGION_AW88399),
7719+
SND_PCI_QUIRK(0x17aa, 0x3907, "Lenovo Legion Pro 7 16IAX10H", ALC287_FIXUP_LENOVO_LEGION_AW88399),
76977720
SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
76987721
SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
76997722
SND_PCI_QUIRK(0x17aa, 0x391a, "Lenovo Yoga Slim 7 14AKP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
77007723
SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TXNW2781_I2C),
77017724
SND_PCI_QUIRK(0x17aa, 0x3920, "Yoga S990-16 pro Quad VECO Quad", ALC287_FIXUP_TXNW2781_I2C),
77027725
SND_PCI_QUIRK(0x17aa, 0x3929, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
77037726
SND_PCI_QUIRK(0x17aa, 0x392b, "Thinkbook 13x Gen 5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
7727+
SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo Legion Pro 7 16AFR10H", ALC287_FIXUP_LENOVO_LEGION_AW88399),
77047728
SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
77057729
SND_PCI_QUIRK(0x17aa, 0x3978, "Lenovo B50-70", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
77067730
SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),

sound/hda/codecs/side-codecs/Kconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,24 @@ config SND_HDA_SCODEC_MAX98390_I2C
160160

161161
comment "Set to Y if you want auto-loading the side codec driver"
162162
depends on SND_HDA=y && SND_HDA_SCODEC_MAX98390_I2C=m
163+
164+
config SND_HDA_SCODEC_AW88399
165+
tristate
166+
select SND_HDA_GENERIC
167+
168+
config SND_HDA_SCODEC_AW88399_I2C
169+
tristate "Build AW88399 HD-audio side codec support for I2C Bus"
170+
depends on I2C
171+
depends on ACPI
172+
depends on SND_SOC
173+
select SND_HDA_SCODEC_AW88399
174+
select SND_SOC_AW88399
175+
help
176+
Say Y or M here to include AW88399 I2C HD-audio side codec support
177+
in snd-hda-intel driver, such as ALC287.
178+
179+
This is for systems where the AW88399 smart amplifier is connected
180+
as a side codec to the HDA controller, rather than via SOF/SSP.
181+
182+
comment "Set to Y if you want auto-loading the side codec driver"
183+
depends on SND_HDA=y && SND_HDA_SCODEC_AW88399_I2C=m

sound/hda/codecs/side-codecs/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ snd-hda-scodec-tas2781-i2c-y := tas2781_hda_i2c.o
1515
snd-hda-scodec-tas2781-spi-y := tas2781_hda_spi.o
1616
snd-hda-scodec-max98390-y := max98390_hda.o max98390_hda_filters.o
1717
snd-hda-scodec-max98390-i2c-y := max98390_hda_i2c.o
18+
snd-hda-scodec-aw88399-y := aw88399_hda.o
19+
snd-hda-scodec-aw88399-i2c-y := aw88399_hda_i2c.o
1820

1921
obj-$(CONFIG_SND_HDA_CIRRUS_SCODEC) += snd-hda-cirrus-scodec.o
2022
obj-$(CONFIG_SND_HDA_CIRRUS_SCODEC_KUNIT_TEST) += snd-hda-cirrus-scodec-test.o
@@ -30,3 +32,5 @@ obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_I2C) += snd-hda-scodec-tas2781-i2c.o
3032
obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_SPI) += snd-hda-scodec-tas2781-spi.o
3133
obj-$(CONFIG_SND_HDA_SCODEC_MAX98390) += snd-hda-scodec-max98390.o
3234
obj-$(CONFIG_SND_HDA_SCODEC_MAX98390_I2C) += snd-hda-scodec-max98390-i2c.o
35+
obj-$(CONFIG_SND_HDA_SCODEC_AW88399) += snd-hda-scodec-aw88399.o
36+
obj-$(CONFIG_SND_HDA_SCODEC_AW88399_I2C) += snd-hda-scodec-aw88399-i2c.o

0 commit comments

Comments
 (0)