[alsa-devel] [PATCH v2] ASoC: rt5670: add clock source selection controls

Bard Liao bardliao at realtek.com
Tue Sep 2 07:22:49 CEST 2014


> -----Original Message-----
> From: Mark Brown [mailto:broonie at kernel.org]
> Sent: Monday, September 01, 2014 11:35 PM
> To: Bard Liao
> Cc: lgirdwood at gmail.com; alsa-devel at alsa-project.org; lars at metafoo.de;
> Flove; Oder Chiou
> Subject: Re: [PATCH v2] ASoC: rt5670: add clock source selection controls
> 
> On Mon, Sep 01, 2014 at 01:37:58PM +0800, bardliao at realtek.com
> wrote:
> 
> > +static const char * const rt5670_asrc_clk_source[] = {
> > +	"clk_sysy_div_out", "clk_i2s1_track", "clk_i2s2_track",
> > +	"clk_i2s3_track", "clk_i2s4_track", "clk_sys2", "clk_sys3",
> > +	"clk_sys4", "clk_sys5"
> > +};
> 
> Every time I see this patch I raise the same concern about the clocking
> usually being controlled in the kernel since other clocks are controlled
> within the kernel.  I've not seen a response to this yet - it's possible there
> is a good reason for putting this under userspace control but you need to
> make the case for doing that.

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.

> 
> ------Please consider the environment before printing this e-mail.


More information about the Alsa-devel mailing list