All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@arm.linux.org.uk>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@ti.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Takashi Iwai <tiwai@suse.de>,
	Arnaud Patard <arnaud.patard@rtp-net.org>,
	Jaroslav Kysela <perex@perex.cz>,
	Rabeeh Khoury <rabeeh@solid-run.com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@googlemail.com>,
	alsa-devel@alsa-project.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 0/10] Kirkwood ASoC drivers fixes and improvements
Date: Thu, 22 Nov 2012 14:06:14 +0000	[thread overview]
Message-ID: <20121122140614.GA26930@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20121120122051.GA12063@n2100.arm.linux.org.uk>

All,

I'm opening this to a wider audience in the hope of getting a solution.

There are classes of hardware out there where the DMA support is tightly
integrated along side the rest of the I2S interface.

One such example of this is the hardware found on Marvell Kirkwood
platforms and their derivatives.   Not only are the registers interleaved
between the I2S interface part and the DMA part, and the DMA can only be
used for I2S, but the current Kirkwood ASoC implementation in
sound/soc/kirkwood shares a common data structure created by the "cpu dai"
to provide register access and other data.  This data structure is
"struct kirkwood_dma_data".

This means that in software, as things stand today, kirkwood-dma.c has
intimate knowledge of kirkwood-i2s.c despite being two separate platform
drivers.  This also means that the split between kirkwood-dma.c and
kirkwood-i2s.c is entirely artificial, brought about by the insistance
of ASoC that these things shall be separate.

How does ASoC insist that these be separate?  It only provides the
necessary callbacks for DMA related stuff to what it calls the "platform"
driver.  The interface part is called a "cpu dai" and one of those must
always be provided.  Each of these must be a separate platform device,
because they're each named drivers, and the name comes from the
device/driver.

This is fine in the pre-DT world, where we have board files in arch/arm
which can create whatever platform devices are needed to bring ASoC up,
but we're moving to a DT-only solution - that means no board files.
DT is a hardware description; it does not describe whatever random ideas
some software implementation has come up with; a DT description of audio
on Kirkwood will not make any distinction between the artificial
"platform" part and the "cpu dai" part.

Instead, a DT description will just declare there to be one I2S device
with its relevant resources.

Such a description is _inherently_ incompatible with ASoC as long as
ASoC insists that there is this artificial distinction.

What Mark is telling me is that he requires yet more board files to
spring up under sound/soc/ which create these artificial platform
devices.  Not only does that go against the direction which we're heading
on ARM (at Linus' insistance) to get rid of board files, but it perpetuates
this silly idea that every audio interface should be split up whether
there's a distinction there or not.

It also makes the handling of -EPROBE_DEFER yet more complex; using this
driver on the Dove Cubox platform with built as a set of modules revealed
that where a platform device was being registered by code in
sound/soc/kirkwood, and would be immediately unregistered on -EPROBE_DEFER
never to be re-registered.

It is my belief that Mark's position is not the right solution for where
things are heading.

We need to have solutions which do not require artificial breakup of
drivers; we need solutions where hardware can be described by DT and
that DT description be used by the kernel with the minimum of code.
What we don't need are yet more board files appearing in some other
random part of the kernel tree.

Your thoughts please.

WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/10] Kirkwood ASoC drivers fixes and improvements
Date: Thu, 22 Nov 2012 14:06:14 +0000	[thread overview]
Message-ID: <20121122140614.GA26930@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20121120122051.GA12063@n2100.arm.linux.org.uk>

All,

I'm opening this to a wider audience in the hope of getting a solution.

There are classes of hardware out there where the DMA support is tightly
integrated along side the rest of the I2S interface.

One such example of this is the hardware found on Marvell Kirkwood
platforms and their derivatives.   Not only are the registers interleaved
between the I2S interface part and the DMA part, and the DMA can only be
used for I2S, but the current Kirkwood ASoC implementation in
sound/soc/kirkwood shares a common data structure created by the "cpu dai"
to provide register access and other data.  This data structure is
"struct kirkwood_dma_data".

This means that in software, as things stand today, kirkwood-dma.c has
intimate knowledge of kirkwood-i2s.c despite being two separate platform
drivers.  This also means that the split between kirkwood-dma.c and
kirkwood-i2s.c is entirely artificial, brought about by the insistance
of ASoC that these things shall be separate.

