[alsa-devel] [PATCH] ASoC: core - Add platform read and write.

Mark Brown broonie at opensource.wolfsonmicro.com
Mon Jul 4 21:41:41 CEST 2011


On Mon, Jul 04, 2011 at 11:10:15AM +0100, Liam Girdwood wrote:

> +int snd_soc_platform_read(struct snd_soc_platform *platform,
> +					unsigned int reg)
> +{
> +	unsigned int ret;
> +
> +	if (!platform->driver->read) {
> +		dev_err(platform->dev, "platform has no read back\n");
> +		return -1;
> +	}
> +
> +	ret = platform->driver->read(platform, reg);
> +	dev_dbg(platform->dev, "read %x => %x\n", reg, ret);

We should add tracepoints into these as well.

> +int snd_soc_platform_write(struct snd_soc_platform *platform,
> +					 unsigned int reg, unsigned int val)
> +{
> +	if (!platform->driver->write) {
> +		dev_err(platform->dev, "platform has no write back\n");
> +		return -1;

Could return -EINVAL or something here - it's not like read where we're
mixing with the in band data.


More information about the Alsa-devel mailing list