On Tue, Sep 02, 2014 at 05:22:49AM +0000, Bard Liao wrote:
Which clock source should be selected mainly decided by the sampling rate and the audio routing path. However, there are some exceptions. For example, if the MCLK and I2S clock are asynchronous, we should always select "clk_i2s_track" as the clock source. And In some cases, we can choice "clk_i2s_track" or "clk_sysy_div_out" as the clock source. Users can choose what they want to use.
Even if we ignore all the exceptions and make choice for users, it is still hard to implement it in the driver since we need to read a lot of registers to decide the clock source. It will be easier if we open it to user space so user can configure it with the audio routing path.
The choice is usually deferred to the machine driver rather than made entirely automatically within the CODEC driver - where manual control is required typically the machine driver is then able to offer a bigger, system-wide choice to the user that controls several settings and makes sure that any required coordination occurs.