On Thursday, February 25, 2010 4:17 AM Mark Brown wrote:
Are these two functions writing the default codec register values to the CODEC or are these non default (i.e. reset) values. If they are reset values is it not better to just issue the reset (and save the slow I2C writes) ?
Yeap, but they write non default values to most of the registers.
Why are these non-default values being set? The general style with things like this is that the register defaults listed in the driver are the physical defaults, and any explicit configuration is done with register writes. This makes it clearer what's being changed and means that the actual register defaults are there for use if required.
Normally only things that should be changed for all systems would be configured in this manner, things like audio paths which might change per system would be left for userspace to configure.
I meant to say default values, sorry for the confusion
In TWL6040 codec, the registers belong to a power supply domain: VDD or VIO. When the codec hits suspend state, VIO is not longer supplied, so registers lose their values. However, VDD registers preserve their values as they belong to a different power domain which still exist in suspend state. So when codec resumes, it's only needed to restore VIO registers' values lost during suspend. That's the reason why we have two separate functions to set VDD and VIO registers. The former is only needed at probe time and the latter is needed every time codec resumes.
At probe we are using the default values to keep the codec functional as many features have not been enabled yet, some specific values are set using write function.