coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
nhlt.c File Reference
#include <nhlt.h>
#include <soc/nhlt.h>
Include dependency graph for nhlt.c:

Go to the source code of this file.

Functions

int nhlt_soc_add_dmic_array (struct nhlt *nhlt, int num_channels)
 
int nhlt_soc_add_da7219 (struct nhlt *nhlt, int hwlink)
 
int nhlt_soc_add_max98357 (struct nhlt *nhlt, int hwlink)
 
int nhlt_soc_add_rt5682 (struct nhlt *nhlt, int hwlink)
 

Variables

static const struct nhlt_format_config dmic_1ch_formats []
 
static const struct nhlt_dmic_array_config dmic_1ch_mic_config
 
static const struct nhlt_endp_descriptor dmic_1ch_descriptors []
 
static const struct nhlt_format_config dmic_2ch_formats []
 
static const struct nhlt_dmic_array_config dmic_2ch_mic_config
 
static const struct nhlt_endp_descriptor dmic_2ch_descriptors []
 
static const struct nhlt_format_config dmic_4ch_formats []
 
static const struct nhlt_dmic_array_config dmic_4ch_mic_config
 
static const struct nhlt_endp_descriptor dmic_4ch_descriptors []
 
static const struct nhlt_format_config da7219_formats []
 
static const struct nhlt_tdm_config tdm_config
 
static const struct nhlt_endp_descriptor da7219_descriptors []
 
static const struct nhlt_format_config max98357_formats []
 
static const struct nhlt_endp_descriptor max98357_descriptors []
 
static const struct nhlt_format_config rt5682_formats []
 
static const struct nhlt_endp_descriptor rt5682_descriptors []
 

Function Documentation

◆ nhlt_soc_add_da7219()

int nhlt_soc_add_da7219 ( struct nhlt nhlt,
int  hwlink 
)

Definition at line 232 of file nhlt.c.

Referenced by variant_nhlt_init().

Here is the caller graph for this function:

◆ nhlt_soc_add_dmic_array()

int nhlt_soc_add_dmic_array ( struct nhlt nhlt,
int  num_channels 
)

Definition at line 168 of file nhlt.c.

Referenced by variant_nhlt_init().

Here is the caller graph for this function:

◆ nhlt_soc_add_max98357()

int nhlt_soc_add_max98357 ( struct nhlt nhlt,
int  hwlink 
)

Definition at line 239 of file nhlt.c.

Referenced by variant_nhlt_init().

Here is the caller graph for this function:

◆ nhlt_soc_add_rt5682()

int nhlt_soc_add_rt5682 ( struct nhlt nhlt,
int  hwlink 
)

Definition at line 246 of file nhlt.c.

References ARRAY_SIZE, nhlt_add_ssp_endpoints(), and rt5682_descriptors.

Referenced by variant_nhlt_init().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ da7219_descriptors

const struct nhlt_endp_descriptor da7219_descriptors[]
static
Initial value:
= {
{
.link = NHLT_LINK_SSP,
.device = NHLT_SSP_DEV_I2S,
.direction = NHLT_DIR_RENDER,
.vid = NHLT_VID,
.did = NHLT_DID_SSP,
.cfg = &tdm_config,
.cfg_size = sizeof(tdm_config),
.formats = da7219_formats,
.num_formats = ARRAY_SIZE(da7219_formats),
},
{
.link = NHLT_LINK_SSP,
.device = NHLT_SSP_DEV_I2S,
.direction = NHLT_DIR_CAPTURE,
.vid = NHLT_VID,
.did = NHLT_DID_SSP,
.cfg = &tdm_config,
.cfg_size = sizeof(tdm_config),
.formats = da7219_formats,
.num_formats = ARRAY_SIZE(da7219_formats),
},
}
#define ARRAY_SIZE(a)
Definition: helpers.h:12
@ NHLT_LINK_SSP
Definition: nhlt.h:176
@ NHLT_SSP_DEV_I2S
Definition: nhlt.h:185
@ NHLT_DIR_RENDER
Definition: nhlt.h:195
@ NHLT_DIR_CAPTURE
Definition: nhlt.h:196
#define NHLT_DID_SSP
Definition: nhlt.h:11
#define NHLT_VID
Definition: nhlt.h:8
static const struct nhlt_format_config da7219_formats[]
Definition: nhlt.c:102
static const struct nhlt_tdm_config tdm_config
Definition: nhlt.c:113

