alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: Matt Flax <flatmax@flatmax.org>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
	patches@opensource.wolfsonmicro.com
Subject: Re: [PATCH] ASoc: wm8580: Add the wm8581 codec to the driver
Date: Tue, 18 Oct 2016 08:56:36 +0100	[thread overview]
Message-ID: <20161018075636.GG3207@localhost.localdomain> (raw)
In-Reply-To: <54546e80-7d07-6959-af28-b7905980fc5d@flatmax.org>

On Tue, Oct 18, 2016 at 06:15:28AM +1100, Matt Flax wrote:
> 
> 
> On 17/10/16 21:59, Charles Keepax wrote:
> >On Mon, Oct 17, 2016 at 09:46:20PM +1100, Matt Flax wrote:
> >>
> >>On 17/10/16 21:37, Charles Keepax wrote:
> >>>On Mon, Oct 17, 2016 at 09:42:18AM +1100, Matt Flax wrote:
<snip>
> >>I didn't understand your first suggestion, can you give an example of how to
> >>do that in the startup callback ? Sounds like a good idea.
> >If you look in arizona_startup in sound/soc/codecs/arizona.c we
> >specify constraints for the sample rates based off our clocking,
> >there is an equivalent SNDRV_PCM_HW_PARAM_CHANNELS that you
> >should be able to you to specify the supported channels with.
> OK - started on this ... however I get the following problem when trying to
> set the stream name :
> [    6.331002] wm8580 1-001a: ASoC: error - multiple DAI 1-001a registered
> with no name
> 
> I think this is happening in i2c probe. I was wanting to set the stream name
> dynamically to match the codec model number.
> I was planning to do the following :
> static int wm8580_playback_startup(struct snd_pcm_substream *substream,
>                struct snd_soc_dai *dai)
> {
>     struct snd_soc_codec *codec = dai->codec;
>     struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec);
> 
>     strncpy(substream->name, wm8580->drvdata->name_playback,
> sizeof(wm8580->drvdata->name_playback) - 1);
> 
>     return snd_pcm_hw_constraint_single(substream->runtime,
>         SNDRV_PCM_HW_PARAM_CHANNELS, wm8580->drvdata->num_dacs * 2);
> }
> 
> Do you think perhaps I should set a new name in the snd_soc_dai_driver to
> the following :
>     .name = "wm858x-hifi-playback",
>     .name = "wm858x-hifi-capture",

I don't think you need to bother setting the DAI name to match
the CODEC, I am happy with a generic name.

Thanks,
Charles

  reply	other threads:[~2016-10-18  7:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-16 22:42 [PATCH] ASoc: wm8580: Add the wm8581 codec to the driver Matt Flax
2016-10-17 10:37 ` Charles Keepax
2016-10-17 10:46   ` Matt Flax
2016-10-17 10:59     ` Charles Keepax
2016-10-17 19:14       ` Matt Flax
2016-10-17 19:15       ` Matt Flax
2016-10-18  7:56         ` Charles Keepax [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-10-18 18:24 Matt Flax
2016-10-19  9:22 ` Charles Keepax
2016-10-19 23:22   ` Matt Flax

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=20161018075636.GG3207@localhost.localdomain \
    --to=ckeepax@opensource.wolfsonmicro.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=flatmax@flatmax.org \
    --cc=patches@opensource.wolfsonmicro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).