From: Kuninori Morimoto Subject: Re: [PATCH] ASoC: rsnd: use device dependency clock Date: Tue, 04 Feb 2014 16:44:34 -0800 (PST) Message-ID: <87siryv15f.wl%kuninori.morimoto.gx@gmail.com> References: <87wqhg6228.wl%kuninori.morimoto.gx@gmail.com> <20140204182749.GR22609@sirena.org.uk> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by alsa0.perex.cz (Postfix) with ESMTP id 2266C261A76 for ; Wed, 5 Feb 2014 01:44:36 +0100 (CET) Received: by mail-pb0-f53.google.com with SMTP id md12so9176450pbc.40 for ; Tue, 04 Feb 2014 16:44:35 -0800 (PST) In-Reply-To: <20140204182749.GR22609@sirena.org.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Linux-ALSA , Simon , Liam Girdwood , Kuninori Morimoto List-Id: alsa-devel@alsa-project.org Hi Mark > > + clk_orig = clk_get(dev, NULL); > > + adg->clk[CLKA] = clk_get(dev, "clk_a"); > > + adg->clk[CLKB] = clk_get(dev, "clk_b"); > > + adg->clk[CLKC] = clk_get(dev, "clk_c"); > > + adg->clk[CLKI] = clk_get(dev, "clk_i"); > > + > > + for_each_rsnd_clk(clk, adg, i) { > > + if (clk_orig == clk) { > > + dev_warn(dev, > > + "Audio clock doesn't support new style," > > + "use old style\n"); > > + use_old_style = true; > > + break; > > + } > > + } > > This looks really strange though I appreciate it's a workaround for a > custom clock implementation. I guess it's not possible for a kernel to > be built with both common and legacy clock implementations? If that is > the case I think it would be clearer to just use an ifdef. Sorry, I guess my comment makes confusion. Here "new style" means "external sound clock has relationship with sound driver", "old style" means "external sound clock is independent clock" This patch adds new clock-relationship rule to rsnd <-> platform. (sound clock should has relationship to sound drvier) The external sound clocks (= clk_a/b/c/i) are "independent" clock in current linus/master. Then, all clk_get(dev, xxx) will be same clock (= module clock) (It was not strange if clk_get(dev, xxx) returns NULL though, but...) # Above code can works well both common/legacy clock implementations. # And, it can't select both common/legacy clock in same time. I will exchange git log comment (= about "new/old" clock), is it OK ? > It's also better to not split error messages between lines, that makes > it easier to grep for the code that generated the error. I see I will fix it in v2 patch