From mboxrd@z Thu Jan 1 00:00:00 1970 From: Liam Girdwood Subject: Re: [alsa-devel] [PATCHv4 2/7] ASoC: TWL6030: Add twl6030 codec driver Date: Thu, 25 Feb 2010 09:06:58 +0000 Message-ID: <1267088818.3255.42.camel@odin> References: <1889FA7136B567478A67D4B0F85B0CCE65DD1B14@dlee06.ent.ti.com> <1267007881.3274.136.camel@odin> <1889FA7136B567478A67D4B0F85B0CCE65DD22C9@dlee06.ent.ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1889FA7136B567478A67D4B0F85B0CCE65DD22C9@dlee06.ent.ti.com> Sender: linux-omap-owner@vger.kernel.org To: "Olaya, Margarita" Cc: "alsa-devel@alsa-project.org" , "linux-omap@vger.kernel.org" , "broonie@opensource.wolfsonmicro.com" List-Id: alsa-devel@alsa-project.org On Wed, 2010-02-24 at 17:37 -0600, Olaya, Margarita wrote: > > > -----Original Message----- > > From: Liam Girdwood [mailto:lrg@slimlogic.co.uk] > > Sent: Wednesday, February 24, 2010 4:38 AM > > To: Olaya, Margarita > > Cc: alsa-devel@alsa-project.org; linux-omap@vger.kernel.org; broonie@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 > > > > > > 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