Skip to content

Commit b9ef85e

Browse files
committed
ALSA: hda: add AW88399 side codec support
1 parent 632952d commit b9ef85e

File tree

10 files changed

+732
-18
lines changed

10 files changed

+732
-18
lines changed

drivers/acpi/scan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,7 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
17601760
* by the drivers/platform/x86/serial-multi-instantiate.c driver, which
17611761
* knows which client device id to use for each resource.
17621762
*/
1763+
{"AWDZ8399", },
17631764
{"BSG1160", },
17641765
{"BSG2150", },
17651766
{"CSC3551", },

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,11 +395,21 @@ static const struct smi_node tas2781_hda = {
395395
.bus_type = SMI_AUTO_DETECT,
396396
};
397397

398+
static const struct smi_node aw88399_hda = {
399+
.instances = {
400+
{ "aw88399-hda", IRQ_RESOURCE_AUTO, 0 },
401+
{ "aw88399-hda", IRQ_RESOURCE_AUTO, 0 },
402+
{}
403+
},
404+
.bus_type = SMI_AUTO_DETECT,
405+
};
406+
398407
/*
399408
* Note new device-ids must also be added to ignore_serial_bus_ids in
400409
* drivers/acpi/scan.c: acpi_device_enumeration_by_parent().
401410
*/
402411
static const struct acpi_device_id smi_acpi_ids[] = {
412+
{ "AWDZ8399", (unsigned long)&aw88399_hda },
403413
{ "BSG1160", (unsigned long)&bsg1160_data },
404414
{ "BSG2150", (unsigned long)&bsg2150_data },
405415
{ "CSC3551", (unsigned long)&cs35l41_hda },

sound/hda/codecs/realtek/alc269.c

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2974,6 +2974,16 @@ static void cs35l41_fixup_i2c_four(struct hda_codec *cdc, const struct hda_fixup
29742974
comp_generic_fixup(cdc, action, "i2c", "CSC3551", "-%s:00-cs35l41-hda.%d", 4);
29752975
}
29762976

2977+
static void aw88399_fixup_i2c_two(struct hda_codec *cdc, const struct hda_fixup *fix, int action)
2978+
{
2979+
comp_generic_fixup(cdc, action, "i2c", "AWDZ8399", "-%s:00-aw88399-hda.%d", 2);
2980+
}
2981+
2982+
static void alc287_fixup_legion_16iax_aw88399(struct hda_codec *codec,
2983+
const struct hda_fixup *fix, int action)
2984+
{
2985+
}
2986+
29772987
static void cs35l41_fixup_spi_two(struct hda_codec *codec, const struct hda_fixup *fix, int action)
29782988
{
29792989
comp_generic_fixup(codec, action, "spi", "CSC3551", "-%s:00-cs35l41-hda.%d", 2);
@@ -3737,6 +3747,8 @@ enum {
37373747
ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC,
37383748
ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK,
37393749
ALC256_FIXUP_VAIO_RPL_MIC_NO_PRESENCE,
3750+
ALC287_FIXUP_AW88399_I2C_2,
3751+
ALC287_FIXUP_LENOVO_LEGION_AW88399,
37403752
};
37413753

37423754
/* A special fixup for Lenovo C940 and Yoga Duet 7;
@@ -6182,8 +6194,18 @@ static const struct hda_fixup alc269_fixups[] = {
61826194
{ }
61836195
},
61846196
.chained = true,
6185-
.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
6186-
}
6197+
.chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
6198+
},
6199+
[ALC287_FIXUP_AW88399_I2C_2] = {
6200+
.type = HDA_FIXUP_FUNC,
6201+
.v.func = aw88399_fixup_i2c_two,
6202+
},
6203+
[ALC287_FIXUP_LENOVO_LEGION_AW88399] = {
6204+
.type = HDA_FIXUP_FUNC,
6205+
.v.func = alc287_fixup_legion_16iax_aw88399,
6206+
.chained = true,
6207+
.chain_id = ALC287_FIXUP_AW88399_I2C_2,
6208+
},
61876209
};
61886210

61896211
static const struct hda_quirk alc269_fixup_tbl[] = {
@@ -7123,6 +7145,8 @@ static const struct hda_quirk alc269_fixup_tbl[] = {
71237145
SND_PCI_QUIRK(0x17aa, 0x38fa, "Thinkbook 16P Gen5", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD),
71247146
SND_PCI_QUIRK(0x17aa, 0x38fd, "ThinkBook plus Gen5 Hybrid", ALC287_FIXUP_TAS2781_I2C),
71257147
SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
7148+
SND_PCI_QUIRK(0x17aa, 0x3906, "Lenovo Legion Pro 7 16IAX10H", ALC287_FIXUP_LENOVO_LEGION_AW88399),
7149+
SND_PCI_QUIRK(0x17aa, 0x3907, "Lenovo Legion Pro 7 16IAX10H", ALC287_FIXUP_LENOVO_LEGION_AW88399),
71267150
SND_PCI_QUIRK(0x17aa, 0x390d, "Lenovo Yoga Pro 7 14ASP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN),
71277151
SND_PCI_QUIRK(0x17aa, 0x3913, "Lenovo 145", ALC236_FIXUP_LENOVO_INV_DMIC),
71287152
SND_PCI_QUIRK(0x17aa, 0x391f, "Yoga S990-16 pro Quad YC Quad", ALC287_FIXUP_TXNW2781_I2C),

sound/hda/codecs/side-codecs/Kconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,24 @@ config SND_HDA_SCODEC_TAS2781_SPI
141141

142142
comment "Set to Y if you want auto-loading the side codec driver"
143143
depends on SND_HDA=y && SND_HDA_SCODEC_TAS2781_SPI=m
144+
145+
config SND_HDA_SCODEC_AW88399
146+
tristate
147+
select SND_HDA_GENERIC
148+
149+
config SND_HDA_SCODEC_AW88399_I2C
150+
tristate "Build AW88399 HD-audio side codec support for I2C Bus"
151+
depends on I2C
152+
depends on ACPI
153+
depends on SND_SOC
154+
select SND_HDA_SCODEC_AW88399
155+
select SND_SOC_AW88399
156+
help
157+
Say Y or M here to include AW88399 I2C HD-audio side codec support
158+
in snd-hda-intel driver, such as ALC287.
159+
160+
This is for systems where the AW88399 smart amplifier is connected
161+
as a side codec to the HDA controller, rather than via SOF/SSP.
162+
163+
comment "Set to Y if you want auto-loading the side codec driver"
164+
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
@@ -13,6 +13,8 @@ snd-hda-scodec-component-y := hda_component.o
1313
snd-hda-scodec-tas2781-y := tas2781_hda.o
1414
snd-hda-scodec-tas2781-i2c-y := tas2781_hda_i2c.o
1515
snd-hda-scodec-tas2781-spi-y := tas2781_hda_spi.o
16+
snd-hda-scodec-aw88399-y := aw88399_hda.o
17+
snd-hda-scodec-aw88399-i2c-y := aw88399_hda_i2c.o
1618

1719
obj-$(CONFIG_SND_HDA_CIRRUS_SCODEC) += snd-hda-cirrus-scodec.o
1820
obj-$(CONFIG_SND_HDA_CIRRUS_SCODEC_KUNIT_TEST) += snd-hda-cirrus-scodec-test.o
@@ -26,3 +28,5 @@ obj-$(CONFIG_SND_HDA_SCODEC_COMPONENT) += snd-hda-scodec-component.o
2628
obj-$(CONFIG_SND_HDA_SCODEC_TAS2781) += snd-hda-scodec-tas2781.o
2729
obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_I2C) += snd-hda-scodec-tas2781-i2c.o
2830
obj-$(CONFIG_SND_HDA_SCODEC_TAS2781_SPI) += snd-hda-scodec-tas2781-spi.o
31+
obj-$(CONFIG_SND_HDA_SCODEC_AW88399) += snd-hda-scodec-aw88399.o
32+
obj-$(CONFIG_SND_HDA_SCODEC_AW88399_I2C) += snd-hda-scodec-aw88399-i2c.o

0 commit comments

Comments
 (0)