coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
max98927.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 max98927_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 = "max98927-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 = "max98927-render-2ch-48khz-16b.bin",
23  },
24 };
25 
26 static const struct nhlt_format_config max98927_capture_formats[] = {
27  /* 48 KHz 16-bits per sample. */
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 |
35  .settings_file = "max98927-render-2ch-48khz-16b.bin",
36  },
37 };
38 static const struct nhlt_endp_descriptor max98927_descriptors[] = {
39  {
41  .device = NHLT_SSP_DEV_I2S,
42  .direction = NHLT_DIR_RENDER,
43  .vid = NHLT_VID,
44  .did = NHLT_DID_SSP,
45  .formats = max98927_render_formats,
46  .num_formats = ARRAY_SIZE(max98927_render_formats),
47  },
48  {
49  .link = NHLT_LINK_SSP,
50  .device = NHLT_SSP_DEV_I2S,
51  .direction = NHLT_DIR_CAPTURE,
52  .vid = NHLT_VID,
53  .did = NHLT_DID_SSP,
54  .formats = max98927_capture_formats,
55  .num_formats = ARRAY_SIZE(max98927_capture_formats),
56  },
57 };
58 
59 int nhlt_soc_add_max98927(struct nhlt *nhlt, int hwlink)
60 {
61  /* Virtual bus id of SSP links are the hardware port ids proper. */
64 }
#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_BACK_LEFT
Definition: nhlt.h:207
@ SPEAKER_FRONT_RIGHT
Definition: nhlt.h:204
@ SPEAKER_BACK_RIGHT
Definition: nhlt.h:208
@ 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_max98927(struct nhlt *nhlt, int hwlink)
Definition: max98927.c:59
static const struct nhlt_format_config max98927_capture_formats[]
Definition: max98927.c:26
static const struct nhlt_endp_descriptor max98927_descriptors[]
Definition: max98927.c:38
static const struct nhlt_format_config max98927_render_formats[]
Definition: max98927.c:5
int num_channels
Definition: nhlt.h:260
Definition: nhlt.h:287