[alsa-devel] ASoC: About amp driver
Joonyoung Shim
jy0922.shim at samsung.com
Mon Jun 15 13:15:53 CEST 2009
On 6/15/2009 6:07 PM, Mark Brown wrote:
> On Mon, Jun 15, 2009 at 04:54:49PM +0900, Joonyoung Shim wrote:
>
>> I have one question. Currently, the amp driver of ASoC is included in machine
>> driver. (ex. neo1973_wm8753 machine driver)
>> I want to use the same amp driver in more than one machine driver, but then the
>> same amp driver code exists double in each machine driver.
>
>> So, how about spliting between the amp driver and the machine driver? and Is it
>> possible?
>
> Put the generic bits of the amp driver in sound/soc/codecs (there won't
> be much). At the minute you'll need to glue it in in via the machine
> driver in the same way that OpenMoko does, there's not really any
> support for multiple devices in the analouge part of the audio
> subsystem. This is on my radar to deal with, I have some systems where
> it is relevant, but it's not there yet.
This is heard me there is no way to split the amp driver from machine driver
at the minute.
The lm4857 amp driver is a complete i2c driver seperated in neo1973_wm8753.c.
It makes me confused that two complete drivers exist in a same file.
The controls of the lm4857 amp driver is depended only by neo1973 machine
driver because of registration through init() of snd_soc_dai_link.
I considered following some modification to solve this dependency.
For example, the amp_init field is added in snd_soc_dai_link struct and the
machine driver assigns the init function of amp driver in amp_init field of
dai_link, and snd_soc_init_card() calls amp_init() of dai_link as init() call
in soc-core.
Is this wrong solution?
Thank you for your reply.
More information about the Alsa-devel
mailing list