Definition at line 1 of file nhlt.c.

Referenced by nhlt_soc_add_da7219().

◆ da7219_formats

const struct nhlt_format_config da7219_formats[]
static
Initial value:
= {
{
.num_channels = 2,
.sample_freq_khz = 48,
.container_bits_per_sample = 32,
.valid_bits_per_sample = 24,
.settings_file = "dialog-2ch-48khz-24b.bin",
},
}

Definition at line 1 of file nhlt.c.

◆ dmic_1ch_descriptors

const struct nhlt_endp_descriptor dmic_1ch_descriptors[]
static
Initial value:
= {
{
.link = NHLT_LINK_PDM,
.device = NHLT_PDM_DEV,
.direction = NHLT_DIR_CAPTURE,
.vid = NHLT_VID,
.did = NHLT_DID_DMIC,
.cfg_size = sizeof(dmic_1ch_mic_config),
.formats = dmic_1ch_formats,
.num_formats = ARRAY_SIZE(dmic_1ch_formats),
},
}
@ NHLT_LINK_PDM
Definition: nhlt.h:175
@ NHLT_PDM_DEV
Definition: nhlt.h:189
#define NHLT_DID_DMIC
Definition: nhlt.h:9
static const struct nhlt_dmic_array_config dmic_1ch_mic_config
Definition: nhlt.c:17
static const struct nhlt_format_config dmic_1ch_formats[]
Definition: nhlt.c:6

Definition at line 1 of file nhlt.c.

Referenced by nhlt_soc_add_dmic_array().

◆ dmic_1ch_formats

const struct nhlt_format_config dmic_1ch_formats[]
static
Initial value:
= {
{
.num_channels = 1,
.sample_freq_khz = 48,
.container_bits_per_sample = 16,
.valid_bits_per_sample = 16,
.settings_file = "dmic-1ch-48khz-16b.bin",
},
}

Definition at line 1 of file nhlt.c.

◆ dmic_1ch_mic_config

const struct nhlt_dmic_array_config dmic_1ch_mic_config
static
Initial value:
= {
.tdm_config = {
.config_type = NHLT_TDM_MIC_ARRAY,
},
}
@ NHLT_TDM_MIC_ARRAY
Definition: nhlt.h:301
@ NHLT_MIC_ARRAY_VENDOR_DEFINED
Definition: nhlt.h:319

Definition at line 1 of file nhlt.c.

◆ dmic_2ch_descriptors

const struct nhlt_endp_descriptor dmic_2ch_descriptors[]
static
Initial value:
= {
{
.link = NHLT_LINK_PDM,
.device = NHLT_PDM_DEV,
.direction = NHLT_DIR_CAPTURE,
.vid = NHLT_VID,
.did = NHLT_DID_DMIC,
.cfg_size = sizeof(dmic_2ch_mic_config),
.formats = dmic_2ch_formats,
.num_formats = ARRAY_SIZE(dmic_2ch_formats),
},
}
static const struct nhlt_dmic_array_config dmic_2ch_mic_config
Definition: nhlt.c:49
static const struct nhlt_format_config dmic_2ch_formats[]
Definition: nhlt.c:38

Definition at line 1 of file nhlt.c.

Referenced by nhlt_soc_add_dmic_array().

◆ dmic_2ch_formats

const struct nhlt_format_config dmic_2ch_formats[]
static
Initial value:
= {
{
.num_channels = 2,
.sample_freq_khz = 48,
.container_bits_per_sample = 16,
.valid_bits_per_sample = 16,
.settings_file = "dmic-2ch-48khz-16b.bin",
},
}

Definition at line 1 of file nhlt.c.

◆ dmic_2ch_mic_config

const struct nhlt_dmic_array_config dmic_2ch_mic_config
static
Initial value:
= {
.tdm_config = {
.config_type = NHLT_TDM_MIC_ARRAY,
},
.array_type = NHLT_MIC_ARRAY_2CH_SMALL,
}
@ NHLT_MIC_ARRAY_2CH_SMALL
Definition: nhlt.h:314

Definition at line 1 of file nhlt.c.

◆ dmic_4ch_descriptors

