coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
max98373.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 max98373_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 = "max98373-render-2ch-48khz-24b.bin",
14  },
15  /* 48 KHz 16-bits per sample. */
16  {
17  .num_channels = 2,
18  .sample_freq_khz = 48,
19  .container_bits_per_sample = 16,
20  .valid_bits_per_sample = 16,
21  .speaker_mask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT,
22  .settings_file = "max98373-render-2ch-48khz-16b.bin",
23  }
24 };
25 
26 static const struct nhlt_format_config max98373_capture_formats[] = {
27  /* 48 KHz 16-bits per sample - Quad Channel. */
28  {
29  .num_channels = 4,
30  .sample_freq_khz = 48,
31  .container_bits_per_sample = 32,
32  .valid_bits_per_sample = 16,
33  .speaker_mask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT,
34  .settings_file = "max98373-render-2ch-48khz-16b.bin",
35  },
36  /* 48 KHz 16-bits per sample - Stereo Channel */
37  {
38  .num_channels = 2,
39  .sample_freq_khz = 48,
40  .container_bits_per_sample = 32,
41  .valid_bits_per_sample = 16,
42  .speaker_mask = SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT,
43  .settings_file = "max98373-render-2ch-48khz-16b.bin",
44  },
45 };
46 
47 static const struct nhlt_endp_descriptor max98373_descriptors[] = {
48  {
50  .device = NHLT_SSP_DEV_I2S,
51  .direction = NHLT_DIR_RENDER,
52  .vid = NHLT_VID,
53  .did = NHLT_DID_SSP,
54  .formats = max98373_render_formats,
55  .num_formats = ARRAY_SIZE(max98373_render_formats),
56  },
57  {
58  .link = NHLT_LINK_SSP,
59  .device = NHLT_SSP_DEV_I2S,
60  .direction = NHLT_DIR_CAPTURE,
61  .vid = NHLT_VID,
62  .did = NHLT_DID_SSP,
63  .formats = max98373_capture_formats,
64  .num_formats = ARRAY_SIZE(max98373_capture_formats),
65  },
66 };
67 
68 int nhlt_soc_add_max98373(struct nhlt *nhlt, int hwlink)
69 {
70  /* Virtual bus id of SSP links are the hardware port ids proper. */
73 }
#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
@ 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_max98373(struct nhlt *nhlt, int hwlink)
Definition: max98373.c:68
static const struct nhlt_format_config max98373_render_formats[]
Definition: max98373.c:5
static const struct nhlt_endp_descriptor max98373_descriptors[]
Definition: max98373.c:47
static const struct nhlt_format_config max98373_capture_formats[]
Definition: max98373.c:26
int num_channels
Definition: nhlt.h:260
Definition: nhlt.h:287