Commit 6bff73c6 authored by Mark Brown's avatar Mark Brown

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
...@@ -352,6 +352,21 @@ struct snd_soc_dai { ...@@ -352,6 +352,21 @@ struct snd_soc_dai {
unsigned int started:1; 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, static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai,
const struct snd_pcm_substream *ss) const struct snd_pcm_substream *ss)
{ {
......
...@@ -484,6 +484,7 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, ...@@ -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, struct snd_soc_dapm_widget_list **list,
bool (*custom_stop_condition)(struct snd_soc_dapm_widget *, bool (*custom_stop_condition)(struct snd_soc_dapm_widget *,
enum snd_soc_dapm_direction)); 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_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(
struct snd_kcontrol *kcontrol); struct snd_kcontrol *kcontrol);
......
...@@ -145,6 +145,7 @@ static inline void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd) ...@@ -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 dpcm_path_get(struct snd_soc_pcm_runtime *fe,
int stream, struct snd_soc_dapm_widget_list **list_); 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 dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
int stream, struct snd_soc_dapm_widget_list **list, int new); int stream, struct snd_soc_dapm_widget_list **list, int new);
int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream); 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); ...@@ -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 dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
int event); int event);
static inline void dpcm_path_put(struct snd_soc_dapm_widget_list **list)
{
kfree(*list);
}
#endif #endif
...@@ -112,10 +112,7 @@ static void skl_set_suspend_active(struct snd_pcm_substream *substream, ...@@ -112,10 +112,7 @@ static void skl_set_suspend_active(struct snd_pcm_substream *substream,
struct snd_soc_dapm_widget *w; struct snd_soc_dapm_widget *w;
struct skl_dev *skl = bus_to_skl(bus); struct skl_dev *skl = bus_to_skl(bus);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) w = snd_soc_dai_get_widget(dai, substream->stream);
w = dai->playback_widget;
else
w = dai->capture_widget;
if (w->ignore_suspend && enable) if (w->ignore_suspend && enable)
skl->supend_active++; skl->supend_active++;
...@@ -475,10 +472,7 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd, ...@@ -475,10 +472,7 @@ static int skl_pcm_trigger(struct snd_pcm_substream *substream, int cmd,
if (!mconfig) if (!mconfig)
return -EIO; return -EIO;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) w = snd_soc_dai_get_widget(dai, substream->stream);
w = dai->playback_widget;
else
w = dai->capture_widget;
switch (cmd) { switch (cmd) {
case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_RESUME:
......
...@@ -390,12 +390,7 @@ int snd_soc_dai_compress_new(struct snd_soc_dai *dai, ...@@ -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) bool snd_soc_dai_stream_valid(struct snd_soc_dai *dai, int dir)
{ {
struct snd_soc_pcm_stream *stream; struct snd_soc_pcm_stream *stream = snd_soc_dai_get_pcm_stream(dai, dir);
if (dir == SNDRV_PCM_STREAM_PLAYBACK)
stream = &dai->driver->playback;
else
stream = &dai->driver->capture;
/* If the codec specifies any channels at all, it supports the stream */ /* If the codec specifies any channels at all, it supports the stream */
return stream->channels_min; return stream->channels_min;
......
...@@ -1105,6 +1105,11 @@ static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget) ...@@ -1105,6 +1105,11 @@ static int snd_soc_dapm_suspend_check(struct snd_soc_dapm_widget *widget)
} }
} }
static void dapm_widget_list_free(struct snd_soc_dapm_widget_list **list)
{
kfree(*list);
}
static int dapm_widget_list_create(struct snd_soc_dapm_widget_list **list, static int dapm_widget_list_create(struct snd_soc_dapm_widget_list **list,
struct list_head *widgets) struct list_head *widgets)
{ {
...@@ -1310,6 +1315,11 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, ...@@ -1310,6 +1315,11 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
return paths; return paths;
} }
void snd_soc_dapm_dai_free_widgets(struct snd_soc_dapm_widget_list **list)
{
dapm_widget_list_free(list);
}
/* /*
* Handler for regulator supply widget. * Handler for regulator supply widget.
*/ */
...@@ -2620,10 +2630,7 @@ static int dapm_update_dai_unlocked(struct snd_pcm_substream *substream, ...@@ -2620,10 +2630,7 @@ static int dapm_update_dai_unlocked(struct snd_pcm_substream *substream,
struct snd_soc_dapm_widget *w; struct snd_soc_dapm_widget *w;
int ret; int ret;
if (dir == SNDRV_PCM_STREAM_PLAYBACK) w = snd_soc_dai_get_widget(dai, dir);
w = dai->playback_widget;
else
w = dai->capture_widget;
if (!w) if (!w)
return 0; return 0;
...@@ -4389,10 +4396,7 @@ static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream, ...@@ -4389,10 +4396,7 @@ static void soc_dapm_dai_stream_event(struct snd_soc_dai *dai, int stream,
struct snd_soc_dapm_widget *w; struct snd_soc_dapm_widget *w;
unsigned int ep; unsigned int ep;
if (stream == SNDRV_PCM_STREAM_PLAYBACK) w = snd_soc_dai_get_widget(dai, stream);
w = dai->playback_widget;
else
w = dai->capture_widget;
if (w) { if (w) {
dapm_mark_dirty(w, "stream event"); dapm_mark_dirty(w, "stream event");
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment