Skip to content

Commit

Permalink
ALSA: hda: intel-nhlt: Ignore vbps when looking for DMIC 32 bps format
Browse files Browse the repository at this point in the history
When looking up DMIC blob from the NHLT table and the format is 32 bits,
ignore the vbps matching for 32 bps for DMIC since some NHLT table have
the vbps as 24, some have it as 32.
The DMIC hardware supports only one type of 32 bit sample size, which is
24 bit sampling on the MSB side and bits[1:0] is used for indicating the
channel number.

Signed-off-by: Peter Ujfalusi <[email protected]>
  • Loading branch information
ujfalusi committed Nov 8, 2023
1 parent 09138cb commit f294891
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions sound/hda/intel-nhlt.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,12 @@ nhlt_get_specific_cfg(struct device *dev, struct nhlt_fmt *fmt, u8 num_ch,
dev_dbg(dev, "Endpoint format: ch=%d fmt=%d/%d rate=%d\n",
wfmt->channels, _vbps, _bps, wfmt->samples_per_sec);

/*
* When looking for exact match of configuration ignore the vbps
* from NHTL table when vbps == 0 passed to the function
*/
if (wfmt->channels == num_ch && wfmt->samples_per_sec == rate &&
vbps == _vbps && bps == _bps)
(!vbps || vbps == _vbps) && bps == _bps)
return &cfg->config;

cfg = (struct nhlt_fmt_cfg *)(cfg->config.caps + cfg->config.size);
Expand Down Expand Up @@ -298,7 +302,21 @@ intel_nhlt_get_endpoint_blob(struct device *dev, struct nhlt_acpi_table *nhlt,
dev_dbg(dev, "Looking for configuration:\n");
dev_dbg(dev, " vbus_id=%d link_type=%d dir=%d, dev_type=%d\n",
bus_id, link_type, dir, dev_type);
dev_dbg(dev, " ch=%d fmt=%d/%d rate=%d\n", num_ch, vbps, bps, rate);
if (link_type == NHLT_LINK_DMIC && bps == 32) {
/*
* Ignore the vbps matching for 32 bps for DMIC since some NHLT
* table have the vbps as 24, some have it as 32.
* The DMIC hardware supports only one type of 32 bit sample
* size, which is 24 bit sampling on the MSB side and bits[1:0]
* is used for indicating the channel number.
*/
dev_dbg(dev,
" ch=%d fmt=%d rate=%d (vbps is ignored for DMIC 32bit format)\n",
num_ch, bps, rate);
vbps = 0;
} else {
dev_dbg(dev, " ch=%d fmt=%d/%d rate=%d\n", num_ch, vbps, bps, rate);
}
dev_dbg(dev, "Endpoint count=%d\n", nhlt->endpoint_count);

epnt = (struct nhlt_endpoint *)nhlt->desc;
Expand Down

0 comments on commit f294891

Please sign in to comment.