Skip to content

Commit

Permalink
ASoC: soc-pcm: merge soc_pcm_hw_update_format/subformat()
Browse files Browse the repository at this point in the history
format() and subformat() should be handled in the same time, no need to
have each functions. Let's merge these

	soc_pcm_hw_update_format()
	soc_pcm_hw_update_subformat()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Cezary Rojewski <cezary.rojewski@intel.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/87v7soz664.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Kuninori Morimoto authored and Mark Brown committed Mar 5, 2025
1 parent de22dc7 commit b92bc4d
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,13 +603,8 @@ static void soc_pcm_hw_update_chan(struct snd_pcm_hardware *hw,
static void soc_pcm_hw_update_format(struct snd_pcm_hardware *hw,
const struct snd_soc_pcm_stream *p)
{
hw->formats &= p->formats;
}

static void soc_pcm_hw_update_subformat(struct snd_pcm_hardware *hw,
const struct snd_soc_pcm_stream *p)
{
hw->subformats &= p->subformats;
hw->formats &= p->formats;
hw->subformats &= p->subformats;
}

/**
Expand Down Expand Up @@ -650,7 +645,6 @@ int snd_soc_runtime_calc_hw(struct snd_soc_pcm_runtime *rtd,
soc_pcm_hw_update_chan(hw, cpu_stream);
soc_pcm_hw_update_rate(hw, cpu_stream);
soc_pcm_hw_update_format(hw, cpu_stream);
soc_pcm_hw_update_subformat(hw, cpu_stream);
}
cpu_chan_min = hw->channels_min;
cpu_chan_max = hw->channels_max;
Expand All @@ -672,7 +666,6 @@ int snd_soc_runtime_calc_hw(struct snd_soc_pcm_runtime *rtd,
soc_pcm_hw_update_chan(hw, codec_stream);
soc_pcm_hw_update_rate(hw, codec_stream);
soc_pcm_hw_update_format(hw, codec_stream);
soc_pcm_hw_update_subformat(hw, codec_stream);
}

/* Verify both a valid CPU DAI and a valid CODEC DAI were found */
Expand Down Expand Up @@ -1765,7 +1758,6 @@ static void dpcm_runtime_setup_fe(struct snd_pcm_substream *substream)
soc_pcm_hw_update_rate(hw, cpu_stream);
soc_pcm_hw_update_chan(hw, cpu_stream);
soc_pcm_hw_update_format(hw, cpu_stream);
soc_pcm_hw_update_subformat(hw, cpu_stream);
}

}
Expand Down Expand Up @@ -1803,7 +1795,6 @@ static void dpcm_runtime_setup_be_format(struct snd_pcm_substream *substream)
codec_stream = snd_soc_dai_get_pcm_stream(dai, stream);

soc_pcm_hw_update_format(hw, codec_stream);
soc_pcm_hw_update_subformat(hw, codec_stream);
}
}
}
Expand Down

0 comments on commit b92bc4d

Please sign in to comment.