const struct nhlt_endp_descriptor dmic_4ch_descriptors[]
static
Initial value:
= {
{
.link = NHLT_LINK_PDM,
.device = NHLT_PDM_DEV,
.direction = NHLT_DIR_CAPTURE,
.vid = NHLT_VID,
.did = NHLT_DID_DMIC,
.cfg_size = sizeof(dmic_4ch_mic_config),
.formats = dmic_4ch_formats,
.num_formats = ARRAY_SIZE(dmic_4ch_formats),
},
}
static const struct nhlt_format_config dmic_4ch_formats[]
Definition: nhlt.c:70
static const struct nhlt_dmic_array_config dmic_4ch_mic_config
Definition: nhlt.c:81

Definition at line 1 of file nhlt.c.

Referenced by nhlt_soc_add_dmic_array().

◆ dmic_4ch_formats

const struct nhlt_format_config dmic_4ch_formats[]
static
Initial value:
= {
{
.num_channels = 4,
.sample_freq_khz = 48,
.container_bits_per_sample = 16,
.valid_bits_per_sample = 16,
.settings_file = "dmic-4ch-48khz-16b.bin",
},
}

Definition at line 1 of file nhlt.c.

◆ dmic_4ch_mic_config

const struct nhlt_dmic_array_config dmic_4ch_mic_config
static
Initial value:
= {
.tdm_config = {
.config_type = NHLT_TDM_MIC_ARRAY,
},
}
@ NHLT_MIC_ARRAY_4CH_L_SHAPED
Definition: nhlt.h:317

Definition at line 1 of file nhlt.c.

◆ max98357_descriptors

const struct nhlt_endp_descriptor max98357_descriptors[]
static
Initial value:
= {
{
.link = NHLT_LINK_SSP,
.device = NHLT_SSP_DEV_I2S,
.direction = NHLT_DIR_RENDER,
.vid = NHLT_VID,
.did = NHLT_DID_SSP,
.formats = max98357_formats,
.num_formats = ARRAY_SIZE(max98357_formats),
},
}
static const struct nhlt_format_config max98357_formats[]
Definition: nhlt.c:145

Definition at line 1 of file nhlt.c.

Referenced by nhlt_soc_add_max98357().

◆ max98357_formats

const struct nhlt_format_config max98357_formats[]
static
Initial value:
= {
{
.num_channels = 2,
.sample_freq_khz = 48,
.container_bits_per_sample = 32,
.valid_bits_per_sample = 24,
.settings_file = "max98357-render-2ch-48khz-24b.bin",
},
}

Definition at line 1 of file nhlt.c.

◆ rt5682_descriptors

const struct nhlt_endp_descriptor rt5682_descriptors[]
static
Initial value:
= {
{
.link = NHLT_LINK_SSP,
.device = NHLT_SSP_DEV_I2S,
.direction = NHLT_DIR_RENDER,
.vid = NHLT_VID,
.did = NHLT_DID_SSP,
.cfg = &tdm_config,
.cfg_size = sizeof(tdm_config),
.formats = rt5682_formats,
.num_formats = ARRAY_SIZE(rt5682_formats),
},
{
.link = NHLT_LINK_SSP,
.device = NHLT_SSP_DEV_I2S,
.direction = NHLT_DIR_CAPTURE,
.vid = NHLT_VID,
.did = NHLT_DID_SSP,
.cfg = &tdm_config,
.cfg_size = sizeof(tdm_config),
.formats = rt5682_formats,
.num_formats = ARRAY_SIZE(rt5682_formats),
},
}
static const struct nhlt_format_config rt5682_formats[]
Definition: nhlt.c:189

Definition at line 168 of file nhlt.c.

Referenced by nhlt_soc_add_rt5682().

◆ rt5682_formats

const struct nhlt_format_config rt5682_formats[]
static
Initial value:
= {
{
.num_channels = 2,
.sample_freq_khz = 48,
.container_bits_per_sample = 32,
.valid_bits_per_sample = 24,
.settings_file = "rt5682-2ch-48khz-24b.bin",
},
}
@ SPEAKER_FRONT_LEFT
Definition: nhlt.h:203
@ SPEAKER_FRONT_RIGHT
Definition: nhlt.h:204

Definition at line 168 of file nhlt.c.

◆ tdm_config

const struct nhlt_tdm_config tdm_config
static
Initial value:
= {
.virtual_slot = 0,
.config_type = NHLT_TDM_BASIC,
}
@ NHLT_TDM_BASIC
Definition: nhlt.h:300

Definition at line 1 of file nhlt.c.