1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * intel-nhlt.h - Intel HDA Platform NHLT header
5 * Copyright (c) 2015-2019 Intel Corporation
8 #ifndef __INTEL_NHLT_H__
9 #define __INTEL_NHLT_H__
11 #include <linux/acpi.h>
13 #if IS_ENABLED(CONFIG_ACPI) && IS_ENABLED(CONFIG_SND_INTEL_NHLT)
19 u32 avg_bytes_per_sec
;
28 u16 valid_bits_per_sample
;
29 u16 samples_per_block
;
44 enum nhlt_device_type
{
51 struct nhlt_specific_cfg
{
57 struct wav_fmt_ext fmt_ext
;
58 struct nhlt_specific_cfg config
;
63 struct nhlt_fmt_cfg fmt_config
[];
66 struct nhlt_endpoint
{
77 struct nhlt_specific_cfg config
;
80 struct nhlt_acpi_table
{
81 struct acpi_table_header header
;
83 struct nhlt_endpoint desc
[];
86 struct nhlt_resource_desc
{
92 u64 addr_trans_offset
;
96 #define MIC_ARRAY_2CH 2
97 #define MIC_ARRAY_4CH 4
99 struct nhlt_device_specific_config
{
104 struct nhlt_dmic_array_config
{
105 struct nhlt_device_specific_config device_config
;
109 struct nhlt_vendor_dmic_array_config
{
110 struct nhlt_dmic_array_config dmic_config
;
112 /* TODO add vendor mic config */
116 NHLT_MIC_ARRAY_2CH_SMALL
= 0xa,
117 NHLT_MIC_ARRAY_2CH_BIG
= 0xb,
118 NHLT_MIC_ARRAY_4CH_1ST_GEOM
= 0xc,
119 NHLT_MIC_ARRAY_4CH_L_SHAPED
= 0xd,
120 NHLT_MIC_ARRAY_4CH_2ND_GEOM
= 0xe,
121 NHLT_MIC_ARRAY_VENDOR_DEFINED
= 0xf,
124 struct nhlt_acpi_table
*intel_nhlt_init(struct device
*dev
);
126 void intel_nhlt_free(struct nhlt_acpi_table
*addr
);
128 int intel_nhlt_get_dmic_geo(struct device
*dev
, struct nhlt_acpi_table
*nhlt
);
132 struct nhlt_acpi_table
;
134 static inline struct nhlt_acpi_table
*intel_nhlt_init(struct device
*dev
)
139 static inline void intel_nhlt_free(struct nhlt_acpi_table
*addr
)
143 static inline int intel_nhlt_get_dmic_geo(struct device
*dev
,
144 struct nhlt_acpi_table
*nhlt
)