| 1 |
|
| 2 |
|
| 3 |
#include <commonlib/bsd/helpers.h> |
| 4 |
#include <nhlt.h> |
| 5 |
#include <soc/nhlt.h> |
| 6 |
|
| 7 |
static const struct nhlt_tdm_config tdm_config = { |
| 8 |
.virtual_slot = 0, |
| 9 |
.config_type = NHLT_TDM_BASIC, |
| 10 |
}; |
| 11 |
|
| 12 |
static const struct nhlt_format_config da7219_formats[] = { |
| 13 |
|
| 14 |
{ |
| 15 |
.num_channels = 2, |
| 16 |
.sample_freq_khz = 48, |
| 17 |
.container_bits_per_sample = 32, |
| 18 |
.valid_bits_per_sample = 24, |
| 19 |
.settings_file = "dialog-2ch-48khz-24b.bin", |
| 20 |
}, |
| 21 |
}; |
| 22 |
|
| 23 |
static const struct nhlt_endp_descriptor da7219_descriptors[] = { |
| 24 |
|
| 25 |
{ |
| 26 |
.link = NHLT_LINK_SSP, |
| 27 |
.device = NHLT_SSP_DEV_I2S, |
| 28 |
.direction = NHLT_DIR_RENDER, |
| 29 |
.vid = NHLT_VID, |
| 30 |
.did = NHLT_DID_SSP, |
| 31 |
.cfg = &tdm_config, |
| 32 |
.cfg_size = sizeof(tdm_config), |
| 33 |
.formats = da7219_formats, |
| 34 |
.num_formats = ARRAY_SIZE(da7219_formats), |
| 35 |
}, |
| 36 |
|
| 37 |
{ |
| 38 |
.link = NHLT_LINK_SSP, |
| 39 |
.device = NHLT_SSP_DEV_I2S, |
| 40 |
.direction = NHLT_DIR_CAPTURE, |
| 41 |
.vid = NHLT_VID, |
| 42 |
.did = NHLT_DID_SSP, |
| 43 |
.cfg = &tdm_config, |
| 44 |
.cfg_size = sizeof(tdm_config), |
| 45 |
.formats = da7219_formats, |
| 46 |
.num_formats = ARRAY_SIZE(da7219_formats), |
| 47 |
}, |
| 48 |
}; |
| 49 |
|
| 50 |
int nhlt_soc_add_da7219(struct nhlt *nhlt, int hwlink) |
| 51 |
{ |
| 52 |
|
| 53 |
return nhlt_add_ssp_endpoints(nhlt, hwlink, da7219_descriptors, |
| 54 |
ARRAY_SIZE(da7219_descriptors)); |
| 55 |
} |