All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: Re: [PATCH v2 1/7] ASoC: add soc-link.c
Date: Thu, 21 May 2020 11:10:19 -0700	[thread overview]
Message-ID: <51622f63fdde93142e5df1867b8fd0a3676654db.camel@linux.intel.com> (raw)
In-Reply-To: <87367u59ve.wl-kuninori.morimoto.gx@renesas.com>

On Thu, 2020-05-21 at 10:56 +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> Current ALSA SoC has many dai_link->xxx() functions.
> But, it is implemented randomly at random place.
> 
> This patch creats new soc-link.c and collect dai_link related
> operation into it.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  include/sound/soc-link.h | 13 +++++++++++++
>  sound/soc/Makefile       |  2 +-
>  sound/soc/soc-core.c     | 12 ++++--------
>  sound/soc/soc-link.c     | 36 ++++++++++++++++++++++++++++++++++++
>  4 files changed, 54 insertions(+), 9 deletions(-)
>  create mode 100644 include/sound/soc-link.h
>  create mode 100644 sound/soc/soc-link.c
> 
> diff --git a/include/sound/soc-link.h b/include/sound/soc-link.h
> new file mode 100644
> index 000000000000..7fc5cead5942
> --- /dev/null
> +++ b/include/sound/soc-link.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: GPL-2.0
> + *
> + * soc-link.h
> + *
> + * Copyright (C) 2019 Renesas Electronics Corp.
> + * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> + */
> +#ifndef __SOC_LINK_H
> +#define __SOC_LINK_H
> +
> +int snd_soc_link_init(struct snd_soc_pcm_runtime *rtd);
> +
> +#endif /* __SOC_LINK_H */
> diff --git a/sound/soc/Makefile b/sound/soc/Makefile
> index 861a21b79484..70a5f19ea3a1 100644
> --- a/sound/soc/Makefile
> +++ b/sound/soc/Makefile
> @@ -1,6 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0
>  snd-soc-core-objs := soc-core.o soc-dapm.o soc-jack.o soc-utils.o
> soc-dai.o soc-component.o
> -snd-soc-core-objs += soc-pcm.o soc-io.o soc-devres.o soc-ops.o
> +snd-soc-core-objs += soc-pcm.o soc-io.o soc-devres.o soc-ops.o soc-
> link.o
>  snd-soc-core-$(CONFIG_SND_SOC_COMPRESS) += soc-compress.o
>  
>  ifneq ($(CONFIG_SND_SOC_TOPOLOGY),)
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index e697258d2ffc..955e175643d7 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -38,6 +38,7 @@
>  #include <sound/soc.h>
>  #include <sound/soc-dpcm.h>
>  #include <sound/soc-topology.h>
> +#include <sound/soc-link.h>
>  #include <sound/initval.h>
>  
>  #define CREATE_TRACE_POINTS
> @@ -1049,14 +1050,9 @@ static int soc_init_pcm_runtime(struct
> snd_soc_card *card,
>  	rtd->pmdown_time = pmdown_time;
>  
>  	/* do machine specific initialization */
> -	if (dai_link->init) {
> -		ret = dai_link->init(rtd);
> -		if (ret < 0) {
> -			dev_err(card->dev, "ASoC: failed to init %s:
> %d\n",
> -				dai_link->name, ret);
> -			return ret;
> -		}
> -	}
> +	ret = snd_soc_link_init(rtd);
> +	if (ret < 0)
> +		return ret;
>  
>  	if (dai_link->dai_fmt) {
>  		ret = snd_soc_runtime_set_dai_fmt(rtd, dai_link-
> >dai_fmt);
> diff --git a/sound/soc/soc-link.c b/sound/soc/soc-link.c
> new file mode 100644
> index 000000000000..4bdd8d0dd93a
> --- /dev/null
> +++ b/sound/soc/soc-link.c
> @@ -0,0 +1,36 @@
> +// SPDX-License-Identifier: GPL-2.0
> +//
> +// soc-link.c
> +//
> +// Copyright (C) 2019 Renesas Electronics Corp.
> +// Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> +//
> +#include <sound/soc.h>
Morimoto-san,

Dont we also need to include soc-link.h in soc-link.c?

Thanks,
Ranjani


  parent reply	other threads:[~2020-05-21 18:11 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21  1:55 [PATCH v2 0/7] ASoC: add soc-link Kuninori Morimoto
2020-05-21  1:56 ` [PATCH v2 1/7] ASoC: add soc-link.c Kuninori Morimoto
2020-05-21  8:34   ` kbuild test robot
2020-05-21 10:12   ` kbuild test robot
2020-05-21 18:10   ` Ranjani Sridharan [this message]
2020-05-21 23:17     ` Kuninori Morimoto
2020-05-21  1:56 ` [PATCH v2 2/7] ASoC: soc-link: move soc_rtd_xxx() Kuninori Morimoto
2020-05-21  9:34   ` kbuild test robot
2020-05-21 10:54   ` kbuild test robot
2020-05-21  1:57 ` [PATCH v2 3/7] ASoC: soc-link: remove unneeded parameter from snd_soc_link_xxx() Kuninori Morimoto
2020-05-21  1:57 ` [PATCH v2 4/7] ASoC: soc-link: add snd_soc_link_be_hw_params_fixup() Kuninori Morimoto
2020-05-21 10:18   ` kbuild test robot
2020-05-21 11:37   ` kbuild test robot
2020-05-21  1:57 ` [PATCH v2 5/7] ASoC: soc-link: add snd_soc_link_compr_startup() Kuninori Morimoto
2020-05-21 11:19   ` kbuild test robot
2020-05-21 12:17   ` kbuild test robot
2020-05-21  1:57 ` [PATCH v2 6/7] ASoC: soc-link: add snd_soc_link_compr_shutdown() Kuninori Morimoto
2020-05-21 12:33   ` kbuild test robot
2020-05-21 18:57     ` Nick Desaulniers
2020-05-21  1:57 ` [PATCH v2 7/7] ASoC: soc-link: add snd_soc_link_compr_set_params() Kuninori Morimoto
2020-05-21 18:25 ` [PATCH v2 0/7] ASoC: add soc-link Ranjani Sridharan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51622f63fdde93142e5df1867b8fd0a3676654db.camel@linux.intel.com \
    --to=ranjani.sridharan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.