coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
rt5663.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <soc/nhlt.h>
4 
5 /*
6  * The same DSP firmware settings are used for both the capture and
7  * render endpoints.
8 */
9 static const struct nhlt_format_config rt5663_formats[] = {
10  /* 48 KHz 24-bits per sample. */
11  {
12  .num_channels = 2,
13  .sample_freq_khz = 48,
14  .container_bits_per_sample = 32,
15  .valid_bits_per_sample = 24,
16  .speaker_mask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT,
17  .settings_file = "rt5663-2ch-48khz-24b.bin",
18  },
19 };
20 
21 /*
22  * The rt5663 just has headphones and a mic. Both the capture and render
23  * endpoints occupy the same virtual slot.
24 */
25 static const struct nhlt_tdm_config tdm_config = {
26  .virtual_slot = 0,
27  .config_type = NHLT_TDM_BASIC,
28 };
29 
30 static const struct nhlt_endp_descriptor rt5663_descriptors[] = {
31  /* Render Endpoint */
32  {
34  .device = NHLT_SSP_DEV_I2S,
35  .direction = NHLT_DIR_RENDER,
36  .vid = NHLT_VID,
37  .did = NHLT_DID_SSP,
38  .cfg = &tdm_config,
39  .cfg_size = sizeof(tdm_config),
42  },
43  /* Capture Endpoint */
44  {
45  .link = NHLT_LINK_SSP,
46  .device = NHLT_SSP_DEV_I2S,
47  .direction = NHLT_DIR_CAPTURE,
48  .vid = NHLT_VID,
49  .did = NHLT_DID_SSP,
50  .cfg = &tdm_config,
51  .cfg_size = sizeof(tdm_config),
54  },
55 };
56 
57 int nhlt_soc_add_rt5663(struct nhlt *nhlt, int hwlink)
58 {
59  /* Virtual bus id of SSP links are the hardware port ids proper. */
62 }
#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
@ SPEAKER_FRONT_LEFT
Definition: nhlt.h:203
@ SPEAKER_FRONT_RIGHT
Definition: nhlt.h:204
@ 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_endp_descriptor rt5663_descriptors[]
Definition: rt5663.c:30
int nhlt_soc_add_rt5663(struct nhlt *nhlt, int hwlink)
Definition: rt5663.c:57
static const struct nhlt_format_config rt5663_formats[]
Definition: rt5663.c:9
static const struct nhlt_tdm_config tdm_config
Definition: rt5663.c:25
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