public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH] ASoC: generic: add generic compound card with DT support
Date: Wed, 01 Jan 2014 20:05:05 +0100	[thread overview]
Message-ID: <52C466E1.3030302@metafoo.de> (raw)
In-Reply-To: <20131231113138.102044cf@armhf>

On 12/31/2013 11:31 AM, Jean-Francois Moine wrote:
> Some audio cards are built from different hardware components.
> When such compound cards don't need specific code, this driver creates
> them with the required DAI links and routes from a DT.
> 
> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
> ---
> This code was first developped on the generic simple card, but its
> recent DT extension cannot be easily extended again to support compound
> cards as the one in the Cubox.
> Note also that the example relies on a proposed patch of mine aiming to
> render the codec name / OF node optional in DAI links
> (http://mailman.alsa-project.org/pipermail/alsa-devel/2013-December/070082.html).
> ---
>  .../devicetree/bindings/sound/compound-card.txt |  95 ++++++++++++
>  sound/soc/generic/Kconfig                       |   6 +
>  sound/soc/generic/Makefile                      |   2 +
>  sound/soc/generic/compound-card.c               | 247 +++++++++++++++++++++++++
>  4 file changed, 350 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/sound/compound-card.txt b/Documentation/devicetree/bindings/sound/compound-card.txt
> new file mode 100644
> index 0000000..554a796
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/compound-card.txt
> @@ -0,0 +1,95 @@
> +Device-Tree bindings for compound audio card
> +
> +Compound audio card describes the links between the different parts
> +of an audio card built from different hardware components.
> +
> +Required properties:
> +  - compatible: should be "compound-audio-card"
> +  - audio-controller: phandle of the audio controller
> +
> +Optional properties:
> +  - routes: list of couple of strings (sink, source)
> +
> +Required subnodes:
> +  - link: DAI link subnode
> +	At least one link must be specified.
> +
> +Required link subnode properties:
> +  - link-name: names of the DAI link and of the stream
> +  - cpu-dai-name: name of the CPU or CODEC DAI
> +		An empty string indicates that the CPU DAI is
> +		the same as the audio controller.
> +  - codec-dai-name: name of the CODEC DAI
> +
> +Optional link subnode properties:
> +  - audio-codec or codec-name: phandle or name of the CODEC
> +		in case the codec-dai-name is not unique
> +  - format: DAI format. One of:
> +		"i2s", "right_j", "left_j" , "dsp_a"
> +		"dsp_b", "ac97", "pdm", "msb", "lsb"
> +  - front-end or back-end: present if the DAI link describes resp.
> +		a front-end CPU DAI or a back-end CODEC DAI
> +  - playback or capture: present if the DAI link is used for
> +		playback or capture only


As Mark also said, this binding definitely leaks way too much internals of
the current ASoC implementation. In my opinion the way forward for ASoC is
to stop to distinguish between different types of components. This is on one
hand CODECS and CPU-DAIs and on the other hand also front-end and beck-end
DAIs. The first steps in this direction have already been take by the start
of the component-fication, but its still a long way to go. Exposing those
concepts via the devicetree will only make it harder to get rid of them
later. The bindings for a compound card should essentially describe which
components are involved and how the fabric between and around them looks
like. If the type of the component is needed in the ASoC implementation it
should be possible to auto-discover it. Also I think we want to align the
devicetree bindings with what the media people have been doing[1]. Audio and
video are not that different in this regard and there will also be boards
where the audio and video fabric will be intermingled  (e.g. like on your
board with HDMI).

- Lars

  parent reply	other threads:[~2014-01-01 19:04 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-31 10:31 [PATCH] ASoC: generic: add generic compound card with DT support Jean-Francois Moine
2013-12-31 11:59 ` Mark Brown
2013-12-31 12:36   ` Jean-Francois Moine
2013-12-31 12:47     ` Mark Brown
2014-01-01 19:05 ` Lars-Peter Clausen [this message]
2014-01-01 20:08   ` [alsa-devel] " Jean-Francois Moine
2014-01-01 20:11     ` Lars-Peter Clausen
2014-01-02  9:26       ` Jean-Francois Moine
2014-01-02 11:10         ` Mark Brown
2014-01-02 11:43           ` Jean-Francois Moine
2014-01-02 11:56             ` Mark Brown
2014-01-02 12:44               ` Jean-Francois Moine
2014-01-02 13:10                 ` Mark Brown
2014-01-02 17:50                   ` Jean-Francois Moine
2014-01-02 18:35                     ` 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=52C466E1.3030302@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=moinejf@free.fr \
    /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