Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp22176674ybl; Mon, 6 Jan 2020 20:16:17 -0800 (PST) X-Google-Smtp-Source: APXvYqyyJrQYt+5y0M2b9cGyxz6CGkuJ0UfMqVA35NS7OHfrkLHBYrmypfQMqQJvH9OXCMKeS6VU X-Received: by 2002:a05:6830:16d1:: with SMTP id l17mr96057665otr.21.1578370577673; Mon, 06 Jan 2020 20:16:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578370577; cv=none; d=google.com; s=arc-20160816; b=CepVz3n6x++wLa/5+UtZB+qS6YlwG9i+/TK6vgaAL/18AO4QPNO9S8wrYyq3glZ9Oy LWV+Pq9SNCDr4x1+EkoEgFI2ZfkldRPllHk5RPwwzOlsQiYmgLg9zNtlwG1AxYWgPIWO P548Ugyg8zsY01HsflXbF4kVrghP7kkjvbd9QmMDx6Ub4Lqho9trfaWNj6mgj9WeMg+e FA7ov1VvSQ3kgQ+iS6AxiDDVwZQVaZ3PYz9bOg0bxT0fx+GtS3s2Rrr834NuT4ajRX8A fM1ahnC0cmVGE6207GwyiFW6CeeEqdwHgAHiNHbXgPZhzDdvnGagw5nyfxMNF2ea2vzN RMhg== 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=ERGgNErJ4Bzz8doU2c1guYvJprSgp4YwasNSESsd2Uw=; b=DCxy41K3tGFw28zkYi+0YdBpAf/3/pfSSemfBBvr+AbR5/lG/pMNHg78dzPb9cJeyy CeoRuYkFOaAb/SIUwzJ+IKs6dfJASx0E7cWjdyL4GSerNhWwC2epG1/kXmYeEEvpoAxW Zteyi6I5frPZG/N+28Li/lXw2aIdDpgt/LqAT64bpxvRlydXd/3Knb95H3jnwO2ulWLx rV91lP+SKEEtJhxPwbhNjGaAismkREmX8fk+wsuL3X438mtlE0S7LxWSTctbq4LlZT1I oE9g5d0WWfoZ0ibdGkM3giNRWlgW2i5O332KRkY8CFfHeZpunuRDpwBCMzWCaGTiqOgi 14Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=WXJ+p5Jr; 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 18si9460076oir.123.2020.01.06.20.16.04; Mon, 06 Jan 2020 20:16:17 -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=WXJ+p5Jr; 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 S1727790AbgAGEPM (ORCPT + 99 others); Mon, 6 Jan 2020 23:15:12 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:11406 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727653AbgAGEOf (ORCPT ); Mon, 6 Jan 2020 23:14:35 -0500 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 06 Jan 2020 20:13:47 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Mon, 06 Jan 2020 20:14:34 -0800 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Mon, 06 Jan 2020 20:14:34 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 7 Jan 2020 04:14:34 +0000 Received: from hqnvemgw03.nvidia.com (10.124.88.68) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 7 Jan 2020 04:14:34 +0000 Received: from skomatineni-linux.nvidia.com (Not Verified[10.2.171.88]) by hqnvemgw03.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 06 Jan 2020 20:14:34 -0800 From: Sowjanya Komatineni To: , , , , , , , , , , , , CC: , , , , , , , , , , Subject: [PATCH v6 13/19] ASoC: tegra: Add fallback implementation for audio mclk Date: Mon, 6 Jan 2020 20:14:12 -0800 Message-ID: <1578370458-3686-14-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1578370458-3686-1-git-send-email-skomatineni@nvidia.com> References: <1578370458-3686-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=1578370427; bh=ERGgNErJ4Bzz8doU2c1guYvJprSgp4YwasNSESsd2Uw=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:X-NVConfidentiality:MIME-Version: Content-Type; b=WXJ+p5JrAqa6oR/zo6bmhtOxpWHkon7qcVRiPACuJfhvody7tjTOxTYa2GcgzHu5p 8QW3P0G3EIT0BYk7x7AmZMICRKVYHQezK2GA/rlh0l61IX2Xitv22PWvey6XqrRJ65 wMgaXH4bg2M0yvDnPFPLwmgqRiwhlwbrl/6Ubsi5VUXvWIBR0Jd0sBweYo5YMFzUVa w1y/lTZ6wr+xkchelXN8T4c/2sIjpEMzfe4KYeQ1XBjr9aYrG00AIBnkVrVi+vgqYH RLBa4QGfBNlH/f+jqVjmXPy4LftEApADMTRocUZwwwhf4C6XarQe2/Ya3aQTjTxbi/ Q/i9rdXStqOGQ== 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 2886ae9f5a16..1e28abea156c 100644 --- a/sound/soc/tegra/tegra_asoc_utils.c +++ b/sound/soc/tegra/tegra_asoc_utils.c @@ -181,7 +181,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