/*
 * File: HdaModels.h
 *
 * Copyright (c) 2018 John Davis
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

// From the VoodooHDA project (https://sourceforge.net/p/voodoohda),
// ALSA (Linux kernel), and vendor datasheets.

#ifndef _EFI_HDA_MODELS_H_
#define _EFI_HDA_MODELS_H_

#include <Uefi.h>

// Generic names.
#define HDA_CONTROLLER_MODEL_GENERIC    L"HD Audio Controller"
#define HDA_CODEC_MODEL_GENERIC    L"Unknown Codec"

// Vendor IDs.
#define VEN_AMD_ID              0x1002
#define VEN_ANALOGDEVICES_ID    0x11D4
#define VEN_CIRRUSLOGIC_ID      0x1013
#define VEN_CONEXANT_ID         0x14F1
#define VEN_CREATIVE_ID         0x1102
#define VEN_IDT_ID              0x111D
#define VEN_INTEL_ID            0x8086
#define VEN_NVIDIA_ID           0x10DE
#define VEN_QEMU_ID             0x1AF4
#define VEN_REALTEK_ID          0x10EC
#define VEN_SIGMATEL_ID         0x8384
#define VEN_VIA_ID              0x1106
#define VEN_INVALID_ID          0xFFFF

//
// Controller models.
//
#define HDA_CONTROLLER_CONSTRUCT(vendor, id) (((UINT32) (id) << 16) | ((VEN_##vendor##_ID) & 0xFFFF))

// AMD.
#define HDA_CONTROLLER_AMDXXXX    HDA_CONTROLLER_CONSTRUCT(AMD, 0xFFFF)

// Intel.
#define HDA_CONTROLLER_ICH6         HDA_CONTROLLER_CONSTRUCT(INTEL, 0x2668)
#define HDA_CONTROLLER_63XXESB      HDA_CONTROLLER_CONSTRUCT(INTEL, 0x269A)
#define HDA_CONTROLLER_ICH7         HDA_CONTROLLER_CONSTRUCT(INTEL, 0x27D8)
#define HDA_CONTROLLER_ICH8         HDA_CONTROLLER_CONSTRUCT(INTEL, 0x284B)
#define HDA_CONTROLLER_ICH9         HDA_CONTROLLER_CONSTRUCT(INTEL, 0x293E)
#define HDA_CONTROLLER_ICH10_1      HDA_CONTROLLER_CONSTRUCT(INTEL, 0x3A3E)
#define HDA_CONTROLLER_ICH10_2      HDA_CONTROLLER_CONSTRUCT(INTEL, 0x3A6E)
#define HDA_CONTROLLER_5SERIES_1    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x3B56)
#define HDA_CONTROLLER_5SERIES_2    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x3B57)
#define HDA_CONTROLLER_6SERIES      HDA_CONTROLLER_CONSTRUCT(INTEL, 0x1C20)
#define HDA_CONTROLLER_X79          HDA_CONTROLLER_CONSTRUCT(INTEL, 0x1D20)
#define HDA_CONTROLLER_7SERIES      HDA_CONTROLLER_CONSTRUCT(INTEL, 0x1E20)
#define HDA_CONTROLLER_8SERIES_1    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x8C20)
#define HDA_CONTROLLER_8SERIES_2    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x8C21)
#define HDA_CONTROLLER_8SERIES_3    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x9C20)
#define HDA_CONTROLLER_8SERIES_4    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x9C21)
#define HDA_CONTROLLER_9SERIES_1    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x8CA0)
#define HDA_CONTROLLER_9SERIES_2    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x9CA0)
#define HDA_CONTROLLER_X99_1        HDA_CONTROLLER_CONSTRUCT(INTEL, 0x8D20)
#define HDA_CONTROLLER_X99_2        HDA_CONTROLLER_CONSTRUCT(INTEL, 0x8D21)
#define HDA_CONTROLLER_100SERIES    HDA_CONTROLLER_CONSTRUCT(INTEL, 0xA170)
#define HDA_CONTROLLER_200SERIES    HDA_CONTROLLER_CONSTRUCT(INTEL, 0xA2F0)
#define HDA_CONTROLLER_300SERIES    HDA_CONTROLLER_CONSTRUCT(INTEL, 0xA348)
#define HDA_CONTROLLER_HASWELL_1    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x0A0C)
#define HDA_CONTROLLER_HASWELL_2    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x0C0C)
#define HDA_CONTROLLER_CRYSTALWELL  HDA_CONTROLLER_CONSTRUCT(INTEL, 0x0D0C)
#define HDA_CONTROLLER_BROADWELL    HDA_CONTROLLER_CONSTRUCT(INTEL, 0x160C)
#define HDA_CONTROLLER_INTELXXXX    HDA_CONTROLLER_CONSTRUCT(INTEL, 0xFFFF)

// NVIDIA.
#define HDA_CONTROLLER_MCP51        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x026C)
#define HDA_CONTROLLER_MCP55        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0371)
#define HDA_CONTROLLER_MCP61_1      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x03E4)
#define HDA_CONTROLLER_MCP61_2      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x03F0)
#define HDA_CONTROLLER_MCP65_1      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x044A)
#define HDA_CONTROLLER_MCP65_2      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x044B)
#define HDA_CONTROLLER_MCP67_1      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x055C)
#define HDA_CONTROLLER_MCP67_2      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x055D)
#define HDA_CONTROLLER_MCP72        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0774)
#define HDA_CONTROLLER_MCP73        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x07FC)
#define HDA_CONTROLLER_MCP79_1      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0AC0)
#define HDA_CONTROLLER_MCP79_2      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0AC1)
#define HDA_CONTROLLER_MCP79_3      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0AC2)
#define HDA_CONTROLLER_MCP79_4      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0AC3)
#define HDA_CONTROLLER_MCP89        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0D94)
#define HDA_CONTROLLER_GT216        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0BE2)
#define HDA_CONTROLLER_GF100        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0BE5)
#define HDA_CONTROLLER_GF106        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0BE9)
#define HDA_CONTROLLER_GF108        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0BEA)
#define HDA_CONTROLLER_GF104        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0BEB)
#define HDA_CONTROLLER_GF116        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0BEE)
#define HDA_CONTROLLER_GF119        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0E08)
#define HDA_CONTROLLER_GF110        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0E09)
#define HDA_CONTROLLER_GK104        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0E0A)
#define HDA_CONTROLLER_GK106        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0E0B)
#define HDA_CONTROLLER_GF114        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0E0C)
#define HDA_CONTROLLER_GK208        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0E0F)
#define HDA_CONTROLLER_GK110        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0E1A)
#define HDA_CONTROLLER_GK107        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0E1B)
#define HDA_CONTROLLER_GM200        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0FB0)
#define HDA_CONTROLLER_GP108        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0FB8)
#define HDA_CONTROLLER_GP107GL      HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0FB9)
#define HDA_CONTROLLER_GM206        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0FBA)
#define HDA_CONTROLLER_GM204        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x0FBB)
#define HDA_CONTROLLER_GP102        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x10EF)
#define HDA_CONTROLLER_GP104        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x10F0)
#define HDA_CONTROLLER_GP106        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x10F1)
#define HDA_CONTROLLER_TU102        HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0x10F7)
#define HDA_CONTROLLER_NVIDIAXXXX   HDA_CONTROLLER_CONSTRUCT(NVIDIA, 0xFFFF)

//
// Codec models.
//
#define HDA_CODEC_CONSTRUCT(vendor, id) (((UINT32) (VEN_##vendor##_ID) << 16) | ((id) & 0xFFFF))

// AMD.
#define HDA_CODEC_AMDXXXX           HDA_CODEC_CONSTRUCT(AMD, 0xFFFF)

// Analog Devices.
#define HDA_CODEC_AD1884A           HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x184A)
#define HDA_CODEC_AD1882            HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1882)
#define HDA_CODEC_AD1883            HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1883)
#define HDA_CODEC_AD1884            HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1884)
#define HDA_CODEC_AD1984A           HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x194A)
#define HDA_CODEC_AD1984B           HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x194B)
#define HDA_CODEC_AD1981HD          HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1981)
#define HDA_CODEC_AD1983            HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1983)
#define HDA_CODEC_AD1984            HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1984)
#define HDA_CODEC_AD1986A           HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1986)
#define HDA_CODEC_AD1987            HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1987)
#define HDA_CODEC_AD1988            HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x1988)
#define HDA_CODEC_AD1988B           HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x198B)
#define HDA_CODEC_AD1882A           HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x882A)
#define HDA_CODEC_AD1989A           HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x989A)
#define HDA_CODEC_AD1989B           HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x989B)
#define HDA_CODEC_ADXXXX            HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0xFFFF)

// Cirrus Logic.
#define HDA_CODEC_CS4206            HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4206)
#define HDA_CODEC_CS4207            HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4207)
#define HDA_CODEC_CS4210            HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0x4210)
#define HDA_CODEC_CSXXXX            HDA_CODEC_CONSTRUCT(CIRRUSLOGIC, 0xFFFF)

// Conexant.
#define HDA_CODEC_CX20549           HDA_CODEC_CONSTRUCT(CONEXANT, 0x5045)
#define HDA_CODEC_CX20551           HDA_CODEC_CONSTRUCT(CONEXANT, 0x5047)
#define HDA_CODEC_CX20561           HDA_CODEC_CONSTRUCT(CONEXANT, 0x5051)
#define HDA_CODEC_CX20582           HDA_CODEC_CONSTRUCT(CONEXANT, 0x5066)
#define HDA_CODEC_CX20583           HDA_CODEC_CONSTRUCT(CONEXANT, 0x5067)
#define HDA_CODEC_CX20584           HDA_CODEC_CONSTRUCT(CONEXANT, 0x5068)
#define HDA_CODEC_CX20585           HDA_CODEC_CONSTRUCT(CONEXANT, 0x5069)
#define HDA_CODEC_CX20588           HDA_CODEC_CONSTRUCT(CONEXANT, 0x506C)
#define HDA_CODEC_CX20590           HDA_CODEC_CONSTRUCT(CONEXANT, 0x506E)
#define HDA_CODEC_CX20631           HDA_CODEC_CONSTRUCT(CONEXANT, 0x5097)
#define HDA_CODEC_CX20632           HDA_CODEC_CONSTRUCT(CONEXANT, 0x5098)
#define HDA_CODEC_CX20641           HDA_CODEC_CONSTRUCT(CONEXANT, 0x50A1)
#define HDA_CODEC_CX20642           HDA_CODEC_CONSTRUCT(CONEXANT, 0x50A2)
#define HDA_CODEC_CX20651           HDA_CODEC_CONSTRUCT(CONEXANT, 0x50AB)
#define HDA_CODEC_CX20652           HDA_CODEC_CONSTRUCT(CONEXANT, 0x50AC)
#define HDA_CODEC_CX20664           HDA_CODEC_CONSTRUCT(CONEXANT, 0x50B8)
#define HDA_CODEC_CX20665           HDA_CODEC_CONSTRUCT(CONEXANT, 0x50B9)
#define HDA_CODEC_CXXXXX            HDA_CODEC_CONSTRUCT(CONEXANT, 0xFFFF)

// Creative.
#define HDA_CODEC_CA0110            HDA_CODEC_CONSTRUCT(CREATIVE, 0x000A)
#define HDA_CODEC_CA0110_2          HDA_CODEC_CONSTRUCT(CREATIVE, 0x000B)
#define HDA_CODEC_SB0880            HDA_CODEC_CONSTRUCT(CREATIVE, 0x000D)
#define HDA_CODEC_CA0132            HDA_CODEC_CONSTRUCT(CREATIVE, 0x0011)
#define HDA_CODEC_CAXXXX            HDA_CODEC_CONSTRUCT(CREATIVE, 0xFFFF)

// IDT.
#define HDA_CODEC_IDT92HD75BX       HDA_CODEC_CONSTRUCT(IDT, 0x7603)
#define HDA_CODEC_IDT92HD83C1X      HDA_CODEC_CONSTRUCT(IDT, 0x7604)
#define HDA_CODEC_IDT92HD81B1X      HDA_CODEC_CONSTRUCT(IDT, 0x7605)
#define HDA_CODEC_IDT92HD75B3       HDA_CODEC_CONSTRUCT(IDT, 0x7608)
#define HDA_CODEC_IDT92HD73D1       HDA_CODEC_CONSTRUCT(IDT, 0x7674)
#define HDA_CODEC_IDT92HD73C1       HDA_CODEC_CONSTRUCT(IDT, 0x7675)
#define HDA_CODEC_IDT92HD73E1       HDA_CODEC_CONSTRUCT(IDT, 0x7676)
#define HDA_CODEC_IDTID7695         HDA_CODEC_CONSTRUCT(IDT, 0x7695)
#define HDA_CODEC_IDT92HD71B8       HDA_CODEC_CONSTRUCT(IDT, 0x76B0)
#define HDA_CODEC_IDT92HD71B8_2     HDA_CODEC_CONSTRUCT(IDT, 0x76B1)
#define HDA_CODEC_IDT92HD71B7       HDA_CODEC_CONSTRUCT(IDT, 0x76B2)
#define HDA_CODEC_IDT92HD71B7_2     HDA_CODEC_CONSTRUCT(IDT, 0x76B3)
#define HDA_CODEC_IDT92HD71B6       HDA_CODEC_CONSTRUCT(IDT, 0x76B4)
#define HDA_CODEC_IDT92HD71B6_2     HDA_CODEC_CONSTRUCT(IDT, 0x76B5)
#define HDA_CODEC_IDT92HD71B5       HDA_CODEC_CONSTRUCT(IDT, 0x76B6)
#define HDA_CODEC_IDT92HD71B5_2     HDA_CODEC_CONSTRUCT(IDT, 0x76B7)
#define HDA_CODEC_IDT92HD89C3       HDA_CODEC_CONSTRUCT(IDT, 0x76C0)
#define HDA_CODEC_IDT92HD89C2       HDA_CODEC_CONSTRUCT(IDT, 0x76C1)
#define HDA_CODEC_IDT92HD89C1       HDA_CODEC_CONSTRUCT(IDT, 0x76C2)
#define HDA_CODEC_IDT92HD89B3       HDA_CODEC_CONSTRUCT(IDT, 0x76C3)
#define HDA_CODEC_IDT92HD89B2       HDA_CODEC_CONSTRUCT(IDT, 0x76C4)
#define HDA_CODEC_IDT92HD89B1       HDA_CODEC_CONSTRUCT(IDT, 0x76C5)
#define HDA_CODEC_IDT92HD89E3       HDA_CODEC_CONSTRUCT(IDT, 0x76C6)
#define HDA_CODEC_IDT92HD89E2       HDA_CODEC_CONSTRUCT(IDT, 0x76C7)
#define HDA_CODEC_IDT92HD89E1       HDA_CODEC_CONSTRUCT(IDT, 0x76C8)
#define HDA_CODEC_IDT92HD89D3       HDA_CODEC_CONSTRUCT(IDT, 0x76C9)
#define HDA_CODEC_IDT92HD89D2       HDA_CODEC_CONSTRUCT(IDT, 0x76CA)
#define HDA_CODEC_IDT92HD89D1       HDA_CODEC_CONSTRUCT(IDT, 0x76CB)
#define HDA_CODEC_IDT92HD89F3       HDA_CODEC_CONSTRUCT(IDT, 0x76CC)
#define HDA_CODEC_IDT92HD89F2       HDA_CODEC_CONSTRUCT(IDT, 0x76CD)
#define HDA_CODEC_IDT92HD89F1       HDA_CODEC_CONSTRUCT(IDT, 0x76CE)
#define HDA_CODEC_IDT92HD87B1_3     HDA_CODEC_CONSTRUCT(IDT, 0x76D1)
#define HDA_CODEC_IDT92HD83C1C      HDA_CODEC_CONSTRUCT(IDT, 0x76D4)
#define HDA_CODEC_IDT92HD81B1C      HDA_CODEC_CONSTRUCT(IDT, 0x76D5)
#define HDA_CODEC_IDT92HD87B2_4     HDA_CODEC_CONSTRUCT(IDT, 0x76D9)
#define HDA_CODEC_IDT92HD93BXX      HDA_CODEC_CONSTRUCT(IDT, 0x76Df)
#define HDA_CODEC_IDT92HD91BXX      HDA_CODEC_CONSTRUCT(IDT, 0x76E0)
#define HDA_CODEC_IDT92HD98BXX      HDA_CODEC_CONSTRUCT(IDT, 0x76E3)
#define HDA_CODEC_IDT92HD99BXX      HDA_CODEC_CONSTRUCT(IDT, 0x76E5)
#define HDA_CODEC_IDT92HD90BXX      HDA_CODEC_CONSTRUCT(IDT, 0x76E7)
#define HDA_CODEC_IDT92HD66B1X5     HDA_CODEC_CONSTRUCT(IDT, 0x76E8)
#define HDA_CODEC_IDT92HD66B2X5     HDA_CODEC_CONSTRUCT(IDT, 0x76E9)
#define HDA_CODEC_IDT92HD66B3X5     HDA_CODEC_CONSTRUCT(IDT, 0x76EA)
#define HDA_CODEC_IDT92HD66C1X5     HDA_CODEC_CONSTRUCT(IDT, 0x76EB)
#define HDA_CODEC_IDT92HD66C2X5     HDA_CODEC_CONSTRUCT(IDT, 0x76EC)
#define HDA_CODEC_IDT92HD66C3X5     HDA_CODEC_CONSTRUCT(IDT, 0x76ED)
#define HDA_CODEC_IDT92HD66B1X3     HDA_CODEC_CONSTRUCT(IDT, 0x76EE)
#define HDA_CODEC_IDT92HD66B2X3     HDA_CODEC_CONSTRUCT(IDT, 0x76EF)
#define HDA_CODEC_IDT92HD66B3X3     HDA_CODEC_CONSTRUCT(IDT, 0x76F0)
#define HDA_CODEC_IDT92HD66C1X3     HDA_CODEC_CONSTRUCT(IDT, 0x76F1)
#define HDA_CODEC_IDT92HD66C2X3     HDA_CODEC_CONSTRUCT(IDT, 0x76F2)
#define HDA_CODEC_IDT92HD66C3_65    HDA_CODEC_CONSTRUCT(IDT, 0x76F3)
#define HDA_CODEC_IDTXXXX           HDA_CODEC_CONSTRUCT(IDT, 0xFFFF)

// Intel.
#define HDA_CODEC_INTELCRESTLINE    HDA_CODEC_CONSTRUCT(INTEL, 0x29FB)
#define HDA_CODEC_INTELBEARLAKE     HDA_CODEC_CONSTRUCT(INTEL, 0x2801)
#define HDA_CODEC_INTELCANTIGA      HDA_CODEC_CONSTRUCT(INTEL, 0x2802)
#define HDA_CODEC_INTELEAGLELAKE    HDA_CODEC_CONSTRUCT(INTEL, 0x2803)
#define HDA_CODEC_INTELIBEXPEAK     HDA_CODEC_CONSTRUCT(INTEL, 0x2804)
#define HDA_CODEC_INTELIBEXPEAK2    HDA_CODEC_CONSTRUCT(INTEL, 0x0054)
#define HDA_CODEC_INTELCOUGARPOINT  HDA_CODEC_CONSTRUCT(INTEL, 0x2805)
#define HDA_CODEC_INTELPANTHERPOINT HDA_CODEC_CONSTRUCT(INTEL, 0x2806)
#define HDA_CODEC_INTELHASWELL      HDA_CODEC_CONSTRUCT(INTEL, 0x2807)
#define HDA_CODEC_INTELBROADWELL    HDA_CODEC_CONSTRUCT(INTEL, 0x2808)
#define HDA_CODEC_INTELSKYLAKE      HDA_CODEC_CONSTRUCT(INTEL, 0x2809)
#define HDA_CODEC_INTELBROXTON      HDA_CODEC_CONSTRUCT(INTEL, 0x280A)
#define HDA_CODEC_INTELKABYLAKE     HDA_CODEC_CONSTRUCT(INTEL, 0x280B)
#define HDA_CODEC_INTELCANNONLAKE   HDA_CODEC_CONSTRUCT(INTEL, 0x280C)
#define HDA_CODEC_INTELGEMINILAKE   HDA_CODEC_CONSTRUCT(INTEL, 0x280D)
#define HDA_CODEC_INTELGEMINILAKE2  HDA_CODEC_CONSTRUCT(INTEL, 0x2800)
#define HDA_CODEC_INTELXXXX         HDA_CODEC_CONSTRUCT(INTEL, 0xFFFF)

// NVIDIA.
#define HDA_CODEC_NVIDIAXXXX        HDA_CODEC_CONSTRUCT(NVIDIA, 0xFFFF)

// Realtek.
#define HDA_CODEC_ALC221            HDA_CODEC_CONSTRUCT(REALTEK, 0x0221)
#define HDA_CODEC_ALC225            HDA_CODEC_CONSTRUCT(REALTEK, 0x0225)
#define HDA_CODEC_ALC230            HDA_CODEC_CONSTRUCT(REALTEK, 0x0230)
#define HDA_CODEC_ALC233            HDA_CODEC_CONSTRUCT(REALTEK, 0x0233)
#define HDA_CODEC_ALC235            HDA_CODEC_CONSTRUCT(REALTEK, 0x0235)
#define HDA_CODEC_ALC236            HDA_CODEC_CONSTRUCT(REALTEK, 0x0236)
#define HDA_CODEC_ALC255            HDA_CODEC_CONSTRUCT(REALTEK, 0x0255)
#define HDA_CODEC_ALC256            HDA_CODEC_CONSTRUCT(REALTEK, 0x0256)
#define HDA_CODEC_ALC257            HDA_CODEC_CONSTRUCT(REALTEK, 0x0257)
#define HDA_CODEC_ALC260            HDA_CODEC_CONSTRUCT(REALTEK, 0x0260)
#define HDA_CODEC_ALC262            HDA_CODEC_CONSTRUCT(REALTEK, 0x0262)
#define HDA_CODEC_ALC267            HDA_CODEC_CONSTRUCT(REALTEK, 0x0267)
#define HDA_CODEC_ALC268            HDA_CODEC_CONSTRUCT(REALTEK, 0x0268)
#define HDA_CODEC_ALC269            HDA_CODEC_CONSTRUCT(REALTEK, 0x0269)
#define HDA_CODEC_ALC270            HDA_CODEC_CONSTRUCT(REALTEK, 0x0270)
#define HDA_CODEC_ALC272            HDA_CODEC_CONSTRUCT(REALTEK, 0x0272)
#define HDA_CODEC_ALC273            HDA_CODEC_CONSTRUCT(REALTEK, 0x0273)
#define HDA_CODEC_ALC275            HDA_CODEC_CONSTRUCT(REALTEK, 0x0275)
#define HDA_CODEC_ALC276            HDA_CODEC_CONSTRUCT(REALTEK, 0x0276)
#define HDA_CODEC_ALC280            HDA_CODEC_CONSTRUCT(REALTEK, 0x0280)
#define HDA_CODEC_ALC282            HDA_CODEC_CONSTRUCT(REALTEK, 0x0282)
#define HDA_CODEC_ALC283            HDA_CODEC_CONSTRUCT(REALTEK, 0x0283)
#define HDA_CODEC_ALC284            HDA_CODEC_CONSTRUCT(REALTEK, 0x0284)
#define HDA_CODEC_ALC285            HDA_CODEC_CONSTRUCT(REALTEK, 0x0285)
#define HDA_CODEC_ALC286            HDA_CODEC_CONSTRUCT(REALTEK, 0x0286)
#define HDA_CODEC_ALC288            HDA_CODEC_CONSTRUCT(REALTEK, 0x0288)
#define HDA_CODEC_ALC289            HDA_CODEC_CONSTRUCT(REALTEK, 0x0289)
#define HDA_CODEC_ALC290            HDA_CODEC_CONSTRUCT(REALTEK, 0x0290)
#define HDA_CODEC_ALC292            HDA_CODEC_CONSTRUCT(REALTEK, 0x0292)
#define HDA_CODEC_ALC293            HDA_CODEC_CONSTRUCT(REALTEK, 0x0293)
#define HDA_CODEC_ALC294            HDA_CODEC_CONSTRUCT(REALTEK, 0x0294)
#define HDA_CODEC_ALC295            HDA_CODEC_CONSTRUCT(REALTEK, 0x0295)
#define HDA_CODEC_ALC298            HDA_CODEC_CONSTRUCT(REALTEK, 0x0298)
#define HDA_CODEC_ALC660            HDA_CODEC_CONSTRUCT(REALTEK, 0x0660)
#define HDA_CODEC_ALC662            HDA_CODEC_CONSTRUCT(REALTEK, 0x0662)
#define HDA_CODEC_ALC663            HDA_CODEC_CONSTRUCT(REALTEK, 0x0663)
#define HDA_CODEC_ALC665            HDA_CODEC_CONSTRUCT(REALTEK, 0x0665)
#define HDA_CODEC_ALC668            HDA_CODEC_CONSTRUCT(REALTEK, 0x0668)
#define HDA_CODEC_ALC670            HDA_CODEC_CONSTRUCT(REALTEK, 0x0670)
#define HDA_CODEC_ALC671            HDA_CODEC_CONSTRUCT(REALTEK, 0x0671)
#define HDA_CODEC_ALC680            HDA_CODEC_CONSTRUCT(REALTEK, 0x0680)
#define HDA_CODEC_ALC861            HDA_CODEC_CONSTRUCT(REALTEK, 0x0861)
#define HDA_CODEC_ALC861VD          HDA_CODEC_CONSTRUCT(REALTEK, 0x0862)
#define HDA_CODEC_ALC880            HDA_CODEC_CONSTRUCT(REALTEK, 0x0880)
#define HDA_CODEC_ALC882            HDA_CODEC_CONSTRUCT(REALTEK, 0x0882)
#define HDA_CODEC_ALC883            HDA_CODEC_CONSTRUCT(REALTEK, 0x0883)
#define HDA_CODEC_ALC885            HDA_CODEC_CONSTRUCT(REALTEK, 0x0885)
#define HDA_CODEC_ALC887            HDA_CODEC_CONSTRUCT(REALTEK, 0x0887)
#define HDA_CODEC_ALC888            HDA_CODEC_CONSTRUCT(REALTEK, 0x0888)
#define HDA_CODEC_ALC889            HDA_CODEC_CONSTRUCT(REALTEK, 0x0889)
#define HDA_CODEC_ALC892            HDA_CODEC_CONSTRUCT(REALTEK, 0x0892)
#define HDA_CODEC_ALC898            HDA_CODEC_CONSTRUCT(REALTEK, 0x0898)
#define HDA_CODEC_ALC899            HDA_CODEC_CONSTRUCT(REALTEK, 0x0899)
#define HDA_CODEC_ALC1150           HDA_CODEC_CONSTRUCT(REALTEK, 0x0900)
#define HDA_CODEC_ALC1220           HDA_CODEC_CONSTRUCT(REALTEK, 0x1168)
#define HDA_CODEC_ALCXXXX           HDA_CODEC_CONSTRUCT(REALTEK, 0xFFFF)

// Sigmatel.
#define HDA_CODEC_STAC9230X         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7612)
#define HDA_CODEC_STAC9230D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7613)
#define HDA_CODEC_STAC9229X         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7614)
#define HDA_CODEC_STAC9229D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7615)
#define HDA_CODEC_STAC9228X         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7616)
#define HDA_CODEC_STAC9228D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7617)
#define HDA_CODEC_STAC9227X         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7618)
#define HDA_CODEC_STAC9227D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7619)
#define HDA_CODEC_STAC9274          HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7620)
#define HDA_CODEC_STAC9274D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7621)
#define HDA_CODEC_STAC9273X         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7622)
#define HDA_CODEC_STAC9273D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7623)
#define HDA_CODEC_STAC9272X         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7624)
#define HDA_CODEC_STAC9272D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7625)
#define HDA_CODEC_STAC9271X         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7626)
#define HDA_CODEC_STAC9271D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7627)
#define HDA_CODEC_STAC9274X5NH      HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7628)
#define HDA_CODEC_STAC9274D5NH      HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7629)
#define HDA_CODEC_STAC9250          HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7634)
#define HDA_CODEC_STAC9251          HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7636)
#define HDA_CODEC_IDT92HD700X       HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7638)
#define HDA_CODEC_IDT92HD700D       HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7639)
#define HDA_CODEC_IDT92HD206X       HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7645)
#define HDA_CODEC_IDT92HD206D       HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7646)
#define HDA_CODEC_CXD9872RDK        HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7661)
#define HDA_CODEC_STAC9872AK        HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7662)
#define HDA_CODEC_CXD9872AKD        HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7664)
#define HDA_CODEC_STAC9221          HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7680)
#define HDA_CODEC_STAC922XD         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7681)
#define HDA_CODEC_STAC9221_A2       HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7682)
#define HDA_CODEC_STAC9221D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7683)
#define HDA_CODEC_STAC9220          HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7690)
#define HDA_CODEC_STAC9200D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7691)
#define HDA_CODEC_IDT92HD005        HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7698)
#define HDA_CODEC_IDT92HD005D       HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7699)
#define HDA_CODEC_STAC9205X         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76A0)
#define HDA_CODEC_STAC9205D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76A1)
#define HDA_CODEC_STAC9204X         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76A2)
#define HDA_CODEC_STAC9204D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76A3)
#define HDA_CODEC_STAC9255          HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76A4)
#define HDA_CODEC_STAC9255D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76A5)
#define HDA_CODEC_STAC9254          HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76A6)
#define HDA_CODEC_STAC9254D         HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76A7)
#define HDA_CODEC_STAC9220_A2       HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7880)
#define HDA_CODEC_STAC9220_A1       HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7882)
#define HDA_CODEC_STACXXXX          HDA_CODEC_CONSTRUCT(SIGMATEL, 0xFFFF)

// VIA.
#define HDA_CODEC_VT1708_8          HDA_CODEC_CONSTRUCT(VIA, 0x1708)
#define HDA_CODEC_VT1708_9          HDA_CODEC_CONSTRUCT(VIA, 0x1709)
#define HDA_CODEC_VT1708_A          HDA_CODEC_CONSTRUCT(VIA, 0x170A)
#define HDA_CODEC_VT1708_B          HDA_CODEC_CONSTRUCT(VIA, 0x170B)
#define HDA_CODEC_VT1709_0          HDA_CODEC_CONSTRUCT(VIA, 0xe710)
#define HDA_CODEC_VT1709_1          HDA_CODEC_CONSTRUCT(VIA, 0xe711)
#define HDA_CODEC_VT1709_2          HDA_CODEC_CONSTRUCT(VIA, 0xe712)
#define HDA_CODEC_VT1709_3          HDA_CODEC_CONSTRUCT(VIA, 0xe713)
#define HDA_CODEC_VT1709_4          HDA_CODEC_CONSTRUCT(VIA, 0xe714)
#define HDA_CODEC_VT1709_5          HDA_CODEC_CONSTRUCT(VIA, 0xe715)
#define HDA_CODEC_VT1709_6          HDA_CODEC_CONSTRUCT(VIA, 0xe716)
#define HDA_CODEC_VT1709_7          HDA_CODEC_CONSTRUCT(VIA, 0xe717)
#define HDA_CODEC_VT1708B_0         HDA_CODEC_CONSTRUCT(VIA, 0xe720)
#define HDA_CODEC_VT1708B_1         HDA_CODEC_CONSTRUCT(VIA, 0xe721)
#define HDA_CODEC_VT1708B_2         HDA_CODEC_CONSTRUCT(VIA, 0xe722)
#define HDA_CODEC_VT1708B_3         HDA_CODEC_CONSTRUCT(VIA, 0xe723)
#define HDA_CODEC_VT1708B_4         HDA_CODEC_CONSTRUCT(VIA, 0xe724)
#define HDA_CODEC_VT1708B_5         HDA_CODEC_CONSTRUCT(VIA, 0xe725)
#define HDA_CODEC_VT1708B_6         HDA_CODEC_CONSTRUCT(VIA, 0xe726)
#define HDA_CODEC_VT1708B_7         HDA_CODEC_CONSTRUCT(VIA, 0xe727)
#define HDA_CODEC_VT1708S_0         HDA_CODEC_CONSTRUCT(VIA, 0x0397)
#define HDA_CODEC_VT1708S_1         HDA_CODEC_CONSTRUCT(VIA, 0x1397)
#define HDA_CODEC_VT1708S_2         HDA_CODEC_CONSTRUCT(VIA, 0x2397)
#define HDA_CODEC_VT1708S_3         HDA_CODEC_CONSTRUCT(VIA, 0x3397)
#define HDA_CODEC_VT1708S_4         HDA_CODEC_CONSTRUCT(VIA, 0x4397)
#define HDA_CODEC_VT1708S_5         HDA_CODEC_CONSTRUCT(VIA, 0x5397)
#define HDA_CODEC_VT1708S_6         HDA_CODEC_CONSTRUCT(VIA, 0x6397)
#define HDA_CODEC_VT1708S_7         HDA_CODEC_CONSTRUCT(VIA, 0x7397)
#define HDA_CODEC_VT1702_0          HDA_CODEC_CONSTRUCT(VIA, 0x0398)
#define HDA_CODEC_VT1702_1          HDA_CODEC_CONSTRUCT(VIA, 0x1398)
#define HDA_CODEC_VT1702_2          HDA_CODEC_CONSTRUCT(VIA, 0x2398)
#define HDA_CODEC_VT1702_3          HDA_CODEC_CONSTRUCT(VIA, 0x3398)
#define HDA_CODEC_VT1702_4          HDA_CODEC_CONSTRUCT(VIA, 0x4398)
#define HDA_CODEC_VT1702_5          HDA_CODEC_CONSTRUCT(VIA, 0x5398)
#define HDA_CODEC_VT1702_6          HDA_CODEC_CONSTRUCT(VIA, 0x6398)
#define HDA_CODEC_VT1702_7          HDA_CODEC_CONSTRUCT(VIA, 0x7398)
#define HDA_CODEC_VT1716S_0         HDA_CODEC_CONSTRUCT(VIA, 0x0433)
#define HDA_CODEC_VT1716S_1         HDA_CODEC_CONSTRUCT(VIA, 0xA721)
#define HDA_CODEC_VT1718S_0         HDA_CODEC_CONSTRUCT(VIA, 0x0428)
#define HDA_CODEC_VT1718S_1         HDA_CODEC_CONSTRUCT(VIA, 0x4428)
#define HDA_CODEC_VT1802_0          HDA_CODEC_CONSTRUCT(VIA, 0x0446)
#define HDA_CODEC_VT1802_1          HDA_CODEC_CONSTRUCT(VIA, 0x8446)
#define HDA_CODEC_VT1812            HDA_CODEC_CONSTRUCT(VIA, 0x0448)
#define HDA_CODEC_VT1818S           HDA_CODEC_CONSTRUCT(VIA, 0x0440)
#define HDA_CODEC_VT1828S           HDA_CODEC_CONSTRUCT(VIA, 0x4441)
#define HDA_CODEC_VT2002P_0         HDA_CODEC_CONSTRUCT(VIA, 0x0438)
#define HDA_CODEC_VT2002P_1         HDA_CODEC_CONSTRUCT(VIA, 0x4438)
#define HDA_CODEC_VT2020            HDA_CODEC_CONSTRUCT(VIA, 0x0441)
#define HDA_CODEC_VTXXXX            HDA_CODEC_CONSTRUCT(VIA, 0xFFFF)

#endif
