On Wednesday 26 May 2010 09:00:35 Ujfalusi Peter (Nokia-D/Tampere) wrote:
...
I did run some tests. The codec registers are in reset state whenever the device boots (either power on, or reboot). In our setup the codec is built in the kernel. I have measured the time needed to execute the twl4030_init_chip with and without rewriting the codec registers (71 register writes): No reset_registers: ~51ms reset registers: ~71ms
I need to optimize for module loading time, and ~20ms extra is quite big.
Can we make a compromise? I propose to have twl4030_setup_data.reset_registers, if it is set by the machine driver, than we are going to reset the registers, if it is not set, than we skip the restore part (not writing the 71 registers). So during development, or if one have the codec as module, the machine can set this, so the registers will be restored, but if the testing shows that there is no need to do that, than we can speed up the module probe.
What do you think?
Better thing to do is: restore the registers in these cases: if (!setup || (setup && setup->reset_registers))
So if the machine does not provide setup data, than we can assume, than no one taken a time to tune the platform, so we need to restore to be on the safe side.
What do you think?
Thanks
Liam