Skip to content

Commit bc1c6dd

Browse files
jasontaosmb49
authored andcommitted
ALSA: hda: Glenfly: add HD Audio PCI IDs and HDMI Codec Vendor IDs.
BugLink: https://bugs.launchpad.net/bugs/2029401 [ Upstream commit c51e431 ] Add a set of HD Audio PCI IDS, and the HDMI codec vendor IDs for Glenfly Gpus. - In default_bdl_pos_adj, set bdl to 128 as Glenfly Gpus have hardware limitation, need to increase hdac interrupt interval. - In azx_first_init, enable polling mode for Glenfly Gpu. When the codec complete the command, it sends interrupt and writes response entries to memory, howerver, the write requests sometimes are not actually synchronized to memory when driver handle hdac interrupt on Glenfly Gpus. If the RIRB status is not updated in the interrupt handler, azx_rirb_get_response keeps trying to recevie a response from rirb until 1s timeout. Enabling polling mode for Glenfly Gpu can fix the issue. - In patch_gf_hdmi, set Glenlfy Gpu Codec's no_sticky_stream as it need driver to do actual clean-ups for the linked codec when switch from one codec to another. Signed-off-by: jasontao <[email protected]> Signed-off-by: Reaper Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent bcf7df1 commit bc1c6dd

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

