skl-nhlt.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * skl-nhlt.h - Intel HDA Platform NHLT header
  3. *
  4. * Copyright (C) 2015 Intel Corp
  5. * Author: Sanjiv Kumar <sanjiv.kumar@intel.com>
  6. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; version 2 of the License.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. *
  19. */
  20. #ifndef __SKL_NHLT_H__
  21. #define __SKL_NHLT_H__
  22. #include <linux/acpi.h>
  23. struct wav_fmt {
  24. u16 fmt_tag;
  25. u16 channels;
  26. u32 samples_per_sec;
  27. u32 avg_bytes_per_sec;
  28. u16 block_align;
  29. u16 bits_per_sample;
  30. u16 cb_size;
  31. } __packed;
  32. struct wav_fmt_ext {
  33. struct wav_fmt fmt;
  34. union samples {
  35. u16 valid_bits_per_sample;
  36. u16 samples_per_block;
  37. u16 reserved;
  38. } sample;
  39. u32 channel_mask;
  40. u8 sub_fmt[16];
  41. } __packed;
  42. enum nhlt_link_type {
  43. NHLT_LINK_HDA = 0,
  44. NHLT_LINK_DSP = 1,
  45. NHLT_LINK_DMIC = 2,
  46. NHLT_LINK_SSP = 3,
  47. NHLT_LINK_INVALID
  48. };
  49. enum nhlt_device_type {
  50. NHLT_DEVICE_BT = 0,
  51. NHLT_DEVICE_DMIC = 1,
  52. NHLT_DEVICE_I2S = 4,
  53. NHLT_DEVICE_INVALID
  54. };
  55. struct nhlt_specific_cfg {
  56. u32 size;
  57. u8 caps[0];
  58. } __packed;
  59. struct nhlt_fmt_cfg {
  60. struct wav_fmt_ext fmt_ext;
  61. struct nhlt_specific_cfg config;
  62. } __packed;
  63. struct nhlt_fmt {
  64. u8 fmt_count;
  65. struct nhlt_fmt_cfg fmt_config[0];
  66. } __packed;
  67. struct nhlt_endpoint {
  68. u32 length;
  69. u8 linktype;
  70. u8 instance_id;
  71. u16 vendor_id;
  72. u16 device_id;
  73. u16 revision_id;
  74. u32 subsystem_id;
  75. u8 device_type;
  76. u8 direction;
  77. u8 virtual_bus_id;
  78. struct nhlt_specific_cfg config;
  79. } __packed;
  80. struct nhlt_acpi_table {
  81. struct acpi_table_header header;
  82. u8 endpoint_count;
  83. struct nhlt_endpoint desc[0];
  84. } __packed;
  85. struct nhlt_resource_desc {
  86. u32 extra;
  87. u16 flags;
  88. u64 addr_spc_gra;
  89. u64 min_addr;
  90. u64 max_addr;
  91. u64 addr_trans_offset;
  92. u64 length;
  93. } __packed;
  94. #endif