Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sound/soc/intel/boards/sof_sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ int sdw_startup(struct snd_pcm_substream *substream)
return sdw_startup_stream(substream);
}

static int sdw_prepare(struct snd_pcm_substream *substream)
int sdw_prepare(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct sdw_stream_runtime *sdw_stream;
Expand All @@ -244,7 +244,7 @@ static int sdw_prepare(struct snd_pcm_substream *substream)
return sdw_prepare_stream(sdw_stream);
}

static int sdw_trigger(struct snd_pcm_substream *substream, int cmd)
int sdw_trigger(struct snd_pcm_substream *substream, int cmd)
{
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct sdw_stream_runtime *sdw_stream;
Expand Down Expand Up @@ -284,7 +284,7 @@ static int sdw_trigger(struct snd_pcm_substream *substream, int cmd)
return ret;
}

static int sdw_hw_free(struct snd_pcm_substream *substream)
int sdw_hw_free(struct snd_pcm_substream *substream)
{
struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
struct sdw_stream_runtime *sdw_stream;
Expand Down
3 changes: 3 additions & 0 deletions sound/soc/intel/boards/sof_sdw_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ struct mc_private {
extern unsigned long sof_sdw_quirk;

int sdw_startup(struct snd_pcm_substream *substream);
int sdw_prepare(struct snd_pcm_substream *substream);
int sdw_trigger(struct snd_pcm_substream *substream, int cmd);
int sdw_hw_free(struct snd_pcm_substream *substream);
void sdw_shutdown(struct snd_pcm_substream *substream);

/* generic HDMI support */
Expand Down
33 changes: 32 additions & 1 deletion sound/soc/intel/boards/sof_sdw_max98373.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,40 @@ static int spk_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}

static int max98373_sdw_trigger(struct snd_pcm_substream *substream, int cmd)
{
int ret;

switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
/* enable max98373 first */
ret = max98373_trigger(substream, cmd);
if (ret < 0)
break;

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;

ret = max98373_trigger(substream, cmd);
break;
}

return ret;
}

static const struct snd_soc_ops max_98373_sdw_ops = {
.startup = sdw_startup,
.trigger = max98373_trigger,
.prepare = sdw_prepare,
.trigger = max98373_sdw_trigger,
.hw_free = sdw_hw_free,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this here? This makes no sense to me.

.shutdown = sdw_shutdown,
};

Expand Down