Re: Does anyone really have success experience with SPI codecs with new name-based SOC API?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexander,

On Thu, Nov 18, 2010 at 9:31 AM, Alexander <subaparts@xxxxxxxxx> wrote:
> Does anyone really have success experience with SPI codecs with new
> name-based SOC API?
> There are really few SPI codecs in ASoC subsystem, so I wonder if only I
> cannot bind my SPI codec to machine driver.
>
> The codec is registered with name spi0.0 it's the behavior of SPI
> subsystem, I suppose. So the form is %s%d.%d and not %s.%d as supposed
> in fmt_single_name() in soc_core.c
>
> For me
> dev_name(dev)==spi0.0
> dev->driver->name==cs4271-codec
>
> Is this really working code?
> -----
> Â Â Â Âstrncpy(name, dev_name(dev), NAME_SIZE);
>
> Â Â Â Â/* are we a "%s.%d" name (platform and SPI components) */
> Â Â Â Âfound = strstr(name, dev->driver->name);
> Â Â Â Âif (found) {
> Â Â Â Â Â Â Â Â/* get ID */
> Â Â Â Â Â Â Â Âif (sscanf(&found[strlen(dev->driver->name)], ".%d", id) == 1) {
>
> Â Â Â Â Â Â Â Â Â Â Â Â/* discard ID from name if ID == -1 */
> Â Â Â Â Â Â Â Â Â Â Â Âif (*id == -1)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âfound[strlen(dev->driver->name)] = '\0';
> Â Â Â Â Â Â Â Â}
>
> Â Â Â Â} else {
> -----

Have you managed to bind the SPI codec? I am trying the same thing
here. Please let me know.

Regards,

Fabio Estevam
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux