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 x0052729@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