From patchwork Thu Oct 1 17:32:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812023 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DCCB139A for ; Thu, 1 Oct 2020 17:35:17 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 569C52085B for ; Thu, 1 Oct 2020 17:35:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Otp2xQnS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="DcDXK86b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 569C52085B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 620D71947; Thu, 1 Oct 2020 19:34:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 620D71947 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601573714; bh=RaNYOKYlcT5jL4YIYtEOpZP4NwX4Xe1F5lzOohsxlFk=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Otp2xQnSBDbCb7WvWnoEuuBvYzWopWHaFosryVhuZ9Z96vgtw/tFMtd3vSixqiTo5 RbNojjFnz3kzoLeH404KMKkFA4DaTfJ/shfH5vGxjTGsbSRHnIFjMEvTPwhR2IEU74 J8Kbvvs6EMKxg7XX5eYHvY//P2vCUs+O4t/vSsD0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 39DF7F8022D; Thu, 1 Oct 2020 19:33:51 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id AC3FBF801D8; Thu, 1 Oct 2020 19:33:49 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 98909F801D8 for ; Thu, 1 Oct 2020 19:33:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 98909F801D8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="DcDXK86b" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:32:45 -0700 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; Thu, 1 Oct 2020 17:33:33 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:33:28 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 01/13] ASoC: soc-core: Fix component name_prefix parsing Date: Thu, 1 Oct 2020 23:02:55 +0530 Message-ID: <1601573587-15288-2-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573565; bh=uRImc76K31n+hTi7iV8LIW2zE967Cr4MOzJhpu4XeKk=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=DcDXK86bTbtPxFls8Nzc2w1338dEuAY1M7adk3YDn5Z6cDRDchIlmBMIdwm078snY ZB3p89jB2O2eRpkRUu+/xGsVG1IIsorYHsuKVfQa0zSvdCtoxb840H/DklTNUQGwpv 4gYsl7Oa7IAaBzzzPolyu+W3TKzl+RHwaanFqz6psT8Mw58z1ZDm40Vvr81IoB6NL2 A+dNeyMnfGpns3kja5tj5Aay5qc9secKAqlv9/xIb/ZmPmYKev2YsxzX9C5K3AGYc/ IsFU/EZ7YNRw28/mgeOeS0yGpzBa6ywMucK9KRvFdJR/xfsotmOHxQ3qB8Tt54niNK Efx9jvfU+0qxw== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The "prefix" can be defined in DAI link node or it can be specified as part of the component node itself. Currently "sound-name-prefix" defined in a component is not taking effect. Actually the property is not getting parsed. It can be fixed by parsing "sound-name-prefix" property whenever "prefix" is missing in DAI link Codec node. Signed-off-by: Sameer Pujar --- sound/soc/soc-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 74df224..a784943 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1124,7 +1124,8 @@ static void soc_set_name_prefix(struct snd_soc_card *card, for (i = 0; i < card->num_configs; i++) { struct snd_soc_codec_conf *map = &card->codec_conf[i]; - if (snd_soc_is_matching_component(&map->dlc, component)) { + if (snd_soc_is_matching_component(&map->dlc, component) && + map->name_prefix) { component->name_prefix = map->name_prefix; return; } From patchwork Thu Oct 1 17:32:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812027 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 997261668 for ; Thu, 1 Oct 2020 17:36:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8C3C62054F for ; Thu, 1 Oct 2020 17:36:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="SgAm80/4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="aWKbsPji" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C3C62054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7490D19FE; Thu, 1 Oct 2020 19:35:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7490D19FE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601573763; bh=6sHZcyuVnn3p/mLygeXG13a8vPke7HtuCUdtrdI+HF8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SgAm80/40rozZJLenMWW21eo/4EnVu89YdMrSG1u7Tq+Qh/tyWHxFZbiJT+ulmKww /rq8IZjHkj2hvIaclWOSCkbE0XIg/AA5ApmPZs74X8qc+2wEXDzuweMClSoO9J3ur6 2HxooQ/F0Xml/iMqsaN/oQfGeHMH+HcTAc2BK9Jw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DB27EF802E0; Thu, 1 Oct 2020 19:33:55 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 94BB0F802E1; Thu, 1 Oct 2020 19:33:54 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7DCB9F8020C for ; Thu, 1 Oct 2020 19:33:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7DCB9F8020C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="aWKbsPji" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:32:55 -0700 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; Thu, 1 Oct 2020 17:33:44 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:33:38 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 02/13] ASoC: soc-pcm: Get all BEs along DAPM path Date: Thu, 1 Oct 2020 23:02:56 +0530 Message-ID: <1601573587-15288-3-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573575; bh=3W6UwWfLG2y91GsD4wxpT6TKLXhYsYzkiLpXPArPYYQ=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=aWKbsPjiYcs+eBs60mOl5T1fCxii/NCGDY3P6oZ31iiqIW05HFPv2FdgXWbWa8UGi 7isM0+VMPdy7ZmFBmp9ekCXqBlGB9SMUuNtE4PsMElp79OIIxXjCpcWJl5PVDC7irE uZP2Pd8M9VlBNEP/sw4qZNxwXCHO8JVh5vrbjhbldNx1kkkJKZRvWH9dxiAzlcOfKZ wi8pAY5J/U8ZEDHdjUkgxwgwj0ACtW00WCh2iVV+kxRZNUvwo/Sr1XsLNQp04bp1is TzbJ1q5vE+++Whpz052t770g1QqxSzDgA2VxNX853NYEEZHukqGYr8yXBus3T89gX2 HBvgPw5jq9jNQ== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" dpcm_end_walk_at_be() stops the graph walk when first BE is found for the given FE component. In a component model we may want to connect multiple DAIs from different components. A new flag is introduced in 'snd_soc_card', which when set allows DAI/component chaining. Later PCM operations can be called for all these listed components for a valid DAPM path. Signed-off-by: Sameer Pujar --- include/sound/soc.h | 1 + sound/soc/soc-pcm.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sound/soc.h b/include/sound/soc.h index 3b038c5..9b69d70 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1084,6 +1084,7 @@ struct snd_soc_card { unsigned int fully_routed:1; unsigned int disable_route_checks:1; unsigned int probed:1; + unsigned int component_chaining:1; void *drvdata; }; diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 09e8d70..25904b8 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1283,7 +1283,8 @@ int dpcm_path_get(struct snd_soc_pcm_runtime *fe, /* get number of valid DAI paths and their widgets */ paths = snd_soc_dapm_dai_get_connected_widgets(cpu_dai, stream, list, - dpcm_end_walk_at_be); + fe->card->component_chaining ? + NULL : dpcm_end_walk_at_be); dev_dbg(fe->dev, "ASoC: found %d audio %s paths\n", paths, stream ? "capture" : "playback"); From patchwork Thu Oct 1 17:32:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812029 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6EF1139A for ; Thu, 1 Oct 2020 17:36:40 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4FC2320872 for ; Thu, 1 Oct 2020 17:36:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="ol43yyme"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="J48GOF67" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FC2320872 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 99CF61931; Thu, 1 Oct 2020 19:35:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 99CF61931 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601573798; bh=15xhUrxb/MpT+5GpYvg2JfPmkbw2KN6Or0pmPgUYMpg=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=ol43yymewm8e3TyFCb5YFRHJrf7/KH02e8CzddR+o8/UyqoO+IyTtB66WaD1DbqJg zuaus8zWBf9VpRnqlVCPaVJ6/ng38W3S48fw0TBkKA95q7isn7iStBhtnET7a74YWO zI5Dw4+9BswYzBqWUu0i46QbX7o8obg0bq5BvFtc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C5925F802E1; Thu, 1 Oct 2020 19:34:05 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 508CEF802E8; Thu, 1 Oct 2020 19:34:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,PRX_BODY_30,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F05D6F802E1 for ; Thu, 1 Oct 2020 19:33:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F05D6F802E1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="J48GOF67" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:33:04 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:33:53 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:33:48 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 03/13] ASoC: audio-graph: Use of_node and DAI for DPCM DAI link names Date: Thu, 1 Oct 2020 23:02:57 +0530 Message-ID: <1601573587-15288-4-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573584; bh=DUfSjxqgTyMLeILJTEcFS/WZ2++sn+Xe/SbNNLGn5Pg=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=J48GOF67g8IwIWiaMDft3OCFD6E4u3eJCstB4b1GncdNLIeuARL9ZaH8R7XVvFxRd cKsWB1hF4boJmfcIR2Np85EWGuvAUJov1CZ9r5zouB+cLEDaicbDP1SVhxdNQtmChm eEaTaAeDNFlTZi0/pcp/2o5sh3FNUZlqgtWe58tPjgscQNup21ZbvgcNzF9YffI07Y hVyaaS/6T1TGwqKJJy2Y5KgfBi5iDpeXwnCxrXEfPpg2nJxA75PLM7AdqPIEwf9sna PU7UXLhCcEmQEXAVbUyyjefatXZvwAFgSQ7oKEC4oZyqg8CnnWEfG17Wo+EAHwUS3F fKeC91lhm/qDw== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" For multiple instances of components, using DAI name alone for DAI links is causing conflicts. Components can define multiple DAIs and hence using just a device name won't help either. Thus DT device node reference and DAI names are used to uniquely represent DAI link names. Signed-off-by: Sameer Pujar Acked-by: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 97b4f54..1e20562 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -253,7 +253,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, goto out_put_node; ret = asoc_simple_set_dailink_name(dev, dai_link, - "fe.%s", + "fe.%pOFP.%s", + cpus->of_node, cpus->dai_name); if (ret < 0) goto out_put_node; @@ -287,7 +288,8 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, goto out_put_node; ret = asoc_simple_set_dailink_name(dev, dai_link, - "be.%s", + "be.%pOFP.%s", + codecs->of_node, codecs->dai_name); if (ret < 0) goto out_put_node; From patchwork Thu Oct 1 17:32:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812031 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67C7E92C for ; Thu, 1 Oct 2020 17:36:58 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEA3420872 for ; Thu, 1 Oct 2020 17:36:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="liwYtFh4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="qh6ixMdr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEA3420872 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 41085194A; Thu, 1 Oct 2020 19:36:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 41085194A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601573816; bh=YbX3Xs+IlkZvwttFLiXjgQc2kMiTtiyWfEmqYnyAdCc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=liwYtFh4JOBaf6YkcSrKgLJn1Ebwbca4IRLmQ16ikeGvuN1YIow1NuCtvO5o9Q6NR JsoAJOVF8erROPRBai58y0VLdEBFaOUpjW0/4VdeBYKx5cQ+sHdxrXIvHEF+y9RYvS HyzViHDUspqIrUE+9L9ZUP0sjpD6e9v6bVuewsXA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A2B6CF802EB; Thu, 1 Oct 2020 19:34:19 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2EF7EF802EC; Thu, 1 Oct 2020 19:34:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9274AF802E7 for ; Thu, 1 Oct 2020 19:34:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9274AF802E7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="qh6ixMdr" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:33:18 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:34:06 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:34:01 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 04/13] ASoC: audio-graph: Identify 'no_pcm' DAI links for DPCM Date: Thu, 1 Oct 2020 23:02:58 +0530 Message-ID: <1601573587-15288-5-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573599; bh=FxtLB3V25/9092fJImUbmEK5DDd1xaC11DWTieE2aCs=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=qh6ixMdrkj816QIY0WmOUzRZcLvyEd3MNzsOR3UMAb1KnCe6PBtrKmtui7l835exM FMWyfdPQkYQUmGT8bfc32gsUqdTerVWX7S4tl8Z/HUpnDESTtGu+xub8jU5N1Q6Fk3 P/97eKI5f4bV/QxpDQj3+W+dEs/MFv3xLZq8ixCR+1Bf9li/Dz1jr4ZeKEj0tCfoZb KHwAq0yES2wk5QeT0eyqz2xzciFfAR3vS0Jckk6/Nb2LTsNOknf7MVoF02QpxPRbHq 7RtUYGew/iybPmTll5JvwEasbWt6OnVq8u+H1PDPSCE6RQBt9exOoUBbgpnl0mwxeE hRzEpYfvFMaAA== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" PCM devices are created for FE dai links with 'no-pcm' flag as '0'. Such DAI links have CPU component which implement either pcm_construct() or pcm_new() at component or dai level respectively. Based on this, current patch exposes a helper function to identify such components and populate 'no_pcm' flag for DPCM DAI link. This helps to have BE<->BE component links where PCM devices need not be created for CPU component involved in such links. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 1e20562..9b06841 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -111,6 +111,17 @@ static int graph_get_dai_id(struct device_node *ep) return id; } +static bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc) +{ + struct snd_soc_dai *dai = snd_soc_find_dai_with_mutex(dlc); + + if (dai && (dai->component->driver->pcm_construct || + dai->driver->pcm_new)) + return true; + + return false; +} + static int asoc_simple_parse_dai(struct device_node *ep, struct snd_soc_dai_link_component *dlc, int *is_single_link) @@ -205,6 +216,7 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, int dup_codec) { struct device *dev = simple_priv_to_dev(priv); + struct snd_soc_card *card = simple_priv_to_card(priv); struct snd_soc_dai_link *dai_link = simple_priv_to_link(priv, li->link); struct simple_dai_props *dai_props = simple_priv_to_props(priv, li->link); struct device_node *top = dev->of_node; @@ -259,6 +271,19 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, if (ret < 0) goto out_put_node; + /* + * In BE<->BE connections it is not required to create + * PCM devices at CPU end of the dai link and thus 'no_pcm' + * flag needs to be set. It is useful when there are many + * BE components and some of these have to be connected to + * form a valid audio path. + * + * For example: FE <-> BE1 <-> BE2 <-> ... <-> BEn where + * there are 'n' BE components in the path. + */ + if (card->component_chaining && !soc_component_is_pcm(cpus)) + dai_link->no_pcm = 1; + /* card->num_links includes Codec */ asoc_simple_canonicalize_cpu(dai_link, is_single_links); } else { From patchwork Thu Oct 1 17:32:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812035 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 456FF618 for ; Thu, 1 Oct 2020 17:37:41 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 71A232054F for ; Thu, 1 Oct 2020 17:37:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="WJzOmWQP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="JzJBA1Ru" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 71A232054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CDFB01A94; Thu, 1 Oct 2020 19:36:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CDFB01A94 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601573858; bh=CApja9/3i4SSZxCyu1S8rCuEjQ9eENWhYSW5FFnSQuQ=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WJzOmWQPFM1nf/MoSxWnZ1tQKhw8MbCheLe/fhK8EmMLjEaie7WOE/h8udX4OYw3j 3llrRczZB92uUkd9NXNfbnmGQvHVCNlotiW0JfCiXymVqt2FrsxYq1v+ZgbAQHpUkJ eAmCfyB6CdqLeKvwB54OtHWyEChiZbkeXmKj3Cfw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 82B07F802F8; Thu, 1 Oct 2020 19:34:27 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A4266F802FB; Thu, 1 Oct 2020 19:34:25 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BF811F802F8 for ; Thu, 1 Oct 2020 19:34:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BF811F802F8 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="JzJBA1Ru" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:33:26 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:34:14 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:34:09 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 05/13] ASoC: audio-graph: Support empty Codec endpoint Date: Thu, 1 Oct 2020 23:02:59 +0530 Message-ID: <1601573587-15288-6-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573606; bh=xesz+C4t0YPTEFk/rqoe+zcMPgDi6HPptJd7hjC0VQQ=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=JzJBA1RuXOHgUu2eDrsEpKVQqr8gQFQAInbH/EUxhlR8CkQ1yzLjM2yrPrZhEPndl AOkHtCLO80qIyrijDr5Fi0TEuHZ1eM11//KRjNqEEWlhWr9mat+cf1u3nOL8cxwC52 qKyl0J1l1ZQTzWp2NNQnso2GKnq3GgT0RV91A0HdmU3LN38tK21rqZXaJ4mLRu3pUT m+tcvkxhoYHmOokmmS8V4/ACrpT7Md9P5AscHlTqtCgrQY7oOk1prpDvcdzlveIFUB 5umfj2aXsP8yWkndb0dX+5U8RvqI2E4os/ODUNLpSL7o31CLukbHKFO1u2g8y/Vv60 2pn/AeUdhZmDg== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" For open platforms, which can support pluggable audio cards, Codec endpoint is not fixed always. It actually depends on the compatible HW module that is going to be connected. From SoC side the given I/O interface is always available. Hence such links have fixed CPU endpoint but no Codec endpoint. This patch helps to support such links where user can populate Codec endpoint only and its fields in Platform DT depending on the plugged HW. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 9b06841..0ba50be9 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -229,6 +229,14 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, struct snd_soc_dai_link_component *codecs = dai_link->codecs; int ret; + /* + * Codec endpoint can be NULL for pluggable audio HW. + * Platform DT can populate the Codec endpoint depending on the + * plugged HW. + */ + if (!li->cpu && !codec_ep) + return 0; + /* Do it all CPU endpoint, and 1st Codec endpoint */ if (!li->cpu && dup_codec) return 0; @@ -565,7 +573,7 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv, li->link++; /* 1xCPU-dummy */ li->dais++; /* 1xCPU */ - if (!dup_codec) { + if (!dup_codec && codec_ep) { li->link++; /* 1xdummy-Codec */ li->conf++; /* 1xdummy-Codec */ li->dais++; /* 1xCodec */ From patchwork Thu Oct 1 17:33:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812037 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFB7D92C for ; Thu, 1 Oct 2020 17:37:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 34FAA2054F for ; Thu, 1 Oct 2020 17:37:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="O2s2rE/I"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="RpitwpNM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 34FAA2054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 762A01AAA; Thu, 1 Oct 2020 19:37:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 762A01AAA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601573868; bh=GKPLOUQxFgGyDVRjmfRFvHk/t75T60mCxPQb7CdL+Gc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=O2s2rE/IYPT/dOGQY3Mx+F7KF2Yjzu+athJXTM71/2zxMwx4YHoHtxFkCGSDHwLhG r0YCHLHMms0kvSBZkY4W1BlhN9qIU9gRuYHQhagBk9tktHEhIAgsyTOJB7y4l1q7ih O9sN0wnF3xEvwBIRw6KafgCL/+n3lw7lVADXh36o= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 672C3F802F9; Thu, 1 Oct 2020 19:34:41 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 471BCF802FE; Thu, 1 Oct 2020 19:34:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A452DF801DB for ; Thu, 1 Oct 2020 19:34:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A452DF801DB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="RpitwpNM" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:33:39 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:34:27 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:34:22 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 06/13] ASoC: simple-card-utils: Expose new members for asoc_simple_priv Date: Thu, 1 Oct 2020 23:03:00 +0530 Message-ID: <1601573587-15288-7-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573619; bh=TnQC3AMzHJvCLc6PzO7nm4Imy6ab/tEd095RThQjCi0=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=RpitwpNMhaOfs6SsD/PwdvmVMQH79tV7duBLmM49M6xf85Cx1d62RKWPgi1rS2tPq RUIz917LCh3Im01vIBDRu++l2h9Enkp6A/y2axdmen4ryp0iMTJZpjfPT13MN3AIXn 1KplgaPsPfHwVS/e5so9ESktrrZQYBlZ6HJy4kQALNFXDJ71eWu74Aio3SaXnQzgxt fKdf0aHbIXpV6XIDcp1fYGEclXkZAkpkjMe2Gg/BJbpME0HSPG1vrXzKvKsmj3a5p+ nL/ZxbJfsU68Oh0VlGD7Y0j/4a5Zze+52EzXhGp29lLw2WjyHF9zGzBMZxdTKLb4yw uCZqW1KVyxrGA== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add new members in struct 'asoc_simple_priv'. Idea is to leverage simple or graph card driver as much as possible and vendor can maintain a thin driver to control the behavior by populating these newly exposed members. Following are the members added in 'asoc_simple_priv': - 'ops' struct: In some cases SoC vendor drivers may want to implement 'snd_soc_ops' callbacks differently. In such cases custom callbacks would be used. - 'force_dpcm' flag: Right now simple or graph card drivers detect DAI links as DPCM links if: * The dpcm_selectable is set AND * Codec is connected to multiple CPU endpoints or aconvert property is used for rate/channels. So there is no way to directly specify usage of DPCM alone. So a flag is exposed to mark all links as DPCM. Vendor driver can set this if required. - 'dpcm_selectable': Currently simple or audio graph drivers provide a way to enable this for specific compatibles. However vendor driver may want to define some additional info. Thus expose this variable where vendor drivers can set this if required. - 'data': A void pointer member is provided. This would be useful when vendor driver wants to define its own structure for internal usage and still wants to rely on most of the other members from 'asoc_simple_priv'. Subsequent patches in the series illustrate usage for above. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto --- include/sound/simple_card_utils.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 86a1e95..9825308 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -56,6 +56,10 @@ struct asoc_simple_priv { struct asoc_simple_dai *dais; struct snd_soc_codec_conf *codec_conf; struct gpio_desc *pa_gpio; + const struct snd_soc_ops *ops; + unsigned int force_dpcm:1; + uintptr_t dpcm_selectable; + void *data; }; #define simple_priv_to_card(priv) (&(priv)->snd_card) #define simple_priv_to_props(priv, i) ((priv)->dai_props + (i)) From patchwork Thu Oct 1 17:33:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812041 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 390A0618 for ; Thu, 1 Oct 2020 17:38:34 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ADE2B2054F for ; Thu, 1 Oct 2020 17:38:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="Q82MYxHS"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="fYUhqZEf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADE2B2054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E9B541947; Thu, 1 Oct 2020 19:37:48 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E9B541947 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601573912; bh=GiNZX79O2csAv7JOl/1RQUZbO7U3W/uAaLvwhjKGGXc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Q82MYxHSjU8ni2R86YI5f0QsFqvQV4hwWgN7DrZzxp9ywzePbkrI4RdgVT2PkKDWA lOspUrG7hv9ofHW8kUwAThZQKWANYk+NGM7/fi4voY/v159x6gs/GnAGr/p6I9eCWU YvYazTI+rD4OwWdpDxsgoKew5LZUEc+bD0MtYg9k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 38314F80303; Thu, 1 Oct 2020 19:34:49 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E82B2F80305; Thu, 1 Oct 2020 19:34:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1117FF80303 for ; Thu, 1 Oct 2020 19:34:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1117FF80303 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="fYUhqZEf" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:33:46 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:34:36 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:34:30 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 07/13] ASoC: audio-graph: Update driver as per new exposed members Date: Thu, 1 Oct 2020 23:03:01 +0530 Message-ID: <1601573587-15288-8-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573626; bh=KGVHwu7gz2uVTadbhaTYCpdQftlC5kySO8eaYF0Uy+k=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=fYUhqZEfnTADS7VXjUCEX/mFkoL/V4WT96/Hsx2evVoPrcLybnJFba3ISNLNlf7WU FnMTpnqun8xFjI3uVJi23uQ5ITpAkVfig+Fh9UK5HXzMM57j0zib40G5wWHOlt18Ij trZtM1py2HX8SMfwyVM5mGIg2N3lLMfVOIWhOe9GKnpwJNlT8Oo+GKrlqeOaFGSjIQ Ml3t6d0ZsZzx7E3uUefwAzqKIcWh6WVaXCZPk37uTzTBwjfU2UOJf9FUjFjk4MSvAE r06/nS0fX0dtHlwVTnfqW4iKDrzNDW4J8vUOMm/+AP1uzw6JJ7dzaRQovXi9GcY+Nb ajIa1X4fl2TlA== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" As per the members exposed earlier in the series, audio graph driver is updated to make use of these. Functionally there is no change in behavior if these are not populated. So following changes are made as part of this. - Update 'dai_link->ops' for DPCM links if a custom 'snd_soc_ops' is defined by the vendor driver. - Consider 'force_dpcm' flag status when deciding if a DAI link needs to be treated as DPCM or not. In doing so the logic is moved to a separate inline function for a better readability. - Populate 'dpcm_selectable' flag which is then used to detect DPCM DAI links. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto --- sound/soc/generic/audio-graph-card.c | 40 ++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index 0ba50be9..fb34e34 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -355,6 +355,11 @@ static int graph_dai_link_of_dpcm(struct asoc_simple_priv *priv, snd_soc_dai_link_set_capabilities(dai_link); dai_link->ops = &graph_ops; + + /* Use custom snd_soc_ops callbacks if available */ + if (priv->ops) + dai_link->ops = priv->ops; + dai_link->init = asoc_simple_dai_init; out_put_node: @@ -439,6 +444,28 @@ static int graph_dai_link_of(struct asoc_simple_priv *priv, return 0; } +static inline bool parse_as_dpcm_link(struct asoc_simple_priv *priv, + struct device_node *codec_port, + struct asoc_simple_data *adata) +{ + if (priv->force_dpcm) + return true; + + if (!priv->dpcm_selectable) + return false; + + /* + * It is DPCM + * if Codec port has many endpoints, + * or has convert-xxx property + */ + if ((of_get_child_count(codec_port) > 1) || + (adata->convert_rate || adata->convert_channels)) + return true; + + return false; +} + static int graph_for_each_link(struct asoc_simple_priv *priv, struct link_info *li, int (*func_noml)(struct asoc_simple_priv *priv, @@ -459,7 +486,6 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, struct device_node *codec_port; struct device_node *codec_port_old = NULL; struct asoc_simple_data adata; - uintptr_t dpcm_selectable = (uintptr_t)of_device_get_match_data(dev); int rc, ret; /* loop for all listed CPU port */ @@ -482,14 +508,8 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, graph_parse_convert(dev, codec_ep, &adata); graph_parse_convert(dev, cpu_ep, &adata); - /* - * It is DPCM - * if Codec port has many endpoints, - * or has convert-xxx property - */ - if (dpcm_selectable && - ((of_get_child_count(codec_port) > 1) || - adata.convert_rate || adata.convert_channels)) + /* check if link requires DPCM parsing */ + if (parse_as_dpcm_link(priv, codec_port, &adata)) ret = func_dpcm(priv, cpu_ep, codec_ep, li, (codec_port_old == codec_port)); /* else normal sound */ @@ -678,6 +698,8 @@ static int graph_probe(struct platform_device *pdev) card->num_dapm_widgets = ARRAY_SIZE(graph_dapm_widgets); card->probe = graph_card_probe; + priv->dpcm_selectable = (uintptr_t)of_device_get_match_data(dev); + memset(&li, 0, sizeof(li)); graph_get_dais_count(priv, &li); if (!li.link || !li.dais) From patchwork Thu Oct 1 17:33:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812043 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0068992C for ; Thu, 1 Oct 2020 17:39:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7FFF02054F for ; Thu, 1 Oct 2020 17:39:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="WsRAvY1Z"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="ofk/1Mxw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7FFF02054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D17821A9A; Thu, 1 Oct 2020 19:38:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D17821A9A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601573956; bh=QZ0w74km0NH+dfLSe4P3QR0Jgnv/5TAxq2Cg5icthT8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=WsRAvY1ZozxNaNJ4m4yBHwIaapfEfGNwMNDMMZ01zeM72B/PuRjJOfk9B3AI4By0q 1MGndZTjK12oq36cd/KLz5K+imhSVH6KXkNcNU4hyksLvwDjQG0iK0mmLotwffXtAX 43IN2CQ8Z0lIjdM+WwNP/yvSn/KDqWme7var4rqk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B6BCBF80322; Thu, 1 Oct 2020 19:35:01 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D61E9F80322; Thu, 1 Oct 2020 19:34:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 84AABF80317 for ; Thu, 1 Oct 2020 19:34:53 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 84AABF80317 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="ofk/1Mxw" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:34:39 -0700 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; Thu, 1 Oct 2020 17:34:47 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:34:41 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 08/13] ASoC: audio-graph: Expose helpers from audio graph Date: Thu, 1 Oct 2020 23:03:02 +0530 Message-ID: <1601573587-15288-9-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573679; bh=fvJEjJoXH9qCM6UDH1pRLmiRVww30y/yRy8RfTCHrP8=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=ofk/1MxwXwLQ/DyWiGUlHbvif4b/uhYHkPbbx/PWOyDgu1QphhiAIFjoD5FMvrv/p Fij6mt0BxfdNIdqFE5aPHXDlLo89Um68U5ONpM2QGJpqsGN2eEcfai33lClwSdBTLP hoeNbK0Korr4aZdATpsYJuVx55bRDAuwyrajQC6H7CqJNUvQ3sqIriFD6/N2MAaaFW x1Uj7bL9RPjwEonKdI6N/qQm77RbPSmhfHemVXhlRlDCaeca1q5sZWTFur9NGX/Swi HCUu9uYso0GT8bn47J8MbA/XFLdpBmP7Igkz/SNn85mAAFnMYqRCnc4uK/A5hJ3wly y5FXb/Ayrbiuw== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This commit exposes following functions which can be used by a sound card driver based on audio graph driver. Idea is vendors can have a thin driver and re-use common stuff from audio graph driver. - graph_card_probe() - graph_get_dais_count() - graph_parse_of() In doing so a new header file is added for audio graph which can be included by vendor drivers. Signed-off-by: Sameer Pujar Cc: Kuninori Morimoto Reported-by: kernel test robot Reported-by: kernel test robot --- include/sound/graph_card.h | 19 +++++++++++++++++++ sound/soc/generic/audio-graph-card.c | 11 +++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 include/sound/graph_card.h diff --git a/include/sound/graph_card.h b/include/sound/graph_card.h new file mode 100644 index 0000000..0372c1c --- /dev/null +++ b/include/sound/graph_card.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 + * + * ASoC audio graph card support + * + */ + +#ifndef __GRAPH_CARD_H +#define __GRAPH_CARD_H + +#include + +int graph_card_probe(struct snd_soc_card *card); + +void graph_get_dais_count(struct asoc_simple_priv *priv, + struct link_info *li); + +int graph_parse_of(struct asoc_simple_priv *priv); + +#endif /* __GRAPH_CARD_H */ diff --git a/sound/soc/generic/audio-graph-card.c b/sound/soc/generic/audio-graph-card.c index fb34e34..ae234bf 100644 --- a/sound/soc/generic/audio-graph-card.c +++ b/sound/soc/generic/audio-graph-card.c @@ -529,7 +529,7 @@ static int graph_for_each_link(struct asoc_simple_priv *priv, return 0; } -static int graph_parse_of(struct asoc_simple_priv *priv) +int graph_parse_of(struct asoc_simple_priv *priv) { struct snd_soc_card *card = simple_priv_to_card(priv); struct link_info li; @@ -566,6 +566,7 @@ static int graph_parse_of(struct asoc_simple_priv *priv) return asoc_simple_parse_card_name(card, NULL); } +EXPORT_SYMBOL_GPL(graph_parse_of); static int graph_count_noml(struct asoc_simple_priv *priv, struct device_node *cpu_ep, @@ -604,8 +605,8 @@ static int graph_count_dpcm(struct asoc_simple_priv *priv, return 0; } -static void graph_get_dais_count(struct asoc_simple_priv *priv, - struct link_info *li) +void graph_get_dais_count(struct asoc_simple_priv *priv, + struct link_info *li) { struct device *dev = simple_priv_to_dev(priv); @@ -661,8 +662,9 @@ static void graph_get_dais_count(struct asoc_simple_priv *priv, dev_dbg(dev, "link %d, dais %d, ccnf %d\n", li->link, li->dais, li->conf); } +EXPORT_SYMBOL_GPL(graph_get_dais_count); -static int graph_card_probe(struct snd_soc_card *card) +int graph_card_probe(struct snd_soc_card *card) { struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card); int ret; @@ -677,6 +679,7 @@ static int graph_card_probe(struct snd_soc_card *card) return 0; } +EXPORT_SYMBOL_GPL(graph_card_probe); static int graph_probe(struct platform_device *pdev) { From patchwork Thu Oct 1 17:33:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812045 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E2BE618 for ; Thu, 1 Oct 2020 17:39:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02CF42054F for ; Thu, 1 Oct 2020 17:39:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="BWMWtrm2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="AzEA73aR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02CF42054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6167A1725; Thu, 1 Oct 2020 19:38:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6167A1725 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601573969; bh=9K0MXW/TCJWbLuAW2+qS7ZZMjKBu9HQVYq5b0ZB7Y50=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BWMWtrm2ZTV9ArSuW9uTEOyBjBU7Tp/t3pR6Bowe/AD/CuVevRaXM4+P2sMr1TiN+ HjUV0YBxCleG3cCI8GKFTb6F4UmgcxQSqJzXHq4d9EFbprDTQyDeeHXZerwFWwEncX gYMvQvN4jqdo2TgGxWFmthwmK5B8lgossQSKj5X8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2467DF8032A; Thu, 1 Oct 2020 19:35:15 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id BAA9AF80331; Thu, 1 Oct 2020 19:35:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 60CD8F80329 for ; Thu, 1 Oct 2020 19:35:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 60CD8F80329 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="AzEA73aR" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:33:17 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:34:58 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:34:53 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 09/13] ASoC: dt-bindings: tegra: Add schema for audio graph card Date: Thu, 1 Oct 2020 23:03:03 +0530 Message-ID: <1601573587-15288-10-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573598; bh=1m9aUvgKZy/iYRzXFgjMHyA/Qza8PoLq3wlioFAv9eA=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=AzEA73aRHr1Q5sWyGpruRHzIMIRr4romEKt/fkyz/dYS3i5X6LQ+IV79Ep4ePtarF ORVwnrydL5DcqC6Kr7+WhBnG411R2XlDppdbO1H5LRb19IWLLMaWKVdvKYmuagQMg/ MimzlGVqKBgBUEfxCk1EgHWKXa4oLOtekyOK0kXsbJRuEryMepQcMsnKOovQfNTed/ Yfh/jlSiathVhB1JSaFNjDunbQYSgLyEAC43Jq8rMLW6PBdYILDcdVePYsFUjUxIIg +VTXndoQyFsCW+GMrBS/k9R7MwSTyudvLKAUdEcHCYiMMnOZHZofnQ576M2WcQPwWD uYTW5H0q5sdrw== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add YAML schema for Tegra audio graph sound card DT bindings. It uses the same DT bindings provided by generic audio graph driver. Along with this few standard clock DT bindings are added which are specifically required for Tegra audio. Signed-off-by: Sameer Pujar --- .../sound/nvidia,tegra-audio-graph-card.yaml | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml diff --git a/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml new file mode 100644 index 0000000..b73fbe5 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/nvidia,tegra-audio-graph-card.yaml @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/nvidia,tegra-audio-graph-card.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Audio Graph based Tegra sound card driver + +description: | + This is based on generic audio graph card driver along with additional + customizations for Tegra platforms. It uses the same bindings with + additional standard clock DT bindings required for Tegra. + + See{LINUX}/Documentation/devicetree/bindings/sound/audio-graph-card.txt + +maintainers: + - Jon Hunter + - Sameer Pujar + +properties: + compatible: + oneOf: + - const: nvidia,tegra210-audio-graph-card + - const: nvidia,tegra186-audio-graph-card + + clocks: + minItems: 2 + + clock-names: + minItems: 2 + items: + - const: pll_a + - const: plla_out0 + + assigned-clocks: + minItems: 1 + maxItems: 3 + + assigned-clock-parents: + minItems: 1 + maxItems: 3 + + assigned-clock-rates: + minItems: 1 + maxItems: 3 + +required: + - compatible + - clocks + - clock-names + - assigned-clocks + - assigned-clock-parents + +examples: + - | + #include + + tegra_sound { + compatible = "nvidia,tegra210-audio-graph-card"; + clocks = <&tegra_car TEGRA210_CLK_PLL_A>, + <&tegra_car TEGRA210_CLK_PLL_A_OUT0>; + clock-names = "pll_a", "plla_out0"; + assigned-clocks = <&tegra_car TEGRA210_CLK_PLL_A>, + <&tegra_car TEGRA210_CLK_PLL_A_OUT0>, + <&tegra_car TEGRA210_CLK_EXTERN1>; + assigned-clock-parents = <0>, <0>, <&tegra_car TEGRA210_CLK_PLL_A_OUT0>; + assigned-clock-rates = <368640000>, <49152000>, <12288000>; + }; + +... From patchwork Thu Oct 1 17:33:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812047 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94650618 for ; Thu, 1 Oct 2020 17:40:16 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EFE22054F for ; Thu, 1 Oct 2020 17:40:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="usxidtcp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="pQcrmPxJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EFE22054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D5F1E1AAC; Thu, 1 Oct 2020 19:39:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D5F1E1AAC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601574013; bh=CWfwJIwasKM7K7UnjGjzNilTIUqRV+nAFVGvst2/2PY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=usxidtcp7UV63KZNcFzKSS1+WzSjZ9aJKOszVnCcW+lXBYARmwVxxKKTCHsbeM7XA KmogRzq14PeJNFJa0SEEQzksxOE+8m3Ndw+aO72yhasfm50LgAb0+oYMgJfoFhP6Gh 9A4ZQVQwP9xSzGHNffNOeHlBC/H1IHUu13qlWYic= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 29392F800AB; Thu, 1 Oct 2020 19:35:20 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8455EF80332; Thu, 1 Oct 2020 19:35:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,PRX_BODY_30,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 80B12F802C4 for ; Thu, 1 Oct 2020 19:35:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 80B12F802C4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="pQcrmPxJ" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:34:19 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:35:09 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:35:03 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 10/13] ASoC: tegra: Add audio graph based card driver Date: Thu, 1 Oct 2020 23:03:04 +0530 Message-ID: <1601573587-15288-11-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573659; bh=xLwuU8GQzYSja3cDYFxy+G3QxwENSRDUvAxW5witbAU=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=pQcrmPxJAG6IDyGziX5XuaVf56lBugtKVQlImnsh/DaE+LNo/XDolvGOJgIbS4a5W Uwn/FhrpC6BG+3j33Eym0f1l7Lle/NuHzBnusPhxfSnpcCqr5Jmt38dKMl6d3z7yMk 9C2zLPPG7rXCtLnaGODWbbj4BafxzpL+WZulufGdUAe9N/mGkC0PDLaNFpTE8m8oOE cCb9SVuGWmO3J7d3FcjNG7TSJTAT+f4p8DNuxyg/2S1/GE6gJa6b6T24YL/ezrmXkQ l9JeeMLh5wNZLS0xAn2mNDkL2D37GgkbNsAxsZDQB//vP1zQQbmVv+rBbfYtCDw9G1 1MO5/cThjNN7w== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Add Tegra audio machine driver which is based on generic audio graph card driver. It re-uses most of the common stuff from audio graph driver and uses the same DT binding. Required Tegra specific customizations are done in the driver. Details on the customizations done: - Update PLL rates at runtime: Tegra HW supports multiple sample rates (multiples of 8x and 11.025x) and both of these groups require different PLL rates. Hence there is a requirement to update this at runtime. This is achieved by providing a custom 'snd_soc_ops' and in hw_param() callback PLL rate is updated as per the sample rate. - Internal structure 'tegra_audio_graph_data' is used to maintain clock handles of PLL. - The 'force_dpcm' flag is set to use DPCM for all DAI links. - The 'component_chaining' flag is set to use DPCM with component model. Signed-off-by: Sameer Pujar --- sound/soc/tegra/Kconfig | 9 + sound/soc/tegra/Makefile | 2 + sound/soc/tegra/tegra_audio_graph_card.c | 291 +++++++++++++++++++++++++++++++ 3 files changed, 302 insertions(+) create mode 100644 sound/soc/tegra/tegra_audio_graph_card.c diff --git a/sound/soc/tegra/Kconfig b/sound/soc/tegra/Kconfig index 3d91bd3..9959605 100644 --- a/sound/soc/tegra/Kconfig +++ b/sound/soc/tegra/Kconfig @@ -118,6 +118,15 @@ config SND_SOC_TEGRA210_ADMAIF channel. Buffer size is configurable for each ADMAIIF channel. Say Y or M if you want to add support for Tegra210 ADMAIF module. +config SND_SOC_TEGRA_AUDIO_GRAPH_CARD + tristate "Audio Graph Card based Tegra driver" + depends on SND_AUDIO_GRAPH_CARD + help + Config to enable Tegra audio machine driver based on generic + audio graph driver. It is a thin driver written to customize + few things for Tegra audio. Most of the code is re-used from + audio graph driver and the same DT bindings are used. + config SND_SOC_TEGRA_RT5640 tristate "SoC Audio support for Tegra boards using an RT5640 codec" depends on SND_SOC_TEGRA && I2C && GPIOLIB diff --git a/sound/soc/tegra/Makefile b/sound/soc/tegra/Makefile index 60040a0..b17dd6e 100644 --- a/sound/soc/tegra/Makefile +++ b/sound/soc/tegra/Makefile @@ -38,6 +38,7 @@ snd-soc-tegra-trimslice-objs := trimslice.o snd-soc-tegra-alc5632-objs := tegra_alc5632.o snd-soc-tegra-max98090-objs := tegra_max98090.o snd-soc-tegra-sgtl5000-objs := tegra_sgtl5000.o +snd-soc-tegra-audio-graph-card-objs := tegra_audio_graph_card.o obj-$(CONFIG_SND_SOC_TEGRA_RT5640) += snd-soc-tegra-rt5640.o obj-$(CONFIG_SND_SOC_TEGRA_RT5677) += snd-soc-tegra-rt5677.o @@ -48,3 +49,4 @@ obj-$(CONFIG_SND_SOC_TEGRA_TRIMSLICE) += snd-soc-tegra-trimslice.o obj-$(CONFIG_SND_SOC_TEGRA_ALC5632) += snd-soc-tegra-alc5632.o obj-$(CONFIG_SND_SOC_TEGRA_MAX98090) += snd-soc-tegra-max98090.o obj-$(CONFIG_SND_SOC_TEGRA_SGTL5000) += snd-soc-tegra-sgtl5000.o +obj-$(CONFIG_SND_SOC_TEGRA_AUDIO_GRAPH_CARD) += snd-soc-tegra-audio-graph-card.o diff --git a/sound/soc/tegra/tegra_audio_graph_card.c b/sound/soc/tegra/tegra_audio_graph_card.c new file mode 100644 index 0000000..cfbd3f0 --- /dev/null +++ b/sound/soc/tegra/tegra_audio_graph_card.c @@ -0,0 +1,291 @@ +// SPDX-License-Identifier: GPL-2.0-only +// +// tegra_audio_graph_card.c - Audio Graph based Tegra Machine Driver +// +// Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. + +#include +#include +#include +#include +#include +#include + +#define MAX_PLLA_OUT0_DIV 128 + +enum srate_type { + /* + * Sample rates multiple of 8000 Hz and below are supported: + * ( 8000, 16000, 32000, 48000, 96000, 192000 Hz ) + */ + x8_RATE, + + /* + * Sample rates multiple of 11025 Hz and below are supported: + * ( 11025, 22050, 44100, 88200, 176400 Hz ) + */ + x11_RATE, + + NUM_RATE_TYPE, +}; + +struct tegra_audio_graph_data { + struct clk *clk_plla_out0; + struct clk *clk_plla; +}; + +struct tegra_audio_chip_data { + unsigned int plla_out0_rates[NUM_RATE_TYPE]; + unsigned int plla_rates[NUM_RATE_TYPE]; +}; + +/* Setup PLL clock as per the given sample rate */ +static int tegra_audio_graph_update_pll(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card); + struct device *dev = rtd->card->dev; + struct tegra_audio_graph_data *graph_data = + (struct tegra_audio_graph_data *)priv->data; + struct tegra_audio_chip_data *chip_data = + (struct tegra_audio_chip_data *)of_device_get_match_data(dev); + unsigned int srate = params_rate(params); + unsigned int plla_rate, plla_out0_rate, bclk; + int err; + + /* There is nothing to configure */ + if (!chip_data) + return 0; + + switch (srate) { + case 11025: + case 22050: + case 44100: + case 88200: + case 176400: + plla_out0_rate = chip_data->plla_out0_rates[x11_RATE]; + plla_rate = chip_data->plla_rates[x11_RATE]; + break; + case 8000: + case 16000: + case 32000: + case 48000: + case 96000: + case 192000: + plla_out0_rate = chip_data->plla_out0_rates[x8_RATE]; + plla_rate = chip_data->plla_rates[x8_RATE]; + break; + default: + dev_err(rtd->card->dev, "Unsupported sample rate %u\n", + srate); + return -EINVAL; + } + + /* + * Below is the clock relation: + * + * PLLA + * | + * |--> PLLA_OUT0 + * | + * |---> I2S modules + * | + * |---> DMIC modules + * | + * |---> DSPK modules + * + * + * Default PLLA_OUT0 rate might be too high when I/O is running + * at minimum PCM configurations. This may result in incorrect + * clock rates and glitchy audio. The maximum divider is 128 + * and any thing higher than that won't work. Thus reduce PLLA_OUT0 + * to work for lower configurations. + * + * This problem is seen for I2S only, as DMIC and DSPK minimum + * clock requirements are under allowed divider limits. + */ + bclk = srate * params_channels(params) * params_width(params); + if (div_u64(plla_out0_rate, bclk) > MAX_PLLA_OUT0_DIV) + plla_out0_rate >>= 1; + + dev_dbg(rtd->card->dev, + "Update clock rates: PLLA(= %u Hz) and PLLA_OUT0(= %u Hz)\n", + plla_rate, plla_out0_rate); + + /* Set PLLA rate */ + err = clk_set_rate(graph_data->clk_plla, plla_rate); + if (err) { + dev_err(rtd->card->dev, + "Can't set plla rate for %u, err: %d\n", + plla_rate, err); + return err; + } + + /* Set PLLA_OUT0 rate */ + err = clk_set_rate(graph_data->clk_plla_out0, plla_out0_rate); + if (err) { + dev_err(rtd->card->dev, + "Can't set plla_out0 rate %u, err: %d\n", + plla_out0_rate, err); + return err; + } + + return err; +} + +static int tegra_audio_graph_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); + struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0); + int err; + + /* + * This gets called for each DAI link (FE or BE) when DPCM is used. + * We may not want to update PLLA rate for each call. So PLLA update + * must be restricted to external I/O links (I2S, DMIC or DSPK) since + * they actually depend on it. I/O modules update their clocks in + * hw_param() of their respective component driver and PLLA rate + * update here helps them to derive appropriate rates. + * + * TODO: When more HW accelerators get added (like sample rate + * converter, volume gain controller etc., which don't really + * depend on PLLA) we need a better way to filter here. + */ + if (cpu_dai->driver->ops && rtd->dai_link->no_pcm) { + err = tegra_audio_graph_update_pll(substream, params); + if (err) + return err; + } + + return asoc_simple_hw_params(substream, params); +} + +static const struct snd_soc_ops tegra_audio_graph_ops = { + .startup = asoc_simple_startup, + .shutdown = asoc_simple_shutdown, + .hw_params = tegra_audio_graph_hw_params, +}; + +static int tegra_audio_graph_card_probe(struct snd_soc_card *card) +{ + struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(card); + struct tegra_audio_graph_data *graph_data = + (struct tegra_audio_graph_data *)priv->data; + + graph_data->clk_plla = devm_clk_get(card->dev, "pll_a"); + if (IS_ERR(graph_data->clk_plla)) { + dev_err(card->dev, "Can't retrieve clk pll_a\n"); + return PTR_ERR(graph_data->clk_plla); + } + + graph_data->clk_plla_out0 = devm_clk_get(card->dev, "plla_out0"); + if (IS_ERR(graph_data->clk_plla_out0)) { + dev_err(card->dev, "Can't retrieve clk plla_out0\n"); + return PTR_ERR(graph_data->clk_plla_out0); + } + + return graph_card_probe(card); +} + +static int tegra_audio_graph_probe(struct platform_device *pdev) +{ + struct asoc_simple_priv *priv; + struct device *dev = &pdev->dev; + struct snd_soc_card *card; + struct link_info li; + int err; + + /* Allocate the private data and the DAI link array */ + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->data = (struct tegra_audio_graph_data *) + devm_kzalloc(dev, sizeof(*priv->data), GFP_KERNEL); + if (!priv->data) + return -ENOMEM; + + card = simple_priv_to_card(priv); + + card->owner = THIS_MODULE; + card->dev = dev; + card->component_chaining = true; + card->probe = tegra_audio_graph_card_probe; + + priv->ops = &tegra_audio_graph_ops; + priv->force_dpcm = 1; + + memset(&li, 0, sizeof(li)); + graph_get_dais_count(priv, &li); + if (!li.link || !li.dais) + return -EINVAL; + + err = asoc_simple_init_priv(priv, &li); + if (err < 0) + return err; + + err = graph_parse_of(priv); + if (err < 0) { + if (err != -EPROBE_DEFER) + dev_err(dev, "Parse error %d\n", err); + goto cleanup; + } + + snd_soc_card_set_drvdata(card, priv); + + asoc_simple_debug_info(priv); + + err = devm_snd_soc_register_card(dev, card); + if (err < 0) + goto cleanup; + + return 0; + +cleanup: + asoc_simple_clean_reference(card); + + return err; +} + +static const struct tegra_audio_chip_data tegra210_data = { + /* PLLA */ + .plla_rates[x8_RATE] = 368640000, + .plla_rates[x11_RATE] = 338688000, + /* PLLA_OUT0 */ + .plla_out0_rates[x8_RATE] = 49152000, + .plla_out0_rates[x11_RATE] = 45158400, +}; + +static const struct tegra_audio_chip_data tegra186_data = { + /* PLLA */ + .plla_rates[x8_RATE] = 245760000, + .plla_rates[x11_RATE] = 270950400, + /* PLLA_OUT0 */ + .plla_out0_rates[x8_RATE] = 49152000, + .plla_out0_rates[x11_RATE] = 45158400, +}; + +static const struct of_device_id graph_of_tegra_match[] = { + { .compatible = "nvidia,tegra210-audio-graph-card", + .data = &tegra210_data }, + { .compatible = "nvidia,tegra186-audio-graph-card", + .data = &tegra186_data }, + {}, +}; +MODULE_DEVICE_TABLE(of, graph_of_tegra_match); + +static struct platform_driver tegra_audio_graph_card = { + .driver = { + .name = "tegra-audio-graph-card", + .pm = &snd_soc_pm_ops, + .of_match_table = graph_of_tegra_match, + }, + .probe = tegra_audio_graph_probe, +}; +module_platform_driver(tegra_audio_graph_card); + +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("ASoC Tegra Audio Graph Sound Card"); +MODULE_AUTHOR("Sameer Pujar "); From patchwork Thu Oct 1 17:33:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812051 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 27110618 for ; Thu, 1 Oct 2020 17:40:43 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90F882054F for ; Thu, 1 Oct 2020 17:40:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="MiDGuYKJ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="ajD/D6gQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90F882054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0E937193A; Thu, 1 Oct 2020 19:39:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0E937193A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601574041; bh=W3jhmc4VDekt6oj2VNnxYk0OAqANwOokGOENalgR+/E=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=MiDGuYKJYDlUiT0Mu4R6dRKNTZNcUZZB6MRMvok4FpXzang/yacVOoW9SsgJxDRg9 VXHCZmjaIe5Uuj21AqBKcNKAIe6+NOn7q5/RV8IsIpmdOfv0uAeBGRmQPGxwCRAzCx i7l9sT8mHLhqmo/colB+0IO5lSDVu8ud83glc5NI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E73CDF802DC; Thu, 1 Oct 2020 19:35:36 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id F0F4FF802DC; Thu, 1 Oct 2020 19:35:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B6E91F802DF for ; Thu, 1 Oct 2020 19:35:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B6E91F802DF Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="ajD/D6gQ" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:34:36 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:35:24 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:35:18 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 11/13] arm64: defconfig: Enable Tegra audio graph card driver Date: Thu, 1 Oct 2020 23:03:05 +0530 Message-ID: <1601573587-15288-12-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573676; bh=qDPqO8snvmPtLs4im4/TAUzuOCuGZgTtCSBi0BVunOI=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=ajD/D6gQV6Ee99aQq3KbAalONOM5U8D8IYIVqyg0kg9OxCQSUHOKZt6ousCke3cJZ O//AKKX956awcqkApYHXzdD9tdrVkCSkCz4q9xEYnl6oThlpP7OQ4qSISLhRwQ/Nsm 4SRVHz2K1anuFNMf6cg2WHHLbx8KYvTgk1iOUuQKfcLvB0iHZ26ymjp6vGZWBqGy/C zz6QGd3q2k1bmeBwfTdRCvH2s6oAXSFq24s6blTkMjb/5njZD0n/7vNbPgI8vL2Y08 f4UDGPg4w6Di6knML4O2v+GJa3OWZbQ3AXW9XlFLsfX2/n9Ko35lkp972/0XjrraGb bnJaACiD/LUsQ== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" This commit enables Tegra audio graph card driver which is based on the generic audio-graph card driver. This is intended to be used on platforms based on Tegra210 and later chips. Signed-off-by: Sameer Pujar --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 55f9c35..2841f77 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -712,6 +712,7 @@ CONFIG_SND_SOC_TEGRA210_DMIC=m CONFIG_SND_SOC_TEGRA210_I2S=m CONFIG_SND_SOC_TEGRA186_DSPK=m CONFIG_SND_SOC_TEGRA210_ADMAIF=m +CONFIG_SND_SOC_TEGRA_AUDIO_GRAPH_CARD=m CONFIG_SND_SOC_AK4613=m CONFIG_SND_SOC_ES7134=m CONFIG_SND_SOC_ES7241=m From patchwork Thu Oct 1 17:33:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812055 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E36D992C for ; Thu, 1 Oct 2020 17:41:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 666362054F for ; Thu, 1 Oct 2020 17:41:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="uPOKS4wc"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="DHYd4jxv" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 666362054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B874716FC; Thu, 1 Oct 2020 19:40:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B874716FC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601574071; bh=I+8cFNkSLRlAB/1ltxO68txG3rZyXjZRxllHHi05mNo=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=uPOKS4wcotlRS2kJyJDFI3LvyOua9O/rUkWFivWfA+aoKGIiUuMjg3kjWNIrY8Bts KykBoV/qexAbko1Jf348S87a8KKtsiua6qtRFQUzMG9Y+lFv7vwyh22Vu6G90WcW3I HWZmQ3rDJmS/Of9TxISQWmPSZ2LofS+yuug8mffQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 668ABF80338; Thu, 1 Oct 2020 19:35:55 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D61F1F8033F; Thu, 1 Oct 2020 19:35:53 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2C0FBF80338 for ; Thu, 1 Oct 2020 19:35:42 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2C0FBF80338 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="DHYd4jxv" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:33:58 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:35:35 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:35:30 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 12/13] arm64: tegra: Audio graph header for Tegra210 Date: Thu, 1 Oct 2020 23:03:06 +0530 Message-ID: <1601573587-15288-13-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573638; bh=PkseXU5CbX2QuJJk9JxJcAxWfFj4JQqkJYM2vQ38KEw=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=DHYd4jxv8uvpZoRkbW/aR7sjTPdjQL+M2EeWksQB4Fmw1k0+jcpUta35uUk1PGzqy sDbscY3MijiEzD7VgIl/yEviMz0v/TRPsIM+oYq7eczbOpuotX1B9HYb1aNM26WRgK 0d2zT9Uw7Ror08EuYAv8OGNbY13aL6bDOu9WWnFCpKQcIN+FDlunrQBsQEz7tpCi0K FnCWnrumjFPUNTznqCZC5N52/R5ABQmpEjGOqDfNHW1oYm+oRTX5yTJ1eat5YzXCfJ aK16YcLtHVwL3R6Py703WrHvBuhBa29fvrBhH0Og5WZnWP6nlKbrJl6aUSqv8GGWIO pweOID51qeFPQ== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Expose a header which describes DT bindings required to use audio-graph based sound card. All Tegra210 based platforms can include this header and add platform specific information. Currently, from SoC point of view, all links are exposed for ADMAIF, AHUB, I2S and DMIC components. Signed-off-by: Sameer Pujar --- .../boot/dts/nvidia/tegra210-audio-graph.dtsi | 138 +++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi diff --git a/arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi b/arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi new file mode 100644 index 0000000..6287d28c --- /dev/null +++ b/arch/arm64/boot/dts/nvidia/tegra210-audio-graph.dtsi @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0 + +/ { + tegra_sound { + status = "disabled"; + + clocks = <&tegra_car TEGRA210_CLK_PLL_A>, + <&tegra_car TEGRA210_CLK_PLL_A_OUT0>; + clock-names = "pll_a", "plla_out0"; + + assigned-clocks = <&tegra_car TEGRA210_CLK_PLL_A>, + <&tegra_car TEGRA210_CLK_PLL_A_OUT0>, + <&tegra_car TEGRA210_CLK_EXTERN1>; + assigned-clock-parents = <0>, <0>, <&tegra_car TEGRA210_CLK_PLL_A_OUT0>; + assigned-clock-rates = <368640000>, <49152000>, <12288000>; + }; +}; + +&tegra_admaif { + admaif1_port: port@0 { + admaif1_ep: endpoint { + remote-endpoint = <&xbar_admaif1_ep>; + }; + }; + admaif2_port: port@1 { + admaif2_ep: endpoint { + remote-endpoint = <&xbar_admaif2_ep>; + }; + }; + admaif3_port: port@2 { + admaif3_ep: endpoint { + remote-endpoint = <&xbar_admaif3_ep>; + }; + }; + admaif4_port: port@3 { + admaif4_ep: endpoint { + remote-endpoint = <&xbar_admaif4_ep>; + }; + }; + admaif5_port: port@4 { + admaif5_ep: endpoint { + remote-endpoint = <&xbar_admaif5_ep>; + }; + }; + admaif6_port: port@5 { + admaif6_ep: endpoint { + remote-endpoint = <&xbar_admaif6_ep>; + }; + }; + admaif7_port: port@6 { + admaif7_ep: endpoint { + remote-endpoint = <&xbar_admaif7_ep>; + }; + }; + admaif8_port: port@7 { + admaif8_ep: endpoint { + remote-endpoint = <&xbar_admaif8_ep>; + }; + }; + admaif9_port: port@8 { + admaif9_ep: endpoint { + remote-endpoint = <&xbar_admaif9_ep>; + }; + }; + admaif10_port: port@9 { + admaif10_ep: endpoint { + remote-endpoint = <&xbar_admaif10_ep>; + }; + }; +}; + +&tegra_ahub { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0x0>; + xbar_admaif1_ep: endpoint { + remote-endpoint = <&admaif1_ep>; + }; + }; + port@1 { + reg = <0x1>; + xbar_admaif2_ep: endpoint { + remote-endpoint = <&admaif2_ep>; + }; + }; + port@2 { + reg = <0x2>; + xbar_admaif3_ep: endpoint { + remote-endpoint = <&admaif3_ep>; + }; + }; + port@3 { + reg = <0x3>; + xbar_admaif4_ep: endpoint { + remote-endpoint = <&admaif4_ep>; + }; + }; + port@4 { + reg = <0x4>; + xbar_admaif5_ep: endpoint { + remote-endpoint = <&admaif5_ep>; + }; + }; + port@5 { + reg = <0x5>; + xbar_admaif6_ep: endpoint { + remote-endpoint = <&admaif6_ep>; + }; + }; + port@6 { + reg = <0x6>; + xbar_admaif7_ep: endpoint { + remote-endpoint = <&admaif7_ep>; + }; + }; + port@7 { + reg = <0x7>; + xbar_admaif8_ep: endpoint { + remote-endpoint = <&admaif8_ep>; + }; + }; + port@8 { + reg = <0x8>; + xbar_admaif9_ep: endpoint { + remote-endpoint = <&admaif9_ep>; + }; + }; + port@9 { + reg = <0x9>; + xbar_admaif10_ep: endpoint { + remote-endpoint = <&admaif10_ep>; + }; + }; + }; +}; From patchwork Thu Oct 1 17:33:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sameer Pujar X-Patchwork-Id: 11812057 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BE05618 for ; Thu, 1 Oct 2020 17:41:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B419B2054F for ; Thu, 1 Oct 2020 17:41:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="B7H1u9V6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="KDVNuZDL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B419B2054F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 400501ABC; Thu, 1 Oct 2020 19:41:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 400501ABC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1601574110; bh=QzdYQoHUe7olF1N8MVeumubA2VrQxiPKk5rspNVzzmA=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=B7H1u9V6WzZLPJ3Uy7fLFeh5G04S07Q2jnjcfw7SziILUbvGll2/vw5m0HZJCdk+n H2j6bR1OS+C8pt+thkM71XSOlKmoDTXrGcZGDnL6ycMmtJEJNEjMVxB/vM9OFn2bZQ kZ3RzYKsgGEG8u0Xf/u3riZaF6tL5B0gBMBhhDHY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id AB03AF8033E; Thu, 1 Oct 2020 19:36:00 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 453DEF80340; Thu, 1 Oct 2020 19:35:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F1490F8033E for ; Thu, 1 Oct 2020 19:35:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F1490F8033E Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="KDVNuZDL" Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 01 Oct 2020 10:35:33 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 1 Oct 2020 17:35:44 +0000 Received: from audio.nvidia.com (10.124.1.5) by mail.nvidia.com (172.20.187.18) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 1 Oct 2020 17:35:39 +0000 From: Sameer Pujar To: , , , , , , , , Subject: [PATCH v3 13/13] arm64: tegra: Audio graph sound card for Jetson Nano and TX1 Date: Thu, 1 Oct 2020 23:03:07 +0530 Message-ID: <1601573587-15288-14-git-send-email-spujar@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1601573587-15288-1-git-send-email-spujar@nvidia.com> References: <1601573587-15288-1-git-send-email-spujar@nvidia.com> MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601573733; bh=FVCTJ/LjockOVXWhbR6LZEgg4awLPuvPGT0FAOMXvyE=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:MIME-Version:Content-Type; b=KDVNuZDLJjpNyYXwTVztiqbm6E7/84pyostQnk2+Dc/PixpdG0N1MVZpnY7EusF6j +Wf2mkO6w8nXInPbcL6bAIaAMPBGJuudWhG//8nMA0/dyxyMc91TegPDOorGY3ykPu 18VSrgmrjth4IAzPCJJzQQSX1Kr7tDu06G/h8nlT935XmOP49nP6xmKI3NPewOwJiA Y/fNyOjJliyewJ5GMaYdsk6xheCL8tVNFAsw/3vtK05B2suq4xmqfpmkPDg0ioeCX6 33hnBMaDulbp+T1XXkrMx5QD+1DzbHRiVZG/9pAdTfzdywGFdKeKb0fIHDuN9Al2Zy Ht27tL339olUw== Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, nicoleotsuka@gmail.com, swarren@nvidia.com, Sameer Pujar , linux-kernel@vger.kernel.org, atalambedu@nvidia.com, viswanathl@nvidia.com, sharadg@nvidia.com, nwartikar@nvidia.com, linux-tegra@vger.kernel.org, rlokhande@nvidia.com, mkumard@nvidia.com, dramesh@nvidia.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Enable support for audio-graph based sound card on Jetson-Nano and Jetson-TX1. Depending on the platform, required I/O interfaces are enabled. * Jetson-Nano: Enable I2S3, I2S4, DMIC1 and DMIC2. * Jetson-TX1: Enable all I2S and DMIC interfaces. Signed-off-by: Sameer Pujar --- arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts | 219 +++++++++++++++++++++ arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts | 124 ++++++++++++ 2 files changed, 343 insertions(+) diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts index 4c9c2a0..1233d67 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts +++ b/arch/arm64/boot/dts/nvidia/tegra210-p2371-2180.dts @@ -3,6 +3,7 @@ #include "tegra210-p2180.dtsi" #include "tegra210-p2597.dtsi" +#include "tegra210-audio-graph.dtsi" / { model = "NVIDIA Jetson TX1 Developer Kit"; @@ -127,4 +128,222 @@ status = "okay"; }; }; + + tegra_sound { + status = "okay"; + + compatible = "nvidia,tegra210-audio-graph-card"; + + dais = /* FE */ + <&admaif1_port>, <&admaif2_port>, <&admaif3_port>, + <&admaif4_port>, <&admaif5_port>, <&admaif6_port>, + <&admaif7_port>, <&admaif8_port>, <&admaif9_port>, + <&admaif10_port>, + /* Router */ + <&xbar_i2s1_port>, <&xbar_i2s2_port>, <&xbar_i2s3_port>, + <&xbar_i2s4_port>, <&xbar_i2s5_port>, <&xbar_dmic1_port>, + <&xbar_dmic2_port>, <&xbar_dmic3_port>, + /* I/O DAP Ports */ + <&i2s1_port>, <&i2s2_port>, <&i2s3_port>, <&i2s4_port>, + <&i2s5_port>, <&dmic1_port>, <&dmic2_port>, <&dmic3_port>; + + label = "jetson-tx1-ape"; + }; +}; + +&tegra_admaif { + status = "okay"; +}; + +&tegra_ahub { + status = "okay"; + + ports { + xbar_i2s1_port: port@a { + reg = <0xa>; + xbar_i2s1_ep: endpoint { + remote-endpoint = <&i2s1_cif_ep>; + }; + }; + xbar_i2s2_port: port@b { + reg = <0xb>; + xbar_i2s2_ep: endpoint { + remote-endpoint = <&i2s2_cif_ep>; + }; + }; + xbar_i2s3_port: port@c { + reg = <0xc>; + xbar_i2s3_ep: endpoint { + remote-endpoint = <&i2s3_cif_ep>; + }; + }; + xbar_i2s4_port: port@d { + reg = <0xd>; + xbar_i2s4_ep: endpoint { + remote-endpoint = <&i2s4_cif_ep>; + }; + }; + xbar_i2s5_port: port@e { + reg = <0xe>; + xbar_i2s5_ep: endpoint { + remote-endpoint = <&i2s5_cif_ep>; + }; + }; + xbar_dmic1_port: port@f { + reg = <0xf>; + xbar_dmic1_ep: endpoint { + remote-endpoint = <&dmic1_cif_ep>; + }; + }; + xbar_dmic2_port: port@10 { + reg = <0x10>; + xbar_dmic2_ep: endpoint { + remote-endpoint = <&dmic2_cif_ep>; + }; + }; + xbar_dmic3_port: port@11 { + reg = <0x11>; + xbar_dmic3_ep: endpoint { + remote-endpoint = <&dmic3_cif_ep>; + }; + }; + }; +}; + +&tegra_i2s1 { + status = "okay"; + + port@0 { + i2s1_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s1_ep>; + }; + }; + + i2s1_port: port@1 { + i2s1_dap: endpoint { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s2 { + status = "okay"; + + port@0 { + i2s2_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s2_ep>; + }; + }; + + i2s2_port: port@1 { + i2s2_dap: endpoint { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s3 { + status = "okay"; + + port@0 { + i2s3_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s3_ep>; + }; + }; + + i2s3_port: port@1 { + i2s3_dap_ep: endpoint { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s4 { + status = "okay"; + + port@0 { + i2s4_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s4_ep>; + }; + }; + + i2s4_port: port@1 { + i2s4_dap: endpoint { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s5 { + status = "okay"; + + port@0 { + i2s5_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s5_ep>; + }; + }; + + i2s5_port: port@1 { + i2s5_dap: endpoint { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic1 { + status = "okay"; + + port@0 { + dmic1_cif_ep: endpoint { + remote-endpoint = <&xbar_dmic1_ep>; + }; + }; + + dmic1_port: port@1 { + dmic1_dap: endpoint { + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic2 { + status = "okay"; + + port@0 { + dmic2_cif_ep: endpoint { + remote-endpoint = <&xbar_dmic2_ep>; + }; + }; + + dmic2_port: port@1 { + dmic2_dap: endpoint { + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic3 { + status = "okay"; + + port@0 { + dmic3_cif_ep: endpoint { + remote-endpoint = <&xbar_dmic3_ep>; + }; + }; + + dmic3_port: port@1 { + dmic3_dap: endpoint { + /* Placeholder for external Codec */ + }; + }; }; diff --git a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts index 859241d..fcce8eed 100644 --- a/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts +++ b/arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dts @@ -6,6 +6,7 @@ #include #include "tegra210.dtsi" +#include "tegra210-audio-graph.dtsi" / { model = "NVIDIA Jetson Nano Developer Kit"; @@ -870,4 +871,127 @@ vin-supply = <&vdd_5v0_sys>; }; + + tegra_sound { + status = "okay"; + + compatible = "nvidia,tegra210-audio-graph-card"; + + dais = /* FE */ + <&admaif1_port>, <&admaif2_port>, <&admaif3_port>, + <&admaif4_port>, <&admaif5_port>, <&admaif6_port>, + <&admaif7_port>, <&admaif8_port>, <&admaif9_port>, + <&admaif10_port>, + /* Router */ + <&xbar_i2s3_port>, <&xbar_i2s4_port>, + <&xbar_dmic1_port>, <&xbar_dmic2_port>, + /* I/O DAP Ports */ + <&i2s3_port>, <&i2s4_port>, + <&dmic1_port>, <&dmic2_port>; + + label = "jetson-nano-ape"; + }; +}; + +&tegra_admaif { + status = "okay"; +}; + +&tegra_ahub { + status = "okay"; + + ports { + xbar_i2s3_port: port@c { + reg = <0xc>; + xbar_i2s3_ep: endpoint { + remote-endpoint = <&i2s3_cif_ep>; + }; + }; + xbar_i2s4_port: port@d { + reg = <0xd>; + xbar_i2s4_ep: endpoint { + remote-endpoint = <&i2s4_cif_ep>; + }; + }; + xbar_dmic1_port: port@f { + reg = <0xf>; + xbar_dmic1_ep: endpoint { + remote-endpoint = <&dmic1_cif_ep>; + }; + }; + xbar_dmic2_port: port@10 { + reg = <0x10>; + xbar_dmic2_ep: endpoint { + remote-endpoint = <&dmic2_cif_ep>; + }; + }; + }; +}; + +&tegra_i2s3 { + status = "okay"; + + port@0 { + i2s3_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s3_ep>; + }; + }; + + i2s3_port: port@1 { + i2s3_dap_ep: endpoint { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_i2s4 { + status = "okay"; + + port@0 { + i2s4_cif_ep: endpoint { + remote-endpoint = <&xbar_i2s4_ep>; + }; + }; + + i2s4_port: port@1 { + i2s4_dap: endpoint@0 { + dai-format = "i2s"; + + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic1 { + status = "okay"; + + port@0 { + dmic1_cif_ep: endpoint@0 { + remote-endpoint = <&xbar_dmic1_ep>; + }; + }; + + dmic1_port: port@1 { + dmic1_dap: endpoint@0 { + /* Placeholder for external Codec */ + }; + }; +}; + +&tegra_dmic2 { + status = "okay"; + + port@0 { + dmic2_cif_ep: endpoint@0 { + remote-endpoint = <&xbar_dmic2_ep>; + }; + }; + + dmic2_port: port@1 { + dmic2_dap: endpoint@0 { + /* Placeholder for external Codec */ + }; + }; };