Skip to content

Commit

Permalink
ASoC: Intel: catpt: Wake up device before configuring SSP port
Browse files Browse the repository at this point in the history
catpt_dai_pcm_new() invoked during new PCM runtime creation configures
SSP by sending IPC to DSP firmware. For that to succeed device needs to
be up and running. While components default probing behavior -
snd_soc_catpt causing machine board module to load just after it - needs
no changes, machine board's module may be unloaded and re-loaded at a
different time e.g.: when catpt is already asleep.

Wake device explicitly in catpt_dai_pcm_new() to ensure communication is
established before sending any IPCs, enabling those advanced scenarios
in the process.

Signed-off-by: Cezary Rojewski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
crojewsk-intel authored and broonie committed Oct 14, 2020
1 parent 1849a38 commit 1d159ed
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sound/soc/intel/catpt/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,17 @@ static int catpt_dai_pcm_new(struct snd_soc_pcm_runtime *rtm,
break;
}

/* see if this is a new configuration */
if (!memcmp(&cdev->devfmt[devfmt.iface], &devfmt, sizeof(devfmt)))
return 0;

pm_runtime_get_sync(cdev->dev);

ret = catpt_ipc_set_device_format(cdev, &devfmt);

pm_runtime_mark_last_busy(cdev->dev);
pm_runtime_put_autosuspend(cdev->dev);

if (ret)
return CATPT_IPC_ERROR(ret);

Expand Down

0 comments on commit 1d159ed

Please sign in to comment.