Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3721687ybl; Fri, 20 Dec 2019 14:29:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwczEjNANbXc3FXEVSMgrFBxVnUlvpyMmj2sVYj0yZqT1IFZP/bIWRT8id9vQ0Mobzct+Y/ X-Received: by 2002:a9d:480b:: with SMTP id c11mr2749616otf.283.1576880952621; Fri, 20 Dec 2019 14:29:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576880952; cv=none; d=google.com; s=arc-20160816; b=KwUHi/ssysdQnaekFBD9mAc+CFBKQUaBcIq2+rKUx+xuC/mbnoOoJXCPFRDpJMoHA+ 5j3OnA1/Yf4xokXlW7pOTJVlusw166+boha/e1qKetWGOSYx2cJa1xU+UcsUTKY1ILH0 zxepkp2mXRUJiKUoyUE7TaHjmpJ7PMsR5iiiSeYkUZzg2S8UHCraxbFb7T8TQlt7wzkz mfeNrrFceN5GI5EnEaxmlQ4YDzVdGxMHySviBiLvy6K0xeteMXCxe+tszC0kW9+vCgm6 P97guFFTc3sqefTUKm6Phutvdcv8pI103Fmjwf7hl/pc3XW+DjP1nM83v/36RcpxHnjM JrUg== 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=z7SsrqcLkMI91+hk9rh2Uy0osUWCnias+wy7iFK2u6A=; b=qdNhlRgTqapfIFuHcy4pehPAsGD3Y51MdOdZfFKTccauBpl9d+inAjIFuEEwR95fvL QIxNcByyXGwyxwqiQj5OjKhPVyUz4lgI0ajPHMt/XJ1/ATQR0ntxLGMCUCILL6QWXivK R8N7y7krVo6S7kWnwh+BUtsDzrO6yBMVo//yuz4rT+ua/TemU9jO1x4jFfw9d1HNvD1w W/PaFDQfzDfFNjMZklSDwNeDIpbeJEA60CD8bSLdAcfWbZbfAyIXAE+YdF86Br9a1CP9 3H7aAktG567in/qwwg4o+MK6VHApkYZ4eAkPq4+ia60OVgktbBnBefuP2gOaz99xtRvo LS9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=LrOsa1dX; 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 y130si5281368oiy.28.2019.12.20.14.29.01; Fri, 20 Dec 2019 14:29:12 -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=LrOsa1dX; 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 S1727814AbfLTW16 (ORCPT + 99 others); Fri, 20 Dec 2019 17:27:58 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:13460 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727628AbfLTW1W (ORCPT ); Fri, 20 Dec 2019 17:27:22 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 20 Dec 2019 14:27:11 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Fri, 20 Dec 2019 14:27:21 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Fri, 20 Dec 2019 14:27:21 -0800 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 20 Dec 2019 22:27:21 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 20 Dec 2019 22:27:21 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.2.169.197]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Fri, 20 Dec 2019 14:27:21 -0800 From: Sowjanya Komatineni To: , , , , , , , , , , , , CC: , , , , , , , , , , Subject: [PATCH v5 13/19] ASoC: tegra: Add fallback implementation for audio mclk Date: Fri, 20 Dec 2019 14:26:59 -0800 Message-ID: <1576880825-15010-14-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1576880825-15010-1-git-send-email-skomatineni@nvidia.com> References: <1576880825-15010-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=1576880831; bh=z7SsrqcLkMI91+hk9rh2Uy0osUWCnias+wy7iFK2u6A=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=LrOsa1dXKRw2rYhSzoJKvNBgVo2xEByPFU7HYwL3nitpWFJyBIHjpXL5d+UU8HUFP vmglugAguTCm0O7bgmIUDt6hYlQTfrz/BTSsnmRCm5GOv1DkTqO4WSa9X+Yp8TsX9M oCcIDPuvj8w1toeyOB4E+stIsJaLrKcKMq9aFgG5EzIa2q4TK0qkpqGxBkBA45xQeP ZxjE28cCLRJgrS5TcGxsjFGclaBBa/01cH6BNs4Af99q/keuXL4tAiAoHgx+HKtC/F WbQhtcNL4trMm4s7lc57FL0jleHe17NsZIHAXnc5utawtiwkJcEtVbUT16XeTXj7xC UC9O3yo9PZJSQ== 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. 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 fc3135c08f43..46ff70c16b74 100644 --- a/sound/soc/tegra/tegra_asoc_utils.c +++ b/sound/soc/tegra/tegra_asoc_utils.c @@ -166,7 +166,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