[alsa-devel] snd-soc-cs4270: Convert to a new-style i2c driver (work in progress)

Jean Delvare khali at linux-fr.org
Wed Sep 3 22:44:02 CEST 2008

On Wed, 3 Sep 2008 15:30:33 -0500, Timur Tabi wrote:
> On Wed, Sep 3, 2008 at 2:47 PM, Timur Tabi <timur at freescale.com> wrote:
> > I'm working on a fix for this, but there's something you need to know.
> >  I don't think ASoC V1 modules can be unloaded.
> Correction: ASoC drivers can't be compiled as modules, not even the
> codec drivers.  I had to hack up the Kconfigs to get this to work, but
> there is no way to compile the drivers as modules.  If you try, you
> get this:
>   CC [M]  sound/soc/codecs/cs4270.o
>   LD [M]  sound/soc/codecs/snd-soc-cs4270.o
> ...
> sound/built-in.o: In function `mpc8610_hpcd_probe':
> /temp/alsa.1994/sound/soc/fsl/mpc8610_hpcd.c:455: undefined reference
> to `cs4270_dai'
> /temp/alsa.1994/sound/soc/fsl/mpc8610_hpcd.c:455: undefined reference
> to `cs4270_dai'
> /temp/alsa.1994/sound/soc/fsl/mpc8610_hpcd.c:469: undefined reference
> to `soc_codec_device_cs4270'
> /temp/alsa.1994/sound/soc/fsl/mpc8610_hpcd.c:469: undefined reference
> to `soc_codec_device_cs4270'
> make: *** [.tmp_vmlinux1] Error 1
> So I don't see how an I2C 'remove' function would ever be called
> anyway.  If you can show me how, I'll add it.

By writing to the unbind file that the i2c driver in question exposes
in /sys? I didn't try it but it should cause the driver to unbind from
the device in question and thus ->remove would be called.

Note that I do not care much myself. I mentioned the lack of a remove
function merely because the driver could be build as a module and
because the original code did have an equivalent function. If you are
confident that the code isn't needed or you decide that you don't care,
up to you. I am really not familiar with the ASoC drivers so I don't
think my view really matters.

> Now, the ASoC V2 driver can be loaded and unloaded, and I'm pretty
> sure I have bugs there.

Jean Delvare

More information about the Alsa-devel mailing list