From: Jean-Francois Moine <moinejf-GANU6spQydw@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jaroslav Kysela <perex-/Fr2/VpizcU@public.gmane.org>,
Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH] ASoC: generic: Add generic DT based simple codec
Date: Thu, 19 Sep 2013 19:34:03 +0200 [thread overview]
Message-ID: <20130919193403.30ac5764@armhf> (raw)
In-Reply-To: <20130919104028.GI21013-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
On Thu, 19 Sep 2013 11:40:28 +0100
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> On Thu, Sep 19, 2013 at 10:54:37AM +0200, Jean-Francois Moine wrote:
> > This patch adds a simple sound codec which is described by the DT.
> > This codec may be used when no specific codec action is needed.
>
> Hrm. I'm generally not enthusiastic about this sort of thing because it
> requires every user of the device to understand the capabilities of the
> device instead of being able to just say they have a device of type X -
> it seems better to type the data in once in a driver and then reference
> it. That said...
Well, first, the codecs hdmi and dmic have no DT support.
Then, from the Cubox point of vue, the codec hdmi offers playback
and capture while the Cubox has only playback (via the tda998x HDMI
transmitter), and, also, the codec spdif transmitter has a lot of
sample rates while the Dove audio device supports only 44.1, 48 and 96
kHz.
So, instead of adding new hdmi and spdif_transmitter codecs,
I thought it could be useful to have a generic codec with DT support.
On the other hand, as the first use of this codec is for the Cubox,
an other solution could be to have the codec included in the kirkwood
driver (declared by DT as either i2s or s/pdif). This would simplify
the use or not of s/pdif in this driver.
> > +Child 'capture' and 'playback' required properties:
> > +- stream-name: name of the stream
>
> What does this mean in the binding?
Indeed, the stream name could be implicit (either "Playback" or
"Capture"), but, as the users are aware of it, a more friendly
name is nicer ("S/PDIF Playback").
> > +Formats:
> > + "s8"
> > + "u8"
>
> I'd cut this down to just the PCM formats for now - many of the formats
> you list there aren't terribly well defined even within ALSA, I don't
> think some of them have ever been used at all. A binding document
> should really document what things mean as well.
I have no idea about which format is used or not, and there is no
explanation about their meanings in the uapi (but I can search them..).
Otherwise, for Dove, we need at least "s16_le", "s24_le" and "s32_le"
and, perhaps, "iec958_subframe_le" and "iec958_subframe_be".
So, what do you think should be the format set?
> > +Rates:
> > + 5512
> > + 8000
>
> This shouldn't be a list of defined rates, it should allow any number,
> and it should support ranges since while some devices do enumerate
> specific rates simpler devices often just support a continuous range of
> rates.
There cannot be any number because the rates are coded by discrete
values in a bitmap.
For the continuous range, I was thinking about the value '0' followed
by the min and max rates. Have you any other syntax in mind?
> > --- a/sound/soc/generic/Kconfig
> > +++ b/sound/soc/generic/Kconfig
>
> CODEC drivers should go in codecs.
OK.
> > +#define DRV_NAME "simple-codec"
>
> Just write the string in the one place where it is used.
OK.
> > +static char *format_tb[] = {
> > + "s8", "u8", "s16_le", "s16_be",
> > + "u16_le", "u16_be", "s24_le", "s24_be",
> > + "u24_le", "u24_be", "s32_le", "s32_be",
> > + "u32_le", "u32_be", "float_le", "float_be",
> > +
> > + "float64_le", "float64_be", "iec958_subframe_le", "iec958_subframe_be",
> > + "mu_law", "a_law", "ima_adpcm", "mpeg",
> > + "gsm", "", "", "",
> > + "", "", "", "special",
>
> This seems a bit obscure and fragile - an explicit lookup table would be
> better I think.
OK.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-09-19 17:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-19 8:54 [PATCH] ASoC: generic: Add generic DT based simple codec Jean-Francois Moine
2013-09-19 10:40 ` Mark Brown
[not found] ` <20130919104028.GI21013-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-09-19 17:34 ` Jean-Francois Moine [this message]
2013-09-19 17:49 ` Russell King - ARM Linux
[not found] ` <20130919174952.GC12758-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-09-19 18:12 ` Mark Brown
2013-09-19 18:05 ` Mark Brown
2013-09-23 21:19 ` Stephen Warren
[not found] ` <5240B07C.6080404-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-09-23 23:26 ` Mark Brown
[not found] ` <20130923232648.GL21013-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-09-26 23:16 ` Stephen Warren
2013-09-27 2:57 ` Rob Herring
2013-09-27 9:55 ` Mark Brown
[not found] ` <CAL_JsqKmfurrCqEYRNqcLRZMU-VjPin2dvK1Q6CMcK4i=+x-8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-30 16:49 ` Stephen Warren
[not found] ` <5249AB82.60701-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-09-30 17:43 ` Mark Brown
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=20130919193403.30ac5764@armhf \
--to=moinejf-ganu6spqydw@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=perex-/Fr2/VpizcU@public.gmane.org \
--cc=tiwai-l3A5Bk7waGM@public.gmane.org \
/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).