sound/pci/hda/hda_intel.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ enum {
230230
AZX_DRIVER_ATI,
231231
AZX_DRIVER_ATIHDMI,
232232
AZX_DRIVER_ATIHDMI_NS,
233+
AZX_DRIVER_GFHDMI,
233234
AZX_DRIVER_VIA,
234235
AZX_DRIVER_SIS,
235236
AZX_DRIVER_ULI,
@@ -352,6 +353,7 @@ static const char * const driver_short_names[] = {
352353
[AZX_DRIVER_ATI] = "HDA ATI SB",
353354
[AZX_DRIVER_ATIHDMI] = "HDA ATI HDMI",
354355
[AZX_DRIVER_ATIHDMI_NS] = "HDA ATI HDMI",
356+
[AZX_DRIVER_GFHDMI] = "HDA GF HDMI",
355357
[AZX_DRIVER_VIA] = "HDA VIA VT82xx",
356358
[AZX_DRIVER_SIS] = "HDA SIS966",
357359
[AZX_DRIVER_ULI] = "HDA ULI M5461",
@@ -1742,6 +1744,12 @@ static int default_bdl_pos_adj(struct azx *chip)
17421744
}
17431745

17441746
switch (chip->driver_type) {
1747+
/*
1748+
* increase the bdl size for Glenfly Gpus for hardware
1749+
* limitation on hdac interrupt interval
1750+
*/
1751+
case AZX_DRIVER_GFHDMI:
1752+
return 128;
17451753
case AZX_DRIVER_ICH:
17461754
case AZX_DRIVER_PCH:
17471755
return 1;
@@ -1857,6 +1865,12 @@ static int azx_first_init(struct azx *chip)
18571865
pci_write_config_dword(pci, PCI_BASE_ADDRESS_1, 0);
18581866
}
18591867
#endif
1868+
/*
1869+
* Fix response write request not synced to memory when handle
1870+
* hdac interrupt on Glenfly Gpus
1871+
*/
1872+
if (chip->driver_type == AZX_DRIVER_GFHDMI)
1873+
bus->polling_mode = 1;
18601874

18611875
err = pcim_iomap_regions(pci, 1 << 0, "ICH HD audio");
18621876
if (err < 0)
@@ -1957,6 +1971,7 @@ static int azx_first_init(struct azx *chip)
19571971
chip->playback_streams = ATIHDMI_NUM_PLAYBACK;
19581972
chip->capture_streams = ATIHDMI_NUM_CAPTURE;
19591973
break;
1974+
case AZX_DRIVER_GFHDMI:
19601975
case AZX_DRIVER_GENERIC:
19611976
default:
19621977
chip->playback_streams = ICH6_NUM_PLAYBACK;
@@ -2705,6 +2720,12 @@ static const struct pci_device_id azx_ids[] = {
27052720
{ PCI_DEVICE(0x1002, 0xab38),
27062721
.driver_data = AZX_DRIVER_ATIHDMI_NS | AZX_DCAPS_PRESET_ATI_HDMI_NS |
27072722
AZX_DCAPS_PM_RUNTIME },
2723+
/* GLENFLY */
2724+
{ PCI_DEVICE(0x6766, PCI_ANY_ID),
2725+
.class = PCI_CLASS_MULTIMEDIA_HD_AUDIO << 8,
2726+
.class_mask = 0xffffff,
2727+
.driver_data = AZX_DRIVER_GFHDMI | AZX_DCAPS_POSFIX_LPIB |
2728+
AZX_DCAPS_NO_MSI | AZX_DCAPS_NO_64BIT },
27082729
/* VIA VT8251/VT8237A */
27092730
{ PCI_DEVICE(0x1106, 0x3288), .driver_data = AZX_DRIVER_VIA },
27102731
/* VIA GFX VT7122/VX900 */

sound/pci/hda/patch_hdmi.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4298,6 +4298,22 @@ static int patch_via_hdmi(struct hda_codec *codec)
42984298
return patch_simple_hdmi(codec, VIAHDMI_CVT_NID, VIAHDMI_PIN_NID);
42994299
}
43004300

4301+
static int patch_gf_hdmi(struct hda_codec *codec)
4302+
{
4303+
int err;
4304+
4305+
err = patch_generic_hdmi(codec);
4306+
if (err)
4307+
return err;
4308+
4309+
/*
4310+
* Glenfly GPUs have two codecs, stream switches from one codec to
4311+
* another, need to do actual clean-ups in codec_cleanup_stream
4312+
*/
4313+
codec->no_sticky_stream = 1;
4314+
return 0;
4315+
}
4316+
43014317
/*
43024318
* patch entries
43034319
*/
@@ -4392,6 +4408,12 @@ HDA_CODEC_ENTRY(0x10de00a6, "GPU a6 HDMI/DP", patch_nvhdmi),
43924408
HDA_CODEC_ENTRY(0x10de00a7, "GPU a7 HDMI/DP", patch_nvhdmi),
43934409
HDA_CODEC_ENTRY(0x10de8001, "MCP73 HDMI", patch_nvhdmi_2ch),
43944410
HDA_CODEC_ENTRY(0x10de8067, "MCP67/68 HDMI", patch_nvhdmi_2ch),
4411+
HDA_CODEC_ENTRY(0x67663d82, "Arise 82 HDMI/DP", patch_gf_hdmi),
4412+
HDA_CODEC_ENTRY(0x67663d83, "Arise 83 HDMI/DP", patch_gf_hdmi),
4413+
HDA_CODEC_ENTRY(0x67663d84, "Arise 84 HDMI/DP", patch_gf_hdmi),
4414+
HDA_CODEC_ENTRY(0x67663d85, "Arise 85 HDMI/DP", patch_gf_hdmi),
4415+
HDA_CODEC_ENTRY(0x67663d86, "Arise 86 HDMI/DP", patch_gf_hdmi),
4416+
HDA_CODEC_ENTRY(0x67663d87, "Arise 87 HDMI/DP", patch_gf_hdmi),
43954417
HDA_CODEC_ENTRY(0x11069f80, "VX900 HDMI/DP", patch_via_hdmi),
43964418
HDA_CODEC_ENTRY(0x11069f81, "VX900 HDMI/DP", patch_via_hdmi),
43974419
HDA_CODEC_ENTRY(0x11069f84, "VX11 HDMI/DP", patch_generic_hdmi),

0 commit comments

Comments
 (0)