coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
rt5514.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <soc/nhlt.h>
4 
5 static const struct nhlt_format_config rt5514_4ch_formats[] = {
6  /* 48 KHz 16-bits per sample. */
7  {
8  .num_channels = 4,
9  .sample_freq_khz = 48,
10  .container_bits_per_sample = 16,
11  .valid_bits_per_sample = 16,
12  .speaker_mask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT |
14  .settings_file = "rt5514-capture-4ch-48khz-16b.bin",
15  },
16 };
17 
18 static const struct nhlt_dmic_array_config rt5514_4ch_mic_config = {
19  .tdm_config = {
21  },
22  .array_type = NHLT_MIC_ARRAY_4CH_L_SHAPED,
23 };
24 
25 static const struct nhlt_endp_descriptor rt5514_4ch_descriptors[] = {
26  {
28  .device = NHLT_SSP_DEV_I2S,
29  .direction = NHLT_DIR_CAPTURE,
30  .vid = NHLT_VID,
31  .did = NHLT_DID_SSP,
32  .cfg = &rt5514_4ch_mic_config,
33  .cfg_size = sizeof(rt5514_4ch_mic_config),
36  },
37 };
38 
39 int nhlt_soc_add_rt5514(struct nhlt *nhlt, int hwlink, int num_channels)
40 {
41  switch (num_channels) {
42  case 4:
43  return nhlt_add_ssp_endpoints(nhlt, hwlink,
46  default:
47  return -1;
48  }
49 }
#define ARRAY_SIZE(a)
Definition: helpers.h:12
@ NHLT_LINK_SSP
Definition: nhlt.h:176
@ NHLT_TDM_MIC_ARRAY
Definition: nhlt.h:301
@ NHLT_MIC_ARRAY_4CH_L_SHAPED
Definition: nhlt.h:317
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_BACK_LEFT
Definition: nhlt.h:207
@ SPEAKER_FRONT_RIGHT
Definition: nhlt.h:204
@ SPEAKER_BACK_RIGHT
Definition: nhlt.h:208
@ NHLT_DIR_CAPTURE
Definition: nhlt.h:196
static const struct nhlt_endp_descriptor rt5514_4ch_descriptors[]
Definition: rt5514.c:25
int nhlt_soc_add_rt5514(struct nhlt *nhlt, int hwlink, int num_channels)
Definition: rt5514.c:39
static const struct nhlt_dmic_array_config rt5514_4ch_mic_config
Definition: rt5514.c:18
static const struct nhlt_format_config rt5514_4ch_formats[]
Definition: rt5514.c:5
#define NHLT_DID_SSP
Definition: nhlt.h:11
#define NHLT_VID
Definition: nhlt.h:8
struct nhlt_tdm_config tdm_config
Definition: nhlt.h:305
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 config_type
Definition: nhlt.h:296
Definition: nhlt.h:287