alsa-utils/topology/nhlt/intel/dmic/dmic-intel.h
Jaska Uimonen f9e6010d5e topology: plugins - add Intel nhlt encoder plugin
Add Intel nhlt acpi table encoder plugin into topology2.0 processing.
Nhlt internal structure is defined in:
https://01.org/sites/default/files/595976_intel_sst_nhlt.pdf
Nhlt acpi table contain vendor specific binary data blobs that are used
in some Intel dsp platforms for configuring the dmic and ssp hardware.

The function of this code is mainly to generate the vendor specific
binary blobs, but as there is existing nhlt parser code and header in
kernel there's no point of re-inventing the container: just use the
existing nhlt acpi table format. Basically this code is creating similar
nhlt acpi table that you would get from: cat
/sys/firmware/acpi/tables/NHLT

This code will have implementation for dmic and ssp endpoints. Thus the
code will translate the topology dai tokens into vendor specific binary
blobs and pack them into nhlt acpi table. Ssp and dmic code is lifted
from Sound Open Firmware (sof) code base, thus it will have BSD-3
license.

This plugin can be enabled from command line with:

alsatplg -DPREPROCESS_PLUGINS="nhlt" -c foo.conf -p -o bar.tplg

You can also dump the nhlt binary into a file with additional define:

-DNHLT_BIN="nhlt.bin"

Link: https://github.com/alsa-project/alsa-utils/pull/129
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2022-05-03 13:24:03 +02:00

49 lines
1.2 KiB
C

// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright(c) 2021 Intel Corporation. All rights reserved.
//
// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
// Jaska Uimonen <jaska.uimonen@linux.intel.com>
#ifndef __DMIC_INTEL_H
#define __DMIC_INTEL_H
#include <stdint.h>
#define DMIC_TS_GROUP_SIZE 4
/* structs for intel dmic nhlt vendor specific blob generation */
struct dmic_intel_fir_config {
uint32_t fir_control;
uint32_t fir_config;
uint32_t dc_offset_left;
uint32_t dc_offset_right;
uint32_t out_gain_left;
uint32_t out_gain_right;
uint32_t reserved2[2];
uint32_t fir_coeffs[];
} __attribute__((packed));
struct dmic_intel_pdm_ctrl_cfg {
uint32_t cic_control;
uint32_t cic_config;
uint32_t reserved0;
uint32_t mic_control;
uint32_t pdmsm;
uint32_t reuse_fir_from_pdm;
uint32_t reserved1[2];
struct dmic_intel_fir_config fir_config[];
} __attribute__((packed));
struct dmic_intel_config_data {
uint32_t gateway_attributes;
uint32_t ts_group[DMIC_TS_GROUP_SIZE];
uint32_t clock_on_delay;
uint32_t channel_ctrl_mask;
uint32_t chan_ctrl_cfg[2];
uint32_t channel_pdm_mask;
struct dmic_intel_pdm_ctrl_cfg pdm_ctrl_cfg[];
} __attribute__((packed));
#endif /* __DMIC_INTEL_H */