summaryrefslogtreecommitdiff
path: root/src/soc/intel
diff options
context:
space:
mode:
authorMatt DeVillier <matt.devillier@gmail.com>2022-12-06 21:05:16 -0600
committerFelix Held <felix-coreboot@felixheld.de>2022-12-21 14:00:13 +0000
commitbf3c648fa7f6cdd946698a2ec6584102b53e4c4a (patch)
tree5628cdf3a39071e5cf87c05dcf7bd329766bacc4 /src/soc/intel
parentca342e108227859112746bb262bb742e800b6973 (diff)
soc/intel/skl; mb/google/eve,poppy: Update NHLT methods
Adapted from WIP (and now abandoned) patches CB:25334, 26308, 26309. Update the nhlt_soc_add_*() methods for max98373, max98927, and rt5514 codecs to program the render and feedback slot numbers as appropriate. TEST=boot Windows on google/eve, atlas, nocturne, and rammus. Verify audio functional with both Google project campfire drivers as well as coolstar's AVS audio drivers. Change-Id: Ib8c6e24ba539e205bd5bbd856ecff43b2c016c2e Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70394 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: CoolStar <coolstarorganization@gmail.com>
Diffstat (limited to 'src/soc/intel')
-rw-r--r--src/soc/intel/skylake/include/soc/nhlt.h9
-rw-r--r--src/soc/intel/skylake/nhlt/max98373.c8
-rw-r--r--src/soc/intel/skylake/nhlt/max98927.c8
-rw-r--r--src/soc/intel/skylake/nhlt/rt5514.c8
4 files changed, 25 insertions, 8 deletions
diff --git a/src/soc/intel/skylake/include/soc/nhlt.h b/src/soc/intel/skylake/include/soc/nhlt.h
index dd2825590c..a511f2ff8d 100644
--- a/src/soc/intel/skylake/include/soc/nhlt.h
+++ b/src/soc/intel/skylake/include/soc/nhlt.h
@@ -51,12 +51,14 @@ int nhlt_soc_add_max98357(struct nhlt *nhlt, int hwlink);
* Add max98373 amplifier in stereo configuration on provided SSP link.
* Return 0 on success, < 0 on error.
*/
-int nhlt_soc_add_max98373(struct nhlt *nhlt, int hwlink);
+int nhlt_soc_add_max98373(struct nhlt *nhlt, int hwlink, int render_slot,
+ int feedback_slot);
/*
* Add rt5514 DSP on provided SSP link. Return 0 on success, < 0 on error.
*/
-int nhlt_soc_add_rt5514(struct nhlt *nhlt, int hwlink, int num_channels);
+int nhlt_soc_add_rt5514(struct nhlt *nhlt, int hwlink, int num_channels,
+ int virtual_slot);
/*
* Add rt5663 headset codec on provided SSP link. Return 0 on success, < 0
@@ -68,7 +70,8 @@ int nhlt_soc_add_rt5663(struct nhlt *nhlt, int hwlink);
* Add max98927 amplifier in stereo configuration on provided SSP link.
* Return 0 on success, < 0 on error.
*/
-int nhlt_soc_add_max98927(struct nhlt *nhlt, int hwlink);
+int nhlt_soc_add_max98927(struct nhlt *nhlt, int hwlink, int render_slot,
+ int feedback_slot);
/*
* Add da7219 headset codec on provided SSP link. Return 0 on success, < 0
diff --git a/src/soc/intel/skylake/nhlt/max98373.c b/src/soc/intel/skylake/nhlt/max98373.c
index 5f4d15ee25..9c02bb7e3f 100644
--- a/src/soc/intel/skylake/nhlt/max98373.c
+++ b/src/soc/intel/skylake/nhlt/max98373.c
@@ -81,8 +81,14 @@ static const struct nhlt_endp_descriptor max98373_descriptors[] = {
},
};
-int nhlt_soc_add_max98373(struct nhlt *nhlt, int hwlink)
+int nhlt_soc_add_max98373(struct nhlt *nhlt, int hwlink, int render_slot,
+ int feedback_slot)
{
+ render_config.tdm_config.virtual_slot = render_slot;
+ render_config.feedback_virtual_slot = feedback_slot;
+ capture_config.tdm_config.virtual_slot = feedback_slot;
+ capture_config.feedback_virtual_slot = render_slot;
+
/* Virtual bus id of SSP links are the hardware port ids proper. */
return nhlt_add_ssp_endpoints(nhlt, hwlink, max98373_descriptors,
ARRAY_SIZE(max98373_descriptors));
diff --git a/src/soc/intel/skylake/nhlt/max98927.c b/src/soc/intel/skylake/nhlt/max98927.c
index b19db26224..a3caa0f8e9 100644
--- a/src/soc/intel/skylake/nhlt/max98927.c
+++ b/src/soc/intel/skylake/nhlt/max98927.c
@@ -74,8 +74,14 @@ static struct nhlt_endp_descriptor max98927_descriptors[] = {
},
};
-int nhlt_soc_add_max98927(struct nhlt *nhlt, int hwlink)
+int nhlt_soc_add_max98927(struct nhlt *nhlt, int hwlink, int render_slot,
+ int feedback_slot)
{
+ render_config.tdm_config.virtual_slot = render_slot;
+ render_config.feedback_virtual_slot = feedback_slot;
+ capture_config.tdm_config.virtual_slot = feedback_slot;
+ capture_config.feedback_virtual_slot = render_slot;
+
/* Virtual bus id of SSP links are the hardware port ids proper. */
return nhlt_add_ssp_endpoints(nhlt, hwlink, max98927_descriptors,
ARRAY_SIZE(max98927_descriptors));
diff --git a/src/soc/intel/skylake/nhlt/rt5514.c b/src/soc/intel/skylake/nhlt/rt5514.c
index df4d1e00b3..894f45f143 100644
--- a/src/soc/intel/skylake/nhlt/rt5514.c
+++ b/src/soc/intel/skylake/nhlt/rt5514.c
@@ -16,7 +16,7 @@ static const struct nhlt_format_config rt5514_4ch_formats[] = {
},
};
-static const struct nhlt_dmic_array_config rt5514_4ch_mic_config = {
+static struct nhlt_dmic_array_config rt5514_4ch_mic_config = {
.tdm_config = {
.virtual_slot = 0x1,
.config_type = NHLT_TDM_MIC_ARRAY,
@@ -24,7 +24,7 @@ static const struct nhlt_dmic_array_config rt5514_4ch_mic_config = {
.array_type = NHLT_MIC_ARRAY_4CH_L_SHAPED,
};
-static const struct nhlt_endp_descriptor rt5514_4ch_descriptors[] = {
+static struct nhlt_endp_descriptor rt5514_4ch_descriptors[] = {
{
.link = NHLT_LINK_SSP,
.device = NHLT_SSP_DEV_I2S,
@@ -38,8 +38,10 @@ static const struct nhlt_endp_descriptor rt5514_4ch_descriptors[] = {
},
};
-int nhlt_soc_add_rt5514(struct nhlt *nhlt, int hwlink, int num_channels)
+int nhlt_soc_add_rt5514(struct nhlt *nhlt, int hwlink, int num_channels, int virtual_slot)
{
+ rt5514_4ch_mic_config.tdm_config.virtual_slot = virtual_slot;
+
switch (num_channels) {
case 4:
return nhlt_add_ssp_endpoints(nhlt, hwlink,