Unverified Commit 6bff73c6 authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: soc-pcm cleanup step4

Merge series from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

These are soc-pcm cleanup step4.

[01/13] - [06/13] are posted but not yet accepted patches.
To avoid conflict, I merged these into step4.
These patches are already received Reviewed-by from Pierre-Louis.

	Subject: [PATCH 0/6] ASoC: use for_each_rtd_codec_dai() macro
	Date: Thu, 13 Feb 2020 13:08:07 +0900

Kuninori Morimoto (13):
   1) ASoC: soundwaire: qcom: use for_each_rtd_codec_dai() macro
   2) ASoC: qcom: sdm845: use for_each_rtd_codec_dai() macro
   3) ASoC: qcom: apq8016_sbc: use for_each_rtd_codec_dai() macro
   4) ASoC: intel: cml_rt1011_rt5682: use for_each_rtd_codec_dai() macro
   5) ASoC: intel: kbl_da7219_max98927: use for_each_rtd_codec_dai() macro
   6) ASoC: mediatek: mt8183-da7219-max98357: use for_each_rtd_codec_dai() macro
   7) ASoC: soc-pcm: add snd_soc_dai_get_pcm_stream()
   8) ASoC: soc-pcm: cleanup soc_pcm_apply_msb()
   9) ASoC: soc-pcm: add snd_soc_dai_get_widget()
  10) ASoC: soc-pcm: merge dpcm_run_new/old_update() into dpcm_fe_runtime_update()
  11) ASoC: soc-pcm: move dpcm_path_put() to soc-pcm.c
  12) ASoC: soc-pcm: move CONFIG_DEBUG_FS functions to top side
  13) ASoC: soc-pcm: add dpcm_create/remove_debugfs_state()

 drivers/soundwire/qcom.c                      |   7 +-
 include/sound/soc-dai.h                       |  15 +
 include/sound/soc-dapm.h                      |   1 +
 include/sound/soc-dpcm.h                      |   7 +-
 sound/soc/intel/boards/cml_rt1011_rt5682.c    |   3 +-
 sound/soc/intel/boards/kbl_da7219_max98927.c  |   8 +-
 sound/soc/intel/skylake/skl-pcm.c             |  10 +-
 .../mediatek/mt8183/mt8183-da7219-max98357.c  |   8 +-
 sound/soc/qcom/apq8016_sbc.c                  |   7 +-
 sound/soc/qcom/sdm845.c                       |  20 +-
 sound/soc/soc-dai.c                           |   7 +-
 sound/soc/soc-dapm.c                          |  20 +-
 sound/soc/soc-pcm.c                           | 462 ++++++++----------
 13 files changed, 266 insertions(+), 309 deletions(-)

--
2.17.1

Thank you for your help !!
Best regards
---
Kuninori Morimoto
parents d2aaa8d8 154dae87
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -352,6 +352,21 @@ struct snd_soc_dai {
	unsigned int started:1;
};

static inline struct snd_soc_pcm_stream *
snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream)
{
	return (stream == SNDRV_PCM_STREAM_PLAYBACK) ?
		&dai->driver->playback : &dai->driver->capture;
}

static inline
struct snd_soc_dapm_widget *snd_soc_dai_get_widget(
	struct snd_soc_dai *dai, int stream)
{
	return (stream == SNDRV_PCM_STREAM_PLAYBACK) ?
		dai->playback_widget : dai->capture_widget;
}

static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
					     const struct snd_pcm_substream *ss)
{
+1 −0
Original line number Diff line number Diff line
@@ -484,6 +484,7 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
	struct snd_soc_dapm_widget_list **list,
	bool (*custom_stop_condition)(struct snd_soc_dapm_widget *,
				      enum snd_soc_dapm_direction));
void snd_soc_dapm_dai_free_widgets(struct snd_soc_dapm_widget_list **list);

struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(
	struct snd_kcontrol *kcontrol);
+1 −6
Original line number Diff line number Diff line
@@ -145,6 +145,7 @@ static inline void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd)

int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
	int stream, struct snd_soc_dapm_widget_list **list_);
void dpcm_path_put(struct snd_soc_dapm_widget_list **list);
int dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
	int stream, struct snd_soc_dapm_widget_list **list, int new);
int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream);
@@ -158,10 +159,4 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream);
int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
	int event);

static inline void dpcm_path_put(struct snd_soc_dapm_widget_list **list)
{
	kfree(*list);
}


#endif
+2 −8
Original line number Diff line number Diff line
@@ -112,10 +112,7 @@ static void skl_set_suspend_active(struct snd_pcm_substream *substream,
	struct snd_soc_dapm_widget *w;
	struct skl_dev *skl = bus_to_skl(bus);

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		w = dai->playback_widget;
	else
		w = dai->capture_widget;
	w = snd_soc_dai_get_widget(dai, substream->stream);

	if (w->ignore_suspend && enable)
		skl->supend_active++;
@@ -475,10 +472,7 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
	if (!mconfig)
		return -EIO;

	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
		w = dai->playback_widget;
	else
		w = dai->capture_widget;
	w = snd_soc_dai_get_widget(dai, substream->stream);

	switch (cmd) {
	case SNDRV_PCM_TRIGGER_RESUME:
+1 −6
Original line number Diff line number Diff line
@@ -390,12 +390,7 @@ int snd_soc_dai_compress_new(struct snd_soc_dai *dai,
 */
bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)
{
	struct snd_soc_pcm_stream *stream;

	if (dir == SNDRV_PCM_STREAM_PLAYBACK)
		stream = &dai->driver->playback;
	else
		stream = &dai->driver->capture;
	struct snd_soc_pcm_stream *stream = snd_soc_dai_get_pcm_stream(dai, dir);

	/* If the codec specifies any channels at all, it supports the stream */
	return stream->channels_min;
Loading