Unverified Commit c23f0444 authored by Mark Brown's avatar Mark Brown
Browse files

Merge series "ASoC: soc-pcm cleanup step6" from Kuninori Morimoto...

Merge series "ASoC: soc-pcm cleanup step6" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

We are using plural form for for_each_xxx() macro.
But, for_each_rtd_codec/cpu_dai() are out of this rule.
1) - 7) are for it.
8) - 9) add new for_each_card_xxx() macros.

Kuninori Morimoto (9):
   1) ASoC: soc.h: add for_each_rtd_codecs/cpus_dai() macro
   2) ASoC: Intel: use for_each_rtd_codecs/cpus_dai() macro
   3) ASoC: mediatek: use for_each_rtd_codecs/cpus_dai() macro
   4) ASoC: meson: use for_each_rtd_codecs/cpus_dai() macro
   5) ASoC: qcom: use for_each_rtd_codecs/cpus_dai() macro
   6) ASoC: soc: use for_each_rtd_codecs/cpus_dai() macro
   7) ASoC: soc.h: remove non plural form for_each_xxx macro
   8) ASoC: soc-dapm: add for_each_card_dapms() macro
   9) ASoC: soc-dapm: add for_each_card_widgets() macro

 drivers/soundwire/qcom.c                      |   2 +-
 include/sound/soc.h                           |  28 ++--
 sound/soc/intel/boards/cml_rt1011_rt5682.c    |   2 +-
 sound/soc/intel/boards/kbl_da7219_max98927.c  |   4 +-
 sound/soc/intel/boards/kbl_rt5663_max98927.c  |   2 +-
 .../intel/boards/kbl_rt5663_rt5514_max98927.c |   2 +-
 .../mediatek/mt8173/mt8173-rt5650-rt5514.c    |   2 +-
 .../mediatek/mt8173/mt8173-rt5650-rt5676.c    |   2 +-
 sound/soc/mediatek/mt8173/mt8173-rt5650.c     |   2 +-
 .../mediatek/mt8183/mt8183-da7219-max98357.c  |   4 +-
 sound/soc/meson/axg-card.c                    |   2 +-
 sound/soc/meson/meson-card-utils.c            |   2 +-
 sound/soc/qcom/apq8016_sbc.c                  |   2 +-
 sound/soc/qcom/sdm845.c                       |   8 +-
 sound/soc/soc-core.c                          |  16 +--
 sound/soc/soc-dapm.c                          |  53 ++++----
 sound/soc/soc-pcm.c                           | 124 +++++++++---------
 sound/soc/soc-topology.c                      |   2 +-
 18 files changed, 134 insertions(+), 125 deletions(-)

--
2.17.1
parents a3b7343e 14596692
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -603,7 +603,7 @@ static int qcom_swrm_startup(struct snd_pcm_substream *substream,

	ctrl->sruntime[dai->id] = sruntime;

	for_each_rtd_codec_dai(rtd, i, codec_dai) {
	for_each_rtd_codec_dais(rtd, i, codec_dai) {
		ret = snd_soc_dai_set_sdw_stream(codec_dai, sruntime,
						 substream->stream);
		if (ret < 0 && ret != -ENOTSUPP) {
+18 −10
Original line number Diff line number Diff line
@@ -1117,6 +1117,14 @@ struct snd_soc_card {
#define for_each_card_components(card, component)			\
	list_for_each_entry(component, &(card)->component_dev_list, card_list)

#define for_each_card_dapms(card, dapm)					\
	list_for_each_entry(dapm, &card->dapm_list, list)

#define for_each_card_widgets(card, w)\
	list_for_each_entry(w, &card->widgets, list)
#define for_each_card_widgets_safe(card, w, _w)	\
	list_for_each_entry_safe(w, _w, &card->widgets, list)

/* SoC machine DAI configuration, glues a codec and cpu DAI together */
struct snd_soc_pcm_runtime {
	struct device *dev;
@@ -1163,19 +1171,19 @@ struct snd_soc_pcm_runtime {
	for ((i) = 0;							\
	     ((i) < rtd->num_components) && ((component) = rtd->components[i]);\
	     (i)++)
#define for_each_rtd_codec_dai(rtd, i, dai)\
#define for_each_rtd_cpu_dais(rtd, i, dai)				\
	for ((i) = 0;							\
	     ((i) < rtd->num_cpus) && ((dai) = rtd->cpu_dais[i]);	\
	     (i)++)
#define for_each_rtd_cpu_dais_rollback(rtd, i, dai)		\
	for (; (--(i) >= 0) && ((dai) = rtd->cpu_dais[i]);)
#define for_each_rtd_codec_dais(rtd, i, dai)				\
	for ((i) = 0;							\
	     ((i) < rtd->num_codecs) && ((dai) = rtd->codec_dais[i]);	\
	     (i)++)
#define for_each_rtd_codec_dai_rollback(rtd, i, dai)		\
#define for_each_rtd_codec_dais_rollback(rtd, i, dai)		\
	for (; (--(i) >= 0) && ((dai) = rtd->codec_dais[i]);)

#define for_each_rtd_cpu_dai(rtd, i, dai)\
	for ((i) = 0;						       \
	     ((i) < rtd->num_cpus) && ((dai) = rtd->cpu_dais[i]); \
	     (i)++)
#define for_each_rtd_cpu_dai_rollback(rtd, i, dai)		\
	for (; (--(i) >= 0) && ((dai) = rtd->cpu_dais[i]);)

void snd_soc_close_delayed_work(struct snd_soc_pcm_runtime *rtd);

+1 −1
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ static int cml_rt1011_hw_params(struct snd_pcm_substream *substream,

	srate = params_rate(params);

	for_each_rtd_codec_dai(rtd, i, codec_dai) {
	for_each_rtd_codec_dais(rtd, i, codec_dai) {

		/* 100 Fs to drive 24 bit data */
		ret = snd_soc_dai_set_pll(codec_dai, 0, RT1011_PLL1_S_BCLK,
+2 −2
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ static int kabylake_ssp0_hw_params(struct snd_pcm_substream *substream,
	struct snd_soc_dai *codec_dai;
	int ret, j;

	for_each_rtd_codec_dai(runtime, j, codec_dai) {
	for_each_rtd_codec_dais(runtime, j, codec_dai) {

		if (!strcmp(codec_dai->component->name, MAX98927_DEV0_NAME)) {
			ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x30, 3, 8, 16);
@@ -224,7 +224,7 @@ static int kabylake_ssp0_trigger(struct snd_pcm_substream *substream, int cmd)
	struct snd_soc_dai *codec_dai;
	int j, ret;

	for_each_rtd_codec_dai(rtd, j, codec_dai) {
	for_each_rtd_codec_dais(rtd, j, codec_dai) {
		const char *name = codec_dai->component->name;
		struct snd_soc_component *component = codec_dai->component;
		struct snd_soc_dapm_context *dapm =
+1 −1
Original line number Diff line number Diff line
@@ -472,7 +472,7 @@ static int kabylake_ssp0_hw_params(struct snd_pcm_substream *substream,
	struct snd_soc_dai *codec_dai;
	int ret = 0, j;

	for_each_rtd_codec_dai(rtd, j, codec_dai) {
	for_each_rtd_codec_dais(rtd, j, codec_dai) {
		if (!strcmp(codec_dai->component->name, MAXIM_DEV0_NAME)) {
			/*
			 * Use channel 4 and 5 for the first amp
Loading