How does ASoC insist that these be separate?  It only provides the
necessary callbacks for DMA related stuff to what it calls the "platform"
driver.  The interface part is called a "cpu dai" and one of those must
always be provided.  Each of these must be a separate platform device,
because they're each named drivers, and the name comes from the
device/driver.

This is fine in the pre-DT world, where we have board files in arch/arm
which can create whatever platform devices are needed to bring ASoC up,
but we're moving to a DT-only solution - that means no board files.
DT is a hardware description; it does not describe whatever random ideas
some software implementation has come up with; a DT description of audio
on Kirkwood will not make any distinction between the artificial
"platform" part and the "cpu dai" part.

Instead, a DT description will just declare there to be one I2S device
with its relevant resources.

Such a description is _inherently_ incompatible with ASoC as long as
ASoC insists that there is this artificial distinction.

What Mark is telling me is that he requires yet more board files to
spring up under sound/soc/ which create these artificial platform
devices.  Not only does that go against the direction which we're heading
on ARM (at Linus' insistance) to get rid of board files, but it perpetuates
this silly idea that every audio interface should be split up whether
there's a distinction there or not.

It also makes the handling of -EPROBE_DEFER yet more complex; using this
driver on the Dove Cubox platform with built as a set of modules revealed
that where a platform device was being registered by code in
sound/soc/kirkwood, and would be immediately unregistered on -EPROBE_DEFER
never to be re-registered.

It is my belief that Mark's position is not the right solution for where
things are heading.

We need to have solutions which do not require artificial breakup of
drivers; we need solutions where hardware can be described by DT and
that DT description be used by the kernel with the minimum of code.
What we don't need are yet more board files appearing in some other
random part of the kernel tree.

Your thoughts please.

  reply	other threads:[~2012-11-22 14:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20 12:17 [PATCH 0/10] Kirkwood ASoC drivers fixes and improvements Russell King - ARM Linux
2012-11-20 12:17 ` [PATCH 01/10] ASoC: kirkwood-dma: fix use of virt_to_phys() Russell King
2012-11-20 12:18 ` [PATCH 02/10] ASoC: kirkwood-dma: don't ignore other irq causes on error Russell King
2012-11-20 12:18 ` [PATCH 03/10] ASoC: kirkwood-i2s: fix DCO lock detection Russell King
2012-11-20 12:18 ` [PATCH 04/10] ASoC: kirkwood-i2s: fix DMA underruns Russell King
2012-11-20 12:19 ` [PATCH 05/10] ASoC: kirkwood-i2s: more pause-mode fixes Russell King
2012-11-20 12:19 ` [PATCH 06/10] ASoC: kirkwood-i2s: use devm_* APIs Russell King
2012-11-20 12:19 ` [PATCH 07/10] ASoC: kirkwood-i2s: better handling of play/record control registers Russell King
2012-11-20 12:20 ` [PATCH 08/10] ASoC: kirkwood-dma: remove restriction on sample rates Russell King
2012-11-20 12:20 ` [PATCH 09/10] ASoC: kirkwood-i2s: add support for external clock rates Russell King
2012-11-20 12:20 ` [PATCH 0/10] Kirkwood ASoC drivers fixes and improvements Russell King - ARM Linux
2012-11-22 14:06   ` Russell King - ARM Linux [this message]
2012-11-22 14:06     ` Russell King - ARM Linux
2012-11-23  1:36     ` Mark Brown
2012-11-23  1:36       ` Mark Brown
     [not found]   ` <87ip8xodv1.fsf@lebrac.rtp-net.org>
2012-11-23  1:38     ` Mark Brown
2012-11-20 12:20 ` [PATCH 10/10] ASoC: kirkwood-dma: remove channel restrictions Russell King
2012-11-21  1:40 ` [PATCH 0/10] Kirkwood ASoC drivers fixes and improvements Mark Brown
2012-11-21  9:41   ` Russell King - ARM Linux
2012-11-21  9:47     ` Mark Brown
2012-11-21  9:59       ` Takashi Iwai
2012-11-21 10:01         ` Mark Brown
2012-11-21 10:05       ` Russell King - ARM Linux

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=20121122140614.GA26930@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnaud.patard@rtp-net.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lrg@ti.com \
    --cc=perex@perex.cz \
    --cc=rabeeh@solid-run.com \
    --cc=sebastian.hesselbarth@googlemail.com \
    --cc=tiwai@suse.de \
    --cc=torvalds@linux-foundation.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 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.