* [RFC][ASoC] New device/driver arch
@ 2007-06-14 17:40 Liam Girdwood
2007-06-14 18:06 ` Manuel Lauss
2007-06-15 15:01 ` Seth Forshee
0 siblings, 2 replies; 7+ messages in thread
From: Liam Girdwood @ 2007-06-14 17:40 UTC (permalink / raw)
To: alsa-devel; +Cc: Takashi Iwai, Timur Tabi, Nobin Mathew
I'd like to gather some feedback on some changes I've been making to
ASoC recently. The changes were made to fit in better with the PPC
device tree and to help with easier porting to new platforms. They were
also introduced to make dealing with device probe errors (e.g. I2C probe
failure) a little easier.
The largest change is the introduction of an ASoC bus device. All
component drivers (that is, codec, codec DAI, CPU DAI, and DMA PCM
drivers) register with this bus. This should simplify device
registration and hopefully better fit in with the PPC model. A component
driver now typically consists of the standard driver ops and a set of
ASoC/ALSA ops to configure audio.
The new soc.h shows this here :-
http://opensource.wolfsonmicro.com/cgi-bin/gitweb/gitweb.cgi?p=linux-2.6-asoc;a=blob;f=include/sound/soc.h;h=af7ee8140273028a419b4cc60b5f07b4fe511a64;hb=ppc-dev
Example component drivers are here :-
I2S
http://opensource.wolfsonmicro.com/cgi-bin/gitweb/gitweb.cgi?p=linux-2.6-asoc;a=blob;f=sound/soc/pxa/pxa2xx-i2s.c;h=e058295fdfe05573a5a892c3a2afc90fcb35472a;hb=ppc-dev
DMA
http://opensource.wolfsonmicro.com/cgi-bin/gitweb/gitweb.cgi?p=linux-2.6-asoc;a=blob;f=sound/soc/pxa/pxa2xx-pcm.c;h=679aef6c95ad90e45a2ea41bed51c4dc353d0918;hb=ppc-dev
WM8753 Codec
http://opensource.wolfsonmicro.com/cgi-bin/gitweb/gitweb.cgi?p=linux-2.6-asoc;a=blob;f=sound/soc/codecs/wm8753.c;h=f1d49d9bb2a37c48556e7d9039540d362e65af22;hb=ppc-dev
Another major change is that there is no more snd_dai_link (structure
that connected codec <--> CPU). This has been replaced by an ASoC PCM
device that describes each PCM device in the machine. This new ASoC PCM
device has it's own driver and registers with the bus (like the others).
This allows an ASoC PCM driver to be defined like :-
static struct snd_soc_device_driver hifi_pcm_drv = {
.type = SND_SOC_BUS_TYPE_PCM,
.driver = {
.name = "mainstone-hifi-pcm",
.owner = THIS_MODULE,
.probe = hifi_pcm_probe,
.remove = hifi_pcm_remove,
},
.components = {
.cpu_dai = pxa2xx_i2s,
.codec = wm8753_codec,
.codec_dai = wm8753_hifi_dai,
.platform = pxa2xx_pcm,
},
};
This now shows each component within the driver structure.
The snd_soc_machine driver has changed and can now contain numerous ASoC
PCM devices. It is now a platform driver.
Example machine driver for Mainstone with WM8753 is here :-
http://opensource.wolfsonmicro.com/cgi-bin/gitweb/gitweb.cgi?p=linux-2.6-asoc;a=blob;f=sound/soc/pxa/mainstone_wm8753.c;h=a49c1c528063494aeadee26ea3e07405c3a8762e;hb=ppc-dev
The machine driver now also does the I2C/SPI probing (instead of the
codec) and also does any codec IO (to better support multiple
controllers).
Fwiw, I've not tested any of this code atm. I plan to start this
tomorrow on pxa2xx and i.MX31 and would like to get some feedback before
porting remaining platforms and codecs over.
Liam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC][ASoC] New device/driver arch
2007-06-14 17:40 [RFC][ASoC] New device/driver arch Liam Girdwood
@ 2007-06-14 18:06 ` Manuel Lauss
2007-06-15 9:04 ` Liam Girdwood
2007-06-15 15:01 ` Seth Forshee
1 sibling, 1 reply; 7+ messages in thread
From: Manuel Lauss @ 2007-06-14 18:06 UTC (permalink / raw)
To: Liam Girdwood; +Cc: Takashi Iwai, alsa-devel, Timur Tabi, Nobin Mathew
Hi Liam,
Is it possible to have 2 physical I2S units (which are connected to the same
codec) be repesented as a single ASoC device? (The SH7760 has 2 I2S units
which are "halfduplex" (only transmit OR capture at a time). My dev platform
simply uses the second unit for capture
I need a trigger callback in the machine driver to properly support
multichannel I2S audio on Au1200 (the Au1200 can only do stereo; to get
more channels we double/quadruple the I2S LRCLK coming from the codec;
however the CPLD needs to be told when a new sample starts; although
maybe that can be worked around in VHDL)
Thanks for the great work
Manuel Lauss
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC][ASoC] New device/driver arch
2007-06-14 18:06 ` Manuel Lauss
@ 2007-06-15 9:04 ` Liam Girdwood
2007-06-15 12:06 ` Nobin Mathew
0 siblings, 1 reply; 7+ messages in thread
From: Liam Girdwood @ 2007-06-15 9:04 UTC (permalink / raw)
To: Manuel Lauss; +Cc: Takashi Iwai, alsa-devel, Timur Tabi, Nobin Mathew
On Thu, 2007-06-14 at 20:06 +0200, Manuel Lauss wrote:
> Hi Liam,
>
> Is it possible to have 2 physical I2S units (which are connected to the same
> codec) be repesented as a single ASoC device? (The SH7760 has 2 I2S units
> which are "halfduplex" (only transmit OR capture at a time). My dev platform
> simply uses the second unit for capture
>
Yes. I would create two struct snd_soc_device_drivers in your i2s.c
file. The first would be the driver for the 2 halfduplex I2S units and
the second would be a full duplex driver for a merged I2S controller
(made up of the 2 halfduplex units). This way a device can either probe
against the halfduplex or full duplex driver based on the driver ID.
>
> I need a trigger callback in the machine driver to properly support
> multichannel I2S audio on Au1200 (the Au1200 can only do stereo; to get
> more channels we double/quadruple the I2S LRCLK coming from the codec;
> however the CPLD needs to be told when a new sample starts; although
> maybe that can be worked around in VHDL)
>
I'll add trigger. Probably easier to do this in C than VHDL ;)
Liam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC][ASoC] New device/driver arch
2007-06-15 9:04 ` Liam Girdwood
@ 2007-06-15 12:06 ` Nobin Mathew
2007-06-15 15:40 ` Liam Girdwood
0 siblings, 1 reply; 7+ messages in thread
From: Nobin Mathew @ 2007-06-15 12:06 UTC (permalink / raw)
To: Liam Girdwood; +Cc: Takashi Iwai, Manuel Lauss, alsa-devel, Timur Tabi
So in this architecture we will have so many devices registered to the kernel?
On 6/15/07, Liam Girdwood <lg@opensource.wolfsonmicro.com> wrote:
> On Thu, 2007-06-14 at 20:06 +0200, Manuel Lauss wrote:
> > Hi Liam,
> >
> > Is it possible to have 2 physical I2S units (which are connected to the same
> > codec) be repesented as a single ASoC device? (The SH7760 has 2 I2S units
> > which are "halfduplex" (only transmit OR capture at a time). My dev platform
> > simply uses the second unit for capture
> >
>
> Yes. I would create two struct snd_soc_device_drivers in your i2s.c
> file. The first would be the driver for the 2 halfduplex I2S units and
> the second would be a full duplex driver for a merged I2S controller
> (made up of the 2 halfduplex units). This way a device can either probe
> against the halfduplex or full duplex driver based on the driver ID.
>
> >
> > I need a trigger callback in the machine driver to properly support
> > multichannel I2S audio on Au1200 (the Au1200 can only do stereo; to get
> > more channels we double/quadruple the I2S LRCLK coming from the codec;
> > however the CPLD needs to be told when a new sample starts; although
> > maybe that can be worked around in VHDL)
> >
>
> I'll add trigger. Probably easier to do this in C than VHDL ;)
>
> Liam
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC][ASoC] New device/driver arch
2007-06-14 17:40 [RFC][ASoC] New device/driver arch Liam Girdwood
2007-06-14 18:06 ` Manuel Lauss
@ 2007-06-15 15:01 ` Seth Forshee
2007-06-15 15:36 ` Liam Girdwood
1 sibling, 1 reply; 7+ messages in thread
From: Seth Forshee @ 2007-06-15 15:01 UTC (permalink / raw)
To: Liam Girdwood; +Cc: Takashi Iwai, alsa-devel, Timur Tabi, Nobin Mathew
Hi Liam,
On 6/14/07, Liam Girdwood <lg@opensource.wolfsonmicro.com> wrote:
> Example machine driver for Mainstone with WM8753 is here :-
>
> http://opensource.wolfsonmicro.com/cgi-bin/gitweb/gitweb.cgi?p=linux-2.6-asoc;a=blob;f=sound/soc/pxa/mainstone_wm8753.c;h=a49c1c528063494aeadee26ea3e07405c3a8762e;hb=ppc-dev
>
> The machine driver now also does the I2C/SPI probing (instead of the
> codec) and also does any codec IO (to better support multiple
> controllers).
>
The way in which the platform device is created in this file seems to
have a problem. The mainstone_wm8753_probe() function (along
everything else after that point) seems to expect that the platform
device will be encapsulated in a struct snd_soc_machine, but this
doesn't seem to be the case since you are instantiating the device
with platform_driver_probe(). Am I missing something?
Cheers,
Seth
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC][ASoC] New device/driver arch
2007-06-15 15:01 ` Seth Forshee
@ 2007-06-15 15:36 ` Liam Girdwood
0 siblings, 0 replies; 7+ messages in thread
From: Liam Girdwood @ 2007-06-15 15:36 UTC (permalink / raw)
To: Seth Forshee; +Cc: Takashi Iwai, alsa-devel, Timur Tabi, Nobin Mathew
On Fri, 2007-06-15 at 10:01 -0500, Seth Forshee wrote:
> Hi Liam,
>
> On 6/14/07, Liam Girdwood <lg@opensource.wolfsonmicro.com> wrote:
>
> > Example machine driver for Mainstone with WM8753 is here :-
> >
> > http://opensource.wolfsonmicro.com/cgi-bin/gitweb/gitweb.cgi?p=linux-2.6-asoc;a=blob;f=sound/soc/pxa/mainstone_wm8753.c;h=a49c1c528063494aeadee26ea3e07405c3a8762e;hb=ppc-dev
> >
> > The machine driver now also does the I2C/SPI probing (instead of the
> > codec) and also does any codec IO (to better support multiple
> > controllers).
> >
>
> The way in which the platform device is created in this file seems to
> have a problem. The mainstone_wm8753_probe() function (along
> everything else after that point) seems to expect that the platform
> device will be encapsulated in a struct snd_soc_machine, but this
> doesn't seem to be the case since you are instantiating the device
> with platform_driver_probe(). Am I missing something?
Your right. This is a bug. Will fix.
Thanks
Liam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC][ASoC] New device/driver arch
2007-06-15 12:06 ` Nobin Mathew
@ 2007-06-15 15:40 ` Liam Girdwood
0 siblings, 0 replies; 7+ messages in thread
From: Liam Girdwood @ 2007-06-15 15:40 UTC (permalink / raw)
To: Nobin Mathew; +Cc: Takashi Iwai, Manuel Lauss, alsa-devel, Timur Tabi
On Fri, 2007-06-15 at 17:36 +0530, Nobin Mathew wrote:
> So in this architecture we will have so many devices registered to the kernel?
We will have more devices than at present, however the Linux device
interface is designed to deal with this and more.
Liam
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-06-15 15:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-14 17:40 [RFC][ASoC] New device/driver arch Liam Girdwood
2007-06-14 18:06 ` Manuel Lauss
2007-06-15 9:04 ` Liam Girdwood
2007-06-15 12:06 ` Nobin Mathew
2007-06-15 15:40 ` Liam Girdwood
2007-06-15 15:01 ` Seth Forshee
2007-06-15 15:36 ` Liam Girdwood
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.