Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1214203ybl; Thu, 23 Jan 2020 16:05:07 -0800 (PST) X-Google-Smtp-Source: APXvYqznjAY05oRz+qO878bBMsp/iKnLJfFvqDN6sJmUOo2fwAYwlTeTrWhjFHcwt6rhvlov0HcZ X-Received: by 2002:a05:6830:1401:: with SMTP id v1mr726604otp.360.1579824307235; Thu, 23 Jan 2020 16:05:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579824307; cv=none; d=google.com; s=arc-20160816; b=gd+qxClVCNHVXlIPSLWcRjZV0qs/OscvEMj5ot3WrPovN9qFXvvRDSXNJkrJ4VIsBO 5CNt0Dk4X7z09haBp/M0YkPGDMTQRcqtYIiQJ+XGVAqE76Wg4iF0a7gklDJZ0TdB+Ytl /0w8tfDjeKrTIW6ZjD0ci6Zev5+BzUaLLsHF1Xwyf9Ozg+Tumjb5uSH2pas2F+iGTfBu 0tV0fHyTE7Vi32XhNX+OcJ1z580/kK8YQHRVX8j1hYq1blsXLdrCcZUhvpNJkRYiUUN6 XN57aeUnkVkGm7syJ8cc3AAQYTw0J4QKpLRZhjCeuHwruxzmDCN+kuFPnVwjDzjgT4Tk Qg2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=GBpSA+S70IveCTtKIGEFtQpKccngEqKX7VJI5QTlR44=; b=oskd9i+EVdWh621lT4gcatzL7jYBEce5EuHNiAyFAl/F1faKBK4M/LVCfxuE4T67vY gTGoxuy2sWQrjGX60mQq2yFbi8s6Z4lfiuG5X1aeZkWh6YHXbOLkL5NceKzkc/X4pw+w kOXpi1lUM/kHOMyFKvMdB1bzpdArgV2eoQNaTnG5K5ULwfs0gWXKSazbe+p3DL/fiZaP WMcA9+pPR9bWFn6R2hZ+IRfgqVb0BXENQ/jJGLosqeHeocAGnbVqM69/0OK0/IjL8c++ T2dpBy65veUVKUtaWpYfFvVkXEczZMTvfF8wCzutlvqkpxqIz+GcFeVOI9dXECInL6gB nSuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gqdOAPHf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si1480528oir.123.2020.01.23.16.04.54; Thu, 23 Jan 2020 16:05:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gqdOAPHf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729904AbgAWX4w (ORCPT + 99 others); Thu, 23 Jan 2020 18:56:52 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:41254 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729277AbgAWX4w (ORCPT ); Thu, 23 Jan 2020 18:56:52 -0500 Received: by mail-lj1-f196.google.com with SMTP id h23so353215ljc.8; Thu, 23 Jan 2020 15:56:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GBpSA+S70IveCTtKIGEFtQpKccngEqKX7VJI5QTlR44=; b=gqdOAPHfQJs7X0ZXIxK83uE8YRY1mng4HqdwWXVTp8ByvyNa6ZheKj2RHCguW3xOwZ PUmnNIdiPmp1TjkbXzo4bwZ21v8NE7OR0rDTqT9O9iEZXXL3EeCNmepJpMkkLj+lNpYn CQ7ZTNuFfLU3mLP1kjo5813jL7L7BEakXcMcWSmqmSrMMDSWau3h0+JuO/z7/fxIARFz Gxho2oK8ZnU+aweBDeR8YBIB01ggNKfDr+9S2Xwfc0/R4iOCDAeWFTxyampSwIweBf3g ylJKbNGhspngo3OUllSFtZxk0fQ6RgE64tZVOJOXmIcNo6z2VE3UZM5OXmDXIEE23tpJ 6L0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GBpSA+S70IveCTtKIGEFtQpKccngEqKX7VJI5QTlR44=; b=ThwgBCnCAaZxwT9cifvUcUMiNz5K5z+XDDaSFK23ZKUmljC0f7s4446PA/nNTyb+2g DiuAVLRrHc/gBbYOfI7d4OTF3EXUiMr3mtPr5xsw3WZsPE1nxVte57o41AdOyB3SMzmf 5h0ZZ6VMCDtd3NjgDoxXEzO64HO2H8VtLsMKhcYOd6rZEswuJc4b5obSgHo9VqhVb4vY Xa9qxKmvl+mutP8AaYPH/+AnvCZLWiDmh2pNfX2gw0mtlN7sQmAp2klavPxPDEPqWIPs a3DvcTZcUh4f9xoZrgNWpV9i6auF8HJNZF1PuZfaOziNX15OBM+mG7Mu1csH2+ykFmfW Dvvw== X-Gm-Message-State: APjAAAWNkP8SPsvYxVcP2pPY+LPrDPakpYBO3EGWI1RF2hZxMD7qdTUS LP22RPfSoG1mn9VcltVoCBDPQkBB X-Received: by 2002:a2e:3619:: with SMTP id d25mr481791lja.231.1579823809203; Thu, 23 Jan 2020 15:56:49 -0800 (PST) Received: from [192.168.2.145] (79-139-233-37.dynamic.spd-mgts.ru. [79.139.233.37]) by smtp.googlemail.com with ESMTPSA id y2sm188582ljm.28.2020.01.23.15.56.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Jan 2020 15:56:48 -0800 (PST) Subject: Re: [PATCH v8 11/22] ASoC: tegra: Add fallback implementation for audio mclk To: Sowjanya Komatineni , thierry.reding@gmail.com, jonathanh@nvidia.com, broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, mperttunen@nvidia.com, gregkh@linuxfoundation.org, sboyd@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com Cc: pdeschrijver@nvidia.com, pgaikwad@nvidia.com, spujar@nvidia.com, josephl@nvidia.com, daniel.lezcano@linaro.org, mmaddireddy@nvidia.com, markz@nvidia.com, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <1578986667-16041-1-git-send-email-skomatineni@nvidia.com> <1578986667-16041-12-git-send-email-skomatineni@nvidia.com> From: Dmitry Osipenko Message-ID: Date: Fri, 24 Jan 2020 02:56:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0 MIME-Version: 1.0 In-Reply-To: <1578986667-16041-12-git-send-email-skomatineni@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 14.01.2020 10:24, Sowjanya Komatineni пишет: > mclk is from clk_out_1 which is part of Tegra PMC block and pmc clocks > are moved to Tegra PMC driver with pmc as clock provider and using pmc > clock ids. > > New device tree uses clk_out_1 from pmc clock provider as audio mclk. > > So, this patch adds implementation for mclk fallback to extern1 when > retrieving mclk returns -ENOENT to be backward compatible of new device > tree with older kernels. > > Fixes: 110147c8c513 ("ASoC: tegra: always use clk_get() in utility code") > > Tested-by: Dmitry Osipenko > Reviewed-by: Dmitry Osipenko > Signed-off-by: Sowjanya Komatineni > --- > sound/soc/tegra/tegra_asoc_utils.c | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --git a/sound/soc/tegra/tegra_asoc_utils.c b/sound/soc/tegra/tegra_asoc_utils.c > index 536a578e9512..74d3ffe7e603 100644 > --- a/sound/soc/tegra/tegra_asoc_utils.c > +++ b/sound/soc/tegra/tegra_asoc_utils.c > @@ -191,9 +191,21 @@ int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data, > > data->clk_cdev1 = clk_get(dev, "mclk"); > if (IS_ERR(data->clk_cdev1)) { > - dev_err(data->dev, "Can't retrieve clk cdev1\n"); > - ret = PTR_ERR(data->clk_cdev1); > - goto err_put_pll_a_out0; > + if (PTR_ERR(data->clk_cdev1) != -ENOENT) { > + dev_err(data->dev, "Can't retrieve clk cdev1\n"); > + ret = PTR_ERR(data->clk_cdev1); > + goto err_put_pll_a_out0; > + } > + > + /* Fall back to extern1 */ > + data->clk_cdev1 = clk_get(dev, "extern1"); > + if (IS_ERR(data->clk_cdev1)) { > + dev_err(data->dev, "Can't retrieve clk extern1\n"); > + ret = PTR_ERR(data->clk_cdev1); > + goto err_put_pll_a_out0; > + } > + > + dev_info(data->dev, "Falling back to extern1\n"); > } > > ret = tegra_asoc_utils_set_rate(data, 44100, 256 * 44100); > I tried to double-check if audio works using the updated DT works with this fallback and unfortunately it is not (maybe I actually missed to test this case before).. the driver doesn't probe at all because of the assigned-clocks presence, which makes clk core to fail finding the MCLK and thus assigned-clocks configuration fails, preventing the driver's loading. I'm not sure what could be done about it. Perhaps just to give up on the compatibility of older kernels with the new DTs, missing audio isn't really that critical (perhaps).