coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
da7219.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #include <nhlt.h>
4 #include <soc/nhlt.h>
5 
6 static const struct nhlt_tdm_config tdm_config = {
7  .virtual_slot = 0,
8  .config_type = NHLT_TDM_BASIC,
9 };
10 
11 static const struct nhlt_format_config da7219_formats[] = {
12  /* 48 KHz 24-bits per sample. */
13  {
14  .num_channels = 2,
15  .sample_freq_khz = 48,
16  .container_bits_per_sample = 32,
17  .valid_bits_per_sample = 24,
18  .settings_file = "dialog-2ch-48khz-24b.bin",
19  },
20 };
21 
22 static const struct nhlt_endp_descriptor da7219_descriptors[] = {
23  /* Render Endpoint */
24  {
26  .device = NHLT_SSP_DEV_I2S,
27  .direction = NHLT_DIR_RENDER,
28  .vid = NHLT_VID,
29  .did = NHLT_DID_SSP,
30  .cfg = &tdm_config,
31  .cfg_size = sizeof(tdm_config),
34  },
35  /* Capture Endpoint */
36  {
37  .link = NHLT_LINK_SSP,
38  .device = NHLT_SSP_DEV_I2S,
39  .direction = NHLT_DIR_CAPTURE,
40  .vid = NHLT_VID,
41  .did = NHLT_DID_SSP,
42  .cfg = &tdm_config,
43  .cfg_size = sizeof(tdm_config),
46  },
47 };
48 
49 int nhlt_soc_add_da7219(struct nhlt *nhlt, int hwlink)
50 {
51  /* Virtual bus id of SSP links are the hardware port ids proper. */
54 }
#define ARRAY_SIZE(a)
Definition: helpers.h:12
@ NHLT_LINK_SSP
Definition: nhlt.h:176
@ NHLT_TDM_BASIC
Definition: nhlt.h:300
int nhlt_add_ssp_endpoints(struct nhlt *nhlt, int virtual_bus_id, const struct nhlt_endp_descriptor *epds, size_t num_epds)
Definition: nhlt.c:468
@ 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
int nhlt_soc_add_da7219(struct nhlt *nhlt, int hwlink)
Definition: da7219.c:49
static const struct nhlt_endp_descriptor da7219_descriptors[]
Definition: da7219.c:22
static const struct nhlt_format_config da7219_formats[]
Definition: da7219.c:11
static const struct nhlt_tdm_config tdm_config
Definition: da7219.c:6
const struct nhlt_format_config * formats
Definition: nhlt.h:63
size_t num_formats
Definition: nhlt.h:64
int num_channels
Definition: nhlt.h:260
uint8_t virtual_slot
Definition: nhlt.h:295
Definition: nhlt.h:287