DxeHdaNhlt.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /** @file
  2. Header file for DxePchHdaNhltLib - NHLT structure definitions.
  3. Copyright (c) 2019 Intel Corporation. All rights reserved. <BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #ifndef _DXE_HDA_NHLT_H_
  7. #define _DXE_HDA_NHLT_H_
  8. #include <IndustryStandard/Acpi.h>
  9. //
  10. // ACPI support protocol instance signature definition.
  11. //
  12. #define NHLT_ACPI_TABLE_SIGNATURE SIGNATURE_32 ('N', 'H', 'L', 'T')
  13. // MSFT defined structures
  14. #define SPEAKER_FRONT_LEFT 0x1
  15. #define SPEAKER_FRONT_RIGHT 0x2
  16. #define SPEAKER_FRONT_CENTER 0x4
  17. #define SPEAKER_BACK_LEFT 0x10
  18. #define SPEAKER_BACK_RIGHT 0x20
  19. #define KSAUDIO_SPEAKER_MONO (SPEAKER_FRONT_CENTER)
  20. #define KSAUDIO_SPEAKER_STEREO (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
  21. #define KSAUDIO_SPEAKER_QUAD (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT)
  22. #define WAVE_FORMAT_EXTENSIBLE 0xFFFE
  23. #define KSDATAFORMAT_SUBTYPE_PCM \
  24. {0x00000001, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}}
  25. #pragma pack (push, 1)
  26. typedef struct {
  27. UINT16 wFormatTag;
  28. UINT16 nChannels;
  29. UINT32 nSamplesPerSec;
  30. UINT32 nAvgBytesPerSec;
  31. UINT16 nBlockAlign;
  32. UINT16 wBitsPerSample;
  33. UINT16 cbSize;
  34. } WAVEFORMATEX;
  35. typedef struct {
  36. WAVEFORMATEX Format;
  37. union {
  38. UINT16 wValidBitsPerSample;
  39. UINT16 wSamplesPerBlock;
  40. UINT16 wReserved;
  41. } Samples;
  42. UINT32 dwChannelMask;
  43. GUID SubFormat;
  44. } WAVEFORMATEXTENSIBLE;
  45. //
  46. // List of supported link type.
  47. //
  48. enum NHLT_LINK_TYPE
  49. {
  50. HdaNhltLinkHd = 0,
  51. HdaNhltLinkDsp = 1,
  52. HdaNhltLinkDmic = 2,
  53. HdaNhltLinkSsp = 3,
  54. HdaNhltLinkInvalid
  55. };
  56. //
  57. // List of supported device type.
  58. //
  59. enum NHLT_DEVICE_TYPE
  60. {
  61. HdaNhltDeviceBt = 0,
  62. HdaNhltDeviceDmic = 1,
  63. HdaNhltDeviceI2s = 4,
  64. HdaNhltDeviceInvalid
  65. };
  66. typedef struct {
  67. UINT32 CapabilitiesSize;
  68. UINT8 Capabilities[1];
  69. } SPECIFIC_CONFIG;
  70. typedef struct {
  71. WAVEFORMATEXTENSIBLE Format;
  72. SPECIFIC_CONFIG FormatConfiguration;
  73. } FORMAT_CONFIG;
  74. typedef struct {
  75. UINT8 FormatsCount;
  76. FORMAT_CONFIG FormatsConfiguration[1];
  77. } FORMATS_CONFIG;
  78. typedef struct {
  79. UINT8 DeviceId[16];
  80. UINT8 DeviceInstanceId;
  81. UINT8 DevicePortId;
  82. } DEVICE_INFO;
  83. typedef struct {
  84. UINT8 DeviceInfoCount;
  85. DEVICE_INFO DeviceInformation[1];
  86. } DEVICES_INFO;
  87. typedef struct {
  88. UINT32 EndpointDescriptorLength;
  89. UINT8 LinkType;
  90. UINT8 InstanceId;
  91. UINT16 HwVendorId;
  92. UINT16 HwDeviceId;
  93. UINT16 HwRevisionId;
  94. UINT32 HwSubsystemId;
  95. UINT8 DeviceType;
  96. UINT8 Direction;
  97. UINT8 VirtualBusId;
  98. SPECIFIC_CONFIG EndpointConfig;
  99. FORMATS_CONFIG FormatsConfig;
  100. DEVICES_INFO DevicesInformation;
  101. } ENDPOINT_DESCRIPTOR;
  102. //
  103. // High Level Table structure
  104. //
  105. typedef struct {
  106. EFI_ACPI_DESCRIPTION_HEADER Header; //{'N', 'H', 'L', 'T'}
  107. UINT8 EndpointCount; // Actual number of endpoints
  108. ENDPOINT_DESCRIPTOR EndpointDescriptors[1];
  109. SPECIFIC_CONFIG OedConfiguration;
  110. } NHLT_ACPI_TABLE;
  111. #pragma pack (pop)
  112. #endif // _DXE_HDA_NHLT_H_