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

Alexander subaparts at yandex.ru
Thu Nov 18 12:31:06 CET 2010


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 {
-----



More information about the Alsa-devel mailing list