coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
max98357.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 max98357_render_formats[] = {
6  /* 48 KHz 24-bits per sample. */
7  {
8  .num_channels = 2,
9  .sample_freq_khz = 48,
10  .container_bits_per_sample = 32,
11  .valid_bits_per_sample = 24,
12  .speaker_mask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT,
13  .settings_file = "max98357-render-2ch-48khz-24b.bin",
14  },
15 };
16 
17 static const struct nhlt_endp_descriptor max98357_descriptors[] = {
18  {
20  .device = NHLT_SSP_DEV_I2S,
21  .direction = NHLT_DIR_RENDER,
22  .vid = NHLT_VID,
23  .did = NHLT_DID_SSP,
24  .formats = max98357_render_formats,
25  .num_formats = ARRAY_SIZE(max98357_render_formats),
26  },
27 };
28 
29 int nhlt_soc_add_max98357(struct nhlt *nhlt, int hwlink)
30 {
31  /* Virtual bus id of SSP links are the hardware port ids proper. */
34 }
#define ARRAY_SIZE(a)
Definition: helpers.h:12
@ NHLT_LINK_SSP
Definition: nhlt.h:176
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
static const struct nhlt_endp_descriptor max98357_descriptors[]
Definition: max98357.c:17
int nhlt_soc_add_max98357(struct nhlt *nhlt, int hwlink)
Definition: max98357.c:29
static const struct nhlt_format_config max98357_render_formats[]
Definition: max98357.c:5
#define NHLT_DID_SSP
Definition: nhlt.h:11
#define NHLT_VID
Definition: nhlt.h:8
int num_channels
Definition: nhlt.h:260
Definition: nhlt.h:287