All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@slimlogic.co.uk>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: yoshii <takashi.yoshii.zj@renesas.com>,
	Linux-ALSA <alsa-devel@alsa-project.org>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Magnus <magnus.damm@gmail.com>, Simon <horms@verge.net.au>
Subject: Re: [RFC][PATCH] ASoC: Add soc_remove_dai_links
Date: Fri, 08 Apr 2011 18:35:32 +0100	[thread overview]
Message-ID: <1302284132.3315.120.camel@odin> (raw)
In-Reply-To: <w3pfwptwats.wl%kuninori.morimoto.gx@renesas.com>

On Fri, 2011-04-08 at 14:50 +0900, Kuninori Morimoto wrote:
> card->num_rtd should be 0 after soc_romve_dai_link
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> To Mark, Liam
> 
> I'm not sure that this is correct patch for ASoC.
> But without this patch, below command doesn't work
> 
> ex) FSI-AK4642 case
> 
> # cd /sys/bus/platform/drivers/fsi-ak4642-audio
> # echo sh_fsi2_a_ak4643.0 > unbind
> # echo sh_fsi2_a_ak4643.0 > bind    *1
> 
> *1
> soc_new_pcm isn't called, and "aplay -l" doens't show fsi-ak4642.
> snd_soc_instantiate_card return around /* bind comleted ? */
> 

Can you confirm are you unloading (all ?) then reloading the driver
modules in this test case ?


>  sound/soc/soc-core.c |   16 ++++++++++++----
>  1 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 4dda589..9cd0770 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1451,6 +1451,16 @@ static void soc_remove_dai_link(struct snd_soc_card *card, int num)
>  	}
>  }
>  
> +static void soc_remove_dai_links(struct snd_soc_card *card)
> +{
> +	int i;
> +
> +	for (i = 0; i < card->num_rtd; i++)
> +		soc_remove_dai_link(card, i);
> +
> +	card->num_rtd = 0;
> +}
> +
>  static void soc_set_name_prefix(struct snd_soc_card *card,
>  				struct snd_soc_codec *codec)
>  {
> @@ -1947,8 +1957,7 @@ probe_aux_dev_err:
>  		soc_remove_aux_dev(card, i);
>  
>  probe_dai_err:
> -	for (i = 0; i < card->num_links; i++)
> -		soc_remove_dai_link(card, i);
> +	soc_remove_dai_links(card);
>  
>  card_probe_error:
>  	if (card->remove)
> @@ -2010,8 +2019,7 @@ static int soc_cleanup_card_resources(struct snd_soc_card *card)
>  		soc_remove_aux_dev(card, i);
>  
>  	/* remove and free each DAI */
> -	for (i = 0; i < card->num_rtd; i++)
> -		soc_remove_dai_link(card, i);
> +	soc_remove_dai_links(card);
>  
>  	soc_cleanup_card_debugfs(card);
>  

Thanks

Liam

  reply	other threads:[~2011-04-08 17:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-08  5:50 [RFC][PATCH] ASoC: Add soc_remove_dai_links Kuninori Morimoto
2011-04-08 17:35 ` Liam Girdwood [this message]
2011-04-11  1:11   ` Kuninori Morimoto
2011-04-11 19:57     ` Liam Girdwood

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=1302284132.3315.120.camel@odin \
    --to=lrg@slimlogic.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=magnus.damm@gmail.com \
    --cc=takashi.yoshii.zj@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.