[alsa-devel] [PATCHv4 2/7] ASoC: TWL6030: Add twl6030 codec driver
Liam Girdwood
lrg at slimlogic.co.uk
Thu Feb 25 10:06:58 CET 2010
On Wed, 2010-02-24 at 17:37 -0600, Olaya, Margarita wrote:
>
> > -----Original Message-----
> > From: Liam Girdwood [mailto:lrg at slimlogic.co.uk]
> > Sent: Wednesday, February 24, 2010 4:38 AM
> > To: Olaya, Margarita
> > Cc: alsa-devel at alsa-project.org; linux-omap at vger.kernel.org; broonie at opensource.wolfsonmicro.com
> > Subject: Re: [PATCHv4 2/7] ASoC: TWL6030: Add twl6030 codec driver
> >
> > On Tue, 2010-02-23 at 18:10 -0600, Olaya, Margarita wrote:
> > > From: Misael Lopez Cruz <x0052729 at ti.com>
> > >
> > > Initial version of TWL6030 codec driver.
> > >
> > > The TWL6030 codec uses a propietary PDM-based digital audio interface.
> > > Audio paths supported are:
> > >
> > > - Input: Main Mic, Sub Mic, Headset Mic, Auxiliary-FM Left/Right
> > > - Output: Headset Left/Right, Handsfree Left/Right
> > > +
> > > +/*
> > > + * read from twl6030 hardware register
> > > + */
> > > +static int twl6030_read(struct snd_soc_codec *codec,
> > > + unsigned int reg)
> > > +{
> > > + u8 value;
> > > +
> > > + if (reg >= TWL6030_CACHEREGNUM)
> > > + return -EIO;
> > > +
> > > + twl_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &value, reg);
> > > + twl6030_write_reg_cache(codec, reg, value);
> >
> >
> > You probably want to read from the cache if the register is not
> > volatile. This saves a slow I2C read.
> >
>
> This function is called for volatile registers; if the register is not volatile we call twl6030_read_reg_cache. I could merge those two functions with a case for those.
>
Ok, could amend the name or comment so it's obvious this is for
volatiles.
Thanks
Liam
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
More information about the Alsa-devel
mailing list