[alsa-devel] [PATCH] ASoC: rt5677: Use specific r/w function for DSP mode

Oder Chiou oder_chiou at realtek.com
Wed Oct 29 02:44:57 CET 2014


> -----Original Message-----
> From: Mark Brown [mailto:broonie at kernel.org]
> Sent: Wednesday, October 29, 2014 6:29 AM
> To: Oder Chiou
> Cc: lgirdwood at gmail.com; alsa-devel at alsa-project.org; Bard Liao; Flove;
> anatol at google.com; benzh at google.com
> Subject: Re: [PATCH] ASoC: rt5677: Use specific r/w function for DSP mode
> 
> On Mon, Oct 27, 2014 at 10:52:31AM +0800, Oder Chiou wrote:
> 
> > +	/* Write register */
> > +	r[0] = reg & 0xff;
> > +	xfer[0].addr = client->addr;
> > +	xfer[0].flags = 0;
> > +	xfer[0].len = 1;
> > +	xfer[0].buf = &r[0];
> > +
> > +	/* Read data */
> > +	xfer[1].addr = client->addr;
> > +	xfer[1].flags = I2C_M_RD;
> > +	xfer[1].len = 2;
> > +	xfer[1].buf = data;
> > +
> > +	ret = i2c_transfer(client->adapter, xfer, 2);
> > +	if (ret != 2) {
> > +		dev_err(&client->dev, "i2c_transfer() returned %d\n", ret);
> > +		return -EIO;
> > +	}
> 
> This looks like standard regmap stuff - what's different?

They are not different with regmap stuff, but they are called by
rt5677_dsp_mode_i2c_write_addr(), rt5677_dsp_mode_i2c_read_addr(),
rt5677_read() and rt5677_write().

The customize access function is implemented by rt5677_read() and
rt5677_write() that are assigned to regmap_config "rt5677_regmap" for using
between codec mode or DSP mode.


More information about the Alsa-devel mailing list