lib/nhlt, soc/intel/skl: Update NHLT to program feedback config

Adapted from WIP (and abandoned) patch CB:25334, this patch:

1. Ensures SSP endpoint InstanceId is 0
2. Adds capability_size parameter at the end of the nhlt
3. Adsd more config_type enum values to accommodate feedback stream
4. Programs virtual_slot values for max98373, max98927,
   and rt5514 nhlt files
5. Adds NHLT feedback_config parameters

Default feedback configs are added here to the max98373, max98927, and
rt5514 codecs; in a follow-on patch, these will be overridden at the
board level.

TEST=tested with subsequent patch

Change-Id: I59285e332de09bb448b0d67ad56c72a208588d47
Signed-off-by: Matt DeVillier <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70393
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: CoolStar <coolstarorganization@gmail.com>
This commit is contained in:
Matt DeVillier
2022-12-06 20:46:36 -06:00
committed by Felix Held
parent 343644006f
commit ca342e1082
5 changed files with 67 additions and 37 deletions

View File

@@ -181,14 +181,6 @@ int nhlt_endpoint_add_formats(struct nhlt_endpoint *endp,
return 0;
}
void nhlt_next_instance(struct nhlt *nhlt, int link_type)
{
if (link_type < NHLT_LINK_HDA || link_type >= NHLT_MAX_LINK_TYPES)
return;
nhlt->current_instance_id[link_type]++;
}
static size_t calc_specific_config_size(struct nhlt_specific_config *cfg)
{
return sizeof(cfg->size) + cfg->size;
@@ -255,7 +247,7 @@ static size_t calc_size(struct nhlt *nhlt)
size_t nhlt_current_size(struct nhlt *nhlt)
{
return calc_size(nhlt) + sizeof(acpi_header_t);
return calc_size(nhlt) + sizeof(acpi_header_t) + sizeof(uint32_t);
}
static void nhlt_free_resources(struct nhlt *nhlt)
@@ -360,12 +352,13 @@ static void serialize_endpoint(struct nhlt_endpoint *endp, struct cursor *cur)
static void nhlt_serialize_endpoints(struct nhlt *nhlt, struct cursor *cur)
{
int i;
int i, capabilities_size = 0;
ser8(cur, nhlt->num_endpoints);
for (i = 0; i < nhlt->num_endpoints; i++)
serialize_endpoint(&nhlt->endpoints[i], cur);
ser32(cur, capabilities_size);
}
uintptr_t nhlt_serialize(struct nhlt *nhlt, uintptr_t acpi_addr)
@@ -468,12 +461,5 @@ int nhlt_add_endpoints(struct nhlt *nhlt,
int nhlt_add_ssp_endpoints(struct nhlt *nhlt, int virtual_bus_id,
const struct nhlt_endp_descriptor *epds, size_t num_epds)
{
int ret;
ret = _nhlt_add_endpoints(nhlt, virtual_bus_id, epds, num_epds);
if (!ret)
nhlt_next_instance(nhlt, NHLT_LINK_SSP);
return ret;
return _nhlt_add_endpoints(nhlt, virtual_bus_id, epds, num_epds);
}