Skip to content

Commit

Permalink
Fixes a problem with clock settings of HiFiBerry DAC+ADC PRO (#3545)
Browse files Browse the repository at this point in the history
This patch fixes a problem of the re-calculation of
i2s-clock and -parameter settings when only the ADC is activated.

Signed-off-by: Joerg Schambacher <joerg@i2audio.com>
  • Loading branch information
j-schambacher authored and popcornmix committed May 20, 2020
1 parent 8695764 commit f303194
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sound/soc/bcm/hifiberry_dacplusadcpro.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,11 @@ static int snd_rpi_hifiberry_dacplusadcpro_hw_params(
int channels = params_channels(params);
int width = 32;
struct snd_soc_component *dac = rtd->codec_dais[0]->component;
struct snd_soc_dai *dai = rtd->codec_dais[0];
struct snd_soc_dai_driver *drv = dai->driver;
const struct snd_soc_dai_ops *ops = drv->ops;

if (snd_rpi_hifiberry_is_dacpro) {

width = snd_pcm_format_physical_width(params_format(params));

snd_rpi_hifiberry_dacplusadcpro_set_sclk(dac,
Expand All @@ -414,6 +416,11 @@ static int snd_rpi_hifiberry_dacplusadcpro_hw_params(
return ret;
ret = snd_soc_dai_set_tdm_slot(rtd->codec_dais[1], 0x03, 0x03,
channels, width);
if (ret)
return ret;

if (snd_rpi_hifiberry_is_dacpro && ops->hw_params)
ret = ops->hw_params(substream, params, dai);
return ret;
}

Expand Down

0 comments on commit f303194

Please sign in to comment.