24 Feb
2010
24 Feb
'10
11:42 a.m.
On Wed, Feb 24, 2010 at 10:38:01AM +0000, Liam Girdwood wrote:
On Tue, 2010-02-23 at 18:10 -0600, Olaya, Margarita wrote:
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.
...and if you don't satisfy reads from the cache you may as well not bother with it - it's just consuming memory.
/* skip read-only registers (ASICID, ASICREV, STATUS) */
if ((reg == TWL6030_REG_ASICID) ||
(reg == TWL6030_REG_ASICREV) ||
(reg == TWL6030_REG_STATUS))
continue;
twl6030_write(codec, reg, cache[reg]);
A switch statement would be nicer here.