Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp331199ybl; Tue, 7 Jan 2020 20:28:30 -0800 (PST) X-Google-Smtp-Source: APXvYqz+i/CnDJs4RbxffeXhTYLz5wkmLxrctKDdxMZ5Qqp4a6p/hLfw+sBWhnf6flNBS0L3Cc4K X-Received: by 2002:a9d:7f11:: with SMTP id j17mr2831663otq.281.1578457710469; Tue, 07 Jan 2020 20:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578457710; cv=none; d=google.com; s=arc-20160816; b=ntjgtiz74cUiPwWKKTI7LAZL6iP/OeGxV+piBVwMbkp3irsnZ0OYwLoeUSNNjSpu54 tFGuoyXWUfc+8dqnJ9No+YBlhbXSLBSw1Mq2MPuXDwGzsAyLnJJOjh3Flmk0A14Cc8OF wS2vtEYE/A6H2Nna09GZ/LJ0M6lyqXb+W6PcT4tk9WjPPIfjyrNeP9OPzAWVoEF7S0mb uGrPkjEPGpztKFS5NK1zW9dHkpIYg+NCQVLiB5HzW65FRLMELwB5Vwhanrz2Ho3t00o8 eFsPtH6WgwkERLijBmcET/pKPnXuxvrpUiS7YwdgYqanS/Itq4BIXjmkytyBDoanc8YJ XD0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=o1WkaBZF+V5uOHI2hp52m1Tf/ktBgPdCEp983xhjZ0c=; b=x3zn4DxDD5nkYzrJOEfrdD7l+Fjm9ejz8F1ZAzyx4OI6Y75WA1XecOcwL5qfRZUSGR o9CUU0hhkMTCNaoCMVsd+xQ1d6zoXpCWOldLijOaFiTEkQObj0a9q6B+7T+YPKzwNQVs R8zoTs0iOYNMblaDJ3kiWZ8055pEi7mnWHIsr+V/Oan5rqdbPigSZHZz/xm6tJ5Q+rRu O7r8wYfJuJkWIRwNGwDOgzdTg3VfAyJHzpYFW2CpW2eZY+BpYrZhXtnqQ093HicYnN7L meuxKppclPfEuHgDgklE5OHeZKo32pigzQKpQAvyDzcxa6T8Wzb16NfaOA2slNQ2hGrj q7YA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=eKTJ7I02; 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=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2si1155367otn.117.2020.01.07.20.28.17; Tue, 07 Jan 2020 20:28:30 -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=@nvidia.com header.s=n1 header.b=eKTJ7I02; 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=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727336AbgAHE0T (ORCPT + 99 others); Tue, 7 Jan 2020 23:26:19 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:10430 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727189AbgAHEZq (ORCPT ); Tue, 7 Jan 2020 23:25:46 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 07 Jan 2020 20:25:27 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 07 Jan 2020 20:25:45 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 07 Jan 2020 20:25:45 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 8 Jan 2020 04:25:44 +0000 Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 8 Jan 2020 04:25:44 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.2.162.131]) by rnnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Tue, 07 Jan 2020 20:25:44 -0800 From: Sowjanya Komatineni To: , , , , , , , , , , , , CC: , , , , , , , , , , Subject: [PATCH v7 15/21] ASoC: tegra: Add fallback implementation for audio mclk Date: Tue, 7 Jan 2020 20:25:09 -0800 Message-ID: <1578457515-3477-16-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578457515-3477-1-git-send-email-skomatineni@nvidia.com> References: <1578457515-3477-1-git-send-email-skomatineni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1578457527; bh=o1WkaBZF+V5uOHI2hp52m1Tf/ktBgPdCEp983xhjZ0c=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=eKTJ7I02raJWXBiNI+8QxCLlmMUHbwZmJuyrgepH8vbz4f16moWjFaFWOVUlJB9Gm vlImI3rjv5JlwAk7arbcUHCWtP6+TnVT6Y108XgZFkOSNMnNvFAg++eViVBK3klMVw e3vqqhfkZR1Kaaf935c/+12BJ7XHYDl0cUwPY7ZqgegU3zoQ38Y37uTkTcnt6DLsDU 2VYcLP4QekzDsd/KJIrBpWuUMSDcMTaQkj22KRlIIfCkk1yU+NctplzBIakhbhUfI7 hl2Zch2mAo7CZimNX332J1LLb7QBZGMnFRjjSLwu4lFBxLPbDmUTltDCtjBFeCp0Cj qpgHnvbIcCeEg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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. Tested-by: Dmitry Osipenko Reviewed-by: Dmitry Osipenko Signed-off-by: Sowjanya Komatineni --- sound/soc/tegra/tegra_asoc_utils.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sound/soc/tegra/tegra_asoc_utils.c b/sound/soc/tegra/tegra_asoc_utils.c index 9cfebef74870..9a5f81039491 100644 --- a/sound/soc/tegra/tegra_asoc_utils.c +++ b/sound/soc/tegra/tegra_asoc_utils.c @@ -183,7 +183,16 @@ int tegra_asoc_utils_init(struct tegra_asoc_utils_data *data, data->clk_cdev1 = devm_clk_get(dev, "mclk"); if (IS_ERR(data->clk_cdev1)) { dev_err(data->dev, "Can't retrieve clk cdev1\n"); - return PTR_ERR(data->clk_cdev1); + if (PTR_ERR(data->clk_cdev1) != -ENOENT) + return PTR_ERR(data->clk_cdev1); + /* Fall back to extern1 */ + data->clk_cdev1 = devm_clk_get(dev, "extern1"); + if (IS_ERR(data->clk_cdev1)) { + dev_err(data->dev, "Can't retrieve clk extern1\n"); + return PTR_ERR(data->clk_cdev1); + } + + dev_err(data->dev, "Falling back to extern1\n"); } /* -- 2.7.4