提交 4c54a4ec 编写于 作者: H huangwenhui 提交者: Zheng Zengkai

ALSA: hda/realtek - Add HW8326 support

stable inclusion
from stable-v5.10.124
commit d539feb6df5ef94b171f3497583b3dbc1512a347
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5L6E7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d539feb6df5ef94b171f3497583b3dbc1512a347

--------------------------------

[ Upstream commit 527f4643 ]

Added the support of new Huawei codec HW8326. The HW8326 is developed
by Huawei with Realtek's IP Core, and it's compatible with ALC256.
Signed-off-by: Nhuangwenhui <huangwenhuia@uniontech.com>
Link: https://lore.kernel.org/r/20220608082357.26898-1-huangwenhuia@uniontech.comSigned-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 4328ee79
...@@ -660,6 +660,7 @@ static const struct hda_vendor_id hda_vendor_ids[] = { ...@@ -660,6 +660,7 @@ static const struct hda_vendor_id hda_vendor_ids[] = {
{ 0x14f1, "Conexant" }, { 0x14f1, "Conexant" },
{ 0x17e8, "Chrontel" }, { 0x17e8, "Chrontel" },
{ 0x1854, "LG" }, { 0x1854, "LG" },
{ 0x19e5, "Huawei" },
{ 0x1aec, "Wolfson Microelectronics" }, { 0x1aec, "Wolfson Microelectronics" },
{ 0x1af4, "QEMU" }, { 0x1af4, "QEMU" },
{ 0x434d, "C-Media" }, { 0x434d, "C-Media" },
......
...@@ -439,6 +439,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec) ...@@ -439,6 +439,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
case 0x10ec0245: case 0x10ec0245:
case 0x10ec0255: case 0x10ec0255:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
case 0x10ec0257: case 0x10ec0257:
case 0x10ec0282: case 0x10ec0282:
case 0x10ec0283: case 0x10ec0283:
...@@ -576,6 +577,7 @@ static void alc_shutup_pins(struct hda_codec *codec) ...@@ -576,6 +577,7 @@ static void alc_shutup_pins(struct hda_codec *codec)
switch (codec->core.vendor_id) { switch (codec->core.vendor_id) {
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
case 0x10ec0283: case 0x10ec0283:
case 0x10ec0286: case 0x10ec0286:
case 0x10ec0288: case 0x10ec0288:
...@@ -3252,6 +3254,7 @@ static void alc_disable_headset_jack_key(struct hda_codec *codec) ...@@ -3252,6 +3254,7 @@ static void alc_disable_headset_jack_key(struct hda_codec *codec)
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_write_coef_idx(codec, 0x48, 0x0); alc_write_coef_idx(codec, 0x48, 0x0);
alc_update_coef_idx(codec, 0x49, 0x0045, 0x0); alc_update_coef_idx(codec, 0x49, 0x0045, 0x0);
break; break;
...@@ -3280,6 +3283,7 @@ static void alc_enable_headset_jack_key(struct hda_codec *codec) ...@@ -3280,6 +3283,7 @@ static void alc_enable_headset_jack_key(struct hda_codec *codec)
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_write_coef_idx(codec, 0x48, 0xd011); alc_write_coef_idx(codec, 0x48, 0xd011);
alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045); alc_update_coef_idx(codec, 0x49, 0x007f, 0x0045);
break; break;
...@@ -4849,6 +4853,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) ...@@ -4849,6 +4853,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec)
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_process_coef_fw(codec, coef0256); alc_process_coef_fw(codec, coef0256);
break; break;
case 0x10ec0234: case 0x10ec0234:
...@@ -4964,6 +4969,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, ...@@ -4964,6 +4969,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin,
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_write_coef_idx(codec, 0x45, 0xc489); alc_write_coef_idx(codec, 0x45, 0xc489);
snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); snd_hda_set_pin_ctl_cache(codec, hp_pin, 0);
alc_process_coef_fw(codec, coef0256); alc_process_coef_fw(codec, coef0256);
...@@ -5114,6 +5120,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) ...@@ -5114,6 +5120,7 @@ static void alc_headset_mode_default(struct hda_codec *codec)
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_write_coef_idx(codec, 0x1b, 0x0e4b); alc_write_coef_idx(codec, 0x1b, 0x0e4b);
alc_write_coef_idx(codec, 0x45, 0xc089); alc_write_coef_idx(codec, 0x45, 0xc089);
msleep(50); msleep(50);
...@@ -5213,6 +5220,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) ...@@ -5213,6 +5220,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec)
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_process_coef_fw(codec, coef0256); alc_process_coef_fw(codec, coef0256);
break; break;
case 0x10ec0234: case 0x10ec0234:
...@@ -5327,6 +5335,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) ...@@ -5327,6 +5335,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec)
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_process_coef_fw(codec, coef0256); alc_process_coef_fw(codec, coef0256);
break; break;
case 0x10ec0234: case 0x10ec0234:
...@@ -5428,6 +5437,7 @@ static void alc_determine_headset_type(struct hda_codec *codec) ...@@ -5428,6 +5437,7 @@ static void alc_determine_headset_type(struct hda_codec *codec)
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_write_coef_idx(codec, 0x1b, 0x0e4b); alc_write_coef_idx(codec, 0x1b, 0x0e4b);
alc_write_coef_idx(codec, 0x06, 0x6104); alc_write_coef_idx(codec, 0x06, 0x6104);
alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3); alc_write_coefex_idx(codec, 0x57, 0x3, 0x09a3);
...@@ -5722,6 +5732,7 @@ static void alc255_set_default_jack_type(struct hda_codec *codec) ...@@ -5722,6 +5732,7 @@ static void alc255_set_default_jack_type(struct hda_codec *codec)
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_process_coef_fw(codec, alc256fw); alc_process_coef_fw(codec, alc256fw);
break; break;
} }
...@@ -6325,6 +6336,7 @@ static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec) ...@@ -6325,6 +6336,7 @@ static void alc_combo_jack_hp_jd_restart(struct hda_codec *codec)
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0255: case 0x10ec0255:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */
alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15);
break; break;
...@@ -9813,6 +9825,7 @@ static int patch_alc269(struct hda_codec *codec) ...@@ -9813,6 +9825,7 @@ static int patch_alc269(struct hda_codec *codec)
case 0x10ec0230: case 0x10ec0230:
case 0x10ec0236: case 0x10ec0236:
case 0x10ec0256: case 0x10ec0256:
case 0x19e58326:
spec->codec_variant = ALC269_TYPE_ALC256; spec->codec_variant = ALC269_TYPE_ALC256;
spec->shutup = alc256_shutup; spec->shutup = alc256_shutup;
spec->init_hook = alc256_init; spec->init_hook = alc256_init;
...@@ -11255,6 +11268,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = { ...@@ -11255,6 +11268,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882), HDA_CODEC_ENTRY(0x10ec0b00, "ALCS1200A", patch_alc882),
HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882), HDA_CODEC_ENTRY(0x10ec1168, "ALC1220", patch_alc882),
HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882), HDA_CODEC_ENTRY(0x10ec1220, "ALC1220", patch_alc882),
HDA_CODEC_ENTRY(0x19e58326, "HW8326", patch_alc269),
{} /* terminator */ {} /* terminator */
}; };
MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek); MODULE_DEVICE_TABLE(hdaudio, snd_hda_id_realtek);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册