mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 23:51:37 +00:00
Merge series "ASoC: Intel: machine driver corrections" from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
The first fix solves an underflow in SoundWire platforms using the max98373 amplifier, the rest of the patches are minor corrections in machine drivers. The fix should be queued for the 5.14 cycle, the rest should be harmless but can be deferred for 5.15 if it's too late already. Brent Lu (2): ASoC: SOF: add a helper to get topology configured bclk ASoC: Intel: sof_cs42l42: use helper function to get bclk frequency Gongjun Song (1): ASoC: Intel: soc-acpi: add support for SoundWire of TGL-H-RVP Rander Wang (1): ASoC: Intel: boards: fix xrun issue on platform with max98373 include/sound/sof.h | 1 + sound/soc/intel/boards/sof_cs42l42.c | 8 +- sound/soc/intel/boards/sof_sdw_max98373.c | 81 ++++++++++++------- .../intel/common/soc-acpi-intel-tgl-match.c | 15 ++++ sound/soc/sof/sof-audio.c | 42 ++++++++-- 5 files changed, 111 insertions(+), 36 deletions(-) -- 2.25.1
This commit is contained in:
commit
d4de9aa58b
@ -55,43 +55,68 @@ static int spk_init(struct snd_soc_pcm_runtime *rtd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int max98373_sdw_trigger(struct snd_pcm_substream *substream, int cmd)
|
||||
static int mx8373_enable_spk_pin(struct snd_pcm_substream *substream, bool enable)
|
||||
{
|
||||
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
|
||||
struct snd_soc_dai *codec_dai;
|
||||
struct snd_soc_dai *cpu_dai;
|
||||
int ret;
|
||||
int j;
|
||||
|
||||
switch (cmd) {
|
||||
case SNDRV_PCM_TRIGGER_START:
|
||||
case SNDRV_PCM_TRIGGER_RESUME:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
|
||||
/* enable max98373 first */
|
||||
ret = max_98373_trigger(substream, cmd);
|
||||
if (ret < 0)
|
||||
break;
|
||||
/* set spk pin by playback only */
|
||||
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
|
||||
return 0;
|
||||
|
||||
ret = sdw_trigger(substream, cmd);
|
||||
break;
|
||||
case SNDRV_PCM_TRIGGER_STOP:
|
||||
case SNDRV_PCM_TRIGGER_SUSPEND:
|
||||
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
|
||||
ret = sdw_trigger(substream, cmd);
|
||||
if (ret < 0)
|
||||
break;
|
||||
cpu_dai = asoc_rtd_to_cpu(rtd, 0);
|
||||
for_each_rtd_codec_dais(rtd, j, codec_dai) {
|
||||
struct snd_soc_dapm_context *dapm =
|
||||
snd_soc_component_get_dapm(cpu_dai->component);
|
||||
char pin_name[16];
|
||||
|
||||
ret = max_98373_trigger(substream, cmd);
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
snprintf(pin_name, ARRAY_SIZE(pin_name), "%s Spk",
|
||||
codec_dai->component->name_prefix);
|
||||
|
||||
if (enable)
|
||||
ret = snd_soc_dapm_enable_pin(dapm, pin_name);
|
||||
else
|
||||
ret = snd_soc_dapm_disable_pin(dapm, pin_name);
|
||||
|
||||
if (!ret)
|
||||
snd_soc_dapm_sync(dapm);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mx8373_sdw_prepare(struct snd_pcm_substream *substream)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
/* according to soc_pcm_prepare dai link prepare is called first */
|
||||
ret = sdw_prepare(substream);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return mx8373_enable_spk_pin(substream, true);
|
||||
}
|
||||
|
||||
static int mx8373_sdw_hw_free(struct snd_pcm_substream *substream)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
/* according to soc_pcm_hw_free dai link free is called first */
|
||||
ret = sdw_hw_free(substream);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return mx8373_enable_spk_pin(substream, false);
|
||||
}
|
||||
|
||||
static const struct snd_soc_ops max_98373_sdw_ops = {
|
||||
.startup = sdw_startup,
|
||||
.prepare = sdw_prepare,
|
||||
.trigger = max98373_sdw_trigger,
|
||||
.hw_free = sdw_hw_free,
|
||||
.prepare = mx8373_sdw_prepare,
|
||||
.trigger = sdw_trigger,
|
||||
.hw_free = mx8373_sdw_hw_free,
|
||||
.shutdown = sdw_shutdown,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user