From patchwork Mon Jun 12 11:09:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106195 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2333424vqr; Sun, 11 Jun 2023 20:27:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ41SayBMBuLlU7b52778mUiZQxZIpl30mXsuiMDnzFOdPamhRVwiI9PjlZqgW6r3PdVKEzd X-Received: by 2002:a17:907:6297:b0:978:8790:9100 with SMTP id nd23-20020a170907629700b0097887909100mr8536029ejc.3.1686540449364; Sun, 11 Jun 2023 20:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686540449; cv=none; d=google.com; s=arc-20160816; b=UzuYT4nXY7SryWpv+5DSotZWlFMnTFDLXtLdEhqM/5QHYaTxgDzBPdZAGwnBZEhbrE Ry1zRLPVX6lckE4gNGHFNV4eVCIF/EaemhY6Do83Ey/FcKYp+8A9NM47vyMMnSwPUkvu E76KXygl3EOVAbqoheC5F11NiIz8ve2f6zUoXA2eTYO3H3vuC2087S1qyNw/Em95BoGM QgriitRfskCm38aYdVixP8f98GZZRTR4L+Pcn45cdefIXgffOKz88M1POgeyqxElHWaA Uztd2E4Vo2TWqgTCjrBVnRHW158IxciaOV/3uk2G5P7nlWearatJNH3TeItWUK1ZTOvo +h6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=m7SgrtltKBZOCJKqea54/RTsVtAj8zp9RAYAi6lJJ6A=; b=b3TqJ3HPEMUP+4cycnFip7ZMTsyBIZvR79AF9J4c98sEfp693rSl3VVpeLGF2m4gqg +tqGCbn2/wrehftNwdXC6GKN4YegM7rhsUDJIPJanry+J45q2d8/PW0jWutCkb9Fo7z0 fr1eDrW5Y86t1wG5UxpLVslgj19M/UxWExgRwzt80oI5/9o8EPnrq4Ia1TVOJqPJgBbR mmE429+cHyiWGmpuiXegCLlj5Ba6GMvSSBs4oh+LUVs+7yhJyPNlZceSkctrufr2H8UN eptYkP4EcJMxjIuUzbvxcBOF+O9fqYNfa9kVPk/rmp+9SZi/b70gRw/XZahQh9FbGqqk cNtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KkoQWcrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f18-20020a1709062c5200b00977ab47b334si5004294ejh.435.2023.06.11.20.27.03; Sun, 11 Jun 2023 20:27:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KkoQWcrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234150AbjFLDP1 (ORCPT + 99 others); Sun, 11 Jun 2023 23:15:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234573AbjFLDPA (ORCPT ); Sun, 11 Jun 2023 23:15:00 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8587210D1 for ; Sun, 11 Jun 2023 20:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539687; x=1718075687; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RcAGWFoO9nSBfI/X1vef7WgnMxUZjubEZI94Z23Z+44=; b=KkoQWcrhpPgTpKiDPjjlnWbf955XRkK9m+dkn3yyAYlNBQ1TVKEc3IJy 7eGUdj7r1a/tgzNVwRw3zgTurqHO7vVRrTz5uL56TQzv3MuX+z7qEHFyS dT/lMoh8ZmoC1OPt4P6CVdRcV7jnchhh3ME8MIN1IPMrg3znnmBEZbIcm iNk8zp704zPsHk7vgVrC0ZckPhXA8gWZ5Qflw7kPOoSgKiTtrrpYW+67a /BwCEhTzHAmOVJsmLisNCqxHkF57YKR6UJ3nPWp1CbpRPju92dPkgI+2i fSFGswoolV5xwzzm+syumUhgPOr+PwaGzCpRqAc0AhszZR8Qwnh+NiJZk g==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347578886" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347578886" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:14:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191875" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191875" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:14:44 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 01/12] ASoC: Intel: avs-da7219: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:47 +0800 Message-Id: <20230612110958.592674-2-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768465838304139320?= X-GMAIL-MSGID: =?utf-8?q?1768465838304139320?= Two routes "Playback<-sspX Tx" and "sspX Rx<-Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/da7219.c | 45 ++--------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/avs/boards/da7219.c b/sound/soc/intel/avs/boards/da7219.c index 1a1d572cc1d0..964a763732ab 100644 --- a/sound/soc/intel/avs/boards/da7219.c +++ b/sound/soc/intel/avs/boards/da7219.c @@ -181,38 +181,6 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 2; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Rx", ssp_port); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "Capture"); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_card_suspend_pre(struct snd_soc_card *card) { struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, DA7219_DAI_NAME); @@ -230,14 +198,13 @@ static int avs_card_resume_post(struct snd_soc_card *card) static int avs_da7219_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct snd_soc_jack *jack; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; mach = dev_get_platdata(dev); pname = mach->mach_params.platform; @@ -249,12 +216,6 @@ static int avs_da7219_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - jack = devm_kzalloc(dev, sizeof(*jack), GFP_KERNEL); card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!jack || !card) @@ -271,8 +232,8 @@ static int avs_da7219_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; snd_soc_card_set_drvdata(card, jack); From patchwork Mon Jun 12 11:09:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106196 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2334484vqr; Sun, 11 Jun 2023 20:31:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6X9JjVx27Ay6faC0OJpBk7PlN20VqcfYf6No4yU31WNuFqcGHhWjMQlZrrpXuHU/mPEZwS X-Received: by 2002:a50:ee81:0:b0:504:9346:11d3 with SMTP id f1-20020a50ee81000000b00504934611d3mr4680930edr.29.1686540689767; Sun, 11 Jun 2023 20:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686540689; cv=none; d=google.com; s=arc-20160816; b=W1C/Y27UAv2G4SthS/r134PchNe9w2Ei89UNr4ScpRJVIcilbKbSzhc/fNawXddi5r H0zE/XwURzlVz4YRdXB+MO61X5m4xgXgmimEtiEILjSlEqKgRqwEi9HZ2Jsu+zP86yie tRiqEclrz1AZZrgozZ32KKT6kA+JrKSfZuz1NAYXKG2jIZYM7JnerEnaL4Ni7WxTa0ZV CDfEQcBC8XUrgCuIo7J4vdfqO2VNQ1KzgvBHXOAI49ZcHDGsMIe5kTz180ekHdhKKy7w mOvyRdO1GJjCMNzEPOev5hablP8YY09j1Wf9S2LzzchQb3ALsty7eQDSp9wUI9Di0rBp twkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hjmbvRoSsRHoZ7wONuIQfjCsF6ssYy3H7RSc9rcRDyY=; b=RWwH3bhopqo63us2r9u/lVm95AlcQDj1DlsQRmdPxCl6pMyRNnPwR6d0j8pwtDekE1 hVwX1fMZs/A1gaOXn+e3sY7S1dgJSd6VIwBaReflYxF0btFhjcX/zEafTLjUZdcoWadm MWufrX3R6PA6JO3v2iyhA01jzcWmApbtDFoWh1WOmK7DZcGnNpaLfrQ4bLtpru7AUDjC jOcL+AB7T3Wv9p+P5HyHMJQ5YB6LREycwOldNWMLC2dGG/GQQf+8tuQKx63GV7RlhdYm LFMdGkaTbVCEv3XhIHaP559mqxNm9A6MVV9d3LaxIae1+VLmgTpLjBx3r4VfJpTgesjP VTLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VhM5jSVw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q22-20020a056402033600b0051648e1bce7si5455469edw.679.2023.06.11.20.31.06; Sun, 11 Jun 2023 20:31:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VhM5jSVw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234467AbjFLDPn (ORCPT + 99 others); Sun, 11 Jun 2023 23:15:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234593AbjFLDPA (ORCPT ); Sun, 11 Jun 2023 23:15:00 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00502E77 for ; Sun, 11 Jun 2023 20:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539690; x=1718075690; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=n4WljQzl2VdpQPd3iTWOpWki7dTWlXg8XREKcKcC5Fk=; b=VhM5jSVwHyGGvU/BuoooMXq8qddrksl0178UsSlV6T22a2gVmrqET66R EK3jyXBksQRqIml/sUzbLFHsYOM+qlo6BkVVW8jS+1cOm2i9Qr8sbOzQr 12JuTY4IbeRi9WvOAG8Cewx/1YuraU3ZIzwZ2ovRAevbjvwx64hTZEBhD pvhli5d6/mNBISgNhW4Yndu4KjtsE0clGECy20g5N7xWu8KjYzQijNQJL 9/dkZ90n8p2WxD8AHI8BUhDycvI4Bfj4iZmJ0QASV7935DMXekLHAY2Og 619hf7EOqf658zSQ+iFzSigNUFlYKB5g6avBi7xYuFCJHIqpLB6K+QAfw A==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347578899" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347578899" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:14:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191885" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191885" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:14:47 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 02/12] ASoC: Intel: avs-dmic: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:48 +0800 Message-Id: <20230612110958.592674-3-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768466089948367202?= X-GMAIL-MSGID: =?utf-8?q?1768466089948367202?= Two routes "DMIC Rx<-Capture" and "DMIC WoV Rx<-Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/dmic.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sound/soc/intel/avs/boards/dmic.c b/sound/soc/intel/avs/boards/dmic.c index 90a921638572..c270646faf86 100644 --- a/sound/soc/intel/avs/boards/dmic.c +++ b/sound/soc/intel/avs/boards/dmic.c @@ -44,8 +44,6 @@ static const struct snd_soc_dapm_widget card_widgets[] = { static const struct snd_soc_dapm_route card_routes[] = { {"DMic", NULL, "SoC DMIC"}, - {"DMIC Rx", NULL, "Capture"}, - {"DMIC WoV Rx", NULL, "Capture"}, }; static int avs_dmic_probe(struct platform_device *pdev) From patchwork Mon Jun 12 11:09:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106204 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2337059vqr; Sun, 11 Jun 2023 20:40:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5svYdoQO+q5yKM29w+ZhHh9bsYqw/h0DgWmlN7NjJFV46cXbNpbJQA7R3uMhtAgm8QTpPb X-Received: by 2002:a05:6a20:230c:b0:105:53:991 with SMTP id n12-20020a056a20230c00b0010500530991mr7246064pzc.0.1686541227060; Sun, 11 Jun 2023 20:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686541227; cv=none; d=google.com; s=arc-20160816; b=KPQnTEehIze+DE8PUGbXehz9dQW1oTLtyibwoEdjq2SxCfZuHI/j3vmpkidpjNTMUY wVNoOmJ/Zpji0tmNhaydBrW79xFKCRaYdQtmNfL/7hGjUtW7vEe1Oq8jMOQdfYANEriT 2CMVvsPLrE4IVR7Do1ULX5aRtexDmFx+OYx6ZL/QiGVpnG8lYPJEFXDsOvcvhF37QNYm meEmnoPdrRvnxvIdsaNEaCVR1jwLVppw+HOt2K7BIYgt+skXZdxqPREh4D4lTCKsWWNu 7Q2PZOh+dQ3c7LnZ3TjaGJw3qr50/6X/wAsqGe5zS9GwQFnwIsJjvNodT/x0tK4UpK/1 sIQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yolHH4xzBLUEgEExBV7CBPQnQbj3vZJpz3XKNP8UVdU=; b=TA5cRG53aUmjsPMkmWk8ZebRM9EhZZ0eoJTP2E2YjTPcOOHT9KP3NoKAFdAbRSK/7D AO01dMWhUH6TFeCjNpxhqzMd3tcXW1A/YLOIMDyvEgG70kf8tvIUZaQOhdKaT+FluxaC CeQNBayI5j5nsUOc4Ain6cDRYd1u8zqywdBmPsShOS+8bL1WAkBE879DSG9TXqTuamYc inHapi13ejkCdsVuTivxm1se16J71WbkiBy4f3z6ycnkTot5V7fq46t0DVkEBsCjkSKl NNNqeV7n7dNN5CVZvRco8UPu4JUJw9/YGM5yhkJfwgkRt92CaFzNLgS4V4+7P85uI1gU ivVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=U4pHsz0e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b24-20020a637158000000b00534866eb2c2si6266008pgn.835.2023.06.11.20.40.14; Sun, 11 Jun 2023 20:40:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=U4pHsz0e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229573AbjFLDQN (ORCPT + 99 others); Sun, 11 Jun 2023 23:16:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234599AbjFLDPA (ORCPT ); Sun, 11 Jun 2023 23:15:00 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E65BE7D for ; Sun, 11 Jun 2023 20:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539692; x=1718075692; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5ZigPkJDIXift16/nF0BqzBHx5umgdG3eHZSsE529p8=; b=U4pHsz0e7FT1qttT7uHcH+HFGMUKv64iBKXij54K6S/jFlRNPALMRSHx yJJdlK7rxOqqh63FZPVQrS5vkz+U76xTXcDZvf5eskBFbfL/XEm/KVcXL hJElEEYSBuHMKE/WTxc3u/7m1FPtaBcwUDlf9osd5fW3wj/MGqGdudWNN GjS4P2uK+MxGezAzvhvW2+6nD3xKIysNYoslhHbjv08lLPG7uK7VKwjLa VesbD80wikT2QDPG5V0cbLDYJ661RTZIciGlYbAqEiWJ6QCKcIMiIO8p4 mOVU4o3ZfFIoklLMaUczNUp+j3IY/4cFqkv8f1syepnSg0Yh1sS7wi0M7 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347578920" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347578920" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:14:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191901" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191901" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:14:49 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 03/12] ASoC: Intel: avs-hdaudio: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:49 +0800 Message-Id: <20230612110958.592674-4-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768466654012890426?= X-GMAIL-MSGID: =?utf-8?q?1768466654012890426?= Three routes "HDMI 0 Playback<-hdaudioB0D2-cpu0 Tx", "HDMI 1 Playback<-hdaudioB0D2-cpu1 Tx" and "HDMI 2 Playback<-hdaudioB0D2-cpu2 Tx" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/hdaudio.c | 65 +--------------------------- 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/sound/soc/intel/avs/boards/hdaudio.c b/sound/soc/intel/avs/boards/hdaudio.c index a542a67e21d0..cb00bc86ac94 100644 --- a/sound/soc/intel/avs/boards/hdaudio.c +++ b/sound/soc/intel/avs/boards/hdaudio.c @@ -64,56 +64,6 @@ static int avs_create_dai_links(struct device *dev, struct hda_codec *codec, int return 0; } -static int avs_create_dapm_routes(struct device *dev, struct hda_codec *codec, int pcm_count, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - struct hda_pcm *pcm; - const char *cname = dev_name(&codec->core.dev); - int i, n = 0; - - /* at max twice the number of pcms */ - dr = devm_kcalloc(dev, pcm_count * 2, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - pcm = list_first_entry(&codec->pcm_list_head, struct hda_pcm, list); - - for (i = 0; i < pcm_count; i++, pcm = list_next_entry(pcm, list)) { - struct hda_pcm_stream *stream; - int dir; - - dir = SNDRV_PCM_STREAM_PLAYBACK; - stream = &pcm->stream[dir]; - if (!stream->substreams) - goto capture_routes; - - dr[n].sink = devm_kasprintf(dev, GFP_KERNEL, "%s %s", pcm->name, - snd_pcm_direction_name(dir)); - dr[n].source = devm_kasprintf(dev, GFP_KERNEL, "%s-cpu%d Tx", cname, i); - if (!dr[n].sink || !dr[n].source) - return -ENOMEM; - n++; - -capture_routes: - dir = SNDRV_PCM_STREAM_CAPTURE; - stream = &pcm->stream[dir]; - if (!stream->substreams) - continue; - - dr[n].sink = devm_kasprintf(dev, GFP_KERNEL, "%s-cpu%d Rx", cname, i); - dr[n].source = devm_kasprintf(dev, GFP_KERNEL, "%s %s", pcm->name, - snd_pcm_direction_name(dir)); - if (!dr[n].sink || !dr[n].source) - return -ENOMEM; - n++; - } - - *routes = dr; - *num_routes = n; - return 0; -} - /* Should be aligned with SectionPCM's name from topology */ #define FEDAI_NAME_PREFIX "HDMI" @@ -172,13 +122,12 @@ static int avs_card_late_probe(struct snd_soc_card *card) static int avs_probing_link_init(struct snd_soc_pcm_runtime *rtm) { - struct snd_soc_dapm_route *routes; struct snd_soc_acpi_mach *mach; struct snd_soc_dai_link *links = NULL; struct snd_soc_card *card = rtm->card; struct hda_codec *codec; struct hda_pcm *pcm; - int ret, n, pcm_count = 0; + int ret, pcm_count = 0; mach = dev_get_platdata(card->dev); codec = mach->pdata; @@ -200,18 +149,6 @@ static int avs_probing_link_init(struct snd_soc_pcm_runtime *rtm) return ret; } - ret = avs_create_dapm_routes(card->dev, codec, pcm_count, &routes, &n); - if (ret < 0) { - dev_err(card->dev, "create routes failed: %d\n", ret); - return ret; - } - - ret = snd_soc_dapm_add_routes(&card->dapm, routes, n); - if (ret < 0) { - dev_err(card->dev, "add routes failed: %d\n", ret); - return ret; - } - return 0; } From patchwork Mon Jun 12 11:09:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106200 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2334913vqr; Sun, 11 Jun 2023 20:33:02 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6AvM+ftWKw/Egwmcbqw3iceO7FxSx+18OWJGQamHLiHe1etr7YOAfmRDcjYbM8V8vqkmJk X-Received: by 2002:a05:6a00:248c:b0:663:29c9:7cc6 with SMTP id c12-20020a056a00248c00b0066329c97cc6mr8973692pfv.21.1686540782701; Sun, 11 Jun 2023 20:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686540782; cv=none; d=google.com; s=arc-20160816; b=j0bgp+pyD5hRFZIGPiR4nb4eN1CQzBuhRTYsxqNvj83975vnszkIGJkiK4+Ztkxt/e 5uDjJCMgVgPhyas6SLC5SxbWVHnL8qvr5oK544f5owlzjZ1BrGziYqURVkkhzQFCxotP alcL9QyokpBpK+z19O8AZCp9jmWf3GDz+k3ZzxsFJsp7p93QfpOuZMfLwGsz5oUPkOHK vPBqRy7LXJPeenQd+ARVxtJDzUZ3YAYfY1UBwgAILt4/Fueqqa9kbk5GJuzotamaAqVo UuW0QuvofhjJxWg9xkBVaxeL0xG+IjgrXLyTGq70O/Ar1ak6W0TWzKjeoW94J3iDn9gK 03Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=40M0c6WeEfCmUP0pfT+6yjnCtCbK8p8xVHi/94aiGhg=; b=H1JhNrY33vVZ9cigcKqaTpg1arCAtVLRBIfR4VWz4PvHWD5uWwpNEOAM7ysaFnCMwR AjJm+m6aMoVwhZIss9l3c8CijCtj+BBReEOmP7dpFAlUzczHpf9BM2FeQKW/AvkS08k0 TVGeRgHedBy4wACLR2mufDKumU+3zcZzBLA2+8Xzt2UALL0idZ6k1vW/HQ6DODVtTU9S 4HCgCBPpg8tSq5LO8aetYCaH8LChHPQFeCRV+O2vbRPL4vEMV0J9GHyawer6FageiQtg 7m4hlIU+hLNoOnmz1DBfu/9hl96cYmi+yoDvYvjOKvV2VswTjPkbn5ZY/W2tQ80JyPKV iQ5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kt0UCZ8Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f26-20020aa7969a000000b0065b2d32afbdsi6165184pfk.288.2023.06.11.20.32.51; Sun, 11 Jun 2023 20:33:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kt0UCZ8Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234574AbjFLDQH (ORCPT + 99 others); Sun, 11 Jun 2023 23:16:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234634AbjFLDPB (ORCPT ); Sun, 11 Jun 2023 23:15:01 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08B61E6F for ; Sun, 11 Jun 2023 20:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539695; x=1718075695; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xwsgpdxaqinXUt42/9XufyLi9iO/nioCRY94pZmKTgQ=; b=kt0UCZ8Q6F5ewScDRe0DNbEle0E+u4AqNzFAUGGDp2pIMaIibXyplPNI J9elWTx2tP8QQZjvcsiV9/V9lIgmxscKK+R2UtvKUs5TNIgpbasf3M+XS idoHOrtlJi2aBm1fIQEYO1RY2Kv2QWT6YRK3ubgWPzKbchdNqMFWLTVFr tXnQAhIiSLGwag/AYQNfxzJA4nB5hmJM1FnfLYJS+Yq7lS3HmAmrQQdq1 si3/2dsiRWZc0eQek0IUttfBoEtmFLkHLG0QaVLuTvHHG9Rlq6bS/C7AE /4tC1Gx7yul6nyQqM7rTlW8GPJ/fweu5+M/6u4yfy9nDGASwEUjUyLzzV Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347578933" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347578933" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:14:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191918" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191918" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:14:52 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 04/12] ASoC: Intel: avs-max98357a: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:50 +0800 Message-Id: <20230612110958.592674-5-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768466188103418224?= X-GMAIL-MSGID: =?utf-8?q?1768466188103418224?= The route "HiFi Playback<-sspX Tx" is created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/max98357a.c | 39 ++------------------------ 1 file changed, 3 insertions(+), 36 deletions(-) diff --git a/sound/soc/intel/avs/boards/max98357a.c b/sound/soc/intel/avs/boards/max98357a.c index 183123d08c5a..b9b20562c691 100644 --- a/sound/soc/intel/avs/boards/max98357a.c +++ b/sound/soc/intel/avs/boards/max98357a.c @@ -86,41 +86,14 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 1; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "HiFi Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_max98357a_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; mach = dev_get_platdata(dev); pname = mach->mach_params.platform; @@ -132,12 +105,6 @@ static int avs_max98357a_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!card) return -ENOMEM; @@ -151,8 +118,8 @@ static int avs_max98357a_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; ret = snd_soc_fixup_dai_links_platform_name(card, pname); From patchwork Mon Jun 12 11:09:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106203 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2336988vqr; Sun, 11 Jun 2023 20:40:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Halz4wljZ6bJm3QAezUfTd6oO4w4SpYYXYziPAk7Ay/q9KbXqFb6aQJMu6ugwxUJNMfmI X-Received: by 2002:a17:906:da8a:b0:973:d076:67ab with SMTP id xh10-20020a170906da8a00b00973d07667abmr7540391ejb.42.1686541211512; Sun, 11 Jun 2023 20:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686541211; cv=none; d=google.com; s=arc-20160816; b=GqXs8NJ/CManXrQw3q7eB96AQmF2g/MPIEvweeFGXQZ0saSL7fxBOYmslv2q5TTjW7 RGxehACfT8EASZzj6HtIaY2QgDxKOFpSXXeJhw9qb7N9tgqJVxME84LVRsmt2VB5fjib R1Z68bgMR61KmUsiEkaVheVe4vYPndbBiuSj1lYm2O2nmD4KTL/1fyPcEEOHRJEHvczj QmV0KUxQrvp8E3yeXPp865sWhcAQpS0UpWgEMLj5uMyqx8xEBmnJEoyVW6hg6BBZAB0w CDVRzZMR/q8ecpLRoBalE/jIz0Oux2aJ7oOo+2ZWmeqRAUQK4Bmpc+fm24yVhQeomF9j 6N0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/Kw7xKp7vku0btQh9zOG0e7jN/Mp1VbJ82lrCJuj310=; b=ViNbUCA8kLdvWmx7zqq5Uc3T4OhVIZbvXFRfxorkZO8aAMTURMf9i57RXzdSGwzN9i 9O6Oj5VvJnaEa7AkpjlECWSIJ7A3NEs1R2eFDFUzqZDGo5SVCTFF8Oag/HxHv/uGxuk3 QodZCTOPEHd5UrQDRsuOjzhvOL5zD+LqCQqNOC3yvHfeRtjoVYKIDXPA4zwTe9BroVpu GckdtcgtxZiZo1IvqBMlu2ei0a4d1PqmmulEZ2xEFY7xbZ/3G0EcQr+beNU0Y7yqlpbq 0e/Jfasp6Mzb5fVw6+z2q4oAxROukvOo7FvROVlEUsxNcas/CGLjwjxaMsn1EdSVlQGq tmTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OrPsiMua; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y25-20020a17090629d900b0094f335b0660si4386750eje.185.2023.06.11.20.39.47; Sun, 11 Jun 2023 20:40:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=OrPsiMua; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234494AbjFLDPr (ORCPT + 99 others); Sun, 11 Jun 2023 23:15:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234651AbjFLDPB (ORCPT ); Sun, 11 Jun 2023 23:15:01 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C50B10E0 for ; Sun, 11 Jun 2023 20:14:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539697; x=1718075697; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oLPs9XeZPB29Gk2q8nALmTV059usJ3RGv1ZaTgGsjRQ=; b=OrPsiMuaCf5CZRG7pzWF0axa+9lMJEa/9SY28FwMiwQ5sgD92NlorY1g TKv5NvjZqA56j8X6UYn4SeNVctpTn5Q3NNY+hZuJi07GOWcpjEiSHt3mv SfEYmPcG3OW1kpw2tbw7FAlBz6xfg4isSsTztC+uSRRO2appcI/OcFRlx s53yND/VFtXfN3kJiw+iev9XBxRfGRmZDLh/cmHHjlXT/G2P4Yy8jacTL Brt6EwDp1D4L5PY0RAzZn30o2Q31RqVRwlDZfBrJs2IYV32Jx/z5iuyA6 hG+ZJoAoG1eIuBE+83o5dFb+AIiVlTm79Cl2gH4jPHChwMeSk5R4Zr+Fj w==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347578950" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347578950" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:14:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191923" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191923" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:14:54 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 05/12] ASoC: Intel: avs-max98373: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:51 +0800 Message-Id: <20230612110958.592674-6-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768466637473543231?= X-GMAIL-MSGID: =?utf-8?q?1768466637473543231?= Two routes "Left HiFi Playback<-sspX Tx" and "Right HiFi Playback<-sspX Tx" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/max98373.c | 45 ++------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/avs/boards/max98373.c b/sound/soc/intel/avs/boards/max98373.c index 8e221ecd34b0..3833251ade26 100644 --- a/sound/soc/intel/avs/boards/max98373.c +++ b/sound/soc/intel/avs/boards/max98373.c @@ -141,47 +141,14 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 2; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "Left HiFi Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "Right HiFi Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_max98373_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; mach = dev_get_platdata(dev); pname = mach->mach_params.platform; @@ -193,12 +160,6 @@ static int avs_max98373_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!card) return -ENOMEM; @@ -214,8 +175,8 @@ static int avs_max98373_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; ret = snd_soc_fixup_dai_links_platform_name(card, pname); From patchwork Mon Jun 12 11:09:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106205 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2338882vqr; Sun, 11 Jun 2023 20:47:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Cc/WmASeWTnECek7rWij21Yk+b5O3dJ++7MN2rrb0iSDhkcDmVR+gjiw9Rc3xc4Dp2SWy X-Received: by 2002:a17:907:3da7:b0:978:9666:2ea6 with SMTP id he39-20020a1709073da700b0097896662ea6mr8632988ejc.66.1686541651055; Sun, 11 Jun 2023 20:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686541651; cv=none; d=google.com; s=arc-20160816; b=IJn/aBtbSyBYDXYL+mIgHpoyrEG4xfg2Pth9yVd88dTB4f9H1/9RMhLIcI7ezy7TtE jdKypTUFFndwaehZx0YKwZLLzcMsXvB11fyNdH/brkObkj08xrqHOL3hM0H/XtFAU/pG cKeKKsxNOItu5yQUfLxZwBQdfV7XILy6+OBJb9EZbt63uZ/O0xF0KoEzDWASUl6NtQKh ki2Hag9xTDrBTNIWJTWNWfZyFEXmGyCZDAa6MLikDVS3bJTbK09L1sWUT/SVAaLenwF1 YLPmXO3lIih8g9QvJSu3jAPpe2fC0rWrlEnKTU19AX0Vda/tJLDjqQtkXWdGMbqv1MBf qbrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NH0InJy24kOoPl32JEt+WHh+r7c77sVZv/ls5z3ZzIM=; b=qxA/zineXhS+GX2h9rysuNDt9SawdFJz6cnYP9veyn6X5jAlH6Q5E1mO8V9ysEYQoT rV3WU0LUtb3Q6/6K2eQ3nKAGLwFdFAfHuyu6wJrLBSlLMbfBsCwnEU7CdQILAg6O15zD QjEbquVHmHG/OsTmcGxQWoKRcpC4BMIS+m0B3zjA+c1q93KExlQU2FZ8pQLDkVlA0uEo 6ipqQSqz0vWF7YAA7KP89osIvZ1E8BcVPAkubw2ub5BO0Flm48B/mJn+7WlpE2ke50QH TwSMkzMUiJWuTQY+Q9GVGQk+Q+iYILcTGms63DUNW/wfJHPjMiJ64PoUdrohlrqxby9y /nEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="IO1ArgO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r12-20020a170906350c00b00977d0a5e1e5si4907292eja.44.2023.06.11.20.47.05; Sun, 11 Jun 2023 20:47:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="IO1ArgO/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234422AbjFLDPb (ORCPT + 99 others); Sun, 11 Jun 2023 23:15:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234688AbjFLDPD (ORCPT ); Sun, 11 Jun 2023 23:15:03 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DE0CE63 for ; Sun, 11 Jun 2023 20:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539700; x=1718075700; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=POMQMoF5yCzfeN4V70o3A5GGX/JVr+bQ1FqtXyqQk74=; b=IO1ArgO/ACBVfo/rfvbuCuvz3nTnisVfM/Htag6MG6xmBxjq+g+Zjuse TRdQ9utxk9lt4u5/JvDs7EtBhlZYyQaOUE7XV1zHdAjHotFykzHhHtv41 1wYoGp/FHKlWhW4ddMwIcZ3woZg9LfBIk8oD0RFVrxu+IomYuKMWgtDOP R6/vDFYMrmu1+DCD+vxeBb7X9Mz+WPcsB1FKqDLI7W4iuwDNH2/a0nYw/ RMVjrLCJ58x+BZ6xJEudPstYrjON6rY0atDSdLulSw/JFV2RzUENtVm8B +p7/Ou5JK8kIFJWbT1eEavb/zgBL+k8YbNqVtlgJv/GJ/7JE2ltYsttj5 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347578967" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347578967" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:14:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191928" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191928" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:14:57 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 06/12] ASoC: Intel: avs-max98927: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:52 +0800 Message-Id: <20230612110958.592674-7-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768467098631448017?= X-GMAIL-MSGID: =?utf-8?q?1768467098631448017?= Two routes "Left HiFi Playback<-sspX Tx" and "Right HiFi Playback<-sspX Tx" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/max98927.c | 45 ++------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/avs/boards/max98927.c b/sound/soc/intel/avs/boards/max98927.c index 7cccce99f92e..09b231bf4e6d 100644 --- a/sound/soc/intel/avs/boards/max98927.c +++ b/sound/soc/intel/avs/boards/max98927.c @@ -138,47 +138,14 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 2; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "Left HiFi Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "Right HiFi Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_max98927_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; mach = dev_get_platdata(dev); pname = mach->mach_params.platform; @@ -190,12 +157,6 @@ static int avs_max98927_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!card) return -ENOMEM; @@ -211,8 +172,8 @@ static int avs_max98927_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; ret = snd_soc_fixup_dai_links_platform_name(card, pname); From patchwork Mon Jun 12 11:09:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106201 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2335590vqr; Sun, 11 Jun 2023 20:35:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mlufdcQjT4KFeY6smfSi9Gjv+LqOv8B78pqsrMN+0SpkNsEgwdMRP0AN5gYHeqw6OdsJs X-Received: by 2002:a05:6a20:7f99:b0:119:87b7:9b51 with SMTP id d25-20020a056a207f9900b0011987b79b51mr8739541pzj.50.1686540923595; Sun, 11 Jun 2023 20:35:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686540923; cv=none; d=google.com; s=arc-20160816; b=hNTLpu2vAxzJqEJiCYcJdtTqYDoA4rJ0tyBOX6Ga3g5rP7ortUnV6ME7OLY7MBkPmV 2yItKL+BpPU+2ug091JSOMerH54nuMlFfbHHwd0z5bhmyGMYFSRY2aGvz9wjYSy8QBPN p4i8HieiovlM3KtNfsOgZsYzWe6V9bA3thDDuwAYPgFpVTrKIkSSMvyO0ih2AbqNogM0 8Q7KV4yCzCqKMYOe1oBe7FJvRTlErOopHMRDO4nm4TlG2e5Kfkz4UUPR5T7vepcXWvNa pMQ7qIjvyhDWLG1/qK0FO1aAFHpKJBbOiQNP0N3Jq2RxgpjybG7qvYGDM/MdGcUFMM+P YSoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VgFGhVmvQqHq0EzUflZnV3rj2InbxoNOTjO2Ghu1fKM=; b=DUdaSm9Js4Jjgte4q3Ih71OIPcNnq6DuTtBKvLABrnyPjmY21PsnShPl7FUr+YE6dC prsFxkVSDD5lLIM3waGdfKNDkfRccsGCkBUmlLVzJbsl58zRuPcgEx10Tzg/OijlCf37 FAHRHOH8E+DcbWkSdpA5AG58HyhLLcqVMZEUP25TKyOsOdF8snx1HwVJ3AppYSvCSggJ x6R0D4VI2zju8Fgnx6p3OlZx7t3PWHYjt+ZwdQySMKzwp1vFvfpUnlSJK/TgwZrQMUVO hyOmV/HN7u8fNG1Nh390HL6pF94dIP4kDZTORUWigTHHo8PbZuG2VC3hRanJhqo0Dt3A tMtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ntNbQk75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b24-20020a637158000000b00534866eb2c2si6266008pgn.835.2023.06.11.20.35.10; Sun, 11 Jun 2023 20:35:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ntNbQk75; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234526AbjFLDP5 (ORCPT + 99 others); Sun, 11 Jun 2023 23:15:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234707AbjFLDPD (ORCPT ); Sun, 11 Jun 2023 23:15:03 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE9A1BB for ; Sun, 11 Jun 2023 20:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539702; x=1718075702; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=J5+q5OqTn3NUhd2KAcv2OeDPqTsFvVodE6kntNgJTpc=; b=ntNbQk752H1oYZNn/KQPfpVzLHgLHBulSliFcWb5+R8n98th3qJyI8H3 0NTWWqeA6Q4rL45jwm/ouYKmO7BqtIGT+WOMVE0sdRMm4NxSUALAMRZLT IhdzKtzJGGeeembz+3Zqj1Jq3gLvnty53HjR/fCkkZRR5z8DUhCTZZJKg BmOi3QA5OcTYgLX6jhEhlPtIYuKW3zvniUH7BLHW8F/NBIwvN3iMWVHWh iBY5sa0v81d8VfXbkoGsVMS1TiABbO55A7epBLDtkRH5yHRFHdGEDTUUQ z5j1ZWWUTFwtabnjUji63bT/qf77ZmIEThMc16B4Wh7YqsH2t6Veky5qb A==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347578983" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347578983" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:15:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191950" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191950" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:14:59 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 07/12] ASoC: Intel: avs-nau8825: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:53 +0800 Message-Id: <20230612110958.592674-8-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768466335447594444?= X-GMAIL-MSGID: =?utf-8?q?1768466335447594444?= Two routes "Playback<-sspX Tx" and "sspX Rx<-Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/nau8825.c | 45 ++-------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/avs/boards/nau8825.c b/sound/soc/intel/avs/boards/nau8825.c index b69fc5567135..38c5087d98e9 100644 --- a/sound/soc/intel/avs/boards/nau8825.c +++ b/sound/soc/intel/avs/boards/nau8825.c @@ -215,38 +215,6 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 2; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Rx", ssp_port); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "Capture"); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_card_suspend_pre(struct snd_soc_card *card) { struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, SKL_NUVOTON_CODEC_DAI); @@ -274,14 +242,13 @@ static int avs_card_resume_post(struct snd_soc_card *card) static int avs_nau8825_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct snd_soc_jack *jack; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; mach = dev_get_platdata(dev); pname = mach->mach_params.platform; @@ -293,12 +260,6 @@ static int avs_nau8825_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - jack = devm_kzalloc(dev, sizeof(*jack), GFP_KERNEL); card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!jack || !card) @@ -315,8 +276,8 @@ static int avs_nau8825_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; snd_soc_card_set_drvdata(card, jack); From patchwork Mon Jun 12 11:09:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2340679vqr; Sun, 11 Jun 2023 20:54:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bjfqSpIJFXOLKVQWJ3yxlkQ41QUiA6Mwf38snm+GHVNMAqeliWOVS5uGDQZ7pcY5Tiokk X-Received: by 2002:ad4:5be4:0:b0:626:1163:b446 with SMTP id k4-20020ad45be4000000b006261163b446mr8669349qvc.4.1686542076941; Sun, 11 Jun 2023 20:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686542076; cv=none; d=google.com; s=arc-20160816; b=sfGGHdJiTwcsGf3VkvVo7OA26g9R8Zduwixy6i39g3oFN0I9uZIpZQ5g2m5VflZTYk uGrrn3vqIwrh9W1hozcKPVcqw3QpfZ23sxK4ZiRJpiyEphmFVkSu+d4gmHRy9hQgyWAg gUwoo6UPcDf1fPAOMg22w6l7lieOjZZFLB5sWD2ggrAu1KlWQW8B2zduR7LO89emdV8f vlr33BZVOmKBNumfisRSoT5IGB9n1yxjtsmZkkpYuKILGQyPMZLtcsDQPieY2UvG45mm +FStkkbG0FUq+HgZRMy1UYncOXI6OemjJ/vcWVqzlHtJ+Hf3RgXPB1uAL71zswunTmVZ m8WA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/3RUiiu3BOsT8QCLlFRzzPUuLPpyWHNApmbpsdgivqc=; b=OqHe+2WMLgmqPgpPWwqAkiW1JN1zKal2VYn6g4sVv4ldNGJ+bgCpMLcMgKOz1BgsvE 9SePTR3CqS//nhrDJ5TzaN8Z9jEe4Kpwd/Z0HEDuv86nJhYGaIFjbKjR07xGRQMkrzva ldmmgcJvtEMPM+OWcuvgBeYwM4h2ST0aGvOoOaaRYtS84gUiuh8eKM+89Hess4t3Y+Wz xifklE+m6+VBQ/I1hKhscC9GepXodSNT9w47N8MoDcCrJpWZk4a2GJxTiR7sd+/TyG0D e9zT3Y9t2cK0gNk3rNNS+rTtw4Ps/JtCN5eYLLIuHQ/iLMpinToJLFrIVquPToMtoVrJ riHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="RvlUx/mJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p11-20020a63740b000000b0053f479ef142si3011181pgc.124.2023.06.11.20.54.24; Sun, 11 Jun 2023 20:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="RvlUx/mJ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234643AbjFLDQS (ORCPT + 99 others); Sun, 11 Jun 2023 23:16:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234746AbjFLDPH (ORCPT ); Sun, 11 Jun 2023 23:15:07 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 771A013D for ; Sun, 11 Jun 2023 20:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539705; x=1718075705; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lGVwchl47pkFi5mkMWFQzQSuj4/1bP7rLxRqkLFCwWA=; b=RvlUx/mJYXMBRwn6XZP8hFYKhMvtx++0ZVvG5qSR02cOIDeIdrimpeuA Fm9klg9vJTyZacqkrN9ThofR32uLqHynkjfQPKK5N+xb0NL96exEJnWXQ 08BMpkCdxXAl6J+LhTWErRD65YBUI9IA/75IMHo8qwoIJZp1sK/UrmvgP nUzMtN53CyjSduhnVLZRd13kCT37uHUyLIi7PvmgRoIxhjaqJfqdULXmr jlXIbPkVBFXpNC1AZrxBtybVwlLst53lW3TuEn1YJbirF9XbdGVBvtgJJ TRtHXpz+glb1Cs8HYFdniwC9Z5VrdX6RIjyoyOVFLMnQ0KkyYukDHcDsu w==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347578995" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347578995" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:15:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191967" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191967" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:15:02 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 08/12] ASoC: Intel: avs-rt274: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:54 +0800 Message-Id: <20230612110958.592674-9-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768467544338575123?= X-GMAIL-MSGID: =?utf-8?q?1768467544338575123?= Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/rt274.c | 45 ++---------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/avs/boards/rt274.c b/sound/soc/intel/avs/boards/rt274.c index 6a1e121f082f..ebfee54814ce 100644 --- a/sound/soc/intel/avs/boards/rt274.c +++ b/sound/soc/intel/avs/boards/rt274.c @@ -188,38 +188,6 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 2; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Rx", ssp_port); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Capture"); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_card_suspend_pre(struct snd_soc_card *card) { struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, RT274_CODEC_DAI); @@ -237,14 +205,13 @@ static int avs_card_resume_post(struct snd_soc_card *card) static int avs_rt274_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct snd_soc_jack *jack; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; mach = dev_get_platdata(dev); pname = mach->mach_params.platform; @@ -256,12 +223,6 @@ static int avs_rt274_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - jack = devm_kzalloc(dev, sizeof(*jack), GFP_KERNEL); card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!jack || !card) @@ -278,8 +239,8 @@ static int avs_rt274_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; snd_soc_card_set_drvdata(card, jack); From patchwork Mon Jun 12 11:09:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106206 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2338949vqr; Sun, 11 Jun 2023 20:47:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+Lbh4S8Cb/CbrA/m6sIPUAkSLap2JFPnfUd5J6AZBKJxm/9wEwasb2ce/UlhjxcjmA2N6 X-Received: by 2002:aa7:d6cf:0:b0:510:d0bc:e130 with SMTP id x15-20020aa7d6cf000000b00510d0bce130mr4210423edr.33.1686541664024; Sun, 11 Jun 2023 20:47:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686541664; cv=none; d=google.com; s=arc-20160816; b=Oh04BTF5bGvuC1HPfHIK9sjmHn67a0YupJeKtU2Kvo5YedgeaSiUG/TLAXQRBNqCl1 a37i68iwEKoFwEvi457D8g2KTTIw4SbprW3UPWPXTKzHtJX2w7lSUWitmfYk5Hf7kDbQ wQRoecclh6u1WdJaKsH2mDgK+1hnLndr2gIYNg0bRgN1QVf1m8YPa8uw4zGgF3KQK9Kt wg5xQU038N7+BVrtQuDkLO3R5r0FNurWy8uvnSmO6ktnOwrnluU/nKAVGetrDHqarFXr geVqGJYj0Ah5/zAugihYAarJ7d5LH9gOyS3bBcXbBpuHnYZq1zx5V1ku4Nv0oIrhLyKq 9GYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bjPSU40yrlOkriqnc9uvw2sREaUVprGMV05YpFHjiBo=; b=t8fvEtFSiHze98JAI0t81VRdah7IRItymmsNJ193bqPaLusfBoCd00BPYFR/nGB15Y G4mGGapFlWjyPZx6YL0/FYpHbqGvo5qJ5075gZReC/rG1ETQCKr1UD3wjSR3WCPpfCGh HmvI5iWicrqIgeCKKS3nSntuf3XTXLu4ZXgdgbCYDW9zTWKxL2e/7ESm7LF/oppfGN9N t24KpicgLSl3x4zFGFngqtpiIH3d2dRa9PFr47bRbL8fJJGaZYCFTq8TxMak12vNFU+j jQ6RCI65+1unWy9LYma94hPJPh0trR6xVMmJWY3lNfucnm9SjQL4rX/bJXpUGFad87vK lLnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WMcdjf3z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s25-20020aa7d799000000b00516ad703895si5343064edq.186.2023.06.11.20.47.20; Sun, 11 Jun 2023 20:47:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WMcdjf3z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234564AbjFLDQY (ORCPT + 99 others); Sun, 11 Jun 2023 23:16:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232657AbjFLDP0 (ORCPT ); Sun, 11 Jun 2023 23:15:26 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3CF7C4 for ; Sun, 11 Jun 2023 20:15:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539725; x=1718075725; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RCNPw6SM+wE+oSvjCiunxs3XvlCVgcnR3aZfWQpux90=; b=WMcdjf3z5z4IOVmuvreMMohWWNnpyRBoRZDfw9I5/69A4AQw+PNWpmeb WlBEYOs+oXP9KxH8WdVY1pmwWyLHCUJaguczdxhKVHpWVek6wK/0Anezm PUeDsQIRe/CoOXp/MAtpCJ+TftnsfeqskrbyM13LfzzTY/CIvuAHvWnQZ Ikf86Kdw11Z3N00zqAtORzU32HP6jkY84ovX8zE0ZCSpTJX4XNq5XJwkf n/RmR5tUyoWZhbyXgHjxM8D9xSbmFowLUmMN49LMD3XMcmbOX74ly+dPF 1RF4vIm+KLFkmb6ULka9S6xmVwYjKjOXRFTEie4+rhmZAdwoj78gp0/VP A==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347579012" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347579012" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:15:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191975" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191975" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:15:05 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 09/12] ASoC: Intel: avs-rt286: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:55 +0800 Message-Id: <20230612110958.592674-10-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768467112133515215?= X-GMAIL-MSGID: =?utf-8?q?1768467112133515215?= Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/rt286.c | 45 ++---------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/avs/boards/rt286.c b/sound/soc/intel/avs/boards/rt286.c index 3551a05bd599..84cf9a0c8dfe 100644 --- a/sound/soc/intel/avs/boards/rt286.c +++ b/sound/soc/intel/avs/boards/rt286.c @@ -158,38 +158,6 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 2; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Rx", ssp_port); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Capture"); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_card_suspend_pre(struct snd_soc_card *card) { struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, RT286_CODEC_DAI); @@ -207,14 +175,13 @@ static int avs_card_resume_post(struct snd_soc_card *card) static int avs_rt286_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct snd_soc_jack *jack; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; mach = dev_get_platdata(dev); pname = mach->mach_params.platform; @@ -226,12 +193,6 @@ static int avs_rt286_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - jack = devm_kzalloc(dev, sizeof(*jack), GFP_KERNEL); card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!jack || !card) @@ -248,8 +209,8 @@ static int avs_rt286_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; snd_soc_card_set_drvdata(card, jack); From patchwork Mon Jun 12 11:09:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2334768vqr; Sun, 11 Jun 2023 20:32:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ566e07dguZY6XHRwVgoqaa3UQNLrVYLacimnQQ61JP50GSXFf4eUbcFEBF4l3CFkIp8ibo X-Received: by 2002:a05:6830:1e29:b0:6ad:de28:f3f1 with SMTP id t9-20020a0568301e2900b006adde28f3f1mr5967590otr.13.1686540748449; Sun, 11 Jun 2023 20:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686540748; cv=none; d=google.com; s=arc-20160816; b=VNLFIdP5jMabjCmHkI+39J4pkLDsv3HW789IsYFKel/fhSJ1NA3m6iwV0R3gH0q2oq IHAfqm7nuHAXsdqQztlaULy1D3ijg1Z3k/vj7xIOPNZ3r92NOyeSdHv9sBe2v2Wjxbcb MMWURWv53ObPNvb9I1wtOkPFPFM5RYBm6DgJZM6RBNerVX53mbdx0OAYH0qqEwGEP4hC YGX0ppBBClaxdPgj1+ekY70AAEQvNC3HCUmKJ5E2UmE6nySdkpnIYNHHhwDNTMHb4Gd3 sutsOzv9jiflmLs4CdFeoWxrm/gBfMR4cgOksnOoSIw/QbUVO2kJ5WVZjIh9eTsRz5V3 rgWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2WYD9Gx3LPhIIr9a/v544YeW1ROBjfNQQfoObgVZobI=; b=ojVUGBJnad1Gg4w+FdR4uqxTbVOE+fF2NKhD3hipDgFW/YAomsVlTENuS7b3KrzWPn K6qENpVjzrtnRwYzrUEKt5PY4n+umPWUU7IYi2Z+LY83iEOTCTvWaAXqPsJ1rVLZ015L Pe9tRklfwAiCVmzEfW9n8gL1iby2pS3i3ecvQLCegTXA3+NiM1PEQm9oS07Y6a7NlXIb 5FKZiJFw/fQpipTlA+ZWUEdHR9SO20CkM9X/VfztY0q/OfJgOjQWmoMGRxysrZi/MDxl 14BJC0FOQTAChTCHmG629e8/qqa8eJ24Yv0mTspwEaXQfUU2zze8RqOB+PJjUBe9Gn1w B9cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X7QiO7K9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f26-20020aa7969a000000b0065b2d32afbdsi6165184pfk.288.2023.06.11.20.32.15; Sun, 11 Jun 2023 20:32:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=X7QiO7K9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234737AbjFLDQ2 (ORCPT + 99 others); Sun, 11 Jun 2023 23:16:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234212AbjFLDP2 (ORCPT ); Sun, 11 Jun 2023 23:15:28 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 179A510D for ; Sun, 11 Jun 2023 20:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539727; x=1718075727; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6YiX0yvmiKQf+uAku9yo5ddxL+NRFfsXBZ33VFKIHJM=; b=X7QiO7K9BnxW8kGi+GHAL53LJ2cDbPhxDaCMPIjuRxVtFFUMIHobAaER lqID59dWFTUHn7ttHUAW8ykqXYx1NHb7avtvSyPiumoPQImiuZjP++s// fJE1fKlHOXhpYGens8m6XLmQCju/EBYeV3AKnFKEcD5EqhtG+J5pw/QiI OB/ZI0ETkimj7iJJ6liWo/0eaTNYZIbYOzmsairKAqBiHG5vkI8xpXCYB P+GhQSCzAGRX257Rq9QGBpktZOz/+Kp4CeP3FdaQAGjdvKqFwvQqnWEr6 H4+CXL8FBK1EjV07Qik4LOkqxVbC+zNNqs4hTYI1oEiCHzlLTN67SBRgU A==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347579024" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347579024" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:15:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191988" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191988" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:15:07 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 10/12] ASoC: Intel: avs-rt298: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:56 +0800 Message-Id: <20230612110958.592674-11-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768466152165239978?= X-GMAIL-MSGID: =?utf-8?q?1768466152165239978?= Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/rt298.c | 45 ++---------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/avs/boards/rt298.c b/sound/soc/intel/avs/boards/rt298.c index 2923f3805bbe..3b0e2b1a3251 100644 --- a/sound/soc/intel/avs/boards/rt298.c +++ b/sound/soc/intel/avs/boards/rt298.c @@ -178,38 +178,6 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 2; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Rx", ssp_port); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Capture"); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_card_suspend_pre(struct snd_soc_card *card) { struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, RT298_CODEC_DAI); @@ -227,14 +195,13 @@ static int avs_card_resume_post(struct snd_soc_card *card) static int avs_rt298_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct snd_soc_jack *jack; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; mach = dev_get_platdata(dev); pname = mach->mach_params.platform; @@ -246,12 +213,6 @@ static int avs_rt298_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - jack = devm_kzalloc(dev, sizeof(*jack), GFP_KERNEL); card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!jack || !card) @@ -268,8 +229,8 @@ static int avs_rt298_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; snd_soc_card_set_drvdata(card, jack); From patchwork Mon Jun 12 11:09:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106207 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2339225vqr; Sun, 11 Jun 2023 20:48:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5wRjMcLqkbSg+IA84VlJm5W4gXxAfsPu0kB/ApSKwDbvFoPu+gG1TZINRiU1xuFxLCGxEX X-Received: by 2002:a17:902:d4d0:b0:1a9:b0a3:f03a with SMTP id o16-20020a170902d4d000b001a9b0a3f03amr5779892plg.9.1686541727085; Sun, 11 Jun 2023 20:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686541727; cv=none; d=google.com; s=arc-20160816; b=d14a8vxW0cj5rMw+8Fn5Qm1FnExDW5ggw+t93R9CH0W9xjmEpt0qTg6UyVS/Y96qT4 AK2+WYVWpcPpmSWz6EUbK3Vizq8/uQlvuLQlRk9BI/96ULsGfe32Xu21flQlV2lxBAjt nLArj5Sgx4OJrL5bgfb7vf6ia5lGhEjE+Hxg1OrnbWGlCX1uxlrhK5tgHubV4xJI5xil biZbb8/vFAxQniWJKqNihDI4fz0pqXJHCdnqLJmc8gDwesNDXGO9q2/0/JMg3q6gkPXK 5HHkWkQxlnt5u1Qn4a4IUtfN9Mb+w1KuyCWbl9KcAVjxmx/tJPz6uePp2vv9LtBXDt/i 9fpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QimWEG2Kb3GsGI9WDUiO/zbfXvL9g6gbr5fDn/XxZ3c=; b=tcahPe0TZoIkqmdRqq492l1DSmNp+ZmGgt1cgqxVSv3jlMIlYhvkmp1Wb0pQy6V+hP T+CcW84XO3wWGPYw+rP/RySRg+4bh5YarZ70WlNf0a/361gp452w28Z9Lxzt/wke9G51 8cu1Po+OiLdOhhBrGwNE/v1r1GtPTB/P+jzeN/D5wiRM7aLj64hW2pn6r/GK4Yw1bOXo h76FuEs208y9gGDAjJgJYxliIiGXYpi8OtcOdb934v2fdbLSTfp+O9aJtdwFwM9gEKwA Fko9RgBs6kwEORtK+AHHrxsH00FBKKs9oTAKKybfK6AfDvhReTXfi4WjDQMq3v9JwT+k b6sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XoIqRivd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a17090acf8200b002473e331f90si2925858pju.46.2023.06.11.20.48.34; Sun, 11 Jun 2023 20:48:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XoIqRivd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234651AbjFLDQf (ORCPT + 99 others); Sun, 11 Jun 2023 23:16:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234339AbjFLDP2 (ORCPT ); Sun, 11 Jun 2023 23:15:28 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B019BB for ; Sun, 11 Jun 2023 20:15:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539727; x=1718075727; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S0S7wq1pknM5ia0eidCg38PVrAMtNRnOsHs8GfwgFAs=; b=XoIqRivdEtTXFkUci4yEKd8sDGBlXRSXgV4rUHb+st9h+jn7La/3C6QR F0DaeTgnkRKnT0CEDYlEHT/UAaK5jlcagYq6hEkwKYMOd4Qoy1yiD8hWk 4u7gVmqOF6p7EKYBO4mcKl0nFeNiRvrzaRfDUgaJ+v18A8bUYqsEPVRR3 WFLVplS9Hnka0Qor5f6EYBkP6U9NZ8zIJwxg9Pyw1D2biRktZHkjiez99 EL6aTxM5R8mqeduVvMifnkWDuM0f9UFBdmHTlAApHC4xfnp9OHU1G/5Xu mGUJXHqT9q3CkW+I0QBE1y/7bNXv6xCSFNjABXb9KOcXQqiWdnFY3NcIg w==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347579038" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347579038" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:15:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776191995" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776191995" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:15:10 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 11/12] ASoC: Intel: avs-rt5682: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:57 +0800 Message-Id: <20230612110958.592674-12-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768467177770219384?= X-GMAIL-MSGID: =?utf-8?q?1768467177770219384?= Two routes "AIF1 Playback<-sspX Tx" and "sspX Rx<-AIF1 Capture" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/rt5682.c | 45 ++--------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/sound/soc/intel/avs/boards/rt5682.c b/sound/soc/intel/avs/boards/rt5682.c index b2c2ba93dcb5..7142a67900bf 100644 --- a/sound/soc/intel/avs/boards/rt5682.c +++ b/sound/soc/intel/avs/boards/rt5682.c @@ -234,38 +234,6 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 2; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Rx", ssp_port); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "AIF1 Capture"); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_card_suspend_pre(struct snd_soc_card *card) { struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, AVS_RT5682_CODEC_DAI_NAME); @@ -283,14 +251,13 @@ static int avs_card_resume_post(struct snd_soc_card *card) static int avs_rt5682_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct snd_soc_jack *jack; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; if (pdev->id_entry && pdev->id_entry->driver_data) avs_rt5682_quirk = (unsigned long)pdev->id_entry->driver_data; @@ -308,12 +275,6 @@ static int avs_rt5682_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - jack = devm_kzalloc(dev, sizeof(*jack), GFP_KERNEL); card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!jack || !card) @@ -330,8 +291,8 @@ static int avs_rt5682_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; snd_soc_card_set_drvdata(card, jack); From patchwork Mon Jun 12 11:09:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brent Lu X-Patchwork-Id: 106210 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2340991vqr; Sun, 11 Jun 2023 20:55:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6arqy4JAdmNGLG5G6XMnySH++Yl1X7Xa072m+/dyvaztOkZo1nmjAscIgXkE2FFRK0ateg X-Received: by 2002:a17:902:d504:b0:1a9:6a10:70e9 with SMTP id b4-20020a170902d50400b001a96a1070e9mr5728168plg.33.1686542155380; Sun, 11 Jun 2023 20:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686542155; cv=none; d=google.com; s=arc-20160816; b=fzOiioHBb8uxOHqv21qKfxeQ2DoAJINxpgXxBJtHW8A3yXT5MPttJHAVEppzSd2Els P82RY9Kp8sae8RPK4ucVyGAKSdfiCNkvLRbFjjVg7aE+wORtNCmQ+AuTC5bg1mznbhDI RApx4WCELVOnOdjjlE1N5724k4pMNEyRlD5nsG9qz26/QO0Vw4dOUUSaKuLbkReUr2K7 IbYytbJe3SBjTp/UBreKWiC2oenkIcADO26uXOJEf1pOXq2KRAvuxwtmC4pA0GTSpx3V 8+hDKXzm4b3r8AWUX63Pme+Lvy4zI9+UaYz75TlyqTKUOkAZObZ6w2sFzFrytVTWnXrW 7wEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ouGVgoAd8Uk0dkjLhlZSb2vs+gUcA1HH85UYEH6LAwM=; b=rflesK31g7mqkmQ7VZC/1aejAvMWbS9s9vH40guWndCFRYFqI+zMJbFg4esVy2EXxg RwodAOpHmgX7kYifwIxRHvTR8QeakwCtRlNoyxDCIPWbmL5T6xecWt8DVRCBWypzpd1+ O5XY7mQQDLUCvdVyum6AN/MvHe/IjKqDRm/tlDbsiV2zM5zYfGvIgjTQ13+mUxOhrkgg gSBbN9tGV3nflO3EzWQrspwrUm9YhKFEKxdMKIIfx80r9HLMfyXhYWJelBcsRxXoSms4 QbH+FGLaEaRcce/s9e9XR1WynpuwbUN6Ag6JYXsUT30IcQaV30+/K5vUJ92lCsR6va3W HdJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="VA/uj4AM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jh19-20020a170903329300b001ae52127485si6374302plb.433.2023.06.11.20.55.43; Sun, 11 Jun 2023 20:55:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="VA/uj4AM"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233964AbjFLDQj (ORCPT + 99 others); Sun, 11 Jun 2023 23:16:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234374AbjFLDP3 (ORCPT ); Sun, 11 Jun 2023 23:15:29 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1939DC4 for ; Sun, 11 Jun 2023 20:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686539728; x=1718075728; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yEL4WgOYASzXlYpxiAO18qiaEOcuWhFhWKeJfuvKTD4=; b=VA/uj4AM+QjJ7GlMsQlvivxsNt39804LM2vCFZ+7THpSpV+KyplpVcPW ZPIDbCRYoD2TBtAG6odKFPIbp0ACIPQh7Mi75bD/5ITC/XdIzDpbeSKg+ J73y6MiqYgbOzt2brKctKDEPOrplPr6lKZIkKFO1GHwjQLiUyqV384C6d ogcFKk5MPGPzZp07dcgjEU5aen3Iq7lSkYfqhogPc7M6l5jffEdeXqmHo +x4ODboUk0bEgBB5U15ZgGlPcYKJWoLrh9ojMql3UMnO5U7EJAVbdxnLp eD7ugnyOzSm07f5meyargQslG19jiOZpW6Be7Y5IqSZzXjmDOdCDNPoWK Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="347579056" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="347579056" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2023 20:15:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10738"; a="776192001" X-IronPort-AV: E=Sophos;i="6.00,235,1681196400"; d="scan'208";a="776192001" Received: from brentlu-desktop.itwn.intel.com ([10.5.252.92]) by fmsmga008.fm.intel.com with ESMTP; 11 Jun 2023 20:15:13 -0700 From: Brent Lu To: alsa-devel@alsa-project.org Cc: Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Mark Brown , Jaroslav Kysela , Takashi Iwai , =?utf-8?q?Amadeusz_S=C5=82awi=C5=84ski?= , Brent Lu , linux-kernel@vger.kernel.org, Kuninori Morimoto Subject: [PATCH 12/12] ASoC: Intel: avs-ssm4567: remove redundant dapm routes Date: Mon, 12 Jun 2023 19:09:58 +0800 Message-Id: <20230612110958.592674-13-brent.lu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230612110958.592674-1-brent.lu@intel.com> References: <20230612110958.592674-1-brent.lu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768467627031125229?= X-GMAIL-MSGID: =?utf-8?q?1768467627031125229?= Four routes "Left Playback<-sspX Tx", "Right Playback<-sspX Tx", "sspX Rx<-Left Capture Sense", and "sspX Rx<-Right Capture Sense" are created by snd_soc_dapm_connect_dai_link_widgets() automatically. Remove the duplicate routes. Signed-off-by: Brent Lu --- sound/soc/intel/avs/boards/ssm4567.c | 57 ++-------------------------- 1 file changed, 3 insertions(+), 54 deletions(-) diff --git a/sound/soc/intel/avs/boards/ssm4567.c b/sound/soc/intel/avs/boards/ssm4567.c index 2b7f5ad92aca..7324869d6132 100644 --- a/sound/soc/intel/avs/boards/ssm4567.c +++ b/sound/soc/intel/avs/boards/ssm4567.c @@ -129,59 +129,14 @@ static int avs_create_dai_link(struct device *dev, const char *platform_name, in return 0; } -static int avs_create_dapm_routes(struct device *dev, int ssp_port, - struct snd_soc_dapm_route **routes, int *num_routes) -{ - struct snd_soc_dapm_route *dr; - const int num_base = ARRAY_SIZE(card_base_routes); - const int num_dr = num_base + 4; - int idx; - - dr = devm_kcalloc(dev, num_dr, sizeof(*dr), GFP_KERNEL); - if (!dr) - return -ENOMEM; - - memcpy(dr, card_base_routes, num_base * sizeof(*dr)); - - idx = num_base; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "Left Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "Right Playback"); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Tx", ssp_port); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Rx", ssp_port); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "Left Capture Sense"); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - idx++; - dr[idx].sink = devm_kasprintf(dev, GFP_KERNEL, "ssp%d Rx", ssp_port); - dr[idx].source = devm_kasprintf(dev, GFP_KERNEL, "Right Capture Sense"); - if (!dr[idx].sink || !dr[idx].source) - return -ENOMEM; - - *routes = dr; - *num_routes = num_dr; - - return 0; -} - static int avs_ssm4567_probe(struct platform_device *pdev) { - struct snd_soc_dapm_route *routes; struct snd_soc_dai_link *dai_link; struct snd_soc_acpi_mach *mach; struct snd_soc_card *card; struct device *dev = &pdev->dev; const char *pname; - int num_routes, ssp_port, ret; + int ssp_port, ret; mach = dev_get_platdata(dev); pname = mach->mach_params.platform; @@ -193,12 +148,6 @@ static int avs_ssm4567_probe(struct platform_device *pdev) return ret; } - ret = avs_create_dapm_routes(dev, ssp_port, &routes, &num_routes); - if (ret) { - dev_err(dev, "Failed to create dapm routes: %d", ret); - return ret; - } - card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!card) return -ENOMEM; @@ -214,8 +163,8 @@ static int avs_ssm4567_probe(struct platform_device *pdev) card->num_controls = ARRAY_SIZE(card_controls); card->dapm_widgets = card_widgets; card->num_dapm_widgets = ARRAY_SIZE(card_widgets); - card->dapm_routes = routes; - card->num_dapm_routes = num_routes; + card->dapm_routes = card_base_routes; + card->num_dapm_routes = ARRAY_SIZE(card_base_routes); card->fully_routed = true; card->disable_route_checks = true;