[alsa-devel] Does anyone really have success experience with SPI codecs with new name-based SOC API?

Fabio Estevam festevam at gmail.com
Thu Dec 2 19:12:12 CET 2010


Hi Alexander,

On Thu, Nov 18, 2010 at 9:31 AM, Alexander <subaparts at yandex.ru> 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


More information about the Alsa-devel mailing list