ALSA: hda: Add Loongson LS7A HD-Audio support
authorYanteng Si <siyanteng@loongson.cn>
Wed, 7 Jun 2023 09:21:49 +0000 (17:21 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 7 Jun 2023 10:36:38 +0000 (12:36 +0200)
Add the new PCI ID 0x0014 0x7a07 and the new PCI ID 0x0014 0x7a37
Loongson HDA controller.

Signed-off-by: Yanteng Si <siyanteng@loongson.cn>
Acked-by: Huacai Chen <chenhuacai@loongson.cn>
Link: https://lore.kernel.org/r/993587483b9509796b29a416f257fcfb4b15c6ea.1686128807.git.siyanteng@loongson.cn
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/linux/pci_ids.h
sound/hda/hdac_device.c
sound/pci/hda/hda_intel.c
sound/pci/hda/patch_hdmi.c

index 95f33da..c0c4ca8 100644 (file)
 
 #define PCI_VENDOR_ID_LOONGSON         0x0014
 
+#define PCI_DEVICE_ID_LOONGSON_HDA      0x7a07
+#define PCI_DEVICE_ID_LOONGSON_HDMI     0x7a37
+
 #define PCI_VENDOR_ID_TTTECH           0x0357
 #define PCI_DEVICE_ID_TTTECH_MC322     0x000a
 
index accc9d2..89bed32 100644 (file)
@@ -645,6 +645,7 @@ struct hda_vendor_id {
 };
 
 static const struct hda_vendor_id hda_vendor_ids[] = {
+       { 0x0014, "Loongson" },
        { 0x1002, "ATI" },
        { 0x1013, "Cirrus Logic" },
        { 0x1057, "Motorola" },
index 3226691..9c353dc 100644 (file)
@@ -237,6 +237,7 @@ enum {
        AZX_DRIVER_CTHDA,
        AZX_DRIVER_CMEDIA,
        AZX_DRIVER_ZHAOXIN,
+       AZX_DRIVER_LOONGSON,
        AZX_DRIVER_GENERIC,
        AZX_NUM_DRIVERS, /* keep this as last entry */
 };
@@ -360,6 +361,7 @@ static const char * const driver_short_names[] = {
        [AZX_DRIVER_CTHDA] = "HDA Creative",
        [AZX_DRIVER_CMEDIA] = "HDA C-Media",
        [AZX_DRIVER_ZHAOXIN] = "HDA Zhaoxin",
+       [AZX_DRIVER_LOONGSON] = "HDA Loongson",
        [AZX_DRIVER_GENERIC] = "HD-Audio Generic",
 };
 
@@ -2809,6 +2811,11 @@ static const struct pci_device_id azx_ids[] = {
          .driver_data = AZX_DRIVER_GENERIC | AZX_DCAPS_PRESET_ATI_HDMI },
        /* Zhaoxin */
        { PCI_DEVICE(0x1d17, 0x3288), .driver_data = AZX_DRIVER_ZHAOXIN },
+       /* Loongson HDAudio*/
+       {PCI_DEVICE(PCI_VENDOR_ID_LOONGSON, PCI_DEVICE_ID_LOONGSON_HDA),
+         .driver_data = AZX_DRIVER_LOONGSON },
+       {PCI_DEVICE(PCI_VENDOR_ID_LOONGSON, PCI_DEVICE_ID_LOONGSON_HDMI),
+         .driver_data = AZX_DRIVER_LOONGSON },
        { 0, }
 };
 MODULE_DEVICE_TABLE(pci, azx_ids);
index 64a9440..44b55ba 100644 (file)
@@ -4505,6 +4505,7 @@ static int patch_gf_hdmi(struct hda_codec *codec)
  * patch entries
  */
 static const struct hda_device_id snd_hda_id_hdmi[] = {
+HDA_CODEC_ENTRY(0x00147a47, "Loongson HDMI",   patch_generic_hdmi),
 HDA_CODEC_ENTRY(0x1002793c, "RS600 HDMI",      patch_atihdmi),
 HDA_CODEC_ENTRY(0x10027919, "RS600 HDMI",      patch_atihdmi),
 HDA_CODEC_ENTRY(0x1002791a, "RS690/780 HDMI",  patch_atihdmi),