From patchwork Tue Jan 31 01:58:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F912C636D3 for ; Tue, 31 Jan 2023 02:00:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9176DDF9; Tue, 31 Jan 2023 02:59:13 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9176DDF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130403; bh=5nfnmU6K/b5YpFEaPjMx9URUZy3EreAXlmaLqAWaUkk=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=XaftkTz8MDbTojD9J6NpSLzm2lrquD1Dpp0KPA9QpSfNQSlW9o7y/Axr7x4ytzANW HHZpE6F5tEMiYsha4/6DOo2FoZGdje3R03mDbl17dQUwfk0iEP69Ebn9EFspmC5X/X IZmCxiP9Ot3BQ9VaEkvJqI630qzENqqbrXzEUrZA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3ACFCF80423; Tue, 31 Jan 2023 02:59:03 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 27649F80155; Tue, 31 Jan 2023 02:59:01 +0100 (CET) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2119.outbound.protection.outlook.com [40.107.117.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B41C0F80155 for ; Tue, 31 Jan 2023 02:58:56 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B41C0F80155 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=TbTdAe8j ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHrE+AP/M3dphU60HAkC67WWUv8/gKXkBvQq5WMVakVPSnmpBhFCjv+eQm7SPhQq9MJSUkFm9l/7DrClOvHKyCSF53K2MM1AsgCFSL1wvGrPU2Nai2rQF9bNkB0TKoCGV4mO4GLNNZRprFmqmDlVTOb3XxTeeIWhwagG1igIyHUuZck4LG07n3K9RGntz4Tf29lWcUWNX00R0uMdMB4iEK2yYxXzwUu3ut1t401TahDnhYAphxMA9yIHrH06wQt87Dug1wjVsJuKvui+2qwft1TgEkIgPJIpb/WoXlDRi+y4TWQSYni4dZWKPDsfg2MAozCzEvPvQ/x49H5ncYZF9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JIWlI27zncJI6mrCeGB4mikKky6wwvFOOPrwT+cojGI=; b=Bud5CdIzJgp8zPSd6yM6pDDaZHq0nIUfgMcQIHWKtrzQfxlm2ubWGtBKn/zywQBCCXDJLqhpXZBIHDvQAmnmlkw50y/D1QyyIM8nQJ7d+XVVb8Owr3S+BHLxUzAHogHV0TQMOqOkchfbGNkS6SXvdTDBHhbslSxLYw4qg9ZPrzdADRc7zR6XAplRGuUBiehaiQRnQER0iUXeNauN2blfJnQVOwKUuaQPbTLnyj7fg2a3qWobGRsfxcqfgSw2munMHpby3dvuJSI4UVJU2Q81X6hDgpMGfWkTBNmrse9UB34V1DdAGmcuTITBSJ34RJW02AK8YsGxtUAHoEyUGDSLkw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JIWlI27zncJI6mrCeGB4mikKky6wwvFOOPrwT+cojGI=; b=TbTdAe8js4Kr+Ipkb30M9jI2JqbPcN1HF5wZsjTwVG+NzDyMZ6gDcCt7xGBzctI/P7OoFuHZ5ldHwZoSOQn3SrSMOy4mfmpe0TySKQKnJbz043mtzQolZL2kDLj+JMGEgVMvIdLP2BDbXR+Lwj/F7GmbnmdHX9T9PregBGt7ZoA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TY3PR01MB9980.jpnprd01.prod.outlook.com (2603:1096:400:1aa::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 01:58:51 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 01:58:50 +0000 Message-ID: <87bkmfforp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 01/25] ASoC: soc-dai.h: add missing snd_soc_dai_set_widget() User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 01:58:50 +0000 X-ClientProxiedBy: TYAPR01CA0169.jpnprd01.prod.outlook.com (2603:1096:404:ba::13) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TY3PR01MB9980:EE_ X-MS-Office365-Filtering-Correlation-Id: 8cd9dc89-8a3f-4444-f144-08db032eb2e2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eAZlP906CzkZO4cTs5WBw1wddOJA0OUYZoW6jVRYq9ecjPBQ6x8tT2biI9KiA6goNnx61wAxn0ciSMYxUZg+qNAhtmyj1a87cx1UOwAuaGsjwXvn+yGYdzsKQDVkBRmmnF7dzCx0wJ8Lsbym/SYrdLRWL29OuJt2Xlg5HbJ8QH1a06NVi1zYuFqgjD6oZQmOdvpa53U09t2/phYOm3qKil9fx63+iP5In5245qrMqQGBAThvdAjZ6d5MBwyPpCY37A0EDB0MlyPd6iYlAlGbGFWCCgOjvG84Fdr3Jvcpfea7zmHiwqj/54HV5YLTR+7t6/5C8VrEVwOdoCRmpvi51hdzAvFvaGZbsxJwzLvQoIv6gTVjYU1sDkQRI+Y7ezQuF80qzWNO4D6LgSa298y4AFdZYvnZxbPUUstwVSzMXmR47Q6oVivxISbcXaoVZsI8whvNxIlQAFCUHrHgu4cvJ7609H8J93mlFoNIg4cmIFUHik9XcgyZDAdS9sULR1ib3C4Rbz9zQFbx+2OTYlEmxQJ2pYE+uci8a7QABOeJwJZTNwcvnl6fh/XYcD0WI2J4BwYU3c1ikOXJ6Q08tsIjYZBrAFIlxj7nUQoech4Jeb0g8UDRO92n+BJwDpky6Go7FzH89MHGJYOX7G1p9bkA5osH7AsHmalgXZ8kU/aBS5hQ9uNAnb/Hatvpg5SeCmDe2jNubCHvSFSsFa+m3sdjdQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(366004)(396003)(346002)(39860400002)(451199018)(66476007)(8676002)(66946007)(66556008)(4326008)(41300700001)(6916009)(8936002)(316002)(2906002)(5660300002)(6486002)(478600001)(52116002)(186003)(6506007)(26005)(6512007)(2616005)(83380400001)(36756003)(38100700002)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: mBW8Pu8fLfUGbLK2AA1yQ+XiinNJAQbmY9SNd2liFK48U2we4wMcIyzwYmqaPp0u457BIAYSSd5g+kR5XP/OCvH27Hdu4EdJEgD+P2oxTXQXst8fi1jCos++aUKHpLMsJNJKBqhAqZoOxSYA9HvytTVO7RQGC+DUlYHAVFEEMgUii4uzk3cChRysZyeZsXTmMsquKBBZZOyBtcnUlniZ2EyMiNd/dsyHEhUwBtoSIOcrNFWzYskC7V+O6tWaBYzEQCclxBnu9Q+dYQRnGxKUQAxCEptqiK4TyzmtON9stLaOXanKazr2QzpyB5MlEl8CibSJhnO/9k9zVInEXuteJMBuC8Zshq8d35GoPp0/rjWUmKqPJa4AQ+z9/V8V3qPWYtEWNffUFo8cTv68b7d90+s6u6DSZkKUtoOWTs9y2/y+Jp3NbtqPb7tlyjCLVh8aslC8wpNcj+nWyTwSSC0rTzZnSiYZpkuORXSJItZ6cgbuvsLzOYUbGt10FlqeQotk53a6uDk068chfunDbnEyVDDWNNTiyF8/RJPtmq2hvYB9rBeTNvUl8kOJSV2NMjW+Cy5H6vDzcBCMKT5ghY5p494whHGm9Tmr/Sjy3QFDAMLlWUQv0SUR+l4+o2OE5X8zMC4eC5V1EXTV0uA79nHEHo28yafGtFNPYHM+5gesXBBMwf3OGtf77c1MZRdi9FX61TOCrkG07KLXSa2qBE+l4/r49pQNzyt1bbVmFhkpGtJVuH4R2WbfuSDFZqW184mpNOCFayI7zLxyWvnEVqPHKsOQq8LzYgbOawwDe3eKr4dOIr7Ul+h8HE5yMWtO1aoduOz71b821UNlZlxoyfUJISXzIncfQ/HCtnkhTvzueWk0w2Ii9bAK2+GBwISf2uaYKuu4BY39UnQslND99oKrBOFYk4kOdOT7h4s/1ipzrCfmuTYqwJTKVvL99zwwZ/96XtyvhdCdnYg2qTa8az+qj5bn5MFYv8GpU7TIGeBS9QD75yhgySVF9++YYGpswYPiYRKDV44sz+rGHZklICmVIiYt8SST+PeFrS+GPcKVMlgB0b9M/W/jwFvYskHF9eRwuJ36OfAGLvpTk6VJKrBdW/sg9vnlajtOBQHNeFleW+No6kf25vVVrDKCE/N8akulAeYyArWLLLzIhIZEXSlNCqdf/XkkLLAirwrH+1FRH5dwvv7X/wTM9jZKeMmYLbpe5j9TLCBbOIwQvK1dQHqg4YGDfkpAGvZ6oCytmaTmp7FQamO5f7rcdK3qubJ6/aXq9iM04FiyyvckuKs9273OfdfzLzJtfULaK4Rz3MPQLOfyIaNtHZgbHkuc7BMUo4+ve0c9ZjjNoO+9azmYHrQn0JXlCok6TD2GM4mD+Pjk8ZNsG29TqnPrQE1Omylr0rnlFzVmN54CJpMNhiSiXB+a+VFNB6d16kMyltjIXb11T+lX5exkar7QA3W8F/wGroG2t6PEZQBAQhaDSSdjIXEZPrp3PnSDiJx1K6M4jFu5X1CFlRgsrhak4diLFLTkYIVL60wcqpMek7VtSByBoVbywZ3HP4tq5zB7O42h1hhNBDMutbZDnxeLz9J9V9my2P4Fdmqhw8f7SGUcf+EH91eU/oWxxWcAVZYlB/oYJ3cdq2g= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cd9dc89-8a3f-4444-f144-08db032eb2e2 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 01:58:50.9372 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: eXcZXjYnCMqhEq89M6EDfj/dTGbZ0V8pVu1czphCfEJDbmaXu5WtK4nQq9mZ0rRXXBkXF5/xlevDScsTyNEv+aMSz5wU+uYOR1xfmgxCKKQNwE6UEPY0zK53r3mYKkQU X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB9980 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has snd_soc_dai_get_widget() (= _get_) but doesn't have _set_ function. This patch adds it. This patch also cleanup unnecessary line break for _get_ function. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax --- include/sound/soc-dai.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index ea7509672086..ea704d92deaa 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -478,13 +478,21 @@ snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream) } static inline -struct snd_soc_dapm_widget *snd_soc_dai_get_widget( - struct snd_soc_dai *dai, int stream) +struct snd_soc_dapm_widget *snd_soc_dai_get_widget(struct snd_soc_dai *dai, int stream) { return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? dai->playback_widget : dai->capture_widget; } +static inline +void snd_soc_dai_set_widget(struct snd_soc_dai *dai, int stream, struct snd_soc_dapm_widget *widget) +{ + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + dai->playback_widget = widget; + else + dai->capture_widget = widget; +} + static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, const struct snd_pcm_substream *ss) { From patchwork Tue Jan 31 01:58:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2656CC636D3 for ; Tue, 31 Jan 2023 02:00:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A5456AE9; Tue, 31 Jan 2023 02:59:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A5456AE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130427; bh=CyzRx2bD1So0VkJzfv7bi9HUGyT90m5ggpvn/z95xGg=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=moxtKnEtYbuI+mTh1g3KglnYOJEmw9HRz6sM294ILJSfmpBZAIlJXwb5APmqIJsbU 4ox/V9lERxJWz94eBtCaHFupria3KIDnP71gy9BnbpmsXtLM6wHEQq/rP2J+vMIUAh lKLrpiB0s0Ea5YK/HU8BLLeeDCmHJnha1OkrXzfY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id F303CF804B2; Tue, 31 Jan 2023 02:59:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DB653F804C2; Tue, 31 Jan 2023 02:59:06 +0100 (CET) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2107.outbound.protection.outlook.com [40.107.117.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5A13CF8047D for ; Tue, 31 Jan 2023 02:59:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5A13CF8047D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=abwOtCx3 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RLpdsBa1sfP79zmMFjVKzRda/bpCj31qVgA1mssEjh/+236d2Biz4MUMoao7eHldif48IgjNCIL5RfaHUWvsAb3lY8QGZK/BhksskcRIL6LBd3r7ZsUtPzKl2PnJTBRm8W+9sX5q1n0ZtggqcQtf3/5T0p2/1PpHtQFfL3Zlu2ugVWWLr1t2V9qnHess8384fmMlUeGHn11W9XAO9r54wbcCMKs+81JxjZ65hwVyyigM2fxwg6B6p5vWuDaqSNthFERvs2e0k+3Uz+ntC9OhsTlPqf/G3bTqBNOFmX9iit9fvY9rKTDUPHCOcP/YmBERWKOesR7aNCeRKkbs6CLvEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=DCBBiVpXXVVV/WdixsKJwRGj8NlkbWf+jRkxdl8LC/Y=; b=RSV261h8yx8zYocU++JltM3t+CI5XpxvSwvK1r7tN40ScIXDZA3E5QUFU22l+E9lvW60aZWzRD+AibiQ5uDpL2hoSl1HTMe1ja5+GrWKtzDPlckxdkObO1Th+KGMy1I+x9jw9lcmDH3V0bjGv4GGU/90+Np+bD0sr/KDz7ibG/78zXXNToO5IeTdn436gWIpWomnfCeUNUmNpxPWqb1uXwPSNoyhBUKeAU746y+iKgGO/VZgqEGW7NT7ssQdGNHz+ngFfqYtbiUXd+zcDfmNd2Z8qxHvyd9C9I1SplH82/0KsQt6VijVsTpzmoqVwuNZw86srmD8HIrYhXWrHfF1KQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DCBBiVpXXVVV/WdixsKJwRGj8NlkbWf+jRkxdl8LC/Y=; b=abwOtCx37oOy0sFB//bpHHd3v5eVIEjV06SQCsfKzSWXMPYJaOCSdI9NBswCrS/vaD6AGXrc6QD3Y97zsjUJ50o5h2x11E83yt+AaHf3UoCv43HPzM2tXDOmiNCME40paz76a6gxpRMRJ14Ll6mqyteAc0K6dJriZfe0D8xZ4+k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TY3PR01MB9980.jpnprd01.prod.outlook.com (2603:1096:400:1aa::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 01:58:58 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 01:58:58 +0000 Message-ID: <87a61zfori.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 02/25] ASoC: soc-dai.h: add snd_soc_dai_dma_data_set/get() for low level User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 01:58:58 +0000 X-ClientProxiedBy: TYCPR01CA0006.jpnprd01.prod.outlook.com (2603:1096:405::18) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TY3PR01MB9980:EE_ X-MS-Office365-Filtering-Correlation-Id: 4160a3c3-d360-4aaa-530b-08db032eb78b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XvjihAZxV74K9nJT6eCqklbLfQHlN74fw3CpSlZzAD6PLrug4UuSUMC3rgrmXcIF6WZZtPY/zB/dymTkDmcZuaHzDTE1VMYn2Z6eXFw0nuf3Dix4Vt2SGWQipsb6+V+jSb3f5gYj6BAjjRrX8Eqtd1CJ+SXR9UNWHMlknCRaOkzfwBUscM/qnmjby7NV8501vZ68UPUR6ElbqfE4t4xM5Hhb6zkLXNMnY+XXgT6GmLWizrl1rTKwhSiiJUr8oLOd1JUKbIu+iSLPWaQVrHkhuq+/WxpXDYGJdb863oEVV/X23tM7MO7Q3Nl7SMqUQdkcSSGcBgzA1UqmKLm4jh+GA3saqUmZeuXuNF/vy4As6mULx5qrAK76AQiduTi+BFESdHIOIrFEuzy17x4CL3Gv8IAXLeaLdBM8g3kAHlhru0Vpk7etgCm+UJc5BeK6hJ57O8tVxubx+c2xcv5St3FLaJAQ4QBX6tuXjXmrvWvu4FQSSFBxgUaG+njrYBz4/HECMRgK5Y1IgmqxvZyIBvfT3KbPNXNcS7zMvqwYgSWIZR+NKJu9i952ceAbdSL5gks0XtYMXrgKSlAcBlT5lnanQkqGumkMsR/dVQuO2crGo2MMclmz7oSw7qAQwmMGXa5GCVmilFtmltoYwXFPu/WdlzSUwQfbN809S2pgYluUozSXg4bpQcUwuzWoXxxW8gvEXXM7+gk6El+pDzuMZAKUuw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(366004)(396003)(346002)(39860400002)(451199018)(66476007)(8676002)(66946007)(66556008)(4326008)(41300700001)(6916009)(8936002)(316002)(2906002)(5660300002)(6486002)(478600001)(52116002)(186003)(6506007)(26005)(6512007)(2616005)(83380400001)(36756003)(38100700002)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YEeLr/3wz/89p74wNzOI13gXWhbwk0UtvvDTdQ66JwxiZwzacqjXqzuF1bu3K7F5Mh3rg789FBtBjPyLee3PakflqeXsmctaA6uKJb5Yy5LjB9vNMBIsZjulkW2Lonn7QlxlxM3H5Ev+wpk0o4D4MXBdBIFnarDd9NEDCN3GGCuR+Onhv063a4FzF24OJM8y1HRXaOx9iUW8SnGbYVDBonfzIpNlLZhKWGyCq/vJZ4li490pOB8O5E1S8pO9yssBRTDl0uuMzYzgkP7iLyCzTNSkUlgx8qszWLYNOLMq28IwJ658XmdyTq9QtbgvJe1KolY0zJO1KjoPcFp/4EwXoBa/o6vzcTROX8iToVgryQiUDdvZ97JXrRUgYiB9n8z/TMRXaQXCj6C9xzwMotQhtaBQPvitSxZVcHN+/Nor6/SgG0dxpONhu3VcsxubINVXj6WIr454tLmin1gkr4heLl48Wmu8zRKrxV7KkxKw2t4f1GL/9p64Rth34DPmvQh0dHY1u3cve1zfYEW4FRetAdzR87WHfOAkaRG9EQVaVKjLyhALw8u/OuhAimauEDDT1424gekBRD+s/wU6bW1d/ekZ2QLV/abRRwbre5gOdljjhxfoK5ZDFmEv94I1oqRZo2YZJZVkrt/tjG2XK8MJe9O56g9wHI7kQQptfZ0JjOJEGuxtGXJkLX3b79ILZfKKEYJX7mIzOPWJ7XzHBKP0dTG3U9Z9BUIUTHxTnIIDWSadOZzdk61N6mbpOMYcybQYjO6HxY4XtrKlBqS0EgNENx57R9ESh+oAu7n6NEBnGXipGuaSurZg2Pn5d43ZCekp01hFqUx/7F5ORxXUufMN9imDNXuLuc0ipTQrX6hZMehcdC3/jfKoaDYs1I1mAipJRSqsBLgKM4Hs1CGCb+RgYTH7zQ0LJV3A2wdsoMS5GKVN5EotRbBpCpu64PxbZ08r1jDiJ1LQD/i61J1zWxlKTeZ9vNQcXrMGyG9sl6IUhNjITUidwGkZHIB1TzO/Xi4vFQciyUzH2//xG6ri95oHmLANcIdettHepTprJps3slhCmPnOym/p0yFWZ4YOM849ZqOpqBk936+Dle+zveV69NM2efdWNcALSxx/Aal22zYsk5YwPukUMerUIpRDfseYZXdytqx+iAbxOw3darXzCIp5DBtaTZE0HzRvtqwl/p+AkVSRVN2XtrRIUYWsyb2QrMfI8uIu6KrEqUFRngP9PN0UaqkCxsTLPAel87ubyZfwwlzVAm1v6D+femkPxB9GopGBPNhsOOR9r8Pkvyb+l9OTJUilQq21S9uF5JtdQkMGr/zZcp4ZIH46HmBeGBMtfQbr/VcUNV0TYUrKjoh+umidydDOnaNCQkaSeGuiYnFR8sQ6P4Lim8wBIfPXL6qthxjsfvn0MlbTPjB4snPV7w93I7wuXH6ctbZ3MZSeKdj8YSeywxhpoUOdnkpvUEl7N+h9RCpEikANe6vGW/brY3A3eOhZs4Ynmh1FZIQ+NZ25Frs2rgcptzSOAt/TZsv9SLjB8FQjbpDBX+3EVDncu88keZp/gA4qpVvS+h02vpaPTp7+SngZrHWH9tZd2r6sfoMhjn3hCLzmWzbhPhF/rO8ajDQQGCTUCcU0XjqTgkc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4160a3c3-d360-4aaa-530b-08db032eb78b X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 01:58:58.6890 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jM80iqSOptd3JJ5ZjrP7RmcBEeCrjbAgAoJgHQNayo5fiL9DQuQX2asaqOl87Lxa+9mv3LHEnv0dpgfhBycpE0ZC6no50UqrabwL+y0eXnsZKWPF8qvzRFW+QJcpPqm2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB9980 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has snd_soc_dai_set/get_dma_data() which is assuming struct snd_pcm_substream to get Playback/Capture direction. But, many drivers want to use it not through snd_pcm_substream. This patch adds more low level snd_soc_dai_dma_data_set/get() for it, and previous functions will be macro for it. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax --- include/sound/soc-dai.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index ea704d92deaa..f27b33dd97bd 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -493,18 +493,21 @@ void snd_soc_dai_set_widget(struct snd_soc_dai *dai, int stream, struct snd_soc_ dai->capture_widget = widget; } -static inline void *snd_soc_dai_get_dma_data(const struct snd_soc_dai *dai, - const struct snd_pcm_substream *ss) +#define snd_soc_dai_dma_data_get_playback(dai) snd_soc_dai_dma_data_get(dai, SNDRV_PCM_STREAM_PLAYBACK) +#define snd_soc_dai_dma_data_get_capture(dai) snd_soc_dai_dma_data_get(dai, SNDRV_PCM_STREAM_CAPTURE) +#define snd_soc_dai_get_dma_data(dai, ss) snd_soc_dai_dma_data_get(dai, ss->stream) +static inline void *snd_soc_dai_dma_data_get(const struct snd_soc_dai *dai, int stream) { - return (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? dai->playback_dma_data : dai->capture_dma_data; } -static inline void snd_soc_dai_set_dma_data(struct snd_soc_dai *dai, - const struct snd_pcm_substream *ss, - void *data) +#define snd_soc_dai_dma_data_set_playback(dai, data) snd_soc_dai_dma_data_set(dai, SNDRV_PCM_STREAM_PLAYBACK, data) +#define snd_soc_dai_dma_data_set_capture(dai, data) snd_soc_dai_dma_data_set(dai, SNDRV_PCM_STREAM_CAPTURE, data) +#define snd_soc_dai_set_dma_data(dai, ss, data) snd_soc_dai_dma_data_set(dai, ss->stream, data) +static inline void snd_soc_dai_dma_data_set(struct snd_soc_dai *dai, int stream, void *data) { - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (stream == SNDRV_PCM_STREAM_PLAYBACK) dai->playback_dma_data = data; else dai->capture_dma_data = data; From patchwork Tue Jan 31 01:59:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFDAEC61DA4 for ; Tue, 31 Jan 2023 02:00:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id BE132EAA; Tue, 31 Jan 2023 02:59:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz BE132EAA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130437; bh=xoEM967RBCE84rKL8tV+Es7AoOK9qkJIpDJOa31ep7g=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=A6B1LSFE+YSgZ9XqUk3iS7ywcc+hAyZjMCnMW/b6TlV36lbr3UaLbsYHXhIm2zt68 fmI3PVhzA2hB6YH0T/ers50hUNNlf1kpA83ZeWk1lLsKuM8faGi2FBi+14gRSSwtex aggViaK3hgLHLC1+PonWRu0wnqsLrZp0prByF8Ro= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DE13FF80552; Tue, 31 Jan 2023 02:59:18 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 23467F80553; Tue, 31 Jan 2023 02:59:18 +0100 (CET) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2070d.outbound.protection.outlook.com [IPv6:2a01:111:f403:704b::70d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 224CCF80155 for ; Tue, 31 Jan 2023 02:59:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 224CCF80155 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=Dhs+DX40 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FM0PH9h+ERK2oCPd+n3xnnt90lD/j9zrq4qJyINCxjL+i+fOYsLVtPKYvUcrWN1mXqExvJsxphCtZTKOG0mo00B5UQRP+PFjvLkRnkRo6zglNNU7Frlyqfw4EcQj/dHEPKOMNrNh3kYhdx30imPr/eq1G8OqW+idhT2yZKu6/g9vqLJcYnDK2iog1QZFMJbeiw82g0bObpJOCDj1mC95gZ/mEHPd4JcmSA1jkuvJTZPCLVesB3g1Y5z1Tyi4RtKsxoQGM9z3fJI6KQKewnkJb0dhXKB++2qBpD0st+dLWZ4n3L9YOCW1xPg4BOpSF4xCfnvYqYjN87TfAQg0K8Q3fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=08SmPlzFDGfNDbwuhDOrffmpY/DKoELMkOYgxQ6SQcw=; b=MFAi/b8mFZ75m7Q9MzCZxk7F3SE1lQhHA0UG8C4U+TsdSgdUKbcJ+pZqGEEdRgMnF/gBSPlGAPv5GNOLndgFVu+kFGj61lOqq1rd2Q3aAAn6HMpHf6msOdAwj4H8XGhpHd3Y795aYAGOyHAIMy/4PiX4tntkOwN7qfq0wImEzaAqXYBMZBYzBZzNpHk2Q58xBngOvJ8c/8UAfgYRGxzbNM4eIUyLjt3j1POZA5FHsA3d/cjL8JpEIZirJ3QjKK22AuABuCuFe/2k7m6PByr7jimgtdXuu/EvonhYYGTr70cHG71k8k7YEh+ax92E0b1lOrNr6gH+Spg0nvcYPs5n1Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=08SmPlzFDGfNDbwuhDOrffmpY/DKoELMkOYgxQ6SQcw=; b=Dhs+DX40DsmWgdmUSW7CC5CBr91Aek7jx300TkVHZ4EYNNwQVwIk1pk2/PR7ewcKGUb5LB3h1Srw0P7Vb3pxWLWNPFS23U3PXKZp1fAKyU43+R5D9EVdJjJ6nASNX4Vx1O4jxSsVh4SSpm4CuZhes+XhK/8jAHTe8AxOVTxXzdY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TY3PR01MB9980.jpnprd01.prod.outlook.com (2603:1096:400:1aa::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 01:59:07 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 01:59:07 +0000 Message-ID: <878rhjfor8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 03/25] ASoC: soc-dai.h: add snd_soc_dai_tdm_mask_set/get() helper User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 01:59:07 +0000 X-ClientProxiedBy: TYCPR01CA0095.jpnprd01.prod.outlook.com (2603:1096:405:3::35) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TY3PR01MB9980:EE_ X-MS-Office365-Filtering-Correlation-Id: e239f901-bd9a-4b17-3de5-08db032ebcda X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fNvO8bnvT4mLOT6RlS+VWQXvMhcBbjxRYXUH2Qu2lKeNyl7kS+NTwMbHHX5fGiKV0kt61TEiXsoQaWxAMrMVWiKaEG85XpeCUztYguWkTIY/vBfgTkfBxRmEM1zVfDmdsfjLGmUIn7K2nK1MixCcIh+/RqY1+ZuDNbP2VJPZr2zpyTQVw+wTP15Zq20dP+BO4ERCzsGgWyViZZSb5C/tjJmlGcSolknIeBZd9NOlSzgAc1K6gXI07ok3o9lhFEg0cXVLSvEAlo3KRSxsa1cafydpRoeW0WaJupXXPtFJ6AQXrunBKUwVuCeOvnCgykuVsBOrcNaNpSVH/xXMKB0CGpn4Z0j4AJPK+yCl/WokTyx1lQh7JdFphOLeTyoW9IwfNpiXJKSPfsL/WdMEtfO2PaI0y8P0/fPnPXeYjPq2nM9Yx4bRxAj8ATIWBR8jSDnQdh3XZscm3R+EAMiCIJ/cHk/z2OHW0DSybgchO0GVE886kbqNK1+QNa1spdEi7c3s41QeMB3f42ROhEZNQzFTZFOk8eCLdu6DYMSJitB43oVzjhZOcmAv2imrKUvxovEIBN6MMhGsX8lx7E5MIKYoXRcEd8DT62Lb6l9QLRI+JDTTMv5eEfvlmZGtC8CptuKiZNcMfuVdhZALKnvk4AJhzOoS4uP9FqyCHOreYXl8F55HvHfvWeTOCs8cAtKWbAXI4IwXZsnI7rHYrD1XM1CucA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(366004)(396003)(346002)(39860400002)(451199018)(66476007)(8676002)(66946007)(66556008)(4326008)(41300700001)(6916009)(8936002)(316002)(2906002)(5660300002)(6486002)(478600001)(52116002)(186003)(6506007)(26005)(6512007)(2616005)(83380400001)(36756003)(38100700002)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6upoZ7Anu2MCiqr2hUrQZCLCqpBRt0pt0AaCl81c93N9tU/UrZgTzyGWok4PV5R8pEneUvaCWpOksNkJMhcBSIZBE7qDDeCJIsJqU7I1fsY1GTVe1pI8FEpA1qp45qnpYCTFdyQPwNezpZFAKQf90fgIaZaZX2giMM6WigCGoLxKgK0nysn/R557KgciBjJvxkYzZlhpfLakwk/hjtiqlgEa+4C5Bs0jvM6V66hHLVLHo7l/2vz+8aEikMvDtYRkZOO8Chl/eHjDRZl5X0oPHwRPq9Bjf20ujEfWc3B6NYZfPudVLtZouCYeL9XZHuX9lxiKx6j/8OKZ0ELXTPjLjHZQFcaqZnBYpYgiDXKDF9qFBa0BWBJ9pNDUYaFoP3+t9YKmG579aOC1Xs0I+bpa6YPaQJIU895o8lpr7DPyNsPZo0vYtyYoYxMyL2pEyfUHVt4gMW+3WNuuwDFpfnSKpIS4RGHqedIWxfp8muhUVDI0oL8/N5nt2ZUZxsluIqwU1S+8NjEIJ/Q+Xladue4ICH8EZsbwUebBAXHYML0SVCDNzE+8SOSBWTheT+zeTWzMCq5tKvhljAHlX0uQpXa7QfkD1/c9e98Io/kTpyABQs3mjZVR2PcByLG8ILBMZNOjwPU2mc9YEuegTH8Uui+boKoYa84jQMhNlZdm7kKKjGAxNyrs0ZSJSYxWBhOMeDzTc8IqL0fTwx41/9TO09k2V95UWY1YnkKiyBT5b5C1k+jECGteuOVT5O9wnhRQ2ZUAV9eXKVgSW+sCIqOlVbjostJki8AlP7BfhbemMJm6l14ekXov4KGj/fWEWOuNbi6ABFSgIcwH6XXR+k4qQNzwaG8Qv+UnhkOiqJOXMi6+zMela8E8yPBNnBs57Cf+sT9GeWfWnEU36J7/1MbtNmSWaM1/Ru2dpR+x+furlzzdo4b22Ugc2/ZVRs8lniMXkyx1GiQMaeZbaBvEAYrf0iATSvsBpP13YI4DikXS35c5ytZTMFUdvMYtJe86GRnsXHuAUSQgIUOXuv/hSIGEAkpg3Xt8ah87KeY73janNO8RQ0yYjB6mmVYqg/R1AOXG3GjvH6aj9IdgxO6oJxeqpb/gNpPe1S5q69gjJd9BD48wpK7792H39ofNMKSf1KvVRiEc8N+8nDi2PQTvy/qkXImXXVVuh6Z5B0nEtGVsId8Sh+3Ti2U5oLKz/B+OJJWVHx0p6L/KgoRcxYWKdq9PtqtKdmK4D5I13XtCnouL8Y8kqj6KOeGlj6LR6UxbmrXckb9tcH+KbM8f5F+Fk9BAw4ujwTCL6mc8G1iC/bYdv1eAYQvLWxlzsgQmXMTQg072TBtV1KENB1nTI8byWh6uyPyLa998lLMcv8Emajg16Y40dWcPuz8z0FNU8hPkZ4YKerWpLG4iUW9qf2LhnBvt9mlS3o9QWIxnT6S7La85k6VzObYRf5/EjvqPEVmEA0gVUNk1+G6hQhihPFmZnafrrHDI+EMxgJeYq2H007AGZdbWh4049vYfD+10jutukq2ST+StN7HzrJA/HJiC8ryrE44RoG+DcxAmO1o0gOlbOjWgvpEb/ihFc2mjDc8JwMLcAMcr5Gl0XCXUQz/nbKsfPCS0WEnsQp9iBZD9rdjlbxPuT8g= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e239f901-bd9a-4b17-3de5-08db032ebcda X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 01:59:07.5948 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Pq4qWNyZoNow0xgOgeWdOd9yWPlh4LeZNOedyoNdQDQol4nBH/EauxfnPVfnFXPk1htI/gOrr7F/Qio/LkLSn9ycUiNOjee9+DTnoKEbss885e4+ysSR7DWEjv0jVmjY X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB9980 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has tx/rx_mask, and is directly accessing to them, but accessing to it via function is nice idea. This patch adds snd_soc_dai_tdm_mask_set/get() for it. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax --- include/sound/soc-dai.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index f27b33dd97bd..9b18e230e5b3 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -520,6 +520,23 @@ static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, dai->capture_dma_data = capture; } +static inline unsigned int snd_soc_dai_tdm_mask_get(struct snd_soc_dai *dai, int stream) +{ + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + return dai->tx_mask; + else + return dai->rx_mask; +} + +static inline void snd_soc_dai_tdm_mask_set(struct snd_soc_dai *dai, int stream, + unsigned int tdm_mask) +{ + if (stream == SNDRV_PCM_STREAM_PLAYBACK) + dai->tx_mask = tdm_mask; + else + dai->rx_mask = tdm_mask; +} + static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai, void *data) { From patchwork Tue Jan 31 01:59:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648944 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C1F85C61DA4 for ; Tue, 31 Jan 2023 02:00:55 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A4B5AE8D; Tue, 31 Jan 2023 03:00:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A4B5AE8D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130453; bh=cnZxgJOpDmkVmBcM2TMoQnU/cr23c+Zkl91FHP4lN5M=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=j40ko5+ELHJm4e8oPNS0n61A2nQSAdQBp2mIL5m5fbFh5myeSuiVHGnWhMysNvyOe ySMH2Hq4I2JlJz0SV9x2DyGVMlMeFjPpSNX9hGmtcRA3kW0n9Jz+dyN+kYzkEtLULP vESXLKtSrfRjcoD0pi7cvVh/31m29AhRXnqF3NRg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8FE3CF8055A; Tue, 31 Jan 2023 02:59:25 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 25AE6F8055B; Tue, 31 Jan 2023 02:59:24 +0100 (CET) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2129.outbound.protection.outlook.com [40.107.117.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 95DEEF80553 for ; Tue, 31 Jan 2023 02:59:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 95DEEF80553 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=UtTzhaY1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cga8T+maDv204CM8v1gnBgqeq+DczJ9Luawu32nOmG8vcn4Z6a2QUL64xfAk6sJUTMjaXeU1Ijcuvkv0roZZIjDNZ3P7SLpNWkwh9UBrpPbqAdaeLRahyGaoqEMOIbCKALuc+KFkCILx1wRWgPO7Yt1fbBFLlvIG6HW4agjncaWO757K04u7NBpu1f0aW1HRKIvOjOBBz4HcAO7ZnEGddLnrz3RwIzvJc4j8bpEqroNgFpXk3G/aZk+W3ygdtN/poITy53LDKGJsAs+QstTeG2BmrhmqQbPR54q0PgaNfT7cx5LA8xOLv9oSPaoUEoSd5/W7CSpJ1R1DXQ2UguJ1bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=InVWUW6g4FGe1LJnTolBTyS+unFt/5azc4hxxvd54qU=; b=S63+Ev6OEO82oZD9lfFrK8Oq/b8Oj6WvvU8gQW1M1NJULuzH1Ur3yWBUZNYs+e4GZsv4THYNXlCnk5HTRQo6eL+ETkmhVnIsKpV5he6DPhxFEZCBA9sqmzvmlmDJFvkUbSkAf5q0WGBb4qZpoZ9r0N8xltVn7+9v7AzTLsQ28VCGOgnKUhojZkUi3t51T2m54Fj0d0l5r4b2tR/5K82sK7Xt6MTQhM2q6cZ1qbT9bYZuBPv6bhOyuwTj8L2fRfrpuQLscTqAUozmtwmD86JhADaBne9o7Cgiy5N9OcOD1WDyt1aD4pvwmEGVbRLyAYdF+NZCuZZB2kDtuIVP8qXhgg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=InVWUW6g4FGe1LJnTolBTyS+unFt/5azc4hxxvd54qU=; b=UtTzhaY1KT12Tha+Y9A55vrZLs6PqiFceqDbcR/RjTkZqml/AaKiroK/oozPN7Yh3gZUH5kzS1MR1KQ6QmCbFjvf9hxPn2GoTHOwzr65gJ5ds9P7/r77f7XdT5bOMtO+EB/ZkN77Dm+FjMRHXf88CtJyB4feAq77WdEDTwXPGdc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TY3PR01MB9980.jpnprd01.prod.outlook.com (2603:1096:400:1aa::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 01:59:17 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 01:59:17 +0000 Message-ID: <877cx3foqz.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 04/25] ASoC: soc-dai.h: add snd_soc_dai_get/set_widget_playback/capture() helper User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 01:59:17 +0000 X-ClientProxiedBy: TYCPR01CA0148.jpnprd01.prod.outlook.com (2603:1096:400:2b7::7) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TY3PR01MB9980:EE_ X-MS-Office365-Filtering-Correlation-Id: 71667099-2f50-4039-f1e8-08db032ec2c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EwI2YhLIaq1Cy5bOO+QfmuxlByUH6UeT/wGkZ0FFoRA82kUWzZ7oinDiLrfB6Hl8CfTeujXuMf3CMHgv11euCsbA83qr8iepa6P2LZbEJ6fPyjDA4LjO/46bK1E+Yw+NPtgMFqk8eX88bxRuqYSON2jLISanDvD9+2xk7FDHW1QwldU5RawGBd8BqFakS/m1LvzHh0ezJbAI89tCk2HKgf2l3zIhUj85zTZvehyd43OnC3dnkC9G/jyrxPMx+1Tyl4btzFr0J/Q5Gpk9FKMkh3jsDQB7o0rqCyOrs69omGGDP29vVrn+Mq4JFxorYNzbBYOG4vSUFsuk4OqyuPeO7KakFdtg4x3VeESLSUuUT+bDPYs1o15q4rfj0fYN4B3pBCCAJh3TvoBFCzPWJePHr0VXMtQr/aQOKgMUviLSXdHpeeSvxMzhC0Ig/opys1c3GJ5m7bE7o84+rbKrW4DrGPJA+UnSCxlR3upYn9FLMtDzlR57u/6sDoEbHhCr58CmgTaKbcXoRaej+hnzMPq7lke0wFHQAL/3qFqLbRMQRBxXpff+WtixT3ZnzO4YnrDuTraOCem5gf7wHzMLvYrswxZqTDnFULXrcJrWCRclsVmYVSSE6dUVT8lCqwtL7351T/+dzdJTd2DQZp/hFssW8OkKZMr58KTPir2zJ03tylfS3A7F2+IpYO7mJiNq4lHuTqRsX+jFtZcIGAhxqLwuTA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(366004)(396003)(346002)(39860400002)(451199018)(66476007)(8676002)(66946007)(66556008)(4326008)(41300700001)(6916009)(8936002)(316002)(2906002)(5660300002)(6486002)(478600001)(52116002)(186003)(6506007)(26005)(6512007)(2616005)(83380400001)(36756003)(38100700002)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: v4kwPBmC5hxnOdJQTkcsWOgBRnA8tLlRKF9vk+qEEWPS2blmyMSjmUxDw+8TVKpHFIS+H1YCn2psZHf7D7Voc1twPQ3dNi3tHuggRG/2jf/CT0+q/4DXqUDboZ1euYMy8uoR+tMKKCBWoK3t72SorMqpOeFo1+Oa2QldLdtrql3vXVU/HjpNLbwqiU+xDpuly/bhOUYWiZC1PPpD2CC1aEAGkrj0x80r7Kgjw9axoaVM80+RNhVs4tmwg2Ku20javNfW6TbdmN7pgunu0uBfsH4LyHhUH9Cc9cimtZ9TAfqi/2yOuVqIkrKf2DUjjBIvtxT1pjBBmMx1ZbOlktp1O3CQPCX0l8G3BvTF90kfkANXWdcdxWFqw2u7Qk4IaIABqwWyhUezajKhJN4+j6FtCe6dAcDuE4DVc68nDsXNsngW6bRCupFvMas0rO1W5Bmm1hw66ApVZgHBIFMq44HjKqWfkEWyz0f3RwApx3eoe+fu2ZBcrF8XwP6W3/OlYW3JB9J8Uf8ZRkow+25g6QJSworqV6vboVO8JkryMEGxw1LrCIVLMtziAr3TWlenIxk8urq13xSenQPfBTFTAjRLRO13ldEdvxiu85d1Lm99HROCGTmzKl3vKGJHgFhyXxi6didXTPKhmNMr/Hna2yL+LqhAPmJdmbiJY/QIzDFuCRaUv9pLAn6sJTCFcIh3+e2mz1pFilDc2u9wjMwEoAIECJajgNp9KECt6p8H2USfUAZ/kSavAYttiDfPo2OHWqGU1fjtTkOV/wt5BA9nWhx+cv8vSOUKFEgvSSeQ/OWO7oSbGIZasDGfK10o5WNAuAbyuw3nZOnpsgVq4ogA/GcNfputKwurn1nzd4JAT8owSMWTWKdASRCVzWux6CDH3WBC6xWVWW9A+fYBQAEM/2fzsonfMgXp4cdvsEy45s27cWe0pcGSLTAqqmafn81lcXsHjWW4Q10U+91G8ISCrEktyJixrAJvYgc/AqXZpPyablg3Y8mukFu5JOQ8QX85hC+J5zVSOR3nt0wRdRRx6fRvcJpZYTXjr8eEpyFFCQ5fgCl53yrYbxbpFqFE1lKEUHVMp2K5O60ofAcH+pPTkh2cRGhBJ/PutpeOxEqUiN9uY3l3os/EwM5TBbhyeHRsQthRWuJJDNHKVlrqrhuxfZANubuNEeiGEQKRnTIOmHf+oO89D8Hs2+ZzShaP0h2Js15SSQGrlZ0cNSLh/kIQiD6KXQxDwv8lN68yJ0zVwKrcAjKn/J9dZUhJMH54HImPFVrP7nWib7ZOHPEiSuVZG6UiuZLiRhs/HcogK5ABNkkYBcZ7VaIukgQhncVke3iaTAM0rTZ/EEjdfB+16MYWEfp6u6FvINoDEQDcJNorkFPmxwlgcHpq6Jzw3uOWsFtffhfmGyH4uKZKEBN+dxbYqyRIlX3iftE9UUnHseHLhPAerSW3qXouOvIW/3jo3g8UGw2DWhkb71ACb6BI9VifGE/i9od9P/3H8ZymHsVSBN8EEYERX0Y3ueaOr0ONtLHBxiTIL7uWzjTfvB8W25N51bYhokuUYTeKBUIUvNtHzDs898d94w2aVYfz3lSbjXwEt7kLZstwTLc6zfj2xKwF6XuXgqx/Whc7TmEcjC6P1DDGYKU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71667099-2f50-4039-f1e8-08db032ec2c5 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 01:59:17.5438 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SLtaKo3tc92FK7Hz5wUZoMsGJvsDT5+jsgflo5hLLhffMpZe987yVBEUO1sPl7YcpoJXrbkJCV6Gwg2F2WBNFoL8oW6D4D/0WLWEv3zfSywlPLuB1KkVaqVI7Db6SDSb X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB9980 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto snd_soc_dai_get_widget() requests SNDRV_PCM_STREAM_PLAYBACK/CAPTURE. This patch adds helper for it. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax --- include/sound/soc-dai.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 9b18e230e5b3..197dc1629708 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -477,6 +477,8 @@ snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream) &dai->driver->playback : &dai->driver->capture; } +#define snd_soc_dai_get_widget_playback(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_PLAYBACK) +#define snd_soc_dai_get_widget_capture(dai) snd_soc_dai_get_widget(dai, SNDRV_PCM_STREAM_CAPTURE) static inline struct snd_soc_dapm_widget *snd_soc_dai_get_widget(struct snd_soc_dai *dai, int stream) { @@ -484,6 +486,8 @@ struct snd_soc_dapm_widget *snd_soc_dai_get_widget(struct snd_soc_dai *dai, int dai->playback_widget : dai->capture_widget; } +#define snd_soc_dai_set_widget_playback(dai, widget) snd_soc_dai_set_widget(dai, SNDRV_PCM_STREAM_PLAYBACK, widget) +#define snd_soc_dai_set_widget_capture(dai, widget) snd_soc_dai_set_widget(dai, SNDRV_PCM_STREAM_CAPTURE, widget) static inline void snd_soc_dai_set_widget(struct snd_soc_dai *dai, int stream, struct snd_soc_dapm_widget *widget) { From patchwork Tue Jan 31 01:59:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CFF0DC61DA4 for ; Tue, 31 Jan 2023 02:01:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 55778836; Tue, 31 Jan 2023 03:00:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 55778836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130470; bh=vBTOQaZ49F6ANUXrzwapNKExAQIm8jWSCaG1V/yTnVI=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=JNrZ947WbatEMAPRnlS5KyXBcrOSKxQNetRUQUf9P5xZIgaQw4+VZr3rTlYHv7fS6 HK9LU7Sd5zP3vFNXg6OuVrL56h4K5/wbj1O816pOVWjszaymQRBp1anoqpcLALzZ0r qOogFo3AC3znim4FIjL3OUJ3KC17PtPA6CZce72U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 2C58AF80564; Tue, 31 Jan 2023 02:59:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B42AFF80567; Tue, 31 Jan 2023 02:59:33 +0100 (CET) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2127.outbound.protection.outlook.com [40.107.117.127]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 841E8F8055B for ; Tue, 31 Jan 2023 02:59:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 841E8F8055B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=XaHhzhUF ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yd9DW0nP6HBx7LHvqmRh/sPLT4pjpicVT9kV9T1YH/f3dDvruF2DgeXEbl+ajNy6XccMbZUuL79xSZZMBoqeypHKuXdljxmnrMRXFTjeRkAly1QeIBPnzzFsseiUqxq7nghphwqb9l4NMTKj5L47zbFlrV7Du70132cC3o4J8A0YwkeURk7dweUxbyJNOWJLZiNW9wHtvP9Ut84AVG8dgn+IFTXYv3Ff1fjs/8ZBjjeGo3q1Sls8Qez7AdVVRHgIgwRqXsiqgNUzrb/XcZH5oeWWu4afW6Tb4nvsFJ+PdSk2IXyFbdDJyJlXYTAGtD27YfHZMGoi3y0dqwBgYRHLLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b/fZ75kVDHBU1wLcbZHXe1AOntqNjN8UwMjt0c1H/XI=; b=e969vVd7slspT1Gmxe1JCu3zhVkvDyP0mFp3oVs9SH9+bPHTllSkeOyp5eKRonDzYMc5rgGioWM4M1Z5R9AG43iTOEfhD42LY4f2/+l7CzBO0tEsDEzeQaV7otmhNwYaxSj4mGG8MxYD6dKgAbHjkKxHPiZ+1/qZs+a/NMu0hu0OtmyGx854+VlN7lbaYRKb5+Kr04aPgoA7wezPAIy6CgCLcXZa6j5ninXzwjLy9m2+cm1dv+TPE3q6hYNjf+M4p4UXw0s/Rf+5AEig2YTg0t28xtUy1lGciP/JfFVctzkcuzqVzk+22orHEsd1UQOQjuClnoamiaRO0Wnj4M4N8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b/fZ75kVDHBU1wLcbZHXe1AOntqNjN8UwMjt0c1H/XI=; b=XaHhzhUFM/oYh5+0Wah8anK4hgLtTq8qg5BrB9dk9EczzvS+hIOzDw9DqbZnoPQjf/FpZEGRcV1T+fHxOQ0beEQDivBm2e7ha+47GaEnTEg7lQtWTC3bNVAXhasvk6l1HvTlZk5+WO6l0aB4ieFC0/1cPCWJZ2U3vzmKCKqkyQs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TY3PR01MB9980.jpnprd01.prod.outlook.com (2603:1096:400:1aa::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 01:59:27 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 01:59:27 +0000 Message-ID: <875ycnfoqp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 05/25] ASoC: soc.h: add snd_soc_card_is_instantiated() helper User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 01:59:27 +0000 X-ClientProxiedBy: TYAPR04CA0022.apcprd04.prod.outlook.com (2603:1096:404:15::34) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TY3PR01MB9980:EE_ X-MS-Office365-Filtering-Correlation-Id: d9408cff-614d-4524-e171-08db032ec8bd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g4xf/1j0zbinOTGJlWiSRQfNsvYtI7oxFuC3+7bfsHlULwJ9wgQrvL6qxeEZlrfkxrNYNZ7ACfcDODv/6QO8fx07xXOVBxChTloX5jSlKj7S8ygxkEPx1ELa2J+gI+NS94m5ZmQ3Qlxw7Do3Czve716hDrSsdpIJrT0u7kM6oRhAqcEe4EqbMSK4pvRIbDWEqzCAR+SEGCxsT3brwCltDwVxyEMqQRH3f1/4PUPZjP16GHINmiUoFAAU3v8ixPkdAJSeQyLCA3YnnlQCFYnbb6bpoXfbs0g9eD4XvdwJjm0AZ7kMDjZ4VEMBJJ6x1Q+2xYA9CypgOUWX/bQC2WE6H5U5BtdZgYSR6jo4PN04i8BXV1y1b/f911rXPbHU083xczOW9IJ8hCIjhq6tBFy/rZzqGXjm0MnUTP98VP81zeWN6L00cAaw310iobIX9WT0y9h/84/AOULH3ewWfPygoLwVbx4qH/djbUiwg60QvKtlCC5hHgHuWHg4Mgo6ISKkmB5CnWICbifrPNeFcevMs/p5h2LJVNMhnabDBJm7L9ISm9v5AKqy1k/UEGnXLEXv4aIycZ4fIz/Ukeq1Tz8w8P9o6cqEOBXcvXyub8yTrWR3dU7NE7SStpZE2ay46cacT6Q5hiKHgd/Ozf7ANFGe7CEkoZ2eS6arwuQJ8MmKaaWSxv7LkDowmROGYzZehKbxyu//ATxQgRXBcHTTLWtUAg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(366004)(396003)(346002)(39860400002)(451199018)(66476007)(8676002)(66946007)(66556008)(4326008)(41300700001)(6916009)(8936002)(316002)(2906002)(5660300002)(4744005)(6486002)(478600001)(52116002)(186003)(6506007)(26005)(6512007)(2616005)(36756003)(38100700002)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rLMDsdJ2C+LI8hjGkHTv2d1GLFV93dqq2wEkVQ/LFXzbkQiGYzhL+W/b7CgiAtn03Fw3zvKwOZ7KPdCshqVbHgcpB2Zpm8PYfkFg/JCIrpY2PY4ffPzvcXdXk76Zhb5BfYgBnzkNlIhwhAmmIzJCPR4+R8TYLYqWDZpr8Lf2bqVRyYbaqTu13gLVNPr0N4nn0mSrM676zED6rNJ42Cie5O+8Yztw7moknrrXcfT88zMIGUWKLv72+gcW9Yv8k0nR0I/J01GJtLUjhuTXYJ7J9qfImT9pAc3Z0Up1e214ig8eNrqhzyebaExheLwJ7xEvagyXGQUOUIGTajoBd/5EtRMmx0sT1tkp78nKFiLVzRdzfRDnpH+udHLVNWTEon1dqQkarptUyQfKs4bn0cAy479HOHmgXmWxxCx8ASr6fgE5Ow9yeY28C8wj9Rk2hLduJpZ/e104tkHDdJmFIfGrz+XykHSV/9urgW4TxgA2VCBI8sFjw65fuxZ8gRMIb9e9XHVzgHDRTj0E0YuAk3A1Z0BDExPjJqinHDn6SsYhOB0lIi+c1J1BAcxJeSAEEGUiCaVG2wj82Z9oHesJipGxr2PlWdOPjpgc1CdpduRf88t7A5y3Vilay+2WzUL1KV3uLtaaNRVWhQvCDFg14FssXTtnlB078f0FIW3CMZsGCY47XZqcP5p7BLd1/mjik6s5zAigeeJn44mmw7dQkum7Blr/93Zvh8KtpuujdZtRB2JOxP8z9iXqyeixDHqUNZro88amObylFJ4h3gxIBV2XdfJ/yO191DgsNdd4LtOVPxnorQ+SntIraVRIGOjC+AjtxRd4Zp2g5KEvkB+apuqmcsy50oeWwG/mkdyUDqRbE+3So73RS2bV5G59v/hjwFmmxTbzQrIkKTjE68CqPrMBXK5fIt5i+C7UK/eTlvGAfYLs83KBtbntf8JdhI00b3QDc6heDvPWKBtJQmIMvQyPS+sFfww7Xj04x/ze+TKqnrvbH1SvhvntWHdnxE9cyxjpUjT5NJnNWAujYgfRHX0Fmn1A7dFHl8zDaZ68S9mL4KYI0TQ7z9v5g7+NJzOQnr2FvNiFHxJZAlKjx74FU4jUCuEu5AlId9GPGPSlA//9iacLjaR8hrZVeowSp/JkTwAIGWvjmRFqH/1CeraHD0U/AGagDEjj1XkIkeLbt6kBQ9hEaWEwvRHaQyjYDIcBBIPE/wOiptD9bFiV+4II480wFTOP2zfGHqkqUEFk/P1Lve09EBERcfTkaOq+KgC77rnPckd/SxgzRMXMWPO0nL5w4QWigvZQvgcwttvr0NozxCsrIddjnAKewmCBz72Sm9mjys2fWGVaSrNpE5FWF6o7UCvF67inhvS87hcNQauqG8YGjNXcgP2NAqs7KT/71/jND9TYe5Ddb0A3jSj56j7rewmv9DcOORoWg8l1GkYHJVXs5kofV7yEHvDDkjCX/tlCTXBwR3H/67csKq4S6Bg8e4WojSFQTlwEKZUEDAUWZIZs02yjwimbVLUS++iqUA9KYYOn53ikOs9EOG77oskFRjZS6KoypTw8jTKH6mH9XTCuah09q1r2/EazAVzQ4ek7FINyFPME3d+LauoQ2591QGl8K7wPYANO8N9xBotDIdk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9408cff-614d-4524-e171-08db032ec8bd X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 01:59:27.5260 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gKHYqGgVYCfUDGF4/lddT7V3bf9wGryAqtMGGj14fTmPqh4PoEKgEuOHiGLycOBOwA0jKrIMHtpINoB9Fp7UUtlZkEMAKYu8NpGezJB4Xy4MoDzEb7cdpiorILPN/X6L X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY3PR01MB9980 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto ASoC framework/driver checks whether card was instantiated every where. Then, it should check card pointer too in such case. This patch adds snd_soc_card_is_instantiated() for it. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax --- include/sound/soc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/sound/soc.h b/include/sound/soc.h index 37bbfc8b45cb..e58b43b5da7c 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1052,6 +1052,12 @@ struct snd_soc_card { #define for_each_card_widgets_safe(card, w, _w) \ list_for_each_entry_safe(w, _w, &card->widgets, list) + +static inline int snd_soc_card_is_instantiated(struct snd_soc_card *card) +{ + return card && card->instantiated; +} + /* SoC machine DAI configuration, glues a codec and cpu DAI together */ struct snd_soc_pcm_runtime { struct device *dev; From patchwork Tue Jan 31 01:59:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648943 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34656C636D6 for ; Tue, 31 Jan 2023 02:01:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1F56BEAB; Tue, 31 Jan 2023 03:00:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1F56BEAB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130490; bh=2fNNpSfO24r+GmKD76Pbiz/ETMMgq6wF0jWrKVIUeL4=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=psupm3Vt2TFLoFYy0fuy0mtt/nY4MosFEUHJL/ahtGykTeKK8GPWJw7rD2boHJDUf UsqGacGabpldGSgaER9k2mpd3yI3rnXORVynJ2kzJ0uJV/CQ7FvsfvsbcZZQWDOffB LPgavrCGxJJ5wQPOejVk9zSuVho6jOUU53vJgxl0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3CE8EF8007C; Tue, 31 Jan 2023 02:59:53 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E2E90F80496; Tue, 31 Jan 2023 02:59:51 +0100 (CET) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on20729.outbound.protection.outlook.com [IPv6:2a01:111:f400:feab::729]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 959D6F8007C for ; Tue, 31 Jan 2023 02:59:47 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 959D6F8007C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=e8ztCa3K ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n81Hlm6CBDftctJcA2N168IRc01ZbcCkmms0FQGnprZWGVmGZc0um9jGM6tqzJM9qlUhcfyQdS4Dy4uyzHQ3De52RxYcIEed2omct4eLRtfA+Eq15rs2XYT0USBbVsU9WszIHHQcxm95GXHWwTrpYtWy+jOQGyMji3xJ5S9Y0ucH+CNns6V1QEFxlrNG/hKYDavtx2d1JoSOz5BW0zYDFv2bZmNHPtruGWScT3qNfa+JlN0PIioabIK4J5jpKL6/vB4iqPqy0NhO/ffxc9TrqcxEBOO1mtlm/fGtx7mnjmz0hxu7fNWt6nc5NT6m48yg384qLoXpuuJ8IBbgNBgzVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=o+DHAC/qAHFuTBfjBrmASsqdMC94lXiyUM2PUGJLHhM=; b=adfdy2r39r7l4sBW3IPLeRdiAFeIOzBP5cU0Kc73GNn8XxGj7IY7DzkjcnXTuPB6lWAbRAKR5tE9WSAbFLVF8vbremlqERw/z9Lh9iOz/Zi87vlnkgeDnzVOSZvVdY8I/o9iPJsdRI2O5pv66iV2c+40dL2XSzXN8MsFEs2o5OxIpK535LyjLxozeULS1dwgcQrTRJZzigusEaW0LPPPFaT3SyVKyss1hbnn0LrkJI9i6BezU+Bz06q37/hziDCWiBihL8qQX5myEtPVOfcmX/KJhjm85kT3uQLUuBIK8qlw9ZOlHSVKr+vnlETeezy98pchCfoRwn1uZ4xptqJ1ow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=o+DHAC/qAHFuTBfjBrmASsqdMC94lXiyUM2PUGJLHhM=; b=e8ztCa3KRxBpVxX9jjP+UMw63aSvuI0RZI8seprW8MM9AHueGs7jQF20AkiVAX4PlaHAdy85mEsxA/7eF867M3t9GiRDFAkNI8FcYlb26DqFZfjBsXboxBVzyppifBZhiP/5vLdI7UViqu73zWxDoo/Xa6wADbeuFky6TAChCxM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS3PR01MB8196.jpnprd01.prod.outlook.com (2603:1096:604:176::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 01:59:41 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 01:59:41 +0000 Message-ID: <874js7foqb.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 06/25] ASoC: hdmi-codec: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 01:59:40 +0000 X-ClientProxiedBy: TYAPR04CA0023.apcprd04.prod.outlook.com (2603:1096:404:15::35) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b187618-a5e8-4c25-ad69-08db032ed0d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SYPRKmZZJfDv0TNeEGbMlKHVKdYqg4abhaNJVj+4eRRPpZmQNJZw/iV3ntW3pdVZ7OBiOdOQ0g0LI8BOO5z4v32d409VDu6X/WJPb7/dFkgyjnx8ylEo7nJnvzGig5bXKGd2dapZW9XFt4TE1F1k16cFcZIAXdRtJ+LJXuqcNDkzvpNRnIAqrMI0DXuw2EK86XTMOv34uApN2mO8/uo6PnwfsjMHtXT5JIMQeHCKU7s1U0v29EjAPmYQm+vKxXyF4CERPAUpZBe6TOcNZ/79LDKosmRWae8HQuenN6vdyDtnB7LUUCDJDCJCN3ZgszuTZJ0bmwJ5Ugs7ROdO/XcUxzh4n5IxG58QVpIFXR3I8BSwMGAZQexcY7Zqse9LjU/Jffmv/41MVimntd+vbiESHgNXMtx1qVIPH2tvoxeGCbWXibw97DuAvaQHfZye5FlnFxH3wtqfxt2O35oRbBySJfStNIVE7kTojMkAsWDfaQtrsLFnxwH7UjvFZcTw555v2k5O+HiHdoMJPyqm7cDvpB+uhLscglRZombFaBAwDwnI4zmGj47lgLS2XbWEznTk/toXQMu5udVCEq7o3MMIxIh24S/lmbpP8yLik8yiaa6+drkvSYPcb0iUNqT8bAMZJ0Q4rzr6GRgCrl6jBEd3z5sv3lCFnagWrPuOmc+2kQv6fwKJZa83sbh+7YsbrQTaAYgszFWWjdyWUTlhZguQBQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199018)(8936002)(2906002)(6916009)(38100700002)(4326008)(38350700002)(36756003)(478600001)(5660300002)(186003)(6486002)(6506007)(52116002)(26005)(6512007)(2616005)(86362001)(41300700001)(83380400001)(66556008)(8676002)(66946007)(66476007)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gpRfTNfsSrAPBV0do3i9jMWiKFY1HMl5wvJ4lCDDih6t8PNTgLUYI8TumRUrsfdkIWMaIZEpSoKPpbtd0bro2T5gkDqV0ZEwJoZSwEKkYtj5jv4EKmEeQzQkRW+DHKCQW8JSu61tl0awNajX4FrahSuZBFGt7CsCKfuyn8bbv/iaXQcZuTPSWnZTDQsUB5t6UODid++pc8OogCDcEEHxoap3Ae7YLGhyVnvBpXMGmXhDSRU3f5E2ZSs1RKpkE3h1/AMsNinXaWzvqybt+UK4cE/mVLjQSaY5c+nrKosF3rEjhQK4gpS3vD+g5mMjFDxjRkUzdcUweKSR6LMHhRuBmVf4X++txHzSJwk9A9d25c7SRpvdM8vHn7nvNLJOzFT2IFISs7pte/3Q93TrrCguYgWoICDQ4Ip5/PfhYxdlDLy15Kn8l6iDLS9AB27HmWFo+xQdV+Z9sV4WfAtjelWaWG7KzTyBADz8Y7YClp6L7wwTR2Y2ALIUNyCwhT+sEjH2qAS+OdHiGadQq6OpIzDBJNC1Ca0QykjS4RZfCFN+4T0gcLei7OnRRQ6wcBUDqB/Cc5/UCbo6JH/lLMcWZCwi2oQrRIcOinMidtO7MfPkjWggYjLEiGFkkRHfo4Du9ygbTKAt9eLxZ8z/ByhljWqdizpsUwSK30Wezi/9t2EwDJb8LCD3lYJTEUZ4xzf4FJWs50Qn36+4qG7D7sjRNQe+lWiVWjvBFFJK41559Zntzt0rveofe4mRTpM14iaAVAhYZHWneyc7wYXDOgPDBl9+ib1TqQ+LvwT19oeaU0MkNJONDofJvvDwAsVG6D6MVIzjoJaFHXHMHKqQevldikyq7j7XwcUfHTlbFj11zYlvtMCEoHKpXyPvvrtf6q7HUx4QmNJZ8Ax5iQRWUpt3YlgkVONmwjljv/XSy1JYf6pIBVeeR2IcFGtm3k8TRQf+ZWRGrBfdIb4hNptMGicBFyo56LJALWZmey9is9Vl2n+8jkn1vM2wpva8SwCx5urKtlI5NOUd6IsKjibRoMntI3sRDNr3xz25YQWxz3GsWrXQtMrZ6Dvy6uu7aLTGxCuhOD72ipJR+8b/g0V7YuQglkFgV7YgOXjWKhfbPuZOV1UEgkCDVif84BcEkboGJE1yAHnJ9H1ZXZ9Zyt2H5y6POdXFdQNQOg4Dht08rgCybvtFJ2LEe/iuVfpj4lQPrLV3kOvdHU9YwxKkT8TpOfABdDOpxkmoE9H5rWYRUEaCskh9FNGmey5qK0o53Wzhuv+6bVxbWtLXYoOAc1ABwqHaovsFcLKpZc4RF+xI4H4cdTAP5gZjG/YQwqhFwaS7F1LvdjHMWriDzwJwgjgTxr3SncqNyejakluhOpSc3iwLtq2OfpUJEqDtYq7h94U9/pbbbgXrrPiWuNzM2VTJ1Vdsy2HY26ylRlwesHW7Rb2lckgeEc3+2KVdP10kcD6LebqaFaXj8rQQaBn5NvsmFHwmgv3XpzODeVk2koVRQlL6/kFcZhpzlU89H96JiHqDz75FIZPF5+cJkiC9n4+tXnmAcWLVysmr3+9LsSwESTfG5jCrabPk7H3YNHRDS8dbB52Nr0QjBzOVB6WHZRy/wmn8Or5y/nFDuw6HHoKS2NFe359lnyw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b187618-a5e8-4c25-ad69-08db032ed0d2 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 01:59:41.0840 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ckFPmFySIJ9N3m4fcsQYYvumuNHUw7eXQf4WAKIgJsBxKZdsqeHKpSnKyHkDw0YXN+/sLPwFvjB56SyOEXz3z7F7KAbFdkz2FtWLXVxNQXnjjXapi1/gC/aK9G/dcPhY X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB8196 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/hdmi-codec.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 74cbbe16f9ae..01e8ffda2a4b 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -518,7 +518,7 @@ static int hdmi_codec_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); - struct hdmi_codec_daifmt *cf = dai->playback_dma_data; + struct hdmi_codec_daifmt *cf = snd_soc_dai_dma_data_get_playback(dai); struct hdmi_codec_params hp = { .iec = { .status = { 0 }, @@ -562,7 +562,7 @@ static int hdmi_codec_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); - struct hdmi_codec_daifmt *cf = dai->playback_dma_data; + struct hdmi_codec_daifmt *cf = snd_soc_dai_dma_data_get_playback(dai); struct snd_pcm_runtime *runtime = substream->runtime; unsigned int channels = runtime->channels; unsigned int width = snd_pcm_format_width(runtime->format); @@ -597,7 +597,7 @@ static int hdmi_codec_prepare(struct snd_pcm_substream *substream, static int hdmi_codec_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) { - struct hdmi_codec_daifmt *cf = dai->playback_dma_data; + struct hdmi_codec_daifmt *cf = snd_soc_dai_dma_data_get_playback(dai); /* Reset daifmt */ memset(cf, 0, sizeof(*cf)); @@ -834,7 +834,8 @@ static int hdmi_dai_probe(struct snd_soc_dai *dai) if (!daifmt) return -ENOMEM; - dai->playback_dma_data = daifmt; + snd_soc_dai_dma_data_set_playback(dai, daifmt); + return 0; } @@ -891,7 +892,7 @@ static int hdmi_dai_spdif_probe(struct snd_soc_dai *dai) if (ret) return ret; - cf = dai->playback_dma_data; + cf = snd_soc_dai_dma_data_get_playback(dai); cf->fmt = HDMI_SPDIF; return 0; From patchwork Tue Jan 31 01:59:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D8D3AC636D3 for ; Tue, 31 Jan 2023 02:01:44 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D0EF7EB1; Tue, 31 Jan 2023 03:00:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D0EF7EB1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130502; bh=CTcchOkvpob68bMHwkywSzJcRpjmweYX7cPtxyy04Ak=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=fOQljNFp8+9v7pbLBzmfZhAnaUdK2HRfsRENjS6MfuEsUJ4OFIqYWqRSLEnDrUDRk XVd/XFLeDn5kHb/hAG/Z1kpxXMET35oT4rKB1DsUT7LtMm3z/SJLogoxq6NvY3gold m47P/IP00j8ZoQhfnjC0M3hfNGUAVldNoHkVXSn8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CDF74F80543; Tue, 31 Jan 2023 03:00:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A1885F80548; Tue, 31 Jan 2023 02:59:59 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on20728.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::728]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F1AC4F80543 for ; Tue, 31 Jan 2023 02:59:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F1AC4F80543 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=V5ajfj7C ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gCFD1D0q0pT2f1gmUlBUVAiyHhDFiq7HqcmQFGYe+TBrKvcaKM86EGY96xiqOcb0o25hvvX+FeDpYSngtF6LUeCHvjfN+hoi8wKUsXSPfq4yEZkXdeNAxf4Vpmwc60cm3jtUHT5O6OQ5W7X5OlBhswBM6Da8mYWBpfZ1SgcSPoWke4D2IQsUGM85Xr0FR/MH/nx4J+2QT6M3VdA1Sh7nDBOApV35AT9cZDGCGyvM7y9raOoZELxqKy9TcmmNW5LzokgDuYXcJcyZnsB2ocjgaDDVzcQeRAJ/uvD656GM1M/nvnp17ql55U+pa6pLcEhqzJPZ4ozZCdNcwJSQ6zEkCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+u9hi1nudyRG7wjvm7iVKYDkzLz1mf/5KMJrRb66Lyw=; b=QT3yXXjg/rSnD+W35Gl3R+pBA4p93hTlQ7QYQlsD43bvx+/xZ5p+TVBShrZN3WJ/fV3cAWK8ymkrDavVjJ6IfbbKphwzxIKYLPKS5DPDNbag3BUo3XCeAVX0ntor3EqevATEKBAOfciu0Al22IEBLznHeTjsTrY/Zyr5Zbz/imp3fWTnZMd/N1+2fRvqzhIhVUBNq3nveomm/FGIipq1L4XL9Yq4WbP/XHMKvt7mZbPBMNx5zY+tTquL1E6JpRifPX8D0d2fbn6IxbhHLGZJPCzKmTZdPIPtIr6ik3OKbQibfXGd5Q3Zcr4opKbzX9c0NOYoF6nrEGw1Pv/WdsO4bQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+u9hi1nudyRG7wjvm7iVKYDkzLz1mf/5KMJrRb66Lyw=; b=V5ajfj7Cc4QjZkv6oOv83fKkiObbavNIYDWO4SN9rgtjjYA9fmqprvPjYbPbKK7huddsJ9pPXdcw0YFGiMFRVSF3oGw5NFcfjI/2IPnAemNINxuUXDGPiR+LLJQpZXC9UEkTf75Do7GCvtkKDKNHR1v78HO4Nl9+2mYaCpip6iM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS3PR01MB8196.jpnprd01.prod.outlook.com (2603:1096:604:176::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 01:59:50 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 01:59:50 +0000 Message-ID: <87357rfoq1.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 07/25] ASoC: hda: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 01:59:50 +0000 X-ClientProxiedBy: TYBP286CA0038.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:10a::26) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: f2b5f02e-484f-4ab0-0af6-08db032ed6aa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ebrWvtaV9YRx78brWC+FCL1VEhgGPSNaZ8cWfEl+2lgHN3Rj2/R6mmJ9pmY0hJDLEqXNOOmQHmxCISk8nmMhzeTlnXCgPlBMyow4Q/0qcmWlCvRx8Bh7J6eOL2liBS4SmTeE1A3G8lowwKhoe2zQBaa1cLk8pqI1RzYJwNYgGa9lJXBvEwlHHK1MkzaWaQy+vKMG/cY50v1JofSnssGuyp6fMuYs3XBVPKOUggk+wDYLFT1N7U06jeUhjppxWcCTJiWXipwLMIQSQOL/48qZdcRgJioFy99qRQjks0T7MrhVlPEV6i071RxRwm6v9dMV6tW001HdRID91b1uWuj5ga7APGkIrR0Ym7wjVxIEBQilWRpCDxe8WW5C0VEV+Ic7G7gOfHasEEia+EyCkkpXMaJlPCcl3VvsdaswljOf61t3cR7tk4QYSRDVz3Qkd6ELAde8prfZuAR37ESzFD8Ht4UgiAMWoLpPF8UQ1ux5Z6BMSe/ozi0o6PN9zhhJ47iS1u6c4p7/QX77GuB/1oZhbt2nmT5kFhfeltlNE/9VUb5gnl2uyy6sk63aGxmj2riXYwQxMnFYyg7hagSKVrg2evyYU1wvu0ZEyWigcCOF89dqPKQQUGxRY1YsDvy1PmoU4CGrPoJ5Nq6/yLeZOE+J+ve7f+07FGQa9ygNxaMTo1G1jIwZP32SiOupG89ldM+dENvk4wl3DFKX1IfNGnWHEg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199018)(8936002)(2906002)(6916009)(38100700002)(4326008)(38350700002)(36756003)(478600001)(5660300002)(4744005)(186003)(6486002)(6506007)(52116002)(26005)(6512007)(2616005)(86362001)(41300700001)(83380400001)(66556008)(8676002)(66946007)(66476007)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FnOIJUmU/dexSB+PrESbGBTTDKTpe2IlJKFQDs2LxfCl3raMNG8Eshh/2oKnFemRMje5nbd3A9W7eHbrUhkzyBV7C8P0gQdfnnsM0xKnwhCJltwixp8GAtPaLls+w8utzMK7nGXx4czQindtifK+ZB8u4d8qYW3BZAEVCbaqAM7D+UG4XbfBtnGWt/l8w5ZMYB/BTNwHakM3flQ9CMR14sl44J4hjBHz3B14jEbnP8A8GE/6xMkLNEi/IRW8+lRpF4kz1D8C3Co/cpiHqAYlydsd5mXOhd1FmICm1xQphIO9iJ56sFc0WGtf0J2deqHZXJTu2z8zqSj/ereyHXHrKSSxlnbLafVAdA3xgMWCFCNHr7XBhAeu/OnOW54HUKQ2mtYc7+Qd+ZtgKjhqDCAFvzelidfPydrPus9g7mQCdtMblAMwN39wBmewfmOL0Z7I1Fs1n4wuwXxjymtQJW+XNljQLhlDVPuGCQ3so4JJCzYlsV2vuwdHNiTjxWP0QbwFTyZqyhOkzAJEb9S/Hpb2/fJdeT9mcPCvAfxqYPd1jaDHLxISJe7tbJkkiIQOC0B1ZoNqNMocKGdwvOhyY5xdEJ4L8HVk1kIfNPomytaWzy+bSqJxCvw+tZMkDU3OP2p/PTKD2fwTxq0lNXgU786EN97MN5gTOt8OauQbtXu3rddtilDcvI5WhRDO476ILfBpOI1DzwIiTuZ/Nmzl+wB0weti4MUv5E9pO5ylsZ86PEvsBzlUJGbEwvKq238g9yZSWF6SSPUFTqaDOkfjYFVjjhjzVWAMNAEqkUBG2+x1rWO7+trMvTBJX0Gk2tPyv4YJ0PKyhepz1ej5LS/6l23SrCT+Kjc/hR3c3ePn0GsFLsNQi4lUTnLebSnZNyrrhZDSP6ZGL6QnO+xMhKf7PAKRv8+IBztONcrnHwzf6WohYwzR6AZiuWaikaWEtkYzgrmh8xARsXXOmas0UYPctdYI2ukjM203TA2f+Soi9rXEu+XHIjtiY4RWacdir38vpTKWkpaPvj29CzaWOOM9oi7B0WTInWaa6jw3J2phsqqZT3sPw2xrXUGnYPJuSf+RTHxqen33M4pu9f6qNnLxBOAUuYs897USpeueKsi7LYYzvYyeArVQsZdgv1dvkE47uMMZZMQ+PGu1eQGw0gqsKSVKZbIm7LrwA5WHYgQN3aInJcf5svqA60sePtH+Tfl/UHjnCtoscdLt4O9N8hg1OLyfFu+D1tMmpBFHiuHW3MW5ICHjjA3rhRzdmd7zdixuVbNzfYZL0nqurfLioJxc5322uPxrkkPVtEZWt9L9M1tt0mkaeDtIrLieIuazAolQ2xbfCO5S9eAGOocDZMXvexkt17FbswseuD8p7nPfViTAyaNO27SVsqfdgoSKEYiKBm3+s/CFt/jb3Ep+JLMZV/uHzVMfXFqGUoKlxGw+KlzI8VQy/e7S/2g1rB32SjQI+LOaQOEVv/Med6rWkJSj2WIc14e33zQoxivxcLN3038L1stsLCNfc99annXvDY08s1rHpbdHhf2SLIVJZdLdxWpK7bYGLkFFdS5Mptuz7MA+607IkGSBujhz+VExvGidmKdNXrUfF5Wacsh1MRsRE3YjMqVYhyek8mHyAZbX/Muneq8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2b5f02e-484f-4ab0-0af6-08db032ed6aa X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 01:59:50.8685 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8xTdKseWmKNqUReQkr82IdTq8GYLZ0B0xbIa3kbVscfNHh3FE5KfGCN6PGRuAlQt+A9dmvLpC+o5ByS4nNdwXoMPx66hb8asivgIHX0mJ0nFBMuFrIG7GlKE63KOeu9u X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB8196 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/hda.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/hda.c b/sound/soc/codecs/hda.c index 4b8ec6f77337..d57b043d6bfe 100644 --- a/sound/soc/codecs/hda.c +++ b/sound/soc/codecs/hda.c @@ -126,12 +126,15 @@ static void hda_codec_unregister_dais(struct hda_codec *codec, struct hda_pcm *pcm; for_each_component_dais_safe(component, dai, save) { + int stream; + list_for_each_entry(pcm, &codec->pcm_list_head, list) { if (strcmp(dai->driver->name, pcm->name)) continue; - snd_soc_dapm_free_widget(dai->playback_widget); - snd_soc_dapm_free_widget(dai->capture_widget); + for_each_pcm_streams(stream) + snd_soc_dapm_free_widget(snd_soc_dai_get_widget(dai, stream)); + snd_soc_unregister_dai(dai); break; } From patchwork Tue Jan 31 01:59:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648942 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4F0F1C61DA4 for ; Tue, 31 Jan 2023 02:02:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6340AE7F; Tue, 31 Jan 2023 03:01:11 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6340AE7F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130521; bh=9l34JNrCKH/X4nvx21PI1aNB3NuvcrDUD35HM5FU7ts=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=aamxVbOMIeNyYqPQM3kOH4zg879Qa7Cq9st0naiUhkCE0JOUKO6hA++vWAtRqCMc2 fKBfUEyPv+phPXxA8JKV7w5Kr5rugxRzFM4jws/fmKXWfdVIITykVqd15GNMyz+oC+ NZwFthWqfqNPpvMsGvUW1nsi7BtnJkWfgb8U9bzY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 932B6F80558; Tue, 31 Jan 2023 03:00:09 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0457AF80558; Tue, 31 Jan 2023 03:00:07 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2129.outbound.protection.outlook.com [40.107.255.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 66804F80551 for ; Tue, 31 Jan 2023 03:00:03 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 66804F80551 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=c3qyZxL0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iXeNubCMbtQvQxlpgelEG6PfS7+CRYTsFLTqI7Ck0y/8ia24g8GFI/y8zY0VMcDwURjYssXWH9tj+US4gf3rApPV+LCE1K0NmN6NKBvM6TO3y+G8VVRrZY92WNlmOVIEbjxHYzSFv/aj7QNEBZvU1yd59gatJnKXo1e26LzGMgsepYURs00trsOqYZxSHgeDXx81jEYj+N2j5JQoFcLImc1R8AAMjN0wMhwDGG/x0duWmgFlCYRtYDConbONtdebUcl9iSW4VOfcmIoJWiPFkZRIqhureyiLF72pIjodkXhvIWp8fCIvuVUJC0Z/Nuj9AI82pwEhao76Ner2bNOWCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=B8Vh7pPnO+anfYS1SQvMlS48/4F1mNT8fZccdrleJoo=; b=SekVpQEUp1Xa15P5ehpaifsrW+7HdzE2ssAYwrHA3trzeyjrJlQNrBI6PX9NyhIhsOnyKFRsxZaI0iU6ORSreiHseQGZOE7Jlz7wW8v7woC1fhVkrhsOCK4j5yIYCT3a/OcoEQgYz6vAqhd7gHD8v0gU7iXzPUoO31VtJZfNH5XMRJRvF9CN7jW4Xg6ns9+d0bFC//PP6Y05Cgvq6v8B5Hsw51rUAy9tw+9ZUJkdjEBwcjyZOscywzTYp1iY85nmWZlsQLeEnpawnEBHeWHOeWusOVxPG4Eb6IKvygLsA3LGlt8rR+y3tjDjh1evZA3dvX0IZK8Jge6IcccWFvGbug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=B8Vh7pPnO+anfYS1SQvMlS48/4F1mNT8fZccdrleJoo=; b=c3qyZxL0QlsW0tGKDdszCW6KSzOmROWJqk8SOBZR71AJQjJBisq15k2tCBXYEdDdyJE0R09yeFAasBejQfPdfzQi0kaYNDrfauug+Qa+hFNUYZ5YeZYwcXjYMDrSGIlkizVlQlzmKi6i+o3dT0prXuiq39MiX/olpHC89vSfwN8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS3PR01MB8196.jpnprd01.prod.outlook.com (2603:1096:604:176::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 01:59:59 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 01:59:59 +0000 Message-ID: <871qnbfopt.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 08/25] ASoC: max: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 01:59:58 +0000 X-ClientProxiedBy: TYWP286CA0009.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:178::7) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: dde8c19e-00ba-45f0-c3cb-08db032edb84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9qqOnx7ktBzA8yjitU/vcDevOK1mvpNujjJNjOEjSufp54sRe7k7tHJNpQqfobzyfvG91H1w4tqlIfWG5LcAYtcx062P0rLECDTkauCyPLsAWsvBAePA45H5szaiWkMt8VNz/Rsm49SofTHDx1LJryMzjCenCecLpms6ine4K1O+m1t4GEYbIXdN5MhkAUZFhbBSMnTuE4IJt6Vbut2U9Kh5aV3zaM4xUWN+EfvFS+kNwVtFriF84QheIRGRGOidaRq3lFkZhiD+6lW0BVpll7KlnvfuYPH/WviYov2EKskxaeEdPeQzK02VL6+XDQHcP/6nCTq0k18BkpLck845H/C/a1s+0dop3y01JNRUQlALru8e9/LlKsljrxEfUvICjovU4oTcPE0+pAzFDuL8PZEF+2B44Ppamf373rt+l2SWijGAe4pveG+j89k3ctnUhQN9SaCbHvf4KGWKKaj3ECRD9N6Mb/GpC8OH6slpbat4T0Rza6LeyoOsV45HdBXcL+jtprM7f51XhxaooQlfjVUvwSkpHdWdl8JcOtBLxKfBS6apiuRldDs8Deh1LaEvnwrckR79dR+4hXTQ2jW7AiEM3heDeyjMvYXy1s7mrr9QTknHJFvHPHmNxxU8bULbJOykydV9trSaFAycgzejQZaDkEissvPxlYMEt3ENppJS8PEp0HSQv/jaIe8VkWMG3vhyTIvmdYn8qT24/QHtiw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199018)(8936002)(2906002)(6916009)(38100700002)(4326008)(38350700002)(36756003)(478600001)(5660300002)(4744005)(186003)(6486002)(6506007)(52116002)(26005)(6512007)(2616005)(86362001)(41300700001)(83380400001)(66556008)(8676002)(66946007)(66476007)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Jk90cElgFbkQAHq2XaC/7rhh3N1nCsxaetc22Ug73203tyP9JQpAf/2ytQe+IzWcUrsmQaRNSRSjRXViwANCOtINwWL/JqZzRwa+bsIwIB8EEPzXwDZRmoyTNhHwNFapRANHVDdZ2WEo0G7V3A9EKXdPfqZe4UYlnn1M2M9LFIANfGKNymSEP8vK6U0VAReekch1XcQ4SzeJvTpUFkye3lYl2rzwh7Bi3UCuqLCY/oXZnMUvwpjQGrDXu7wz21KBWjsEB5nX8U2a7GJjeTnCyyIXtHwqT9VQiC7iEIqf1C5DCk1S7Im7LWcOVbIATZ8w2p7VEcYBf5YtKxFpiltwBu4CmeKEadbv3SurcST8LLdbLQtzy25qK77HgHT4TfDZlib9hrgeA8zTsUAgdtYFMCOf8ZligLGBklmJ1FWBLXvbQR+Mq3MwJLiLhigRHWAJRyN1IwR4hVOKyLRKgXABn+ao2538Wl/HjKZ5c6QR2wEIP0jxrny+8WRUbixw32LDTz8WGUgeW3rm6A4tV6VxnVxFNrG+fEbn338unod1o6nw3U2N5+VWigYU2uh28XTPqXkhNYB6O2ehTSgMhFoDZg/vFzD6nJYdF8nupTn2xhICeQScpoaEan8U+4D/FVpWIoO3INN3ZXhZdGxDj331Iupl6l/rdWPJQbLuccbhvNNIJ6Fip9qh6sM3/fMg+uDhqHy+QdH4YkWeFAhjYmGMnJMfb18wY4/xwiKwv5uVTS7qSozZR6yRTxvqOON2XATemCvd142x+zoXmVEgtdweD3n8SU5tPqfF7pLnj2xH6U7Dpf4lwgAZTWP3GVSty5wFkbZjBdLcV2HATf3Z5hm8ChsD4Joe1ncXI/lkwk4xO3HKjSRExxYoQXIiUww1/A0N4ZKdiG8lxVyHcLpBIgmE+R2BDP/8LKoRqxf2cMJUXpnCa0KA3yBZxdGvMFhW7IjEL4GiTtaMgC/O2SpadfMC34Eq9zlw2b5frugiaTn0vx92SixnF+6DRNCaZtsGFeScDSZaToCKQ5wAbOPHm07L1/v+cXCJtJyigoW0EYKtyNyMTZuR21X6x37H9Cxw9jkFYWEmitnJIKLHeXJNFx3IfTaYgvHuZJqtaOJmiziTa+Ft1IVe9pbaG/Eztgldp3338vsoHmVSlrv8Ue3/rd/Nr9sw/9yOM7itzXnWhArBHwunuX6Yqsk2eN9hCkwZLGwOLoiixLmF/LnaxldVMkot535NF3digwhkPrmi50C2O1q4Gn7vI8I1uDFjJjcFU9fAJ4hk3dPtas4jp3Vu3WoHgM9/3c3L2sOdL9k7yBuTuQl5IQtqc3xUmKzjGSb+fI3cwgvdl2ku56BkZEWNF1rbqLL7q1GuCxabkDdcwT64UH+Z5MJErQu2ApTzczVzQ7Vo8sCi3c2/aiBi7pR1wVOR7ZizfcX0iP/vAGeJkn+LE8btMvgJKi6ssxltQgRsfdjJtHEai3jnmi4reHn5V6JvhYWgIBY+CWyRIz5vxcznffc58MDwvUdkDd+Tk6+B+yurPuxGzM+W+R604FGARDrWXXJ5JziHEk6DBgJgjccj0mwu2yP5FYVMEBC0x6tVs3sZXh7Ne/XfPb5gfZjkPOH0kSZcu28+b1A9wx7UcK//SA0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: dde8c19e-00ba-45f0-c3cb-08db032edb84 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 01:59:59.0909 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /B0FEd5h3z2NOCOXLgIQ6dE43a3yJfhjBzn72lafHS8zDB15J9021JWW5qfibwCfNEayhQs8F10q9tuN715Y8ZKKrgNZMBdXUBC6VqMSNoAN6UTKpiGQJhyARGa74TYk X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB8196 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/max98373-sdw.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c index 3cd1be743d9e..c9a2d4dabd3c 100644 --- a/sound/soc/codecs/max98373-sdw.c +++ b/sound/soc/codecs/max98373-sdw.c @@ -689,10 +689,7 @@ static int max98373_set_sdw_stream(struct snd_soc_dai *dai, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } From patchwork Tue Jan 31 02:00:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EAC7AC636D3 for ; Tue, 31 Jan 2023 02:02:24 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9C6BA857; Tue, 31 Jan 2023 03:01:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9C6BA857 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130542; bh=Bo5E4GtHSRpqPfe4tOUvV9vkSStDRiyyMRxslML06aI=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=ms6kGZPq7HhC23tN5akHbnY62rqQ3mOp+nql8O3ZLTRjHcajQHrLoRYNJAAMWavKZ F6ke2f+y1ZkwVx2oboZ5MIh3ZG9pBNcnar/D1e+PtZpCYuc20BNr2T4uMkaqFy8s/e OXG1qALIQvyY7M8QqGVhTyvAV1inWeO09KYRuGdw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 07A99F804C2; Tue, 31 Jan 2023 03:00:32 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D07F5F8057E; Tue, 31 Jan 2023 03:00:29 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2107.outbound.protection.outlook.com [40.107.255.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id AD46BF80563 for ; Tue, 31 Jan 2023 03:00:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz AD46BF80563 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=WETJgS0s ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C7RrxFxs8lrIgdZIbTPV9Qwqm010J6NwgmXGxApmVVH1bqNsOKgIR78HtOU+9/LuC4NQRHcq63N50I54I2NNnObzwW4hBA90UqUqgz3eilJEd0vv4Xf2amoip+K8sLNSEeCqpY2FoCkeFV5iWRTL3U1ziiNZs3sWcGPENLjDfqv5fekX+g0nEXkk+Y1522VbaFXsAmJir3+gFXmmCxiNIx3TqjRpg7g/wnQfKm9kzJyDX7e6Z03fc+pZtFDQRMWArwKwYD8eCUh4lx4OBSuBWIDojrq+aEqTR8zFoY00cZDyriz+S7kgREdM6TxRe7MYmre8+BfyhY4zMfxwdrOeaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=m04DCurg0rGZ94uhOWyx+cLkrC1ER9W672+pQzbW4R8=; b=SzQV/ATDRyMsmyz+nHg9Ut0tUFSigUl4IA+XBXxUP0N5Lkp1HKv3+Hq1YCbRKI5+7kBcrYnW9eWA3bYVYX3YWcmWGAbSveaOA0kMuJeF1t0cVAYnXQU2KVbmfqP65OkEvY13eHOYB0TI4TlXFGHtkUXVAnGKjHKwJxcgUqFzdq61ixjgFab63b3Bd2VX8AUa7UFf2wMdblg2+RYvus3UxOtpBMyFwpgNBWBXoVXS4PxX/9tBDusOdSohEtp3RUDAIMD07BbluGbm8XNFWwijMkVRBD9Ys17XajYMZ9EZsHDX9iqStxgkkjaJHgx7CUX0A0qqVcDql1XPxhcalAO8rQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=m04DCurg0rGZ94uhOWyx+cLkrC1ER9W672+pQzbW4R8=; b=WETJgS0stan8sM1eSfHWjWYT1BZSHnYutMqwRvE/yMI3Yw6/atvekrOsMY2Z4GQQ7f0vfBc5zf0rWKh63eQwuIQQsdgXls2mGSXbQE1CG/wk1QJ9+vlS24hzxi2WnSCfKJJ6is88I8ka1VXiUuA9wLf0G+h9AuvN0jxNGFFn4Uo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS3PR01MB8196.jpnprd01.prod.outlook.com (2603:1096:604:176::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:00:16 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:00:16 +0000 Message-ID: <87zg9zea4w.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 09/25] ASoC: rt: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:00:16 +0000 X-ClientProxiedBy: TY2PR01CA0017.jpnprd01.prod.outlook.com (2603:1096:404:a::29) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: b9601e8f-4562-41de-5c17-08db032ee5be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J6vV1bS889AncJcjptXJNcv9ziuZDnsL0mLpZy4dbeGTVRIILH6e5d4bh5dpnbreD3xgeSF4EgfQgnkiDYNE7CCv2RleV3Z0oiSk4FEuQiLNitrcgkFMOnsKm7kabXAIF6ge/j5AFUpN6OsFAN5wp1ME638YFRUhWmFMEgPYtyWRlVBr/98DVsdNvX/UH7yJhq91qZ3EIL72dRJGQbQWCtU0x9o8oOkNfusRpElRHM3gsA/fcFjAGye388S+12HEoDXQ/zN5aET9DB2g7ODAlIx66gCCfi7/ey3bn1JJGgbPQhKgtLPu++BfYKF7QXYrwKP6iDNF6Jbs1DvlH973GNKKlWUrVBz3U1s57BwO8lsbVEyZGi+WJhupNjbWlZftBOMWBfaYCkcorsmv/VS/WG1YdBugO32CxwO//NUghMkgTu45waWKGByXJcBlZN0qEuymzMu+BwPo8orCX3ExiPz2rT+av5ZZlrpxPYPbb/pgA6clWLEUHv3/iZDovUyODbOrTB7Jz+SS+RLZ2QAWASy6xiD/DF9kbUpakTxa7AprsLaN5rlRvNqVnGIjPWHzqQXVi+nw9k+Ip6FtZuT5H5YqiVfVScYRFd6tYHpleldhOH8U84Ag74lwF62y+Tm9Oana5r0goTi4F6XDeft7S/Txzez4lBxBkZ7/H0RoqQT7AKSVDdCn7rBiNS8ENuPNlb5XfqMx7I+FSHxwp+0yhA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199018)(8936002)(2906002)(6916009)(38100700002)(4326008)(38350700002)(36756003)(478600001)(5660300002)(30864003)(186003)(6486002)(6506007)(52116002)(26005)(6512007)(2616005)(86362001)(41300700001)(83380400001)(66556008)(8676002)(66946007)(66476007)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P9WpVtAzm4Okq/e1jQZDzL6zxjSX08J4a6Bt7meqLvL7ZPmcP2NPr4+P6xayIJKRQioADNlk6yj3+zLVQHWmSJBoSW2MNCw0aL6idwJ7saF33Bs0vctssGnpjgzobDtvgqStHLQBObBygga/KNfhWvtgSciMMoWuF+UIGR4jtSoU12e37JyFze4YzLr5aUuv8OhHR5aCxXBxFKmYj0YDPk+USD4/D4UbZbpDwSwZft/9DobaECdqL+35w8Umv3TvxqRmczAiEWn329ci0uPTsXHhNRnze/eUwcm8ZBdvrtDETK/W9ZBZiAuXT+1apJSZRxOQzhcuip8sbEnnevHx9lQmC6C/33wPpOSHqmDJadk3XrqdVAPXDnJNmElKU7fGeCnLKvcQB5DejsSsDGKsjBOcOiESrlgc1LxqmXTNtCFI69nwLEp+fLPy1sP2xtlTNn+VAkaz7Kx74IG1T4naF9VEf6r4LSKjjjM6w1rE+hv/Xqri9L0h2ohne+RvWsud39FyAYlO0f5NRbHO8ybw5R9zX+urr+WUAmEuecj3tI91ZqenGEEFzds2S2z1s8+Z+kLSboxbJRpk6EX2SWK8R5U708b9eAL4Ldu6sEIym+rGC0+EiY8euqx0K0ycKFHZIDxGJAhY4q6TYu3K+3iZ12fcAnd8gXhDHNXQQdrt78GqOircO9ruHt9jKW5NS8F+Xx+vLR3T/XykUqXjJPL0d6CMcV7khS0+1EnI0NyKnHZEdkMNyh6gJtrgL1E76C6mcAALqCa0/UjmezBJBhT/GXenKTSDAej8Xt/UArL2fi1uK4l64iSeoKtiXvC/Ojmt3Nt1jBDJnbIf02x7OJyY2HWbyttXITNMvR60kGtJO+uy+mN607FuJFVZT/RUARWKcNO6ub9TXU8rDxGzqR2MPDE25bYNZMH12mcqcqp1EV8yYmwxvpqBaJAG3vk+S1/z/x++XSph3ok0kF5njfmDpPKT9C5zANpuOPdzSDZ18eEsXKOC3p39YfpzdFqRBuRvXRh5xOHIqJVKs5JtfVeCI53Iwwn3UyQ6XriufDXFugbDaXDY5DWd+2F9PGkeTDUxrKCoHNjUcVpINoRkN1x5Gx9jWm0CtovkgpulKKWq7BTow1zGzmI9ibvTIeSgtSMcmbaTYu5AKyRwCLzMgwdjwB1SCF4pReAym5eXrXMLBw94/K5+jaa9Lgv9NKHpBO/+/8DriFKennFTO1Hv8xYjbkflIx6iu+DFwq2mmv791IKz6hAM0CL82yyTyNmktnUxlosOFYpL0aWD/wc/3ZQktGB1/GjaTKWBSNj40VtdmYobaTN0PPNbgKPgUIJ59lKKxCteN5RV3+lfYl+/ryAZUkzSfxZ86cBCaQfa+C353jGm4AmCi9qTyGEO56Dhp9i7bu4n0K00G62JJ9+wlvzmz6rdurIPF8FzXv2ssq5aBI6G7BNqTiarG/1ZVO3XYuYsxUk0fY8nDpTRCOCwkFC2P4Tw4ZWMaHBvoxSsZgLXmN/ZlCuxN35pZnBLPSReMtToG+t6yzQOY0oH13gSOPy9jQzNVt0ZkuPN+juPxFJmLjQa4Ip9raqsFoy10w4HPyMDbXvWXa25wdncrSiRQKaZBKtH/7e2VNPeyztIieEsX8Y= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9601e8f-4562-41de-5c17-08db032ee5be X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:00:16.2768 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: y/QzP+vaIicc8/T0eAiOXXqQ6ffZDjUidb6HomPXG25riyDrbeJdiZ8/SiveCkLpfBjCn6XY3G+naqMKMLjE1y3RK0V6GONMgZlf18uupVHLzTWXuzQsoOE7ByCq/oYI X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB8196 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/rt1308-sdw.c | 5 +---- sound/soc/codecs/rt1316-sdw.c | 5 +---- sound/soc/codecs/rt1318-sdw.c | 5 +---- sound/soc/codecs/rt5645.c | 2 +- sound/soc/codecs/rt5665.c | 4 ++-- sound/soc/codecs/rt5668.c | 4 ++-- sound/soc/codecs/rt5682-sdw.c | 5 +---- sound/soc/codecs/rt5682.c | 4 ++-- sound/soc/codecs/rt5682s.c | 4 ++-- sound/soc/codecs/rt700.c | 7 ++----- sound/soc/codecs/rt711-sdca.c | 7 ++----- sound/soc/codecs/rt711.c | 7 ++----- sound/soc/codecs/rt715-sdca.c | 5 +---- sound/soc/codecs/rt715.c | 5 +---- 14 files changed, 21 insertions(+), 48 deletions(-) diff --git a/sound/soc/codecs/rt1308-sdw.c b/sound/soc/codecs/rt1308-sdw.c index ca2790d63b71..45544b530d3d 100644 --- a/sound/soc/codecs/rt1308-sdw.c +++ b/sound/soc/codecs/rt1308-sdw.c @@ -508,10 +508,7 @@ static int rt1308_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } diff --git a/sound/soc/codecs/rt1316-sdw.c b/sound/soc/codecs/rt1316-sdw.c index e6294cc7a995..6dbb59f51426 100644 --- a/sound/soc/codecs/rt1316-sdw.c +++ b/sound/soc/codecs/rt1316-sdw.c @@ -507,10 +507,7 @@ static int rt1316_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } diff --git a/sound/soc/codecs/rt1318-sdw.c b/sound/soc/codecs/rt1318-sdw.c index f85f5ab2c6d0..b51da098e20b 100644 --- a/sound/soc/codecs/rt1318-sdw.c +++ b/sound/soc/codecs/rt1318-sdw.c @@ -575,10 +575,7 @@ static int rt1318_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 620ecbfa4a7a..7c7cbb6362ea 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -3157,7 +3157,7 @@ static int rt5645_jack_detect(struct snd_soc_component *component, int jack_inse snd_soc_dapm_force_enable_pin(dapm, "LDO2"); snd_soc_dapm_force_enable_pin(dapm, "Mic Det Power"); snd_soc_dapm_sync(dapm); - if (!dapm->card->instantiated) { + if (!snd_soc_card_is_instantiated(dapm->card)) { /* Power up necessary bits for JD if dapm is not ready yet */ regmap_update_bits(rt5645->regmap, RT5645_PWR_ANLG1, diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c index 6e66cc218fa8..17afaef85c77 100644 --- a/sound/soc/codecs/rt5665.c +++ b/sound/soc/codecs/rt5665.c @@ -1298,7 +1298,7 @@ static void rt5665_jack_detect_handler(struct work_struct *work) usleep_range(10000, 15000); } - while (!rt5665->component->card->instantiated) { + while (!snd_soc_card_is_instantiated(rt5665->component->card)) { pr_debug("%s\n", __func__); usleep_range(10000, 15000); } @@ -4748,7 +4748,7 @@ static void rt5665_calibrate_handler(struct work_struct *work) struct rt5665_priv *rt5665 = container_of(work, struct rt5665_priv, calibrate_work.work); - while (!rt5665->component->card->instantiated) { + while (!snd_soc_card_is_instantiated(rt5665->component->card)) { pr_debug("%s\n", __func__); usleep_range(10000, 15000); } diff --git a/sound/soc/codecs/rt5668.c b/sound/soc/codecs/rt5668.c index beb0951ff680..ecf3b0527dbe 100644 --- a/sound/soc/codecs/rt5668.c +++ b/sound/soc/codecs/rt5668.c @@ -1022,8 +1022,8 @@ static void rt5668_jack_detect_handler(struct work_struct *work) container_of(work, struct rt5668_priv, jack_detect_work.work); int val, btn_type; - if (!rt5668->component || !rt5668->component->card || - !rt5668->component->card->instantiated) { + if (!rt5668->component || + !snd_soc_card_is_instantiated(rt5668->component->card)) { /* card not yet ready, try later */ mod_delayed_work(system_power_efficient_wq, &rt5668->jack_detect_work, msecs_to_jiffies(15)); diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c index d8a573dcb771..5f80a5d59b65 100644 --- a/sound/soc/codecs/rt5682-sdw.c +++ b/sound/soc/codecs/rt5682-sdw.c @@ -107,10 +107,7 @@ static int rt5682_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index 7e3eb65afe16..f6c798b65c08 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -1094,8 +1094,8 @@ void rt5682_jack_detect_handler(struct work_struct *work) struct snd_soc_dapm_context *dapm; int val, btn_type; - if (!rt5682->component || !rt5682->component->card || - !rt5682->component->card->instantiated) { + if (!rt5682->component || + !snd_soc_card_is_instantiated(rt5682->component->card)) { /* card not yet ready, try later */ mod_delayed_work(system_power_efficient_wq, &rt5682->jack_detect_work, msecs_to_jiffies(15)); diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c index f5e5dbc3b0f0..77dc62219bb8 100644 --- a/sound/soc/codecs/rt5682s.c +++ b/sound/soc/codecs/rt5682s.c @@ -834,8 +834,8 @@ static void rt5682s_jack_detect_handler(struct work_struct *work) struct snd_soc_dapm_context *dapm; int val, btn_type; - if (!rt5682s->component || !rt5682s->component->card || - !rt5682s->component->card->instantiated) { + if (!rt5682s->component || + !snd_soc_card_is_instantiated(rt5682s->component->card)) { /* card not yet ready, try later */ mod_delayed_work(system_power_efficient_wq, &rt5682s->jack_detect_work, msecs_to_jiffies(15)); diff --git a/sound/soc/codecs/rt700.c b/sound/soc/codecs/rt700.c index 6534c9b51442..659ce26e9f3b 100644 --- a/sound/soc/codecs/rt700.c +++ b/sound/soc/codecs/rt700.c @@ -163,7 +163,7 @@ static void rt700_jack_detect_handler(struct work_struct *work) if (!rt700->hs_jack) return; - if (!rt700->component->card || !rt700->component->card->instantiated) + if (!snd_soc_card_is_instantiated(rt700->component->card)) return; reg = RT700_VERB_GET_PIN_SENSE | RT700_HP_OUT; @@ -887,10 +887,7 @@ static int rt700_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } diff --git a/sound/soc/codecs/rt711-sdca.c b/sound/soc/codecs/rt711-sdca.c index 7cdf184d380b..c65abe812a4c 100644 --- a/sound/soc/codecs/rt711-sdca.c +++ b/sound/soc/codecs/rt711-sdca.c @@ -295,7 +295,7 @@ static void rt711_sdca_jack_detect_handler(struct work_struct *work) if (!rt711->hs_jack) return; - if (!rt711->component->card || !rt711->component->card->instantiated) + if (!snd_soc_card_is_instantiated(rt711->component->card)) return; /* SDW_SCP_SDCA_INT_SDCA_0 is used for jack detection */ @@ -1249,10 +1249,7 @@ static int rt711_sdca_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } diff --git a/sound/soc/codecs/rt711.c b/sound/soc/codecs/rt711.c index 78e1da9b0738..862f50950565 100644 --- a/sound/soc/codecs/rt711.c +++ b/sound/soc/codecs/rt711.c @@ -243,7 +243,7 @@ static void rt711_jack_detect_handler(struct work_struct *work) if (!rt711->hs_jack) return; - if (!rt711->component->card || !rt711->component->card->instantiated) + if (!snd_soc_card_is_instantiated(rt711->component->card)) return; if (pm_runtime_status_suspended(rt711->slave->dev.parent)) { @@ -976,10 +976,7 @@ static int rt711_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } diff --git a/sound/soc/codecs/rt715-sdca.c b/sound/soc/codecs/rt715-sdca.c index 1fca7a3f46ea..920510365fd7 100644 --- a/sound/soc/codecs/rt715-sdca.c +++ b/sound/soc/codecs/rt715-sdca.c @@ -793,10 +793,7 @@ static int rt715_sdca_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } diff --git a/sound/soc/codecs/rt715.c b/sound/soc/codecs/rt715.c index 1a2036ccfbac..c6dd9df7be45 100644 --- a/sound/soc/codecs/rt715.c +++ b/sound/soc/codecs/rt715.c @@ -777,10 +777,7 @@ static int rt715_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } From patchwork Tue Jan 31 02:00:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4307EC61DA4 for ; Tue, 31 Jan 2023 02:02:37 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DAFD8EC3; Tue, 31 Jan 2023 03:01:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DAFD8EC3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130554; bh=vsculmxc1hx+N+BUkp7cdH3YTKpGnSwK8BQpqfswg1I=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=gjIyjJ9T5XNcvAY1rhRvvATYDNisgHzwlNqBUribmfGlKJBy2zKHFyhz2FBL+4Gme fhypwFubb8amJPpq7ETPrySLR14gQiwie8AkXls/xDAMhQOV55UAuKGrTJ5gZu2tq9 iU9YwQ1MoTv0dTcb4UYauWqXcC+m65aP73InmMmQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id A335CF80570; Tue, 31 Jan 2023 03:00:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BCB4BF80587; Tue, 31 Jan 2023 03:00:34 +0100 (CET) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on20720.outbound.protection.outlook.com [IPv6:2a01:111:f400:feab::720]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E6FEFF8045D for ; Tue, 31 Jan 2023 03:00:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E6FEFF8045D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=FuLnpDN3 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gxU0T/89vnsPqgoWeGNOmVa3koxIeM0EuC/wsQFWl/XJpTdCBaC6HccFncFTeYMTN07yIVf4hgXfhMPrwoZhk6dueHi6OWbmbcf2JE7nZwvueWoHLa3OmXZlOKbsfZn7Re+sTiRdogpY4W5lUYK/Zk/ZmpvTVRzZ9u9H8o1BjhaCvWZVtwBjBOomJyHgFCklZzB2Iql6HEsaVCFCDYls28cRGO0Ee4BOU2uAkNW5oDtkiGLi79EQ29QP6etrLkfhkjI98NrxQ19VBEdzGquOfklgkZHxNUTgKHSRAYQhviBP86O9jcuaMW+yzNkY12Awvx8fI3EdwYvqdtViCROkIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KOk8g/8a41/vqaOtTcIV6Zv9DYWHXY+9CUH4m49GtDs=; b=lA3OOSvJzjugzrcK51jLZ5YLCzQLtXu9pe+/n9Jm9KmvLPkHqijRZKZmGibRrKxvvbDLoBTnFFn/W34UZ/uHDGMOXq2/U5pa2S4pCK3VdOz9lNiUDIU6V9nMXcSPh2q10BGkRqtv53I52f5sj3y/VzvOZOJYOO6J8IzDKl5NnLv6mENrPPWxC0UuiUsjS/EBjynWJ4SUX7v8ES7XzAh9yr/9d7MIO3gmWz/p/P1loDdbIedJYWQAC4WHFSh44SmWbSv98qJr88Xbgjf+/eatY7ZFMYLtlVw5XqTlQJkxbXYtNy9B+9Y3wx5iRt4emQISlO4sWaJdq8xEQZROz6YZDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KOk8g/8a41/vqaOtTcIV6Zv9DYWHXY+9CUH4m49GtDs=; b=FuLnpDN3MXqLeTbXphtehkFh8vD/lEY9k0fIuHJiSuHgvLlEdiZfxUZH3bCL7m4/y66Nf/qc36FYDBHgEkPjuWx/uE6v3F7s1+tNyCBtrsjoq0aw3SRSKIrutLbCxzIFszDF8t0oh3QOP4POBoSgc0PaGnZh5TWlygNTIY5duH8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS3PR01MB8196.jpnprd01.prod.outlook.com (2603:1096:604:176::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:00:24 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:00:24 +0000 Message-ID: <87y1pjea4n.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 10/25] ASoC: cirrus: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:00:24 +0000 X-ClientProxiedBy: TYCPR01CA0102.jpnprd01.prod.outlook.com (2603:1096:405:4::18) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fbafcdc-c998-4911-f36b-08db032eead6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cv6QbsVJrLSxjkIzZHpaKbrQs3qrUaN3qDXwlXXcbGbe1VUH/V/QHv+WAJsEdW5SVwMccG+q7YOXVAxPaRojgqMMJCFFTjRu6kJ5Ke3m0Fw0JEimop9ohX5FjERfPSog8ahe6Pc6Xw1vZSkkWK/x0D5qxFPsMrYmvrcU983bXz0Ywi8Fg8sj/SahtEWAxUOfRSPLe/TqA64gBycn9ZFl1s92eDVwwIjRi762zhJSlxNFCqHBT65uFCHZEQ9cd8IKjLILKurH64vbiOgc7XxeSN1AQUR6IFuMlasLyL/6pb+uSvm4LX+t+vDKJSq84V82uUO4P+lF9UdKOzQELlFv0en5OaqejfUWomWO+PFgIWbQXnPcTMUNHXIMY0uQGuV7lUrG5XJZZT9a+rJxHgu/pFlNSkBuGHfezVSLSWEfyovf08UJiJqt5R+Gbeh1vZ91GTw+H1iCADgfz1URsjzvSI036760akpWIRlfWIKnpTEhYIj9ww4QffC40kRmL0hjjve/YkJPhEaDy0QgpqxiEoy1FBqN02AL1c7Drb1Wzy6c9p3orsgD/FCX5AG288kvqVTLcWZOptHEbSPpyb2vmKvWLkBjAnT8jwfAdBSZ5FVYC9viSKel1bYzT04wPtXje0m0aDhyzA5k/FJGWyDUxtPhaJiz+LE43+qABv7yl5Ml37KBndgvQ5bbKFfPuqsLgQJiFwcnaFUSVBRng2CeLw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199018)(8936002)(2906002)(6916009)(38100700002)(4326008)(38350700002)(36756003)(478600001)(5660300002)(186003)(6486002)(6506007)(52116002)(26005)(6512007)(2616005)(86362001)(41300700001)(83380400001)(66556008)(8676002)(66946007)(66476007)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SxNMu9gQcp5gUJjuRQX9oh5cqEYLAlMXzimmb/WWUUJHwUpYeANJfdlwC5adUhHmidInX9QTr5BzPhayspDVC5G8bW9sztRFKEyt/pgTHFbXdhi5zUGvWRznXRtjccrRFKFW59UOR+AZmkE615nFI8ZOXScnINhybj2DUDZhR6VJGaax94ME8a9P2YuEvfRRFE38tG2U1FAvJ/QOWtRew5HaufWWRl6pyeSC35gQW+n1wU6TD+p8WpOxtHgRBSoACvCzAQDW61H632cBadJmcljKw1v86s2e9s5RXROkcmGd0x8l7nRiYzEV9N0gjN7llETfhID4W8dXASVLqUTE2CPamHLdI4uGpNMSXU643XwjgJzu9gzJjOV+3qLSJoqwf4xZYT/pLst3+O+koi9JpcQKYHWf1PHX10trORC27zsrIqCFfayAunkyQJj1r7BI7YB/F/vU59Jm4/ZaGRC9sRDfcj02tHtKWcPDA75d/l+4O3Kw8nX8b6IUgWgzbC4ag7yyyx1apbwqYI8u1CsMDzfpDT7fZ5PE1QZJO6JR27rMfHYNfnfFJw2xsAWE424yNIB18u6rfweJJwLVov1oc8Kr/zte+1KyeFJ40xM1ePWD9P62oNPjU7STFJvsM1ypbJvu+uVULd9OqYKPxYPA5dfm37c87dL3F1qmimEanhDnhvoh6vqULwvEFJgygCfLfStP9Mqxae3TBcf1oEC4F1nD9KwfnVh8tHzwIW8H2QnxhcMqlvMPxfPQN0zznpM9yc3P68u2qudLio6pm8P38lXI2Cb08boivwtjKuGPITe0pQTRvRA7XJUAhKx04lyPLu2UN0k3MgKxw0M+z6JsU0CZCSlDd3h+sYvUYqlPS/0W/sNlR/pB4385V82ZjGUd+HZw5MwuH+BIUG1BMmF8gioS7TX1IXuTUIz/muL/1CRTS5QLhc/T2PyrLpJZDpEes2w/3zxTOvURZbWuwZ0pL60RAW1dZIMHguufeq3AB5jCktBbG1ioU7s07LaCq8VA/Y/uJwb6Qbz2KTm6trm2yygnu4pKqyZRed7lO036TtckXrASlYMyNLZjvv9g5cx07xxgCUOsr4EBulSan924iHP055x244Zk42AS4KR1Ipp7wu/RsTjCdc2HW/pwAkC8BJmcDAhkezWbLhDHbf+qEIKwx0HSdO2IZmF1cFruBsXPOPdB+38PU1Y365w3pf9PhEo4jk5JuRYTU1DLb5nh3b/MB1f1GqNVipQ9+QKIdhMI4tfHYLcRtQguIROOucr7S28Fc3ylT3xpv0Ect4BUmkCmsxhKmu146oUjdt7jQ39EPz6GfkLYZPNKxevpHq+0S/3WcSF9aXONCObqriqq8e5a5aEluCrTRWjR0yfvDyAoHjsS2OGn2yVTQfYT5KMNAIbgoUwyMXIxAPqSnl39iJJ4u/CzCNzNn+lQMBJG4lTqpa6hNjNviMmKOLuMCye5cH9aJ2ukjfQB0DWebH8Qu5gh2E/Sfcuv9WR8200mm6X0lKGR//fXvAP3SX/vJtN4YpcG4EYAS2y3yAMMcshXqNrw4j07K4JR4/luM4t5qqjxEcZ6ZkQVZN78YqOZSHNapEqzqAc/AiSW+9B4yF8b7AEU2T8Qv/wGdoQmsRP3KQo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6fbafcdc-c998-4911-f36b-08db032eead6 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:00:24.7342 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wjXK6sVOwawo+aT9Q7rfwRJ3nXvYyeb637ojY94ELMUCViEJzzM1n4F0VdKdzCQWC/rkH1144KS8F8/iG5I+yGVrp/gw3BQ1mDwB0UVVw2lJ7rQM/7FwQCChu5Ci3Rei X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB8196 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/cirrus/ep93xx-ac97.c | 4 ++-- sound/soc/cirrus/ep93xx-i2s.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index 37593abe6053..cec067c91a0f 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c @@ -323,8 +323,8 @@ static int ep93xx_ac97_dai_probe(struct snd_soc_dai *dai) info->dma_params_tx.filter_data = &ep93xx_ac97_pcm_out; info->dma_params_rx.filter_data = &ep93xx_ac97_pcm_in; - dai->playback_dma_data = &info->dma_params_tx; - dai->capture_dma_data = &info->dma_params_rx; + snd_soc_dai_init_dma_data(dai, &info->dma_params_tx, + &info->dma_params_rx); return 0; } diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c index 982151330c89..8265173a7932 100644 --- a/sound/soc/cirrus/ep93xx-i2s.c +++ b/sound/soc/cirrus/ep93xx-i2s.c @@ -202,8 +202,8 @@ static int ep93xx_i2s_dai_probe(struct snd_soc_dai *dai) info->dma_params_rx.filter_data = &ep93xx_i2s_dma_data[SNDRV_PCM_STREAM_CAPTURE]; - dai->playback_dma_data = &info->dma_params_tx; - dai->capture_dma_data = &info->dma_params_rx; + snd_soc_dai_init_dma_data(dai, &info->dma_params_tx, + &info->dma_params_rx); return 0; } From patchwork Tue Jan 31 02:00:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11048C61DA4 for ; Tue, 31 Jan 2023 02:03:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DB058E82; Tue, 31 Jan 2023 03:02:10 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DB058E82 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130580; bh=uLwrBroZGudU/DKs+m6vh/yUYrxbeEoAeBSkDh039lA=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=TUdrIvKHs3JVSTu/GX7iOEGc6XHEbSbQ2Aa1iQRJVKWYNoCK7qe6Q+KfrsOoxzKV0 cRx67MW85i0cEiaKhcRCZBbkcGunzp1RQIHmRzkxnRwb35OKuzgrb2Fy1nzGXXTvfZ nLW592ff4dUm90yuMJwh/a943/JmXGkahkdHxY0U= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CF3ECF80571; Tue, 31 Jan 2023 03:00:39 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D2C15F805A0; Tue, 31 Jan 2023 03:00:38 +0100 (CET) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on20720.outbound.protection.outlook.com [IPv6:2a01:111:f400:feab::720]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CD14AF8047D for ; Tue, 31 Jan 2023 03:00:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CD14AF8047D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=YvIHvtsX ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eA6k9RgcHIpmPSDXuMjGPeGiQzfIeNh1L3PMzYiDuV1n5O2LRpBodL1m2hPcYJ5r5xnlTUPhs9ZXQphLRFL2Q1VEXOeOLUOebOKs6vtdWc2VbVFAcnrJN/PD1mI5mwnDyGBY7EezLnn8qDCmP+gkh0th0+Und0HcaAsgC8XybI4SJPeJ+GS6k2K5Ji9G1IXzvJAKyLf5kf9cNiSGM34Tc+wzN6hlrq+kb1UYDhNeJysmlciyLH5qre2iCe5RC0pI03ElGHHDjJlbN4GrWsjoRNyI813/IKWyrjIv9NmYNAKuy0THlhb665QkdtJUUOIGzuUvdX2mFV1QV/zMn1HU5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Y02LuwpzK+tWz3XOhLsWzhp30164SfSO7lnXaEf0RWE=; b=AaOC2OYbNl9pCNGG6mgQk6EKgooEsBbcg0csq9Ou06oQb67C6GbgvyNkE/geZWVh2QbwwPPyk6OPL3cO470UK9ltqxqQrz9bb2WEa748+5B6Stb8DLo0vbXia1mJ+b0l3cNkoE+kI1tR3ezyvHMpfDLKQKOITJAxbivtbOw/UWStc+xWGWoru85mhOTeiAVrL4nfJ7S24/FejAlqCMP84GFaOVjKVVq3TPD+hQFrUCRwkID3vIO9+nBK8KtJJLiGYcfUQ6MCOb/AeNFE5CN1zHyfd4i47nWX44QXP+wPlAf6D02PRJO5VSiKQD5DV0rRU4+KSxgmhO2ArwF28XKf5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Y02LuwpzK+tWz3XOhLsWzhp30164SfSO7lnXaEf0RWE=; b=YvIHvtsX4U2o0mG3JSbPhrkAmndcnUy+FqqRJ/GrzlQE39G61uj82uKE0CPZbAZ/33Unqj8EWpfHe+Vixjl+OF5akAXyemULFYu24KjMZhiun9LLPeMLJVXyIoKCCtVx4litIr/KkmCb2iZAQFNQRDabAzGccwB3t900mhsxlVE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS3PR01MB8196.jpnprd01.prod.outlook.com (2603:1096:604:176::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:00:30 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:00:30 +0000 Message-ID: <87wn53ea4i.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 11/25] ASoC: spear: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:00:29 +0000 X-ClientProxiedBy: TYCPR01CA0038.jpnprd01.prod.outlook.com (2603:1096:405:1::26) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: 998ed442-5fff-404b-7ee2-08db032eee12 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DZzs3f9rTljzrhfoxDByVshMGmlcPp3TC9XfId/uo59i9axCpgRQfAj3wHU9KzpLZdwefTN3wFxcG1Vu3NTSobiO6kNgOFj0s3BWZIn1yDO1b/7JbW1709VNLjodoXZmoOGDa/qDOBPReOYJz+5K7qJhtJdHyab9jclDuyjzEbST1m6xyqpF2hm+Y0GHBOkvIEyfpYy76R25rJEsR7kiOwec55jdZeyRcHlOot974KyLzXd80kYgTPXkF74tDx5S2pNW/1UMwDzOPEf91BJuU1LCc8xYKO9kZVKItq7UgnCW3FZAQhK8Qis8XhwnYVpUJvfNz5PhrAcd019phWtih76O6b9S3yFdqG1iI0XdhcRTMXN3C2m2/HJsu/HHdGcGv9eN3OM+vHAmHp39Jp0h1W9ntkwe0zMNWoOF5m9oAdgJ5Gl4+IwmMc9+C/T6+oS3g8P4uf1KcDucAmtMgwkLfVkePgVISAUfZzhlDV/+FppjVz8bA4Bk9loh49wmtsz3RTbF7l2QmJxhcKIy/P+9KgXKGo8EvmVQrV/pU+JGsFkU9Ich9ZtIY7am490Sg8tabRhB/P0Yv+WU+vzBWHn1NjAeBLAvxTtnTObpAo1nBVq84X2yt+cyDC5HBqlUWGY7JR5XHuQT7SXfDhLXBV/PxAt+JnrRA7S6B75a2T3qH0mtoA2n0Mqq8eUVetsa5fJ+SlH4DcFLpZjUyNOzpbW+7Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199018)(8936002)(2906002)(6916009)(38100700002)(4326008)(38350700002)(36756003)(478600001)(5660300002)(4744005)(186003)(6486002)(6506007)(52116002)(26005)(6512007)(2616005)(86362001)(41300700001)(83380400001)(66556008)(8676002)(66946007)(66476007)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5qT6qmy9qXUgL/j6cRAx9zeI2cXGXYJM0xe13XesplouWNVqEy6nFZ267wE0L6VxMDmwAa3R7Us6pyh2L/2Fj5RP1K7NtRoawr8FEiVK+83nhe/TN1F4m6jLfQEFTfwTPoC/KClp5YsSIFYvdBVN8DV5VFYRvn5kpUFRZpYqQy1uvp8WC2RjON3o1R0iGNlcK7fhg/qAuI75tjoQSxxMATni/ghofp2/ukpsgEPcHoA52FgtBLdh/yxCWjMUdAphNQ154UpZRFbYF2sXJIqArmkOHhLKlYMHfiW3vjZw0N2heiMB8q8erqMY0+sIcmdFTk/6re/SqgR9DfGsJhpUHJ9px85DzqKkF1d8SOMQJhsZiqabz32JVgfcKCZUUTJnOUq3fhqQX5YuCsP8tS+Jr0Ax0U7VDb2v9oVG4Waoz3MTo6KN1syjbwRuDF9HfGINmzde2EnuhBl7tqkvZCtqstxZqTgHsT/C27WnNFiRZz4EEBcz/X2FSpLurjSov6ByzVpRKeGfuvw0bs/X3fqQGm8WwXZc1KL9FvnaC5utyX8uU6TmZUdZ9Cm6SEcDNa9QfNNkICQPmxhu7XZfSF27VJVOSFja2C51PMz6oE75TdVTyA3VWYWNS2dW1DFQtYXczdDNJgHbP+sFYWq/X8y3FU44y3Ck9oebc+B72gzqBSsGUiwO7eJftCaCCtoIm8eqW1DbkigXPKGvF0fjerUNacl92gan8zGPSQVMGXpm8CgbQgX3s/FuKZ41iESdimGHJ4kTGPPaNA2LVNzdqqGvoQBJ8SiKj1i3/9mhatigIgQ1ZIG/O/sHK7G0KCttMe6Op0BxQ9QEmBPHxNhppu7LqI5UOuU3ebcMbb01Jtac9nkhjLXskchX9x8yX0xGjv+2diwftaeKbluacOq86WU6Pfo9SfsDHtAFxcdeFioq/Rw+EZqQoHF3NhtnuB1t0f430hAbJFDtVEg30H8KjcDmgaOmYcS38SkVY4EKfEl47u03SetFbHYRy7aOOy2A3q30OqMjppf88pa0iwWoyQ4Qph7KSL12mXyva2a1MwEn1yoE3sql8jpDv/xLJacm9cBP5Hgn8CiLjhb4hAKNTcbotE/9a9tK9aYjmGyGzmmV8589TzXm6zCVtKkPCewYcML0biZoTKP/taNZye5haTJ53yIWuo2Fz7Ek32WlWcuC8tvRV1yG1OHLOSHMobDfb34dGglgZfWrexwjQDxPAJbWsGtw/XDu/wccnTIj7ZqHq96ld7vihw+UbIbKq/FaVtG5tZ0ngKa139JRTcGvOP8vi+4SZYdM5hddOEQSILYl7GEhb+LSdRezG03I8ujm3fxLNwvDcL8sq8A9nBUYt4c8xnhxT9vZT0ldbs4uwTnfJyHyRsJp9l+h+KFopVCuPgcF/r7Lgc3aE44fddwQwhZU/bsmb3adinJ5imU3FPolG7A37Gv/qbqRH/Oy9gLMPLaMZ2qBqw6ZyqE3nZa3BIsUJJeRlRomBt/9HHE19uGgg2mOi06SvX/cn/GmuSEt7YwkgmKLfVI6z6G57SYcosdY8SHAgIocS2fLYJGxfhhtwQszj6+rzdxUgtMu3nbjYAcmpQf23ZBuhHGA2l3LclDLDw3MQNGhN1r7Os8RSPYyD2I= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 998ed442-5fff-404b-7ee2-08db032eee12 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:00:30.1542 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dCDRzpqcFaC7Mw42wVnYeoQ5AaMVb656j3wEGRw559UeOgkdJ7dA5aTz6y0lFCJaEa9e3XxJekfZHm5VGx2UcIJKvFkb9YngtR3ZsP6hEGCCwcXsJz5jOei0uMmO7dU3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB8196 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/spear/spdif_out.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index fb107c5790ad..469373d1bb41 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -244,7 +244,8 @@ static int spdif_soc_dai_probe(struct snd_soc_dai *dai) struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); host->dma_params_tx.filter_data = &host->dma_params; - dai->playback_dma_data = &host->dma_params_tx; + + snd_soc_dai_dma_data_set_playback(dai, &host->dma_params_tx); return snd_soc_add_dai_controls(dai, spdif_out_controls, ARRAY_SIZE(spdif_out_controls)); From patchwork Tue Jan 31 02:00:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648940 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 31FF2C636D7 for ; Tue, 31 Jan 2023 02:03:11 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 0B559EC5; Tue, 31 Jan 2023 03:02:19 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0B559EC5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130589; bh=rC6vpG1Ta9mnRrdRF74hBeGJBtsTTlZH2sKayhKRNb0=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=JQtL7GQvjnTV2b9lzXhU/WNW8Q/hZBWBaudMd2B1PEtFOG6KWKx8vy8PmzEsnREiE WXwZxfGNZWdGnnedJqG9wt47VA4QV3vsZnqfhm4a9a8g8xHJdoIR1DPSpQ1jZK+7ws ovisPuqqQ763TDuoCkgWJR0Rk2f63mDcyurtAFRo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7539AF805A1; Tue, 31 Jan 2023 03:00:46 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F25CDF805A8; Tue, 31 Jan 2023 03:00:45 +0100 (CET) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2110.outbound.protection.outlook.com [40.107.215.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 056E9F8047D for ; Tue, 31 Jan 2023 03:00:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 056E9F8047D Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=RBwtKBcT ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ep8R2asfZBHkkZPDjhMz60ZC75exTkXP2p4Ps9HbS97NXMZbM6EUd/h736pZfN3eXyrS6sWf1zgr0dldjMZ1UnoAur9hzQrwYK61PUG+u14tJ+ngEUkNtikV21Qa29A681ch515fSmSDrw9xZkqaeaRN0LvpIlz2/AuZqn2gQkcDWSQflATeoEcpjTJlRTxw8HR1VtYzQ6LaQeOrXYJnJHbCjq4CHHBAbZMKSLX++sTpvTYIWVRfOodNHW71erFP9mLAjc65dexOWUrX/CAe1p2uuPkJzWux1t0NgNpB2XQH9fUEkrItCIEFaRWqMLduZVzI6xS5mliL/sNuYxZ3Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M2CsvswnVRA/ZNYiMOCeNyvKVtXWrxiY4lp1NA2px+0=; b=icwBp65h3owhX/YYuVIE7VqsBCb/uLBwH3HbKxDoD89pkvy12sAV/7XoZu8HIUV5E1csKZR72ly45XRIlDkEXUiMZL8Yt/IsuwAwNf44jjIFCqyyJygbOksOqAzCiybpzsJ15gjJr4nJJBvjIT2uGTe3nt8y1Rluu5a5A9Az8/19kotbopbGhJ2QXDBCjREsIruJMS51AgwKHzAg0Bl6WrRGbsfj1FxWcuzfLvlvHrFVkUQlqw2+Em2mdzakPmrGwNm8BCedOJjfh+1QVsEMW9dyBsav3/1gQohcI8+mn5cx2O8f697t3q2Ii5xNXCnmvYwAWFoWX06nbH1uaqQokw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M2CsvswnVRA/ZNYiMOCeNyvKVtXWrxiY4lp1NA2px+0=; b=RBwtKBcT5UjBI/Hy5AUOgKGnbAsie3ZVoLTqOgwn3HNqr5V8xcnVSmQoq26cGGuxKKgZ5R+/xtsV21CYq1pO334yBXEbawyqc0DZOLe9ERKzSvoj5rboguHwWKiBDrQM0KZ+Ky2Z+dS4Yd8slT5IVly/fQv6EVUIEqC4gkCP+yI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS3PR01MB8196.jpnprd01.prod.outlook.com (2603:1096:604:176::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:00:37 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:00:37 +0000 Message-ID: <87v8knea4b.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 12/25] ASoC: sdw-mockup: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:00:37 +0000 X-ClientProxiedBy: TYAPR01CA0150.jpnprd01.prod.outlook.com (2603:1096:404:7e::18) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: 67251462-5d91-4ccb-0e02-08db032ef249 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: b3LTBMZNKdzIqjsBghlYYC3A0iN7HDs2h9HAe/p9HSS9EzHJMqZMwARePMSmrRLcmvTCS2AZq1sWirAiWjihvksQ5lbl2GHh1Tsdf+hiQyOS1bqM40duWvymxGhqSUA5J01qn4hvh8d+ZBBlB/q8iaFBmgXIvHpBqeR5e3G4YyJuriNSIJz+xlInYLW62R7B6gBBTfZPr+HBWXE6QKGTPn7ZOtuG9vm5To3dNDnER+EB2TXwMkmx3Jkuifm+IyZrzNuKhVpVanqxVD3Zu5iOU6HoIbJln/hWd8IPxvEKToSIH8ec2jPr8bNEfze9niRXjGa0PJeWRWAnX39FBx2ICOuIhoPP9FUutv3jd53uDaPbM3WKIbtwnl8L/+cUrPW1/iqhZKrFrKUhzh0IEwnfA9Z+8AD47gd1iJeukqdHZTmWvQLEt9J2hoCmtSY8bECNFulWnQ7BBoKP56RLhqbVzxWj1yrKMsmZGgFbYBxlk2ku+4OjxTlexDAg4P+tbeL4gwnllzsIv4Cwo5p4OUz2No68W/jFYqsUgkTbgFfxD0y6FXDuaR7z2yIRbzOA+8X7l9E5ArscFRCgfjO/Z3iHpNNqrY7aeOpcTic7u9FvVgHo1G+qGMSMbboFCFyc4XwzCRyd++uwSwkJ47Pjc4T7gvBGlBHfATZeWcvd+FTrBYRhTM8AF6QuzjpRYpWzObsPj5plEV18ytml/lEPhwDNfA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199018)(8936002)(2906002)(6916009)(38100700002)(4326008)(38350700002)(36756003)(478600001)(5660300002)(4744005)(186003)(6486002)(6506007)(52116002)(26005)(6512007)(2616005)(86362001)(41300700001)(83380400001)(66556008)(8676002)(66946007)(66476007)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KSHrpa7raa5541WGtpCG9cHgf40ykXt7O2d1cRZ8tArl9qqzYcKCuzZIsUxDBGAUsEdYAs4H/2w9r/dY2m4SuEk5BJemfPewQbK7HgbX6ZcCEJsvtS1/HkrNU/+wVH3hDHOupUzDOmeaL7xWWZs5odcy94h9vTnPhJF3DhDSyjnhc97pQr6ToPIwW5SVfALyuuRJ85cICf1684U1klbLE6+tsst0ebyjbqQUM7XfzSRV2cRIj97s7EG0lbh2/FyawvD0/R2eOfKOniggJBEjkiOf0p/kzn3YW75FrW8B1r8tb9gI4MMIhn9mXbXxryaIBSwzri13MW8P2KNEMwrVW0fmNh0bEhDiXVTlNAqT0O2hz1nXgsP9Eu+OBxMFajJYcCy9u1HuVd8mhho06l0aqTd6yIhx/x+mcY0vVABURJipDdAFPiBlipQomOP+ZgrKkKHR1ya37QAqyaSbDH+4EYveesyVz7FjodorY9T83WSVqeF7U1B/jhcBrHymNY+mJ+OTYVlvxJGMsimBaroLCFy898C7QzjdYFROs21gS3RudmrkmNBDB1J7T+UhLbE/thOLaK8hLVdPLlQMdJWzAwotyXyF62RWdPswGcx/1KpeBnqiO1TpXKySAFkgi2xgbaWtl1ku51rA+AXlLsAiEzu64u1kKbplzn5gy87PNPc2IODEMspQHrLf8GHlGGefMhwr01MQeiVrhVgb8IrzFT0zLwFH6du/L7pGJ9hZ1TCEL4Er1eiuiKtSGiU41fjSBm2Ca/m619c0UKYIgvZCwhrQVL2d+b7VikJ/cc1y9YaDIfeQo2Rslrb9GPz+IPV3G7y0JWn007calh0YISaT3SAHX0YNodVTahgp57KziH7vpDPb6ZDxiyCW6G+i3U1aIYvjqdf78klEX6puCw5+qAmoa/mkWls2VYgFU6hBFGgEq2H4MqMbhxI1qpqweagNcTBNpl1I0jzVDuVNPHCSQWXwGNhqnZZfhj+0tF/TbMQNcCTwg36647aSUczhvLHycEoQdFxFGK96C+WuKoTGq0zCaRx8JVC9pXgFe629/NV5filgD5EHIQMr3NcyyIaO5d717Q1uFaySmIt1X+DiQBfaO49mKVgyPfQog7sbrUoRXLO36elo7UY2iOk3hkJCwA4MdX7Am4+VwMo7mfA3jUeKGuvtLyqcFp4H7zGRFj5dYDICqKhAOv+exsmXcUxe39Mxa6+IZc3vvICjkBttVGWUEHLXaxabB2h1hGsTTdghinA9Aws8hyXhe7kL//AHhKSWREyiLoxSWiZIuzexGduHtlXYKmT+y6jzGZ48t23Y1Sm8ziZnweiouyhlZ2izsfr+v1z3owfPhwyLV+9HgQ7sPpGrF9W6e3CToeMyCSMl/i97mTgNRzSDJ9DGepoDk+IgUVpJiGyFxYoEUxSdga9nbd6mRSsNsW1pvBj8mjCMDV0dj6usTQwrZJkrYayZwu3KXdCV/tm9qb6yU6fn5VCZgFJdvZB3tOZIT5gIjP9NDF5LLs+A5pqzAF8yxjMMlXNXAtLrleq6spnX/JuQSfj1qFXebqZtYgZByKQrzn+lQ/0kojyt03wI4Zya2mUsjuRZorZZwF2C+mzuhO17QVe5wRw3ehum71OvtvtQdgw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67251462-5d91-4ccb-0e02-08db032ef249 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:00:37.2091 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YaczDUXqK4nsuY0ENGJzDVCjGAcJFxZ86JXMf/9xd742LROYG/rnb98yktbSFX84di3Hio64Lgs6NQO4pXFrNbR4AHWki41Nm3zDbjKsf2lYWl6nNWQ3s8+k9hV0jPSO X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB8196 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/sdw-mockup.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sound/soc/codecs/sdw-mockup.c b/sound/soc/codecs/sdw-mockup.c index af52f2728854..62b02d764f09 100644 --- a/sound/soc/codecs/sdw-mockup.c +++ b/sound/soc/codecs/sdw-mockup.c @@ -57,10 +57,7 @@ static int sdw_mockup_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream, stream->sdw_stream = sdw_stream; /* Use tx_mask or rx_mask to configure stream tag and set dma_data */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = stream; - else - dai->capture_dma_data = stream; + snd_soc_dai_dma_data_set(dai, direction, stream); return 0; } From patchwork Tue Jan 31 02:00:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6DC2C636D3 for ; Tue, 31 Jan 2023 02:03:32 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A1201EBD; Tue, 31 Jan 2023 03:02:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A1201EBD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130610; bh=Bg2LPm52+XPGpxmgJh3ByPosVHOefwffyTmRc6M6ISw=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=IQ0qXb09i1k//4hRevNG36LSPlK3aqWB+ew9oCuxPfk0v50o/y3MdRcrZgZeUHWch 27fBBZpZDbtc6BwFyfuYXGxvsV4ibsnGVid8SnkcvzWOusYEy3ADAa5tpTfIFJrzJb jFeaVgPZ0XL83HJu3o4zbP3I+amfHSVYxMy3IIgg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 39424F804EB; Tue, 31 Jan 2023 03:00:53 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C51BEF80557; Tue, 31 Jan 2023 03:00:51 +0100 (CET) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2110.outbound.protection.outlook.com [40.107.215.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B4B08F80155 for ; Tue, 31 Jan 2023 03:00:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B4B08F80155 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=BVWizprp ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Czb0vERhWWS5G1d7n5G1M7G2tj6KiwKZTvLg+hLm+hlaFXP/05wGwsvHrEvYQSCNekQ/NaoGFgO7claSoD/2UaZjm0rUZZRz4GMUkoALaJQ2MBvi9hwV49XMiU6pj6V+MSYTC6ROIzM2CHEfNPjzQ4R0J+4pZfeQAcA2VjMOxyvmV2D6NPzHmVBVV+OArDDi5L0lfHa1DECVXzu3QWttaFSRtn7Wwd4GLWX+mCza3l/vhn11AlE5CQfBv0oqB93VbkFs2/X58QC+UKo7aiEbFOGKsh9UfAyAsFMkvJqKICVgFib0PuW4nHxEtdF8Ijw4BJ/Hh0sEbXvVW6tf+ChEiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MQx4HoPoGL52/Kny/7aFTOIX0PAowcD2ccoCXKWB1IQ=; b=U9jKM5xM8Cdr7iudFqZ+4fnQ4BBsTQSe+294nEaspPQXt1sKfyfN3TIcu6eDL2eLXu/Wvrj6+dzAWeX/zKf8gxdFLcGK0AbOLbAqlXABBaykzoYc6pD2i+gIIw52UvXEtBKdX4GjqkTnfNT6c5CfjXXAWUfbIIgxrvkND/CgtnBIc/4qFfk3ZQbNckwmd3tCB3ectvFd/kTgr2fsWFvQ02dkTOeYr8UiQ+KcsyV6hxu5bNcXG0fPOCQetCgl+iaxUL7acSGGZRZE5ebEwwCGgm/jjwBEvs5/967VlJ5ZwRvRijZ2uafxzqG6syJOjusCr4s3tzxwqVoSVTNz5Hd/yw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MQx4HoPoGL52/Kny/7aFTOIX0PAowcD2ccoCXKWB1IQ=; b=BVWizprpbl3O2MmFgj5h5OFcYogUqfeOIPoSBivJBN9KZrxiR1zig36Xf15cjHA61kvTQlwg7hFBx0cucqY3UBTuQCIoIDxHGRBPTtz64IWjnKg5V8b3Z8BOWIadWKVoxIVU1gJV0tIweEpTY8G9G6yXdlykeOz8H2rBbhhK6Yo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by OS3PR01MB8196.jpnprd01.prod.outlook.com (2603:1096:604:176::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:00:42 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:00:42 +0000 Message-ID: <87tu07ea45.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 13/25] ASoC: intel: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:00:42 +0000 X-ClientProxiedBy: TYAPR01CA0024.jpnprd01.prod.outlook.com (2603:1096:404::36) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|OS3PR01MB8196:EE_ X-MS-Office365-Filtering-Correlation-Id: b5b10f5f-f1d5-4c14-667f-08db032ef57a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: epOT4kRYTn2MTTdzZwEP85Wo1SXpP/EzJ1/BtU0cEelykyd58hD30r0Darg40gP4Wqc2P4LA6dK/pA1uVLXRJWgr6cjTPEyKgGMHdlrCD2VkkxGN2wOP9nmqIlaB6N5LkrHBbiKKziH03SbAICUZeo1loQ86Qr0AiFz8Ay9qWmaq2tCLCFejAsqCeIbmu8KoTYKcvFgnVnTdsUyQNzvRlFVsFDAqxJm4VJl499Qwc73oGfwuRfnESIhnUFEwY5lgix2zItHyj1MTuLF9TOxE/HYiLHd+n1/yR8OzJ7bJRvYVx7u126+WlODaa7J4YT3Lq213ldzt3j1bpoUHUhJ5qBEq/+CDFD7A6L5k70NWQ+hSSVRPXmGw4r1l6BnBxAO29xifXQr7ZcR1Y7man7zFasTFEOfwC6RJIaxH4WwRfhPn8v5l1KjUuLyWrmiCPJ//kOsxhBw1RNlraipyBQTVXUjsRvv//whoXxiiEkvd9k+8t5YZk6phHzdcG5Jh3WR7pLyRCspag3u6FcCU7esce82FoNgHuI8v57biWztP7ZqeeqR9izhEo72tGhVq1WccOGrw7qIz3j1peHmtD4NYHlxOJB2FtKU144l3Yr6hMXW9ipt4++13LstL+NgETHZRGMCLs7hBAgD9STNHvhWUI+C+R6Q1r3OVsPAQ6evjSjmfjEjzfOtmTsAcGdQBs50s3zvZ7oyO2LXuo3laUCEBbw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(136003)(366004)(39860400002)(376002)(396003)(451199018)(8936002)(2906002)(6916009)(38100700002)(4326008)(38350700002)(36756003)(478600001)(5660300002)(186003)(6486002)(6506007)(52116002)(26005)(6512007)(2616005)(86362001)(41300700001)(83380400001)(66556008)(8676002)(66946007)(66476007)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: m2Rnb/+vk6Qfrvg0IP0HyI27OF3gcknskQ4fTGsIL9+f8l0IC5niLXC2KGfwu2Mr9IwQKVnyqBzjuUk0hwnf3q4zJVOnXOHRbhoIUT3m/xgTLwrces5ArIPKbwa+XBxnNglr4TyCmKObW66lSpQXegq3evvzfEeHEmGa25uYlUhSa8MwdHAA2qlCcJ/4q9CWf04c+gkJiwtJ+/qkEVn/OF4+sw9Uo+1S922zkn8lpB8Tdf2Og25hehH/XCbWQvR/eyWIu/gFxGPtAHYiTOR7x0ORdnSdnPfQsa9crOhOHARhj9dAREKkuXbHp2fTdFKt+sx1tQCUGB+3GWg/9M2a13qfNqR8jqpZROmniVMUycyrAMIo6HI+iLOw308K5ZP4Mghgsp4CLzq/RvdVs2FqUyFXJ5d6cGi5blQTcaG0EFaJ/E/qWR3zeJgNQp3VrQ3YXGmuuKen7rkxfF5sHX1pSSb2bVrU4hrCDPooBBliXFFqJO/d6npnH9xlyqG1RbVCFsgBf2QxFncTLQxVBLWpfiSPL7LY+/BULP6ZpSv6qNawyMxp3anFT49GS+HaVs5R5QOVsYCNWzAKgw7hGInJTBq9xPETurPVFIzJBeOEJv9Q8T7xi9IOLTYIn3EgG7jh7GlXl5ThFm0Z3sIETxpMFtfwh0h2plBv8+QOtwz4qU4vVfXOp+47FvzxUHAJMfvaSGwfz5O3VZtvdUp9HEiUg4EymyPckkLS16t/ue51fXv1Cj6ZUvSdYxRlvbtFeUKdbrpJR5dEPSP7831qR6IjQWqp5APszQFbCDJALJLzTZ0qYZvGXjrsgQYYC7ZNo4w1qPK7MFPmfCkmXTDfAYCXORbLsBkZgvxyKruKCPVzbSmr3s04DYs1p3KkGtYbrVYASImtwVU+l0h1SkXZlFuSvIVhZRNUu5GZ8680owVqPS5g3twtOJQaAEfOLMI9M90a44CG/bnMdM/+GzRIRdj89IqV9Yi+WDLdN89QiSvF4UeW0i14nKkO1vwv++86jQ/aymDpgKLOvpBMZwslE/38f2lesIKkIUwB4GZ/IKGkyXe1b4i2GN0vcr4x2uZVNCHNPXSz88mPEsXAcTP/HZE4v6v4wsPUTUc/p4+zt2MZIU34UOMbNXCnkK6FpFWbfCn6BNSXd+FwBG/51ad73JJe/LmkhRD4i/7kJVfy9tYqKwqSyhm/O1EVHJSx4iRMRg1R2K6Zmvscw39muUPAda5qDSHs0I5ziwewbmMIS856JINAytM71o4MBgPXcA5jUSzd0jst5+DyqelYuxYDVCmr/lfmO4dmlt2uovQyM1y7iEbtr9DziZaOd0l+5RrF48hlPLMdGnqHC9Py86Ktw05p2CMkmiKIZOEnYkIAcJTRxGXjn8bg/mCrzhNUelv0bOTP0U5c/YEUJr1qJkDuNhfoH/Tox9PNTfgpnxBsgUbVaXYrxk2P8O6fSr/oCrrmFBwNLXDX+Di7m10VNaI1Dlw9W0tb0Ow9e4601czdmX1/kjzJjUgkrBQhTobKFhI12lS/cC05+mhOASlV3EHaR4DivyFwxcPZjIIVu+oRNvrEgZ/Vxdju/QJZHdzQUDHOOEsPZ2MskZOXggkwuc1jHcrMY6at932rjcMsP8XH3AYBr9c= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5b10f5f-f1d5-4c14-667f-08db032ef57a X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:00:42.5812 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kQb9jwKtGOt02Eavw1E/XYLNw0ixFZtoxAD9UvfBKd4YO+88r8ec//uhatWKk/S5TT4592ptpjxVWh20MZ3yTwHkCY6fzoyTpBzQt71BvjwPQVdWqc4VENT6PLnGqwO8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB8196 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/intel/atom/sst-atom-controls.c | 9 ++------- sound/soc/intel/avs/boards/nau8825.c | 5 +++-- sound/soc/intel/avs/pcm.c | 15 ++++++++------- sound/soc/intel/skylake/skl-topology.c | 19 ++++--------------- 4 files changed, 17 insertions(+), 31 deletions(-) diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index fd59b35a62ba..38116c758717 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c @@ -1327,15 +1327,13 @@ static bool is_sst_dapm_widget(struct snd_soc_dapm_widget *w) int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute) { struct sst_data *drv = snd_soc_dai_get_drvdata(dai); - struct snd_soc_dapm_widget *w; + struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); struct snd_soc_dapm_path *p; dev_dbg(dai->dev, "enter, dai-name=%s dir=%d\n", dai->name, stream); + dev_dbg(dai->dev, "Stream name=%s\n", w->name); if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - dev_dbg(dai->dev, "Stream name=%s\n", - dai->playback_widget->name); - w = dai->playback_widget; snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connected && !p->connected(w, p->sink)) continue; @@ -1352,9 +1350,6 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute) } } } else { - dev_dbg(dai->dev, "Stream name=%s\n", - dai->capture_widget->name); - w = dai->capture_widget; snd_soc_dapm_widget_for_each_source_path(w, p) { if (p->connected && !p->connected(w, p->source)) continue; diff --git a/sound/soc/intel/avs/boards/nau8825.c b/sound/soc/intel/avs/boards/nau8825.c index 6731d8a49076..b31fa931ba8b 100644 --- a/sound/soc/intel/avs/boards/nau8825.c +++ b/sound/soc/intel/avs/boards/nau8825.c @@ -258,14 +258,15 @@ static int avs_card_resume_post(struct snd_soc_card *card) { struct snd_soc_dai *codec_dai = snd_soc_card_get_codec_dai(card, SKL_NUVOTON_CODEC_DAI); struct snd_soc_jack *jack = snd_soc_card_get_drvdata(card); + int stream = SNDRV_PCM_STREAM_PLAYBACK; if (!codec_dai) { dev_err(card->dev, "Codec dai not found\n"); return -EINVAL; } - if (codec_dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK] && - codec_dai->playback_widget->active) + if (snd_soc_dai_stream_active(codec_dai, stream) && + snd_soc_dai_get_widget(codec_dai, stream)->active) snd_soc_dai_set_sysclk(codec_dai, NAU8825_CLK_FLL_FS, 0, SND_SOC_CLOCK_IN); return snd_soc_component_set_jack(codec_dai->component, jack, NULL); diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index c4376c9c35ef..211edd51a896 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -35,15 +35,13 @@ struct avs_dma_data { static struct avs_tplg_path_template * avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction) { - struct snd_soc_dapm_widget *dw; + struct snd_soc_dapm_widget *dw = snd_soc_dai_get_widget(dai, direction); struct snd_soc_dapm_path *dp; enum snd_soc_dapm_direction dir; if (direction == SNDRV_PCM_STREAM_CAPTURE) { - dw = dai->capture_widget; dir = is_fe ? SND_SOC_DAPM_DIR_OUT : SND_SOC_DAPM_DIR_IN; } else { - dw = dai->playback_widget; dir = is_fe ? SND_SOC_DAPM_DIR_IN : SND_SOC_DAPM_DIR_OUT; } @@ -929,7 +927,7 @@ static int avs_component_pm_op(struct snd_soc_component *component, bool be, int ret; for_each_component_dais(component, dai) { - data = dai->playback_dma_data; + data = snd_soc_dai_dma_data_get_playback(dai); if (data) { rtd = asoc_substream_to_rtd(data->substream); if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { @@ -942,7 +940,7 @@ static int avs_component_pm_op(struct snd_soc_component *component, bool be, } } - data = dai->capture_dma_data; + data = snd_soc_dai_dma_data_get_capture(dai); if (data) { rtd = asoc_substream_to_rtd(data->substream); if (rtd->dai_link->no_pcm == be && !rtd->dai_link->ignore_suspend) { @@ -1291,11 +1289,14 @@ static void avs_component_hda_unregister_dais(struct snd_soc_component *componen sprintf(name, "%s-cpu", dev_name(&codec->core.dev)); for_each_component_dais_safe(component, dai, save) { + int stream; + if (!strstr(dai->driver->name, name)) continue; - snd_soc_dapm_free_widget(dai->playback_widget); - snd_soc_dapm_free_widget(dai->capture_widget); + for_each_pcm_streams(stream) + snd_soc_dapm_free_widget(snd_soc_dai_get_widget(dai, stream)); + snd_soc_unregister_dai(dai); } } diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index b20643b83401..96cfebded072 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -1663,11 +1663,10 @@ int skl_tplg_update_pipe_params(struct device *dev, struct skl_module_cfg * skl_tplg_fe_get_cpr_module(struct snd_soc_dai *dai, int stream) { - struct snd_soc_dapm_widget *w; + struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); struct snd_soc_dapm_path *p = NULL; if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - w = dai->playback_widget; snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connect && p->sink->power && !is_skl_dsp_widget_type(p->sink, dai->dev)) @@ -1680,7 +1679,6 @@ skl_tplg_fe_get_cpr_module(struct snd_soc_dai *dai, int stream) } } } else { - w = dai->capture_widget; snd_soc_dapm_widget_for_each_source_path(w, p) { if (p->connect && p->source->power && !is_skl_dsp_widget_type(p->source, dai->dev)) @@ -1744,14 +1742,12 @@ static struct skl_module_cfg *skl_get_mconfig_cap_cpr( struct skl_module_cfg * skl_tplg_be_get_cpr_module(struct snd_soc_dai *dai, int stream) { - struct snd_soc_dapm_widget *w; + struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); struct skl_module_cfg *mconfig; if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - w = dai->playback_widget; mconfig = skl_get_mconfig_pb_cpr(dai, w); } else { - w = dai->capture_widget; mconfig = skl_get_mconfig_cap_cpr(dai, w); } return mconfig; @@ -1905,20 +1901,13 @@ static int skl_tplg_be_set_sink_pipe_params(struct snd_soc_dai *dai, int skl_tplg_be_update_params(struct snd_soc_dai *dai, struct skl_pipe_params *params) { - struct snd_soc_dapm_widget *w; + struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, params->stream); if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { - w = dai->playback_widget; - return skl_tplg_be_set_src_pipe_params(dai, w, params); - } else { - w = dai->capture_widget; - return skl_tplg_be_set_sink_pipe_params(dai, w, params); } - - return 0; } static const struct snd_soc_tplg_widget_events skl_tplg_widget_ops[] = { @@ -2978,7 +2967,7 @@ void skl_cleanup_resources(struct skl_dev *skl) return; card = soc_component->card; - if (!card || !card->instantiated) + if (!snd_soc_card_is_instantiated(card)) return; list_for_each_entry(w, &card->widgets, list) { From patchwork Tue Jan 31 02:00:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648939 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9654C61DA4 for ; Tue, 31 Jan 2023 02:03:53 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AA762E7B; Tue, 31 Jan 2023 03:03:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AA762E7B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130631; bh=hYqZDX4g7+L1fKSO3sQEEy+epWCS+JZkmubkf8RXX5c=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=FJXGbh1N0y5W6UMIHqpF/YtWNxko2x2kqDmeDBLVzPJWJU78Nniiu7TacEWizDy6g GrJzjcD6kuof6QHkNAElksRtdkc2RZAnJsn34lfqYtJenh8DIHafwmZA8M/EUjIHGH 6Y7v8co4lQ7XeY49XwJsoGqYPNrBdJyRlgHSSYrs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4A3FCF8055A; Tue, 31 Jan 2023 03:01:00 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CFD08F805AD; Tue, 31 Jan 2023 03:00:58 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2122.outbound.protection.outlook.com [40.107.255.122]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B889AF805AA for ; Tue, 31 Jan 2023 03:00:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B889AF805AA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=CMyNDX/F ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GOIysz59r1AqNMYrpVhwf3mKQKRgxBnvFjfGQMQNRaVMuSMJsvwWwWIiI6ZueKvYIASvyb3Smke8bVTPdCo3GvyUFNV4pYhHSjRIfK9WV/rGVcbfTe0Ch10gPg7goj7oBMJ7ZOMLmub6BQnT4+FszX7fZF/HHNjVMgeJQ1vm7rUny81IEhB37LDFhxiCww4APWPoeXVWmoAKVupLUAfKIM+VmpZ4zrhQa8IeN75vScd0ZeRCteqZbC6Ce83V+fWK+AExJQXS5QYXAuGIvokBVyRtsxr6OMxpiqV0Y7tj3AhaqqNTpRP4pme0/9IOMUn8qeKrK4BU8QsfTdiA5TVw/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7N1WfMuE953yiF6f0iUfU38/HT2yYEaSsIaO2U0pbG4=; b=mzNqA1o87IbGQ3FCHduXr6ax4TvCLf1TtwMiKFOLZWyRslZ8L/jOLll9zb6/CdwNV+pI8mOw9WDSp8B2NVIjxbXnTbsdfTFoq78GjPYcpIQXqlgYTuqkrVqfuxMkEBPcpYa9IQen4kYlLfFapkyHnTHvnlb3LpDLAPm6+SaXb/C+Hvs4YGt9ZeVtjUuV6iTD8gWVS/hdFq//yXXP8vqRssFi4PZEWALiSnHssNka3TJ2YXcKI0lFIkh7vbVml1OnBUQBjmeQou6knuIIkJKUHNaK28BYx0Camda1kFOBzziwd/6airrr8ih3bszP73ACZlj2Bzma45mWAQfsM6qreQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7N1WfMuE953yiF6f0iUfU38/HT2yYEaSsIaO2U0pbG4=; b=CMyNDX/FSs1WVVCp4oUD4qibiXkoKcN0PzqZlMhVA5qioTfUx5JPWRi0FGbXwiiFFWQcnVqm0YOenOXwIb3Yzq4jIHoqhm2KwXIYS39NdQRmdXQ8yn9eDEKZqXaXJdqRfx1+v0tYGyJOOE9kojkYrA/MtqsTd2mesbp/Bfjibno= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYCPR01MB11355.jpnprd01.prod.outlook.com (2603:1096:400:3c2::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 02:00:49 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:00:49 +0000 Message-ID: <87sffrea3z.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 14/25] ASoC: mediatek: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:00:49 +0000 X-ClientProxiedBy: TY2PR0101CA0009.apcprd01.prod.exchangelabs.com (2603:1096:404:92::21) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYCPR01MB11355:EE_ X-MS-Office365-Filtering-Correlation-Id: aa32404c-099a-4e19-5193-08db032ef9a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9xHm9M4ipBs+T010U/TCm8dd1V+/hb83cxtfwaXPlo9audSspxzHKxJ8/Zmy3O9O8CrE77wpjxYUWIffHgBRaVLJ9DvhpRYAaRdoZe9ubZK1Ob4ULs24sRgByqJKt6j/dOVe0CdaWAif9xXfU2xg3xmnBCgnojucYIe7ZKU0M8Z4SUAHYas2djOsxsZrBAqFUAkAEIZpVsp0a8vqEN5sluIV2sqlTXS4MxEJ1Ne5A+/Zv3Ku9r0ah75d5Z6bv8pqKqHqLwUf9nspHLLI/V566zxeET47YuZcg32nIpo2b5PBIG6XdB4RH7/eueUPE/Y3kYS//qRJ4PXElpV0Nfb3DAZXLKYbtJBDAdaRLDD/cJ37ws1tAVk2gijBQd0wEKDOZd5wdphrFsjs6pbQX7ofpNsHAzFH165cz54S2sDyjET23AGVN8YWezpcGtlUShf+jhVXa9DKGo0WUB28qISxAlMvl1VPDCF6pBLcZC/WBiprb8eGWJKxm24c0uE2pbX6s9OWfFN0ybO3boReQ+6Lj5/5sBmWKcZNzeyNUpnIFTWD/AU4o5dK4PG49pcectPQhX44pnH6jZwj/nnnY+MeHb4sBDiDg0ctzT+oBua/0oK7M/Ja+1tqB34ON6u0Cqo+ZmRhT3cxHIhJeUsiOHbDlDj5edPukmnZV9G9bRAqzmlZqXIdHfjnqbmnqqOmkQdSW9PwBhw8t/Po9NgXiNihkQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(346002)(136003)(396003)(376002)(366004)(451199018)(5660300002)(36756003)(86362001)(2906002)(38350700002)(38100700002)(2616005)(52116002)(6486002)(6512007)(186003)(26005)(6506007)(478600001)(83380400001)(316002)(66946007)(4326008)(6916009)(8676002)(66476007)(66556008)(41300700001)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PQ6MLu2J5OoN0iTmwBgIPNHN6Ed9BlhC3EqmKoGlZMWl1jif5ugUBqevwivtgoPsR3Dd6q0j9/5fECVfvV3Oco+ASzsfmyMAWOkjoq1oIZysPXOb8jM3EAWCeTpSArVcZ26ZRXWbzRWtyDXNOgIvASaEEPgEHiAtNCgvPzzviBx8vbqT6ZTScqvH8TNWXDn+R93gCHee2ZVviMQ+jSwZ18jCF5yfORcnwQR/MtOgwYQRE6BN2ySQP+F7J82wz2w27pNWqdoOJVHrKf9TWNhQBNHjQesfXPUfjcIbGZdYI4naXIiDbbltW8vyojMzPsCyk9n1uVgtmWDVJ1fuopyWWmg550mJKZIRNbknTPPLBW6eylt7bMjGUfKXCtomd5dbp+DeGLpLSDHZCbDYdXUG3347pC1/gUGqNhslkN5YBsI9+EyLtaE+PQZBkiZJKwckMMml5+OjGOpto054jwfUwMUU2DdNoD5V14WhNc80JvNIvWEIcCtE56JLObhpfaTml28YxF8ANl82unHSTtNNktwEGbhT733yzpM1lYgl6/4RDRfcmFVu7TahVUvcWkWo6Hgk8WeNDdN3zGBspgwkuRzX6ZHqC3S7Ow6KlJp19PZcCBY0Rz10lpT1vHQPJFchj7tQ2Mt2GqxCgMgILKiInY9yHDENhsTE0bAp6CFvS4FNuhYe2NPTUMKEMNZsuubAll1WDRYeNkupPqyd4Al26YRxqI1v+td7dYXTJBL5z2v4XdZJ+nOW/nGTeGNWgk79C9/L2apOh+Dyz5hjWYxbXa+vKo9qqTWFc3F+l6z7EXwIWRHp59JiQJcJMA5i+C06CmrF4ejx1pHqaavCPfw351YvEAtLmOysaBsjy5gG97KmcDREtTachkR/ZItsRp1b+c8DEUKcQvDz6kQuCDAc2SSw6Cc9i2d9FwFh9PyiCNqaiCPE1b0+igsLNmwaSvgZOqillrOe64s5XXKKkOOxn6WN6zQktIND6uxuOBPn/Ky2GpuMv8XsaL0ISBEfwlLt52H1ByWp77OBSidgC7GZbE0EuZT+8vzOJMRfqkJoZv7WMruvOR6U43CQFCdfZxpBteHLPk47Ww8JpLBd27zIhXs0wc94UBBhXH4YrHGffcyV5WbfnkUlc24yCUjQJ1JP6NVpseZrUp+FNGahNa0KwE5b8E1Eztx4Mjqo8C+ZDmR4YyyavLxpoOH/ECUlwhghJhUptrT2CgLtCUh5SuSdhcpEesXVvYinLBQCTW6AD4BDqrMcDuetQBixmfoZnMc1ePBQlMc3I94J7vDoUiefxszPCgXAzQX+rIq+JgZ0K7y67tFoNqlHIXpZ/xjuu8DT0djeJDdpH5NOUmgDMOjsCurKCBJowCMVhU46bvLeeqyo2LCuYm/ysYyMJG3lgtfg/H5iOAmZUOnFdtVYO2vwnZc170GJig+F0uToOxoTDlse9oRpbaB56brXljQC3k33ZZ4IUh90KIHvCzd/+rZkKuQqEHgyiQ6RJ8cugHAUxXC6uxQi9Y3gctT3eZ/+Pk+JhCtut6TWxVVCEDp81QYtcgC22itUGijPTJbbJXi/mHdfgcmxvKy2BNKNS9BJk03c0Ptvd3k6y3cbCIE47qnbfbkS66sFuZm9xrjjOOwOa4k= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa32404c-099a-4e19-5193-08db032ef9a9 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:00:49.6465 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JPv5eugyp4Pp9tVjsisS8R7CnY3TdXE03ibaMlXFh2vzwCGFmEYW7ni7ZbQwut7cDEPYA0TEXgONmQIywzvWt/fCej4R0zgKdKU9cm4saWhNiDOL0+o66T14L2ED4ctv X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB11355 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto Reviewed-by: AngeloGioacchino Del Regno --- sound/soc/mediatek/common/mtk-dsp-sof-common.c | 18 +++++++----------- sound/soc/mediatek/mt6797/mt6797-dai-pcm.c | 8 +++++--- sound/soc/mediatek/mt8183/mt8183-dai-pcm.c | 7 ++++--- sound/soc/mediatek/mt8186/mt8186-dai-pcm.c | 7 ++++--- sound/soc/mediatek/mt8188/mt8188-dai-pcm.c | 3 ++- sound/soc/mediatek/mt8192/mt8192-dai-pcm.c | 8 +++++--- sound/soc/mediatek/mt8195/mt8195-dai-pcm.c | 7 +++++-- 7 files changed, 32 insertions(+), 26 deletions(-) diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.c b/sound/soc/mediatek/common/mtk-dsp-sof-common.c index 8b1b623207be..6fef16306f74 100644 --- a/sound/soc/mediatek/common/mtk-dsp-sof-common.c +++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.c @@ -32,7 +32,7 @@ int mtk_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, continue; for_each_rtd_cpu_dais(runtime, j, cpu_dai) { - if (cpu_dai->stream_active[conn->stream_dir] > 0) { + if (snd_soc_dai_stream_active(cpu_dai, conn->stream_dir) > 0) { sof_dai_link = runtime->dai_link; break; } @@ -111,21 +111,17 @@ int mtk_sof_card_late_probe(struct snd_soc_card *card) for_each_rtd_cpu_dais(sof_rtd, j, cpu_dai) { struct snd_soc_dapm_route route; struct snd_soc_dapm_path *p = NULL; - struct snd_soc_dapm_widget *play_widget = - cpu_dai->playback_widget; - struct snd_soc_dapm_widget *cap_widget = - cpu_dai->capture_widget; + struct snd_soc_dapm_widget *widget = snd_soc_dai_get_widget(cpu_dai, conn->stream_dir); + memset(&route, 0, sizeof(route)); - if (conn->stream_dir == SNDRV_PCM_STREAM_CAPTURE && - cap_widget) { - snd_soc_dapm_widget_for_each_sink_path(cap_widget, p) { + if (conn->stream_dir == SNDRV_PCM_STREAM_CAPTURE && widget) { + snd_soc_dapm_widget_for_each_sink_path(widget, p) { route.source = conn->sof_dma; route.sink = p->sink->name; snd_soc_dapm_add_routes(&card->dapm, &route, 1); } - } else if (conn->stream_dir == SNDRV_PCM_STREAM_PLAYBACK && - play_widget) { - snd_soc_dapm_widget_for_each_source_path(play_widget, p) { + } else if (conn->stream_dir == SNDRV_PCM_STREAM_PLAYBACK && widget) { + snd_soc_dapm_widget_for_each_source_path(widget, p) { route.source = p->source->name; route.sink = conn->sof_dma; snd_soc_dapm_add_routes(&card->dapm, &route, 1); diff --git a/sound/soc/mediatek/mt6797/mt6797-dai-pcm.c b/sound/soc/mediatek/mt6797/mt6797-dai-pcm.c index 51f736f319e4..8a309b0734f7 100644 --- a/sound/soc/mediatek/mt6797/mt6797-dai-pcm.c +++ b/sound/soc/mediatek/mt6797/mt6797-dai-pcm.c @@ -183,6 +183,8 @@ static int mtk_dai_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); + struct snd_soc_dapm_widget *p = snd_soc_dai_get_widget_playback(dai); + struct snd_soc_dapm_widget *c = snd_soc_dai_get_widget_capture(dai); unsigned int rate = params_rate(params); unsigned int rate_reg = mt6797_rate_transform(afe->dev, rate, dai->id); unsigned int pcm_con = 0; @@ -193,10 +195,10 @@ static int mtk_dai_pcm_hw_params(struct snd_pcm_substream *substream, substream->stream, rate, rate_reg, - dai->playback_widget->active, - dai->capture_widget->active); + p->active, + c->active); - if (dai->playback_widget->active || dai->capture_widget->active) + if (p->active || c->active) return 0; switch (dai->id) { diff --git a/sound/soc/mediatek/mt8183/mt8183-dai-pcm.c b/sound/soc/mediatek/mt8183/mt8183-dai-pcm.c index 38ce0e36cdb4..4e25287fc0e4 100644 --- a/sound/soc/mediatek/mt8183/mt8183-dai-pcm.c +++ b/sound/soc/mediatek/mt8183/mt8183-dai-pcm.c @@ -183,6 +183,8 @@ static int mtk_dai_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); + struct snd_soc_dapm_widget *p = snd_soc_dai_get_widget_playback(dai); + struct snd_soc_dapm_widget *c = snd_soc_dai_get_widget_capture(dai); unsigned int rate = params_rate(params); unsigned int rate_reg = mt8183_rate_transform(afe->dev, rate, dai->id); unsigned int pcm_con = 0; @@ -193,10 +195,9 @@ static int mtk_dai_pcm_hw_params(struct snd_pcm_substream *substream, substream->stream, rate, rate_reg, - dai->playback_widget->active, - dai->capture_widget->active); + p->active, c->active); - if (dai->playback_widget->active || dai->capture_widget->active) + if (p->active || c->active) return 0; switch (dai->id) { diff --git a/sound/soc/mediatek/mt8186/mt8186-dai-pcm.c b/sound/soc/mediatek/mt8186/mt8186-dai-pcm.c index 41221a66111c..a50aa294960b 100644 --- a/sound/soc/mediatek/mt8186/mt8186-dai-pcm.c +++ b/sound/soc/mediatek/mt8186/mt8186-dai-pcm.c @@ -218,6 +218,8 @@ static int mtk_dai_pcm_hw_params(struct snd_pcm_substream *substream, { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); struct mt8186_afe_private *afe_priv = afe->platform_priv; + struct snd_soc_dapm_widget *p = snd_soc_dai_get_widget_playback(dai); + struct snd_soc_dapm_widget *c = snd_soc_dai_get_widget_capture(dai); int pcm_id = dai->id; struct mtk_afe_pcm_priv *pcm_priv = afe_priv->dai_priv[pcm_id]; unsigned int rate = params_rate(params); @@ -230,12 +232,11 @@ static int mtk_dai_pcm_hw_params(struct snd_pcm_substream *substream, unsigned int pcm_con = 0; dev_dbg(afe->dev, "%s(), id %d, stream %d, widget active p %d, c %d\n", - __func__, dai->id, substream->stream, dai->playback_widget->active, - dai->capture_widget->active); + __func__, dai->id, substream->stream, p->active, c->active); dev_dbg(afe->dev, "%s(), rate %d, rate_reg %d, data_width %d, wlen_width %d\n", __func__, rate, rate_reg, data_width, wlen_width); - if (dai->playback_widget->active || dai->capture_widget->active) + if (p->active || c->active) return 0; switch (dai->id) { diff --git a/sound/soc/mediatek/mt8188/mt8188-dai-pcm.c b/sound/soc/mediatek/mt8188/mt8188-dai-pcm.c index 3f1696dcf81c..5bc854a8f3df 100644 --- a/sound/soc/mediatek/mt8188/mt8188-dai-pcm.c +++ b/sound/soc/mediatek/mt8188/mt8188-dai-pcm.c @@ -227,7 +227,8 @@ static int mtk_dai_pcm_configure(struct snd_pcm_substream *substream, static int mtk_dai_pcm_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - if (dai->playback_widget->active || dai->capture_widget->active) + if (snd_soc_dai_get_widget_playback(dai)->active || + snd_soc_dai_get_widget_capture(dai)->active) return 0; return mtk_dai_pcm_configure(substream, dai); diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-pcm.c b/sound/soc/mediatek/mt8192/mt8192-dai-pcm.c index 239e3f5b53d3..2847a2e747be 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-pcm.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-pcm.c @@ -273,6 +273,8 @@ static int mtk_dai_pcm_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mtk_base_afe *afe = snd_soc_dai_get_drvdata(dai); + struct snd_soc_dapm_widget *p = snd_soc_dai_get_widget_playback(dai); + struct snd_soc_dapm_widget *c = snd_soc_dai_get_widget_capture(dai); unsigned int rate = params_rate(params); unsigned int rate_reg = mt8192_rate_transform(afe->dev, rate, dai->id); unsigned int pcm_con = 0; @@ -283,10 +285,10 @@ static int mtk_dai_pcm_hw_params(struct snd_pcm_substream *substream, substream->stream, rate, rate_reg, - dai->playback_widget->active, - dai->capture_widget->active); + p->active, + c->active); - if (dai->playback_widget->active || dai->capture_widget->active) + if (p->active || c->active) return 0; switch (dai->id) { diff --git a/sound/soc/mediatek/mt8195/mt8195-dai-pcm.c b/sound/soc/mediatek/mt8195/mt8195-dai-pcm.c index caceb0deb467..051433689ff5 100644 --- a/sound/soc/mediatek/mt8195/mt8195-dai-pcm.c +++ b/sound/soc/mediatek/mt8195/mt8195-dai-pcm.c @@ -213,11 +213,14 @@ static int mtk_dai_pcm_configure(struct snd_pcm_substream *substream, static int mtk_dai_pcm_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { + struct snd_soc_dapm_widget *p = snd_soc_dai_get_widget_playback(dai); + struct snd_soc_dapm_widget *c = snd_soc_dai_get_widget_capture(dai); + dev_dbg(dai->dev, "%s(), id %d, stream %d, widget active p %d, c %d\n", __func__, dai->id, substream->stream, - dai->playback_widget->active, dai->capture_widget->active); + p->active, c->active); - if (dai->playback_widget->active || dai->capture_widget->active) + if (p->active || c->active) return 0; return mtk_dai_pcm_configure(substream, dai); From patchwork Tue Jan 31 02:00:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649227 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BE2F8C61DA4 for ; Tue, 31 Jan 2023 02:03:59 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 07FBD1FA; Tue, 31 Jan 2023 03:03:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 07FBD1FA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130637; bh=VuJUNAo9gz1HSTn/c4B/Mzd4Eytv73XR4e/E4Ll/MpY=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=sMMWV2xdPEdTyjE4qMdKq+c08IOhslaSQkHRu86CerVOMjSVk0Lw6PG+yJf8KwJBi hSKYHbg9Jm8WGopj1EH088a3OzTYG+FnmatAN0HDTLTyRCnYCqjsGJVPu/J7kMTeNt TlHC9I62x/NXpnWuIlidwt5gRjRpkdgA+Zvb1KC8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 189EFF805B1; Tue, 31 Jan 2023 03:01:08 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 75E39F805B2; Tue, 31 Jan 2023 03:01:06 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on20728.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::728]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9CE1AF805AA for ; Tue, 31 Jan 2023 03:01:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9CE1AF805AA Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=jNVI7NQn ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+t+i423/0WBFnWBkB5Fe4aG3ZM5rwMi5HkUjoFBNm4LgRyWRsP5BVVlFFjQWkfKxcdIMaEGcC1YYGvgUrCrdQstRbHAGBjZMvBS+aTpWSDQTWG8CqWYuD3q+NLj3HVWLBG5AfIpmlEBVuAQcBlrqS5q+u4sSNd+BgflKbYal8lTv6c/qDh7djcK97Gf4ClTEYrH84EaBOtuinDOOnyT0AYvcQnAA9T+g2gXClPqIvsfJ2LRlz0w4lBMq8lqjSvvT6Rgscz5TTEA1IicpqDu1qHcZAYOmXHGHYBGLqy7K2In/dxedt6Hxj3W43s8sRPogWfayr9JoI+2mosnYCEy6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0QZerTTdPFnj38fvbS+BkbLYO7xF5urrNxdtZx1z+qc=; b=Wd1Z9IQ7272Wjel9VqLv2ST9d8juSYq+nRu+2FSm/X0FsznzzlbOXQRp+Khz9zbWa93dInoXCdwH0O1ZqCVf614FKJuYiVyvw3b0497cJvMlDsMyhr0Zs9ew3GklurdHd0QRP+4DyJin5YAgoWVW3WhkBBhEjmsk+fJapWr3sxuPG/iivxN5hST4hk3A9gcY/Q54EreFM2XcJ2DBveF/jYSsa8VSKWGCwhNxze98niRha/MPjkQB7FDRfG/aQmaoHq4QeMwFXa6QPHyQGv6+BSJ8G6atm9Eaazi1Jk0CZOTqdtuiBaB0cGtG5DPtotThUYO2xJUQMP6Dkgcxz9TNJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0QZerTTdPFnj38fvbS+BkbLYO7xF5urrNxdtZx1z+qc=; b=jNVI7NQnQzf+SMB8OQclP2buFPfWk5L0n//9oHfop6SSr2/7B1zR/p0FFmngFP4NpsokvNj8VEhYARuD+yAocAjBC70pKh+ZcRqMn+QjHe8QEzE0gNCnjrg5KjtuIygx1enlx2uxLsHPqxovHX5G712eANlIEn8ogxLpEmViuFQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8592.jpnprd01.prod.outlook.com (2603:1096:400:179::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 02:00:57 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:00:57 +0000 Message-ID: <87r0vbea3r.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 15/25] ASoC: meson: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:00:57 +0000 X-ClientProxiedBy: TY2PR0101CA0023.apcprd01.prod.exchangelabs.com (2603:1096:404:92::35) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8592:EE_ X-MS-Office365-Filtering-Correlation-Id: fac97567-49d3-44ed-2620-08db032efe35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f/sV+XvkXwqc34CofdLYMugUwF8+tBWqQkyJw0Rcyo+tHjo4R3f4ab5b7X5kEG8X5eNB4zXgd1xkuV/CnmdBDccU+JcC23K+K5IObvObQmmzZZfTu32fyxoSZan3GiPRzO3sZEwIk5XvGikTuZgJUcu6itXlyifxbGezKuMWxLqC/08xbGaAA0kwl/2iNQC72k7U3fQxRKDY6MnMSQcaYG0M092N6Co5pWYilNwiOKb9afzSEvO0j+cyba8eD+hPX/gB3h3VDgGdTAg2k9eRddKHDS/YeU9jk2s9a1YPfRaCTeFlQqd9xJGHrAGEFUB+1Tw0OWTWFkRbSqxixjDGwEpbBaewFn7Hzdzc/g3z7joBydkitnarpWKWZhWomm8r9KARJJjQ/BQ1Ghh/jtb1CafyO5akoeVwPcbjltmOwUlpTWS7LOjqXmObg8OaCPajsYNrk7N9pNfYTT5m4Hdebu1P4gabUXTZFhS+u/qmvN4UQDzre2Z06w/gTjsGT0fA1jdEEP2AkViEL9zlnhfVhd7Rdxr66+f9GtWNwWX+5BGopU846gOsg/siJwB6kdulD2D7GReH96xv9H8i/1zjqY3Eu8QUt1HXPvi+9eySnMHm3L+EGal2ACdIp2DQC7dCS/RyNxLuZuVYs7n5setvfQ49thjf38Lx3Tvym8A6eirzHkdpISS0TpmaYTM9HhwwsZrofc5j8cfvfM5j5sDW7A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(451199018)(52116002)(6916009)(66556008)(8676002)(66476007)(4326008)(41300700001)(66946007)(8936002)(83380400001)(86362001)(478600001)(316002)(2906002)(38100700002)(6486002)(38350700002)(26005)(6506007)(5660300002)(186003)(6512007)(36756003)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: QSO795OxCd5ZObgnS53fk+H/8uUchRJt2car1Jj/8ey9DC2zOgWhtIZSjU5HGqTaXwU7m+xSCVtTiR8hlLtCzAL9O904oNIKrLCnggIi2ZFvNfwEGvrJDo3w4Kl5T/xX3s134eBID+w4FFbXKy5WIcOMqsKffQKKoNp85E4lbQCqqSOxJ/40/eQl7mmvK96Uu5iaBBkDMKj7MRif3S9BvEpO9FEPhtxnBGzS9yukjIMBvvC9yCZXRYw6waokN4FLlLDh1YlzrXYp2iANrHk4ZnXb1WqfOA3GtQzFCD3QDt3VGkOzylIS//SlWVHWkODP6TobKsb1QwdLLzuHvp/mOwX54fuYHrpwu4SrykcBZbLF1kUe8xXCqa28mwkO4HmrAhIAL21sxWGAc+4Gx6skKqlTwxKop/T1DndPxcd07GgKiUZ+11DXoT3waXqVZTuSu67QFjd8ZpphNk4pfE1jgilZTD6BmJw/docpjCPRMiEuhIS6mG8llMjD2bJ13HCSn36gxM2fHgBdqA2lFOkx3vM4o7T1OnZ/Nnc1nDGHiCHGzFqKcUznvPcDlUySH0Na2qw9rPpD8Z0t2c0rKjBAmxQ+ZrfgO/yb9KyTIyXAVp0i7XbF/evEoVMR68rWRiWH6WID2rV72WcNiZVcv0UQLQGd43I34cgphTgHSz6fLFCj/O4SspZif/tkxUiYrwRftcd968t2dqPgOh01OEeJKfjIJ0Do3WS3x+8JnbFy5e518s4sc6RI/nYpZw/7MZxT9qMoT3xc6Zt0RJko+nePjUHgJhwbvBBexl1wl4T9z+OY8kzY5Sy53A4WhaOwXlMhHia9dtn10AyaCHDGc0EEHnxidx+ymkLGgEMtbj2hxTVticnbp3OqhsgWCT90OZuuvgrHrH86kpHGAA2AEEmD+hbzGpaOpT7rR0hlDIzkf7SRwHk5HrEBategBGrGxnjEp3ZJQcSISyMNCHbH0SWYZOZOqETOylvLIkrIz9sV2DuBSwHnigf/O4quNWM1YrVdvMF5AVfyBA/dpdM6FM6HRCstbd3IEt47dAK6LEEvWTAst0skFvbAKN82YJ8LK3xe4etrAHNRN3cVUfK2DjLTrmhYcQbk4zkoH+GVw/qvRwYnTJdRw7qbOAQe8EBVO/uSEhjGJrD05aOqk6Gz9KD67qYxVV41OR9XuaX7T60pB5bgkrTAIHtqK1A39SpbXBS9ZP/hPEAOBXuUoe+QM6PQVtDutYDPPOyVKWJeO7pWguNSuJ0RZ46qgbr9Yz4/WlDFR0YmW0yTJ3RTCfZqZ1ZiULpavWY3dleM4aAGJDXAXrK/Yek+fYjUJTqLGplOEGhtlSPUu5axNKmW1zTloyURjQUONJxaqX/J0KpLrIarkbODFhjEirhoV5/4DBnXirds+lCc8zwb1GAc523HMdzAR2zp1ljfKNL64oCszQBkhTofFx39d+tc4460Rz6AHoySaNh+7d9TL0PpLN0ruQDJJ8CRZ/69pT5LdxO4pb0uzsxXtOlj3L39AmgyvGTJY9AuuptW1hURz5mX1+Qfxi0jCWODTe9c8JTCbf5T0vfEQlL3QzRvz1lNmxpP2cLiwgnlbYcYepYCwPRiwnWINrRz+JHFK9FubXZNHDyGyHA9KE8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: fac97567-49d3-44ed-2620-08db032efe35 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:00:57.2425 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RqEFgQVA6sNpjhiaNaG5CwBRyBwZkuePuCZ4xoPhEEJYAZkGB9buCcb4NmFBiSKJU/dLLm2czlZFMzvEQzy+0QqoCrNl3QHYhlytiyBX4jjLHGYt+gz4QAWqD+JAWxrU X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8592 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Jerome Brunet --- sound/soc/meson/aiu-fifo-i2s.c | 4 ++-- sound/soc/meson/aiu-fifo-spdif.c | 2 +- sound/soc/meson/aiu-fifo.c | 21 +++++++++--------- sound/soc/meson/axg-tdm-interface.c | 34 +++++++++++++++-------------- sound/soc/meson/axg-tdmin.c | 2 +- sound/soc/meson/axg-tdmout.c | 2 +- sound/soc/meson/meson-codec-glue.c | 8 +++---- 7 files changed, 38 insertions(+), 35 deletions(-) diff --git a/sound/soc/meson/aiu-fifo-i2s.c b/sound/soc/meson/aiu-fifo-i2s.c index 57e6e7160d2f..59e00a74b5f8 100644 --- a/sound/soc/meson/aiu-fifo-i2s.c +++ b/sound/soc/meson/aiu-fifo-i2s.c @@ -88,7 +88,7 @@ static int aiu_fifo_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; - struct aiu_fifo *fifo = dai->playback_dma_data; + struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); unsigned int val; int ret; @@ -158,7 +158,7 @@ int aiu_fifo_i2s_dai_probe(struct snd_soc_dai *dai) if (ret) return ret; - fifo = dai->playback_dma_data; + fifo = snd_soc_dai_dma_data_get_playback(dai); fifo->pcm = &fifo_i2s_pcm; fifo->mem_offset = AIU_MEM_I2S_START; diff --git a/sound/soc/meson/aiu-fifo-spdif.c b/sound/soc/meson/aiu-fifo-spdif.c index 2fb30f89bf7a..ddbd2fc40185 100644 --- a/sound/soc/meson/aiu-fifo-spdif.c +++ b/sound/soc/meson/aiu-fifo-spdif.c @@ -173,7 +173,7 @@ int aiu_fifo_spdif_dai_probe(struct snd_soc_dai *dai) if (ret) return ret; - fifo = dai->playback_dma_data; + fifo = snd_soc_dai_dma_data_get_playback(dai); fifo->pcm = &fifo_spdif_pcm; fifo->mem_offset = AIU_MEM_IEC958_START; diff --git a/sound/soc/meson/aiu-fifo.c b/sound/soc/meson/aiu-fifo.c index d67ff4cdabd5..543d41856c12 100644 --- a/sound/soc/meson/aiu-fifo.c +++ b/sound/soc/meson/aiu-fifo.c @@ -34,7 +34,7 @@ snd_pcm_uframes_t aiu_fifo_pointer(struct snd_soc_component *component, struct snd_pcm_substream *substream) { struct snd_soc_dai *dai = aiu_fifo_dai(substream); - struct aiu_fifo *fifo = dai->playback_dma_data; + struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); struct snd_pcm_runtime *runtime = substream->runtime; unsigned int addr; @@ -46,7 +46,7 @@ snd_pcm_uframes_t aiu_fifo_pointer(struct snd_soc_component *component, static void aiu_fifo_enable(struct snd_soc_dai *dai, bool enable) { struct snd_soc_component *component = dai->component; - struct aiu_fifo *fifo = dai->playback_dma_data; + struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); unsigned int en_mask = (AIU_MEM_CONTROL_FILL_EN | AIU_MEM_CONTROL_EMPTY_EN); @@ -80,7 +80,7 @@ int aiu_fifo_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_component *component = dai->component; - struct aiu_fifo *fifo = dai->playback_dma_data; + struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); snd_soc_component_update_bits(component, fifo->mem_offset + AIU_MEM_CONTROL, @@ -98,7 +98,7 @@ int aiu_fifo_hw_params(struct snd_pcm_substream *substream, { struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_component *component = dai->component; - struct aiu_fifo *fifo = dai->playback_dma_data; + struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); dma_addr_t end; /* Setup the fifo boundaries */ @@ -132,7 +132,7 @@ static irqreturn_t aiu_fifo_isr(int irq, void *dev_id) int aiu_fifo_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct aiu_fifo *fifo = dai->playback_dma_data; + struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); int ret; snd_soc_set_runtime_hwparams(substream, fifo->pcm); @@ -168,7 +168,7 @@ int aiu_fifo_startup(struct snd_pcm_substream *substream, void aiu_fifo_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - struct aiu_fifo *fifo = dai->playback_dma_data; + struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); free_irq(fifo->irq, substream); clk_disable_unprepare(fifo->pclk); @@ -178,7 +178,7 @@ int aiu_fifo_pcm_new(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) { struct snd_card *card = rtd->card->snd_card; - struct aiu_fifo *fifo = dai->playback_dma_data; + struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); size_t size = fifo->pcm->buffer_bytes_max; int ret; @@ -200,15 +200,16 @@ int aiu_fifo_dai_probe(struct snd_soc_dai *dai) if (!fifo) return -ENOMEM; - dai->playback_dma_data = fifo; + snd_soc_dai_dma_data_set_playback(dai, fifo); return 0; } int aiu_fifo_dai_remove(struct snd_soc_dai *dai) { - kfree(dai->playback_dma_data); + struct aiu_fifo *fifo = snd_soc_dai_dma_data_get_playback(dai); + + kfree(fifo); return 0; } - diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c index c040c83637e0..7624aafe9009 100644 --- a/sound/soc/meson/axg-tdm-interface.c +++ b/sound/soc/meson/axg-tdm-interface.c @@ -37,10 +37,8 @@ int axg_tdm_set_tdm_slots(struct snd_soc_dai *dai, u32 *tx_mask, unsigned int slot_width) { struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); - struct axg_tdm_stream *tx = (struct axg_tdm_stream *) - dai->playback_dma_data; - struct axg_tdm_stream *rx = (struct axg_tdm_stream *) - dai->capture_dma_data; + struct axg_tdm_stream *tx = snd_soc_dai_dma_data_get_playback(dai); + struct axg_tdm_stream *rx = snd_soc_dai_dma_data_get_capture(dai); unsigned int tx_slots, rx_slots; unsigned int fmt = 0; @@ -362,11 +360,14 @@ static int axg_tdm_iface_prepare(struct snd_pcm_substream *substream, static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai) { - if (dai->capture_dma_data) - axg_tdm_stream_free(dai->capture_dma_data); + int stream; - if (dai->playback_dma_data) - axg_tdm_stream_free(dai->playback_dma_data); + for_each_pcm_streams(stream) { + struct axg_tdm_stream *ts = snd_soc_dai_dma_data_get(dai, stream); + + if (ts) + axg_tdm_stream_free(ts); + } return 0; } @@ -374,19 +375,20 @@ static int axg_tdm_iface_remove_dai(struct snd_soc_dai *dai) static int axg_tdm_iface_probe_dai(struct snd_soc_dai *dai) { struct axg_tdm_iface *iface = snd_soc_dai_get_drvdata(dai); + int stream; - if (dai->capture_widget) { - dai->capture_dma_data = axg_tdm_stream_alloc(iface); - if (!dai->capture_dma_data) - return -ENOMEM; - } + for_each_pcm_streams(stream) { + struct axg_tdm_stream *ts; + + if (!snd_soc_dai_get_widget(dai, stream)) + continue; - if (dai->playback_widget) { - dai->playback_dma_data = axg_tdm_stream_alloc(iface); - if (!dai->playback_dma_data) { + ts = axg_tdm_stream_alloc(iface); + if (!ts) { axg_tdm_iface_remove_dai(dai); return -ENOMEM; } + snd_soc_dai_dma_data_set(dai, stream, ts); } return 0; diff --git a/sound/soc/meson/axg-tdmin.c b/sound/soc/meson/axg-tdmin.c index 49b613a1faf2..c8f6ea24ae78 100644 --- a/sound/soc/meson/axg-tdmin.c +++ b/sound/soc/meson/axg-tdmin.c @@ -83,7 +83,7 @@ axg_tdmin_get_tdm_stream(struct snd_soc_dapm_widget *w) if (!be) return NULL; - return be->capture_dma_data; + return snd_soc_dai_dma_data_get_capture(be); } static void axg_tdmin_enable(struct regmap *map) diff --git a/sound/soc/meson/axg-tdmout.c b/sound/soc/meson/axg-tdmout.c index 22d519fc07b2..c4039e4f0847 100644 --- a/sound/soc/meson/axg-tdmout.c +++ b/sound/soc/meson/axg-tdmout.c @@ -81,7 +81,7 @@ axg_tdmout_get_tdm_stream(struct snd_soc_dapm_widget *w) if (!be) return NULL; - return be->playback_dma_data; + return snd_soc_dai_dma_data_get_playback(be); } static void axg_tdmout_enable(struct regmap *map) diff --git a/sound/soc/meson/meson-codec-glue.c b/sound/soc/meson/meson-codec-glue.c index 80c5ed196961..5913486c43ab 100644 --- a/sound/soc/meson/meson-codec-glue.c +++ b/sound/soc/meson/meson-codec-glue.c @@ -39,13 +39,13 @@ meson_codec_glue_get_input(struct snd_soc_dapm_widget *w) static void meson_codec_glue_input_set_data(struct snd_soc_dai *dai, struct meson_codec_glue_input *data) { - dai->playback_dma_data = data; + snd_soc_dai_dma_data_set_playback(dai, data); } struct meson_codec_glue_input * meson_codec_glue_input_get_data(struct snd_soc_dai *dai) { - return dai->playback_dma_data; + return snd_soc_dai_dma_data_get_playback(dai); } EXPORT_SYMBOL_GPL(meson_codec_glue_input_get_data); @@ -99,8 +99,8 @@ int meson_codec_glue_output_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream); - struct meson_codec_glue_input *in_data = - meson_codec_glue_output_get_input_data(dai->capture_widget); + struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget_capture(dai); + struct meson_codec_glue_input *in_data = meson_codec_glue_output_get_input_data(w); if (!in_data) return -ENODEV; From patchwork Tue Jan 31 02:01:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648938 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F41A6C61DA4 for ; Tue, 31 Jan 2023 02:04:21 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CAE68ED4; Tue, 31 Jan 2023 03:03:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CAE68ED4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130659; bh=TQMlP2nPq/QDUPLRENOjCyTngOAgYkDlRcgvB7YXxlE=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=qNQPgI72I93aHG6a8Lw8c4rkpMYqqgTOjw1iwIIXnjCjmpNC7vdEb1f3T+RNYz56j efUqjnhkj90cmOk4RGML9j+NO15mwuQi2T7iv8XWOik04/M4GLwaA8UOwhHu53Qtq/ 39W+k97X7VQMkBhA7AM1tySbpY5YWlV3vul43l9k= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3AC8AF805BB; Tue, 31 Jan 2023 03:01:11 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 38122F805B4; Tue, 31 Jan 2023 03:01:08 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on20728.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::728]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 23D1CF8055C for ; Tue, 31 Jan 2023 03:01:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 23D1CF8055C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=YEtiY/yf ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aVboyIKgV65IEA4PmKROG7A7HRUL5jGNb0qB5KtgR2+d6oVUBTSOrOKo00ESkWKPXcJKZn2AtoJDuGU4csgmxwjWwt1o2VzOREeVVCG79trJWa7bCqOUvbF172xNZL9ctFL2f7Qy8m12Dc2WUM7QROvgxWl5BCobh3aeomWXWqJFUxCKGYMeO6iFVO3SZsul+2qEh6Ali1gV/QdgjmaggRT2fkmYWzgUQHivL6xmndykG/97JVgpKRrFwTd007p/zQo3feGA6MdTn5JesTACVGW68Oq2usOtCctG5BfwDPUxR5ZUqIMFPQTovnsNdcf57BrW4mFMOFvokY5ZiKKZWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=r1lwRWv+Ldc2M5zyJ6cUcgdNTcI7rj6Z3D3wQBfvenE=; b=PPZvf89YGtO8ScFAnkW/8RlvwzlM9K+UPsm1ctRfe9rdt3KJS1WHCxH9zGIuPlXAe/rjzGBX4dbcymBM2ePzTlzYIuWthNcphDKy9R1yDWqUdVLZttnc7tdQzyeFogbTwBfj7bGljV6FEa7xWEeCRrSaILfo91/n7veWXiY/A+BHxHF1muGOeV/dBcaZK1PizjwHrexzppevIyfJYvrctl7zwox+Tn4WLXz6l6oGiG2v42PsfI9/uRNrVplSmxoHv25GWOX1vZyX4Lk/LErWWbv9i81XmuOd/b8ak1LG8OfpTExg2CXjPiYTIOF9ckRUUEA0pX9vpFtm9Mw225r43g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r1lwRWv+Ldc2M5zyJ6cUcgdNTcI7rj6Z3D3wQBfvenE=; b=YEtiY/yfZLwZh+ZC6zySw01Gab/W/81+O4faSjVpLDYGTYPIi2geCYDOJisr+cIFrunZsrexdk3K/6Opp3mWG00HDDrEhkW2+VJ2OEE3SINcpzAA06UBIXoLV8F2+rxEjJfvTSCg8cnAW431dpUtK3WHom5xOfQQZfp8Pb2GmUg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8592.jpnprd01.prod.outlook.com (2603:1096:400:179::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 02:01:02 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:01:02 +0000 Message-ID: <87pmavea3l.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 16/25] ASoC: rockchip: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:01:02 +0000 X-ClientProxiedBy: TYCP286CA0082.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::6) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8592:EE_ X-MS-Office365-Filtering-Correlation-Id: 2470ed0e-7ed5-4903-dfd5-08db032f017d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SD6bwL1Ir6SfYwOw1uxjPSd6iPTO/Ftjqq7/FbYzBy6M08OKLLV94WrciYaXRx+WGLMM2oKpOPsTvLQrFCeP/yX+Lqfsgo027KVTs/yuk1xd7uFQ+G45gHeBjHO4bZFbLvCnOGPX5LI0YYZjAo+349sAQGrftV5zQb8ghiDSat7ponsi3v/+nd6dhzZQiPbl0gO/Ipnt209ZYwkaP36wZTGZLakfS0EATDOI12lu7cgYa7cmBU8ZOVr6gnb/YdN25tAxAtyYK2ObR/U/q8C8PtesLNF1ba51uCCynh/Iowhnx650qJHG4QeMgouhLG27xJR1moWbY7dmZVxNrur7c246t7xaE2vcGbknHISG1Elw71hV+7/ecil0hajxemkbqDvy2JFx8+MRxunzuR4ITyN7Jl2cHSYiPvbYVjpwSGijyDtP/Cs64al8In5ff8orch4e+XuU48gGz+vJdQmd5QuaTpZ/maMc634kLrfWYAgIF40LvhHA3P9uB57F6dDq+cEuoYF4eoTQFz0uRFJVHT0r7p/JfW1eHOf0ACffiPmXREMAsh78hh+aPz7wTp43P+OOoq0/IekMiSe/xp6Qt9HnI4wuMPPzIqhG6BhTfbKKMg7TBdHjG3aF+OKg3+zOk2qR158eILOiiwP/mDMFwIYZM74yG2DHANMcof1Js+jPeAPAr1tzy8Vlnp8z4W8kBdHXwyxQiFSdO5aS/7Tdgw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(451199018)(52116002)(6916009)(66556008)(8676002)(66476007)(4326008)(41300700001)(66946007)(8936002)(83380400001)(86362001)(478600001)(316002)(2906002)(38100700002)(6486002)(38350700002)(26005)(6506007)(5660300002)(186003)(6512007)(36756003)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HIRTxsQigPyCKTUcER6CwBwBy2BX6jOWvDdnPlAxLPfnxWvJXMo29sNT6U3ODeE2t81hc5+rD+N03QxaBM2o9fNwD14sXv23y1HqduDEK+2DKiA1fmo8Hbb6x70XWaMPJHKn80w+9U3UAaz1Yb1Ry3jlTerdS+bw8dYO2hSqKbpGkgCIZ3wN0KepBpgLdvb4FB7rMK6d0cGXFT5iixRHaFuYVcBH2N9w5rV1v/Gkcb1FC9wYCD8LcgTI3Ub39CbpakDg61Yo6s9MweSy/rDwmyTLQVOwaYStxsKaJG9iAEIO/uWVACS66sIldun5nmuvTLdAHT8JzOF0thsmP9kpmZIJJRxbNhTk0ZamXBcIUH5KTEOhu5SgYltm9JikkNt6KFTjFsB0KL5ImzEh+M+3VBeM/kKG3rNs1IrARLtHgClUqJb4ct81nfJFU9JMgXjkoYkzVrV5QHAn2djyBNvlhLuSPt7eau9WDJ6WPDKwAR1dWl2k1tXNZioX91sUgqFvJDmB9vVpqeJRRMwqhZi/eGFk1CO0wdfi8g8NFc+AgHp9iAZZ/DHg1TuvtOa8fMIOSKA+2LRc80Eih+ljk7IPUsYmSZJBSkLGQfBYa+tFcNMVbfXbsFvRh4XzAkKh2yr6R/rWf3g3BmjYMZ5jl8zCGCDdMfc/+T6I46F6q85MCAVcnwKCXbNKj3ZFb+l38q01VmWinn7KOcW/FTMNI9boh6BXjTXeAFsJeYNt1K6TLAyEfZDIwi1qb3yGu5+vVSwO84U1uxyiBcc2GP5xRNS5Xk4IhZVAmAsUu9YTk/uKa3rFiq3DQHs23gD7uAcsMWqkH/CGj1CcepnjO+gRsVNpKhTK99I0M7DBweZSd/hD2LIF9u23hgBWgMni7+J1McRX2dcK5HHZkUn7Fw9WFAqRsktNFPrFq0tMtnKUuO17di/wlCT9rsepCnI4r6+3sHoLBJ9frXguXwxkHx1OQqWvk7bwm9Xmj01j4Ee35zDck0wp4ln7sAulXSOxkpEw0BsXFbuMgaGrogUR0ggqdtH4fWAAw/kPaQXC1HBKlXQhjvoDlJr+wAgZll/0UTV3RozePg5EPfpilwa25U8r3svv/ToOuvLaH/HoaLlSGSiWhEKp3xn8ppUF0CWn8i//Yhcclb648mYEzXdCFk/J9GSGlcRolxVWoLsi6Y/G/NvHgH0kLUoIx0BaXVU24fxcLC5+V6ymF2wwV/PcrkUKUTIOpozz3UCiEGQQoeJ44Tq0KiCPiyoKb7Y0dd47O7Gk+IiZSfRIbVwd75TZLwvuXXKc19KQVduVapu0u4DXCTCZwPFhHFrJD9rPMS5Z34aK0r1noMOwcHOdvI7F9r5+toQPOCqo3ckBhhdTs7FcqCHfMHplHFHFLQCe0t1y8/gYAyyrqV6v0sk06nCGE0+8rKclW5DFJKTmWZSOoWpdyGSXJsfHRKxSh45kFgpPo410SjULSc+LE17zLVcNvuedhfnVYIyXe7AP5/f7o6ptVTuUI06+9nwz4KQ6TECkh9FYe0Wo9ByKhtes+M21rl4hIpzPmJ84+TiDVs3h57ikzdYUYUO7cuAp1nGWj6tuLdHpE7RDUf5JiZGJm0q+nV0vaSsZOXLpUdqllDr2ArDoi4mN5KM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2470ed0e-7ed5-4903-dfd5-08db032f017d X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:01:02.7211 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s9xOMDU4kM4HzZ8Q0zo7qj1dtJ+unLkxmyeJJ3+nYDUH4cDD5PCJlqw3StqRR37kTOU9NjR+x9fINpV4mdbawUKRh0KLC26WFoa0hdsXovG8VJ/d8ZRim4E+apjsguxY X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8592 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/rockchip/rockchip_i2s_tdm.c | 4 ++-- sound/soc/rockchip/rockchip_pdm.c | 2 +- sound/soc/rockchip/rockchip_spdif.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index 08b90ec5cc80..166257c6ae14 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -1070,9 +1070,9 @@ static int rockchip_i2s_tdm_dai_probe(struct snd_soc_dai *dai) struct rk_i2s_tdm_dev *i2s_tdm = snd_soc_dai_get_drvdata(dai); if (i2s_tdm->has_capture) - dai->capture_dma_data = &i2s_tdm->capture_dma_data; + snd_soc_dai_dma_data_set_capture(dai, &i2s_tdm->capture_dma_data); if (i2s_tdm->has_playback) - dai->playback_dma_data = &i2s_tdm->playback_dma_data; + snd_soc_dai_dma_data_set_playback(dai, &i2s_tdm->playback_dma_data); if (i2s_tdm->mclk_calibrate) snd_soc_add_dai_controls(dai, &rockchip_i2s_tdm_compensation_control, 1); diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 5b1e47bdc376..6ce92b1db790 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -373,7 +373,7 @@ static int rockchip_pdm_dai_probe(struct snd_soc_dai *dai) { struct rk_pdm_dev *pdm = to_info(dai); - dai->capture_dma_data = &pdm->capture_dma_data; + snd_soc_dai_dma_data_set_capture(dai, &pdm->capture_dma_data); return 0; } diff --git a/sound/soc/rockchip/rockchip_spdif.c b/sound/soc/rockchip/rockchip_spdif.c index 5b4f00457587..2d937fcf357d 100644 --- a/sound/soc/rockchip/rockchip_spdif.c +++ b/sound/soc/rockchip/rockchip_spdif.c @@ -196,7 +196,7 @@ static int rk_spdif_dai_probe(struct snd_soc_dai *dai) { struct rk_spdif_dev *spdif = snd_soc_dai_get_drvdata(dai); - dai->playback_dma_data = &spdif->playback_dma_data; + snd_soc_dai_dma_data_set_playback(dai, &spdif->playback_dma_data); return 0; } From patchwork Tue Jan 31 02:01:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4EB2C61DA4 for ; Tue, 31 Jan 2023 02:04:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D6D66E0E; Tue, 31 Jan 2023 03:03:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D6D66E0E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130671; bh=T0z3Mce7vgQU4ka0NDRhRgidtcpoOLLnFlssbGJ0FOQ=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=BLzdhB74GKutQ8buIaJt+B47/cKdCzLKRvyL4Yw7X0Zd32FwYJSlKqWfTUgEMUqxR /CdgjBxLfknJw1x1bG6XCWN/3s0inPcd3OP6B75r7zpmorAFV+Pk/O2rQaNLm6PVX7 R98cU3vp6lyGlmT1zHrkgu5NZuIsYYGl71w9LQ+w= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CFA4BF805BF; Tue, 31 Jan 2023 03:01:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id DEFD2F805C0; Tue, 31 Jan 2023 03:01:22 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2071e.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::71e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 81C9CF805BF for ; Tue, 31 Jan 2023 03:01:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 81C9CF805BF Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=Yv4P6mae ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q0KWwt3JjBCtlb/RS1O+nF8zHfitpSjpbbblPbB1znalTwKG9RHP0MhgVijYTRs+Q7Qu0q+XWguiKLmy5fGAo+08LuS1PIdPhcuHczkUxVJ/YoEIYMt/lAlvnbL/bZlNQiTvbhYGKYKkn1pelj6ew7z7WSVQOpe+Kfvc99MWPE/PEKquvNYzAQf38SC1QJMeZ9RwLuVbNRnLFOaD6uktaWiyjoTFCx6TB9AjlCv8SCJYnxQ1yrD6WH9vosurT7P0GHlYvPc7Ytk0l/H59ugIexcr6rnEejM59TqaV1PEPDfd6ZIIHtgm2JhbJ4Eu0mHoje4cq85jX1K7f7JyKzbMgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OQyYNmm2Pimn1dvbZEDcRO+KSwa6SXtya5LlOzGqfxY=; b=IkEMiHD9uRnrTUpm4OmuDuI+C6PP4p/To10Syktdx0mZNATX8UOb5l9FWCdyrq1kAQB79mvRAOV8GRcklCTL1jS/InrfS9tjhBSQ7EtOf/O/Zv1vcs1oFDMRSl+tF6RrJymEKi3dmmFTzE+2V/7Oc5cqao1KEmHqO2ipVvhfBbeHbr1wQu39BACfrhZB40S3FaPS7z5x5Vf2F9mkkg9UdRmtA6rc5ml9vM3sZAyqQxzOPPtXaP3+EOKFS/YnbW97z4vfww6DEQgnMRkEK+dUQw7o1ic9X1pvxaIWNgGrwjCk/ZM+uxsYbAIP0CLLQRNT1IZeQK+XH+zXOrIOV7Pluw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OQyYNmm2Pimn1dvbZEDcRO+KSwa6SXtya5LlOzGqfxY=; b=Yv4P6mae4WLC55WlcYFBlLkz9k/VmGeAJE1WPUFJptdR5BdPdh3ugoULXevtMje2lgHux7qOKFxXozMLZWXvr4cK6UL3meIox6ZjBOs3Gdp4ok3DcqO/JMrCluxrP+PoZ/MT7mTaiv+QphAmG4BqNp2tLaN8rrSpXEsSP4W2NOg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8464.jpnprd01.prod.outlook.com (2603:1096:400:173::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:01:08 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:01:08 +0000 Message-ID: <87o7qfea3f.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 17/25] ASoC: sof: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:01:08 +0000 X-ClientProxiedBy: TYAPR01CA0165.jpnprd01.prod.outlook.com (2603:1096:404:7e::33) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8464:EE_ X-MS-Office365-Filtering-Correlation-Id: acdf9e49-80d1-4459-6b10-08db032f051d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F0AE6MtlPw5qwsIjPdCog3PteKxuGviBoQvkU6j/n5kzELFwwQ8BaHHv6DnvRbOrNSTiJaIbaoMyx4zSX9HaCVU03F0HNw7UTr5LNDcxkhrGDPy/HLVnbp7xMlbrUHZ/Bw+YwgTliZO4Dvq1+X0yuUu5oS1ILgjNkO1HZSv8zwsY3WMRYMtkuha1hOqiM4m2Z8drRHAiZJ3LLz+WcGkUrLK/4DrYyMyeusX9ut02An0wrpPmysroYgD41uRaow+tAzN9Y/lRtwW1R5GyCq22aBPw3aEpXzAWL8eUoylEB2i/pMLzvdeO6xdMzFaOqrW0tuwIA2Vo2pj28MLpHO55oaFopf2TtKPnzhGZo1MVelkAcPMIx5ztUkXIAnTbq+LdSxO7Mnwwvnm6cRFcQh3EyD1eSinRfZ5v3wZHbdEpCGnFiTpi6v76qxBQfLxpLCaEXMQGf7ccLOVGIcsgwy0jYpp/EWqFlvwuzBHAE+QR/8KPAOxE7kljmlX7GNsBJu8TaPSBCSG5Wh1JalDVe4yBcvkor951UgqSSHT5gS8ISJXY7UFOX+u8bDwQWBRMTcONsqlZVfUVm37lSCudRN/Uc32Fv3ODDUD0bKi18RRusc275DdWUzhecvzsCzslhYVMaBb4Xo0jnOZ/dPwrJU1XmKhiBkmf0Q8tg+gjfMUX3CWpTXm0mLigvBbuMwwpIVPwBKqbXfIF9HJ70PaemHk6oA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199018)(36756003)(2906002)(83380400001)(316002)(2616005)(8676002)(478600001)(52116002)(6486002)(6506007)(6512007)(26005)(186003)(6916009)(86362001)(66556008)(66476007)(5660300002)(8936002)(41300700001)(4326008)(66946007)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: A0BC80n0W/wdZ66DG6O7wj/1+k2JxQHBg93zCrZtKhHwVNtDbb5HNB2mph/Z3Aeu/wdjMISI9tLRDK1p6aMU2vqfgQaNtMBUlNYoGSjP3S2LHIXBXfCSaSlRl8PkCXnRVOpUJUeEutuZtI1ssGbViDvTL8nNZPJCttXxb6njlMqkOyCZ8bw9I56aE2ss6Qaifh5x+5VNt2IPg8M0h528LDz24BbvVfYNxF8KBS6osjtyGCB++oNhyQk5B/DcAFKUkPTt2967aDcAuuEeCnJKbKLx8PmHsCHUeT04qwNKB+3sCPyOF7da1voI3TXS8QYek1o+CKNYqk3xz7LpxgL8LW+SqNDeSkj8x6UxhNiEGsrQcrFaU4o+qTGpsIbVvVf4GcxUuR4o5agpPCKWfegpnDLvu+TKwZh8OeuQmcyTt6d1Gtyogpu9sc/6t2mOZoKCXiSimeHAw5O8D9tf+0zkIKhlk/QrJ5QhCqE/UE/Re2EMn+UeFbP0+eM+bnGhVWUvG8izfO1JNAVTeu+ZVjtMp0kg+SPtUgrsQR2W8b92yxDc8WaSBAmYDJ5pI+mlwNg89uWUwg85+qu9kvjUs4EAUBWzIsq9yTxaOHjUa/mClQ4JsLGy0SUp3/Q3tynrtwVr4k4T+gQyHKtiIJw973pLXUhUEA+tQFbkonqzcfeHKKNuPBe+Oidz+Bw3GfqiieZ1WhunhWPx4LDCCMVn4Wq0v0jaS6+XzVAebhSfs8gskdY6XE3UPFnaG9udge94sQp9n+fYKjsYGRPdqt1XIEvJEhHhnpFN+fjD3F2dqJZ0VSDT8n5/nnJ/HR72bCaFxjyug1S0Qlo4PSONpglAL9XlZ7TGNAgB+5Xf5PuMeX/9mkyKTCasr4nOigBGo4XE8p1NfhhnQfSLnTDUBqTMxXpzB2+qglHvCth1zM5KqD7799+BDaOBxGgA1Y1pFYMWLbmqeygd/PR+51VweeeH5npmb8uDzFGEi8SP9/w0t4FzbUq5GvKV926KnKGe39vQ3xMVRGMh3i6NnWt9cVuMXYyI9V6rpdLIbi8lF9o9JiOk0UXogr2Adwa/Xmzx72LEOJRIjsPcOQayvym2E1Hrtz7dVtG1ZGlEtAbbHDIObVKljBu/sR5EJAZAXKJ4/ZdSfNHoQt+wpkOc6aY7PIBg30+TCF0t7psyWnMi6CdvQ7eABNaP0eGmRefbGvH9c30y/s+ea/+K4s5UZhnq5HKMpF6AbUKwpaYzF7juBq7tWFFrGIp1soNtqyYdgOcQmhmIYWWISIsugw+xa186W9Xphi3coag4JGg1jmHoUDQ+Gdkno8EZhvIq0IE+gDgourupHThBpxpTsMltUQwTwd+i8OhhNKnEBVH+P9BYFQS0iBeC/pL8AA40+HRN9RowPxMCHDPFqzoz/AL1z2czSnykACtEyEnpa8Hkxus9E0RtUgzCPUQSQmILOhAmnRWy154B7VfinvmAVOWLtzddUAzMwNxf5Yu4KZ7VRJKk9RZtgX+JIUzak2wn3kZdrRUAzzEXukouvcpLGdH+0ICVTcNB7iTQbTGD6NaoiGV/CTmYpu+w6bztXhkz0aoZ9c7/LZ5VvWzzr/+uRYqdqNi9Gom15Ix5rpOv1ogIhiAjxnX5Ek95JjY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: acdf9e49-80d1-4459-6b10-08db032f051d X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:01:08.8154 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5Zhxq5LRnGHmxppCz2m+ak4sO3pJzuZ2fZgaHzYL3SCZfhqklUqx+5KtH741SJYXb/q7We18byza9SQVtFok9Bo/vDiXmLbaXmVHyYlh0sx7fGsfpbuhOawLD74PcLu8 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8464 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/sof/topology.c | 104 ++++++++++++++------------------------- 1 file changed, 38 insertions(+), 66 deletions(-) diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index 560771ba8fb9..e9a2d4a240b3 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -1055,6 +1055,7 @@ static int sof_connect_dai_widget(struct snd_soc_component *scomp, struct snd_soc_card *card = scomp->card; struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai *cpu_dai; + int stream; int i; if (!w->sname) { @@ -1062,62 +1063,41 @@ static int sof_connect_dai_widget(struct snd_soc_component *scomp, return -EINVAL; } + if (w->id == snd_soc_dapm_dai_out) + stream = SNDRV_PCM_STREAM_CAPTURE; + if (w->id == snd_soc_dapm_dai_in) + stream = SNDRV_PCM_STREAM_PLAYBACK; + else + goto end; + list_for_each_entry(rtd, &card->rtd_list, list) { /* does stream match DAI link ? */ if (!rtd->dai_link->stream_name || strcmp(w->sname, rtd->dai_link->stream_name)) continue; - switch (w->id) { - case snd_soc_dapm_dai_out: - for_each_rtd_cpu_dais(rtd, i, cpu_dai) { - /* - * Please create DAI widget in the right order - * to ensure BE will connect to the right DAI - * widget. - */ - if (!cpu_dai->capture_widget) { - cpu_dai->capture_widget = w; - break; - } - } - if (i == rtd->dai_link->num_cpus) { - dev_err(scomp->dev, "error: can't find BE for DAI %s\n", - w->name); - - return -EINVAL; - } - dai->name = rtd->dai_link->name; - dev_dbg(scomp->dev, "tplg: connected widget %s -> DAI link %s\n", - w->name, rtd->dai_link->name); - break; - case snd_soc_dapm_dai_in: - for_each_rtd_cpu_dais(rtd, i, cpu_dai) { - /* - * Please create DAI widget in the right order - * to ensure BE will connect to the right DAI - * widget. - */ - if (!cpu_dai->playback_widget) { - cpu_dai->playback_widget = w; - break; - } + for_each_rtd_cpu_dais(rtd, i, cpu_dai) { + /* + * Please create DAI widget in the right order + * to ensure BE will connect to the right DAI + * widget. + */ + if (!snd_soc_dai_get_widget(cpu_dai, stream)) { + snd_soc_dai_set_widget(cpu_dai, stream, w); + break; } - if (i == rtd->dai_link->num_cpus) { - dev_err(scomp->dev, "error: can't find BE for DAI %s\n", - w->name); + } + if (i == rtd->dai_link->num_cpus) { + dev_err(scomp->dev, "error: can't find BE for DAI %s\n", w->name); - return -EINVAL; - } - dai->name = rtd->dai_link->name; - dev_dbg(scomp->dev, "tplg: connected widget %s -> DAI link %s\n", - w->name, rtd->dai_link->name); - break; - default: - break; + return -EINVAL; } - } + dai->name = rtd->dai_link->name; + dev_dbg(scomp->dev, "tplg: connected widget %s -> DAI link %s\n", + w->name, rtd->dai_link->name); + } +end: /* check we have a connection */ if (!dai->name) { dev_err(scomp->dev, "error: can't connect DAI %s stream %s\n", @@ -1134,37 +1114,29 @@ static void sof_disconnect_dai_widget(struct snd_soc_component *scomp, struct snd_soc_card *card = scomp->card; struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai *cpu_dai; - int i; + int i, stream; if (!w->sname) return; + if (w->id == snd_soc_dapm_dai_out) + stream = SNDRV_PCM_STREAM_CAPTURE; + else if (w->id == snd_soc_dapm_dai_in) + stream = SNDRV_PCM_STREAM_PLAYBACK; + else + return; + list_for_each_entry(rtd, &card->rtd_list, list) { /* does stream match DAI link ? */ if (!rtd->dai_link->stream_name || strcmp(w->sname, rtd->dai_link->stream_name)) continue; - switch (w->id) { - case snd_soc_dapm_dai_out: - for_each_rtd_cpu_dais(rtd, i, cpu_dai) { - if (cpu_dai->capture_widget == w) { - cpu_dai->capture_widget = NULL; - break; - } - } - break; - case snd_soc_dapm_dai_in: - for_each_rtd_cpu_dais(rtd, i, cpu_dai) { - if (cpu_dai->playback_widget == w) { - cpu_dai->playback_widget = NULL; - break; - } + for_each_rtd_cpu_dais(rtd, i, cpu_dai) + if (snd_soc_dai_get_widget(cpu_dai, stream) == w) { + snd_soc_dai_set_widget(cpu_dai, stream, NULL); + break; } - break; - default: - break; - } } } From patchwork Tue Jan 31 02:01:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648937 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10326C636D3 for ; Tue, 31 Jan 2023 02:04:52 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AD961EAA; Tue, 31 Jan 2023 03:03:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AD961EAA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130689; bh=yQepghdZrcvCm7h4uwL/PRBbPFACmaaDrTIVfJGtGow=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=HxMTE02M/wtN02d7jNSfnu8KcJXLeYFZyt917s2mazW/07uHE3GqhHcUzduIarqGh 9QwoeKoOiIaPDAdeOsMIQidg4h2olfIjQYSm1TlAKQsD1RdJgOcs36tnkqMPeNwRZA iPqmAVhZQ3fv/zPbVlDdffs7yQfgY3ak9kvwRZjI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 9F8FCF805C1; Tue, 31 Jan 2023 03:01:26 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3FC0CF805C1; Tue, 31 Jan 2023 03:01:24 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2071e.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::71e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BA00DF8055B for ; Tue, 31 Jan 2023 03:01:21 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BA00DF8055B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=Hm17PbLY ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NEjSholnOjyNq2tIjwX5v53xvbkmyWtkww+7JKBugTc+rNKc4+Fp+Va+JufyzkotUHmQWNR3MTmjG7w169M8mTSIh5FLTf+7AO6yE7KBCxErhIEZEfsN08Qga1f+l6jD/OY2b8Y03aZkUCUNR8aVsN/Bo0+In5lMOkMkCOKVHR/xGHyREhP1Rg3rvOIGl2c7p4qGnpqyZan0Qnlzi48luHZ4l+iZIXKRbJOiQt/Z7fdcfDYeicJfP4TgnbFMcFgcaNsGpzHk6HedRPJ6ik869b0ww6Th6kzhJl9ZzH0g6m/zYAiUqdvy0qAVw7mQU1lWxqHHNxUG9gvXFT5iDuUuoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KG7siTEsOEZfn7FQUjkFwjTNKSzkDLrUM35wgbsLNZg=; b=AjiPJRGFUeLYCZ/T8GjPPI6H6uy2gzM5ahvkvW7aEoQ0EP7YtEtiwXAZIwJCZSKwEaSNTgECUO+08FJJeQNe4W8sJCqYoD2LRwTMhPdmMZq1ffwIn5gRj56a9FpMe66l961kIhYTL4R6bHZLlCYPk1S6Fp57qAWWbnFsQfLF6dr0XHVa75BvRqhc5veuGgVqPMbJ/9238kVOt/T81uwklOazdtrdnYtbwE8MEsMrTdJ7rvHomrPwpn9627kBOSw47Uqbd4X3qSMKuAuJUsiuKc7GaA8DSLc0K5AJ36jdlzC1bF3sQzkzWux7RFZYxYjVJ/495cS1JrHBf6Yjw9rRqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KG7siTEsOEZfn7FQUjkFwjTNKSzkDLrUM35wgbsLNZg=; b=Hm17PbLYTaLM8CN/XZyDRFCClzT3cRqbCoOfVTk2f/7db7sSKRcySvCiquulNHM4O/OopmUGDHMpf6sKH+/ND8EyEzDrPcZgEtbvOg7Q7IUx6mg2jTlTCxzvhAT/RDBhbvD6/ti6PuytePZCGlR6xIba3l6tXLu+6mnwoqFbFWY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8464.jpnprd01.prod.outlook.com (2603:1096:400:173::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:01:14 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:01:14 +0000 Message-ID: <87mt5zea3a.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 18/25] ASoC: tegra: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:01:13 +0000 X-ClientProxiedBy: TYAPR01CA0164.jpnprd01.prod.outlook.com (2603:1096:404:7e::32) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8464:EE_ X-MS-Office365-Filtering-Correlation-Id: b223a189-8ec3-4fdc-c3b4-08db032f083d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AubRhJ93DYuCUzQmUv5P95k4AZ8j92LUUHSW6s1+3b+TSpqj2MTArnKXZVhpy82Ec+Ab4Wdb8GztaS1xovMkUB+FP9Mq2KpOOOz9dDrJwxxAqMD16wfwkQPFxCP1M6NXo4PoOfw5L+z0geM9H/wM6LjI6Xvm6hjqyyU/630ArT5L+bz4iddzCyjGBn0zScon0tqqJHkRI+ULgxlI8Zo1G99a93O+rIjto7iKD4ieIDF0NJQaLxJ1FWawO61HEfNoaIdTjsiOKXzqvNmtIuZlrR/DvHSwEq/GarXrUOUwwF5Ou39+bCYe2kLPb+CgC1zp6k8HOaNti22qqUQmJxfDnL+wjnpHK0q5y0lv/dj8uHt3QSA2tp0CoSBM/knRi1eZyi/FqdaDVkxy1GKcFIDP/4Z1QpXlBCuHpbJspLtFFIZXeYyqLKJRQSIckI+VtKC0xL5NJwpcvkagfBveGBatTGH0MV1H/DOyyyvtJ5UC/2bdtnle7YCvmIgxCXUt+akWkBnKixwu/x1CaZj5z8/RlhuXLJsjrRRLbb0not2RXRtl5GRJ2R1wbiaJjP+G6BhJH0RnXcDlNSfXiUg+Mqud42zpJ0OXA7bYD+ALgaQGl4GNLrWBjFpjX+9xZDC0bILZ7WBBdXG00spIcqHWOW5FISqx6R322OORCQ9RqBT1s9Vr2x5cObmYko3MIfiMMNU92wESt9xd7x53Suk8Isxgaw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199018)(36756003)(2906002)(83380400001)(316002)(2616005)(8676002)(478600001)(52116002)(6486002)(6506007)(6512007)(26005)(186003)(6916009)(86362001)(66556008)(66476007)(5660300002)(8936002)(41300700001)(4326008)(66946007)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dGPUdsJYYeHzIu948XEc4bIGUenY3iiIH6xvR1lAHnM4gOe4TvBZP2xD2FnntYOOr0+5dZ8g8cnZ3+0PrsYk7xfCkPCx+2tdbmfayy1YQnyXMoWHilegMkhlCTQSwjJcWVfSyCY4nrXDSktlMtDfuYftpLymt7nZvu68j9SSh6UrBYBJjKbnZKIyki1BMYDVeEPZ+R6xMRxtr0YGcSV4rUxk/Frv4EUuG7KqTF9moCJmBfIxjAEsxLkV0wygoOMDK9i9vf2cdVOua3movcy1bh9862M18BHUjZQr1hIHoOBF1yBR4CRKwOcfVHWrN/bvwaW6DGCrkjIOAzCIrdCunItwqMy8PZij9wluzZaq8a0Xwkhm3V6LPUW7rsl/NuWqBqoDwPi3Mq+SaQH/MugbrlCuhvUzzp0/3sCMiP21XPLpw0UlzxWPpYzlMqMWZ8Bvg7IhlvyO5knsKwrIHjxyAE3T0H9eS1/5VqRvWgxzqbb0B896CWXovwjkYy+x5IozyCs8IUby1zEp/l2LuwKJL+4faHh1YqDlmI6x+yUFG5dCqi9Psgv4ZtVAB7/2KTfS6r2yMXW5hOcruXyKjuBcbPyDDSjhRHBpSpHMv4RAZoUB4OtwnGtQa+TGp4LuZC1H1Rxksf3Hhv6RzcQM7rXeQmW/Pv9eW54sc6fY7lZBvODTo3tEEIB40P7JsCA0akD+fswXXMdmPnd5D7ymsrhZvVcgZ82liZgh71H9pTpOtOi1ns+ARTDmhd4flJQs+wmf5CU1u1Gmlwrp5djdhHcBCLUntdB/lFNayoXk87rNY/yHbBmWC39aOeZRV3yxmVh3HtH1IVtH78g+ESfkmW8nPqZKayspK5prx08BI6cSOoWp12eEwB77t5orFhGjTt3Q4mPArXu17S2cOaKFO1nYSK0VF+MUm0C0AhkiatV5kLQJAVxHE8AEq28m0Qk5qvV5O0xzVUk6zjB8mCylCn7+9mrsX4KIi12LbOmJZYS7oa7gOL0MO1VwsIxLu/5qj4SW0RBzpMja+z/R+gW1mDTuDFaH5Sdg/MAOuCfq7TAbNx6gPYuHnzUSiMhcSGTOD77hUD/QQRdBXZO+w8sSb1XHCUW2c7zq7lillw/4uqoW+nS3o2VOff9vBJf9xFbAKeQ2SwyfDFRxQEJ1p0R0GlYJ571P1dxDXbll64GndQJnk0I671Y0Qya71sbhXz2V3QZ9uarScuFNDMTBH4E1fdUxdFv0esiYkVxCQjEBtE2LvyKKSt/gpCUmp8fiWaDpRrnAZtdwGERYP74cm9/z243BdWEBYCfUa16otZJNo+It4ktJAJa+l89mkc78gaDJMYFOBdBOs86aAQcNmbfLUCE5RrB8x1/m8rOoaOirZQeitXuL/E20k53g7/OhVvA8JRS387nSjrxWGvIiVDwQ8LTmqKLUR2JCaF13SksIpb8M+UiyHduCa8KPxoAIl5oY5SYvs7aU3Fa6Dqc6/w/WNLwFKVnqO01VDWiWFqZxOCjEpSJs4+JlJPoK/88JSvSqv8p8jB0uKWYtI9BuAYI9rIyIytGGTVVRugQgEFeGTU7rDI924mMVdwvBbxosSOiRQmZ4M+KerDC+upwCtsASEA8sh7c1suLopKi51gpacclLXP0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b223a189-8ec3-4fdc-c3b4-08db032f083d X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:01:14.0762 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AGr19BjGEpkVTau11GiN9F0j/f2s1a3siY16Rt9XlfBKSKOExdDi9ba7oUILsiUyCRrExdI5gh6yoHZkhU7fxI/SbdAaZWVuGvA2GBhzfB0KSM8eyShOD3MimJYrhtuc X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8464 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/tegra/tegra20_ac97.c | 4 ++-- sound/soc/tegra/tegra20_i2s.c | 4 ++-- sound/soc/tegra/tegra20_spdif.c | 3 +-- sound/soc/tegra/tegra210_admaif.c | 4 ++-- sound/soc/tegra/tegra30_i2s.c | 4 ++-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index 87facfbcdd11..d23d88a10899 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c @@ -212,8 +212,8 @@ static int tegra20_ac97_probe(struct snd_soc_dai *dai) { struct tegra20_ac97 *ac97 = snd_soc_dai_get_drvdata(dai); - dai->capture_dma_data = &ac97->capture_dma_data; - dai->playback_dma_data = &ac97->playback_dma_data; + snd_soc_dai_init_dma_data(dai, &ac97->playback_dma_data, + &ac97->capture_dma_data); return 0; } diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c index fff0cd6588f5..d37a9f2603e8 100644 --- a/sound/soc/tegra/tegra20_i2s.c +++ b/sound/soc/tegra/tegra20_i2s.c @@ -256,8 +256,8 @@ static int tegra20_i2s_probe(struct snd_soc_dai *dai) { struct tegra20_i2s *i2s = snd_soc_dai_get_drvdata(dai); - dai->capture_dma_data = &i2s->capture_dma_data; - dai->playback_dma_data = &i2s->playback_dma_data; + snd_soc_dai_init_dma_data(dai, &i2s->playback_dma_data, + &i2s->capture_dma_data); return 0; } diff --git a/sound/soc/tegra/tegra20_spdif.c b/sound/soc/tegra/tegra20_spdif.c index ca7b222e07d0..86bef54dfdf2 100644 --- a/sound/soc/tegra/tegra20_spdif.c +++ b/sound/soc/tegra/tegra20_spdif.c @@ -236,8 +236,7 @@ static int tegra20_spdif_probe(struct snd_soc_dai *dai) { struct tegra20_spdif *spdif = dev_get_drvdata(dai->dev); - dai->capture_dma_data = NULL; - dai->playback_dma_data = &spdif->playback_dma_data; + snd_soc_dai_init_dma_data(dai, &spdif->playback_dma_data, NULL); return 0; } diff --git a/sound/soc/tegra/tegra210_admaif.c b/sound/soc/tegra/tegra210_admaif.c index 1a2e868a6220..100a2b6e6063 100644 --- a/sound/soc/tegra/tegra210_admaif.c +++ b/sound/soc/tegra/tegra210_admaif.c @@ -544,8 +544,8 @@ static int tegra_admaif_dai_probe(struct snd_soc_dai *dai) { struct tegra_admaif *admaif = snd_soc_dai_get_drvdata(dai); - dai->capture_dma_data = &admaif->capture_dma_data[dai->id]; - dai->playback_dma_data = &admaif->playback_dma_data[dai->id]; + snd_soc_dai_init_dma_data(dai, &admaif->playback_dma_data[dai->id], + &admaif->capture_dma_data[dai->id]); return 0; } diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index 10cd37096fb3..c26f960c6afd 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c @@ -297,8 +297,8 @@ static int tegra30_i2s_probe(struct snd_soc_dai *dai) { struct tegra30_i2s *i2s = snd_soc_dai_get_drvdata(dai); - dai->capture_dma_data = &i2s->capture_dma_data; - dai->playback_dma_data = &i2s->playback_dma_data; + snd_soc_dai_init_dma_data(dai, &i2s->playback_dma_data, + &i2s->capture_dma_data); return 0; } From patchwork Tue Jan 31 02:01:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649225 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DEED8C636D3 for ; Tue, 31 Jan 2023 02:05:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8A0E1EBB; Tue, 31 Jan 2023 03:04:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8A0E1EBB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130712; bh=hZ4qmIsNr1IYsGbCqfC71T9AvkAFMeaLktbP8HlCfzk=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=ncKgA5XJDrdXiwSyP4zjk5843SX1BnEz7d3BO7VcgAZEPHIl/KDjVBooyKVHqEfri RGyRdr9iJrpu/KUElku1Gf0a1XyxCzwFW40A7FbJhtFduLOVgjxJIg/FzLemimYwas tSoljIxiepMv2uU0EQB5CF7Wb7VGFpQYq7AJdPxc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id B3C0BF805C7; Tue, 31 Jan 2023 03:01:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A5EB0F80578; Tue, 31 Jan 2023 03:01:26 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2071e.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::71e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 5D648F8055B for ; Tue, 31 Jan 2023 03:01:23 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5D648F8055B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=pkmCJec7 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XJ0Ec9WbvfoGHbS5PIb/P5TcGWixnHLDRpuds5MxAQEsM5BBnrwwx9MLg0UcHcXs4nv1WyyRW8B9EkIm08f71MvsGlpJ6oQgRx1K/pjoef95qqYGcdlc787/Y1IJKgFBa/o4wojEaQmZJTUh9dqL/rZ29Cjdqy9/yVoFuDabN+djk0QAhAXjnGJXRyW3DveWZ+tr3PiH1/d/E6IRZRaWd0D+s5UE6Ycb27t7DGlWIUI7lJSieNeDUws+blm11rcO6rL1OzBtaKXQB7lXQLkWBi9izvljjNUViDEc7wxWvvBmsVNAS0haKwmoSiG370JMJiZcBhQeg/ejUKZVbuOFgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=BrHPqV5fcL32FYcfzRLgfjorM6eh7YfLrn6q4GN93jo=; b=RaajP2PxFSLjklWxWspurnzEFGLHxZurKsGMnsIdBZENoz5V8UiO1M+beeHe/C1myYXaPPFIVhr5HGB/WtOXaGfV/0zYpkExUh0F5pJGrB4ICzeXjg3p6qYkGijjW5WhrfcxQbOnmBfg0FtGQzTztPYYwX6xSS2TT7zRk+1wFtJeM4I9Df/r0HBhwyULPvForYX+D7i/O+ZV6LJ09QjEjBtHbPeqjmZC5/K1v+wMYrSNC8tdVJ2qX8ah7RweZSTYsvUt8NvO0KPpDBT3XoHaDp49xveI8qJSsV6r7wl6uw2LJQ3DqtGkdK/jnfcXtA/dUKq1B0iKVktE4YLGenlkKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BrHPqV5fcL32FYcfzRLgfjorM6eh7YfLrn6q4GN93jo=; b=pkmCJec7ddiSdpMUAR8kbj34lubVMTaLGgajsV7KiAIh+cI6dHDXa1cHmPmU0hXCl6uppv/jeWGzZoPL4MS4Ig2RvWDdb19As1dJOP/OvrB3H43Qu/xAzLGwLdo0UlhOr6oEaDyAkQORi+wWcW0XhOCk20FO53AnRg2bR06kpDY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8464.jpnprd01.prod.outlook.com (2603:1096:400:173::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:01:19 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:01:19 +0000 Message-ID: <87leljea35.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 19/25] ASoC: ti: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:01:18 +0000 X-ClientProxiedBy: TYAPR01CA0226.jpnprd01.prod.outlook.com (2603:1096:404:11e::22) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8464:EE_ X-MS-Office365-Filtering-Correlation-Id: f8ce84d7-d081-4406-b122-08db032f0b3d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NXpDtZkTIg+CJ1DT0/KCrjICKdiBlbVEh7oyl3H/36M7ifMF+JLRrD+I0Ds2f8IGII32a68i9tOXft2Ib2t8V+B/VHdN0c21nY33QXgW7+BzlU8AD+HTCqWmP/Lqavx6hZbmHfTnB0c+4Hn10cQc6PMFsf1sZkRfaBrA84rAR7HJxtwUOHwfeeKYfa8tscl6okywnQ2O0hLjjB5dVAE1+FosOMU7SeNKjQiZQ5cCjgAwSr/JBZpo8a1KObvKadOTcXrGRTSUeiSe+PY07kM671ymXzd1pnWaJA0F/4WNpLv70dtMgN5AmbVTfqn4QUqrn30vy4JPjYUduRGTYo3nhruRa+plCRMLrhcfUW5aBA+AmYWPkSX6IvUj37wZ4k5/6JXfBMYV50yi8aldDREyYlW0jANoKOnGmmrqo21i75EqgFTWJrpwlbMBhvj1X7rzLXb6Q5yvCAMq0+XyA2wMHv+s6yoKazogGPcWjRtO171kHAot0vGRhNKUMq/GBUNgmXGBGi3MYSe70vq2tAnc7xM2qs503P1EsAZiw6PjKTHV0qSpRHt7hNR2UA+/k85JuAVv4DUW0wATU3zxC+VMh+4AbXXACPkyyR8NP9A5aBLMGGmWQ1KLxOYJAs3rVmBzgyfnOv+mpGmlt4HFKT91ndgvYuhQKHqkBVuriDT4orxAoGfg/c4FuGxgBPr3l5vUecN/v7pma4r9hYmsz1fJRw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199018)(36756003)(2906002)(83380400001)(316002)(2616005)(8676002)(478600001)(52116002)(6486002)(6506007)(6512007)(26005)(186003)(6916009)(86362001)(66556008)(66476007)(5660300002)(8936002)(41300700001)(4326008)(66946007)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jVq+EObXLdrQYF+z4m0odQHsX7A+QZuoROH1i54FRGs/W1na9kNGonKe6ucxnxfvEbDOmqNUP3XaNq37ijp8FvtGSe3/U0AbDEKd5L6H3u1RSvG0FeloJzXQEMUT7+K5jdhcuDj3OTmruv3O7vPqkMcIWdkPCrmFBNxC3EqH7K0aFxePzzEC+4ontUDTgM/3Zg9VRnYt9J4/XokXcnLD3VfYctknho0YUn2YVA7/TUOTKBkwPt1CU6FvvA4Av2EYl+4Nqc5ux1YWLUihaPv0QL/6h05swq0hmyKb0VLTuWfRvhwpvsAN0DBB1RZZhwyPH8YLfFqQiKs+oUenMgV/DKYlhZepYtWzJzwX4pS2HAIKK89+1RHz6EWlhdEWpLn18jQLbZDdJcaFDMMdAuSEr0W1Rvoz2n8f2ePz0335k0XDqjeCP9Rf64as7cFnCtlQZh6zsREB/2wYMnO7OwCP2jW7PEkHl1zi4MhWzysUDOqgrhDEQnZa9dZiUYccv3nggbbEkhpjOs9M4KI8lcL/qzaeDbtHILLThQqUaieSKMa7kfatY5xRxLBg8LakUEdE/f66QvqXWyzylEIq7mlbZKTbj3+2hZZKW6sWnWbRJ0q4uvDd9GZn+gjxNKAwg6LItXCPBQ6vvKAMFuAbyvV/adv0pdVoYpv/bGn58ChnPJ5EluPM6+N5t7andA82Iq7UPDQB3VyN/pS1mn9ciP712BnpVv/BP8U4TS0Omt6WKZB9gE/8XEniuzVcjDQxpV+QadP4SuBfizXLT16+d6BMKix56TfXT/3/xMH+Sn/LhNmzbkgO6avbtp/x2AM/dKA20zotbwN+lrd0HHdpQxyzQKvCerR1sSnkuAXLaCfHToePvAgvf561q18OAXgjKfKMQiqTGEMtId6jmuejTRib36QFtqteRAl0vfCacBK8oXXh+yyfo9nUzSxYchgn61CDM1h4/GxCjitJG2rFM6WaVwcQV/F/ggf6gpPwBV2aU/Wao2vSWcrCgh5I5BeBUq7xxx1L3oN5bHgRk4p+RLLwz3SSaJZVV2wiXbPXqRoabkQQ6vrDiL5hq993hnbKor9l+OjOkf1EdSw6bIafpQCEkNzaiMdNi3zV3K/Z5Q1UtsAcO4gHai9MRiWQgE1aVQe83EaKud+B2/cM77Mh1Ob1K1wrefNLTwobRrVQz5/Bqk7j9Hyv5IculZ33Ea2z6sNkDx8ny5SwsZUvTA3nSf3zndEBFZ183Tsmw4K3OU4qp2J11KWb56yNtlYYZiLa+TDwZbt8IwOZwhMYkzHOtcTNcZDqKasCaqyAkZHGJE79gW0LowI/cAQ8WEdMBpNLv5WU8CATUT+I0RC79kUwbXfdmxcP1vUe+7Pult5SlHhJjtRkL0or6G1ETFArLzEEQ+zGoUL8ZdAtf77zLxCM71YA9yFaFPOoavYz1eEoYzW3jjtxTpbemqgZkN4PHmt+txuaU6OdBAEUOctgXyVOaIt/gjepyqbMP7XoVLSeMcKEDIbbIhhSaD1fB6UADL3oQQtphfL2H6W4n1eq5MVKOKKCIJVq7HXVYk6klG7vcRSa0Ytuc8Du+wajg0oK1J8Cl5X5E61Xd4+Mg1ln2WUudO1qZuXKxWf18o5VATMq05A1I0g= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8ce84d7-d081-4406-b122-08db032f0b3d X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:01:19.0933 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3ov9gvirBuagVfIygB50alhabXmQE1xXyxtEMH/j8Yb+WI9ImVlYXsVzlGMf/38smA8byQWmf9vt/7imp/5eQUlir9PHfUMiCBzM0viSMhPqvBKia8kRJfd43EKdx3IJ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8464 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/ti/davinci-i2s.c | 5 +++-- sound/soc/ti/davinci-mcasp.c | 5 +++-- sound/soc/ti/davinci-vcif.c | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c index e6e77a5f3c1e..3ccd0cfca008 100644 --- a/sound/soc/ti/davinci-i2s.c +++ b/sound/soc/ti/davinci-i2s.c @@ -614,9 +614,10 @@ static const struct snd_soc_dai_ops davinci_i2s_dai_ops = { static int davinci_i2s_dai_probe(struct snd_soc_dai *dai) { struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); + int stream; - dai->playback_dma_data = &dev->dma_data[SNDRV_PCM_STREAM_PLAYBACK]; - dai->capture_dma_data = &dev->dma_data[SNDRV_PCM_STREAM_CAPTURE]; + for_each_pcm_streams(stream) + snd_soc_dai_dma_data_set(dai, stream, &dev->dma_data[stream]); return 0; } diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c index f5ac2ab77f5b..578254549d2d 100644 --- a/sound/soc/ti/davinci-mcasp.c +++ b/sound/soc/ti/davinci-mcasp.c @@ -1699,9 +1699,10 @@ static void davinci_mcasp_init_iec958_status(struct davinci_mcasp *mcasp) static int davinci_mcasp_dai_probe(struct snd_soc_dai *dai) { struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(dai); + int stream; - dai->playback_dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_PLAYBACK]; - dai->capture_dma_data = &mcasp->dma_data[SNDRV_PCM_STREAM_CAPTURE]; + for_each_pcm_streams(stream) + snd_soc_dai_dma_data_set(dai, stream, &mcasp->dma_data[stream]); if (mcasp->op_mode == DAVINCI_MCASP_DIT_MODE) { davinci_mcasp_init_iec958_status(mcasp); diff --git a/sound/soc/ti/davinci-vcif.c b/sound/soc/ti/davinci-vcif.c index 36fa97e2b9e2..fc16b3b8f71a 100644 --- a/sound/soc/ti/davinci-vcif.c +++ b/sound/soc/ti/davinci-vcif.c @@ -161,9 +161,10 @@ static const struct snd_soc_dai_ops davinci_vcif_dai_ops = { static int davinci_vcif_dai_probe(struct snd_soc_dai *dai) { struct davinci_vcif_dev *dev = snd_soc_dai_get_drvdata(dai); + int stream; - dai->playback_dma_data = &dev->dma_data[SNDRV_PCM_STREAM_PLAYBACK]; - dai->capture_dma_data = &dev->dma_data[SNDRV_PCM_STREAM_CAPTURE]; + for_each_pcm_streams(stream) + snd_soc_dai_dma_data_set(dai, stream, &dev->dma_data[stream]); return 0; } From patchwork Tue Jan 31 02:01:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648936 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9BA8DC636D3 for ; Tue, 31 Jan 2023 02:05:23 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B5C39EE5; Tue, 31 Jan 2023 03:04:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B5C39EE5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130721; bh=NgI+iqiNiU+Ubc6bXhDmiBoCwFO9hDTzrUjWABDyKAU=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=phC6trvw4pbfkz7sFBw6R4aG99z8eHhiLTpt/6GK7wMG0uHAU3WlOhBSMBNxJkgYO lfH3WSrI6xRT7inF68BhC+VrEn46IVFp6eCZBgz/jTz8vhlEHE/8kzRpSXqQUyMbCB YLK7FUv9aQj23V0BB3PLyf2sShy+TdhDAmdcOw9Q= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 6F72DF805C5; Tue, 31 Jan 2023 03:01:38 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D9936F805CA; Tue, 31 Jan 2023 03:01:36 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on20716.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::716]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A53C9F8007C for ; Tue, 31 Jan 2023 03:01:34 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A53C9F8007C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=AXMVJrUr ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aNWQorEGSE96z5gIAa+RXt3VNzmlFSG4QBZ9K0Inc7r5Id75ZSV5gmIsESaERw5SwTGkWjP0WUTJ9swwh1vHlRIRzp7bWDxUr98LA73eN/ndzNplfWpoauRWjPdSxSxdYyqzs2zTm3kLEAd/kpFEPDmD5xJlKjiSsknE/80H3h8KUPDDQlDIM1JcXGBjscbC8MzqAlHk515VLOy++nvtw0Avfp2e6Utawc2ptwmSJHeNLiYK9MmM39kUyLPgfEOHvSyUzIWuuxpRI+vYLoTYXqoL3dulGpHnc9lDKiEPuTwUrA+a3+TWhHtJKSJXl4WselhWHnwXTkDwiGjySBz3Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=h52yfGmX289l85qsipnJHVZlnNYu7OlW2JlZeBfgM6M=; b=apxu+RJa3dP5EfcnozqvjjQSxB2pZNRMa7zMhJhCihTEatqxFnJPSvTkmYCHSYQ7Wz9bRsu1YVsmLH4xeHqfzdkEKkeL2BbXBWKnsRiMYP+zOBvbCxE3AWRXT1gc4ll2VrBbw6KIQNinsl3/jDVf8qQLYYCYlZ1iiWlxCkIILfuqYczFt1BRXwk5kepgMkmhxczR241fQoXFedZ3RBnbQEXUBNTxyHFH8TRUJLJmD+5Vrxwn6yLjfsh/XcUTUC56kKXJfJJkPIr6v9cwgVrfsbXcHQ+XP3Ml6rsSimE1nS93jGNe+Eq5ENgjtZWBN8KocNjJ0POYKjAjgRUf46yB9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h52yfGmX289l85qsipnJHVZlnNYu7OlW2JlZeBfgM6M=; b=AXMVJrUrSJjjfkL7aW+hvoOQKufxQFq7DmrqvsuL36osoAmcJH/QPMJ41b0DVgR+SElimbDA2npna1PJma+/tF22Uv9pQZj9sN+3rSFaGaERq5w+Xv+AZ0nCVkgs7rlp5CwKMQlknnGfFB68B2PpuiKHu8G6VWSuQwb4bPW/4V4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8464.jpnprd01.prod.outlook.com (2603:1096:400:173::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:01:29 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:01:29 +0000 Message-ID: <87k013ea2u.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 20/25] ASoC: soc-core.c: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:01:29 +0000 X-ClientProxiedBy: TYCPR01CA0119.jpnprd01.prod.outlook.com (2603:1096:405:4::35) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8464:EE_ X-MS-Office365-Filtering-Correlation-Id: 66f4e3b1-2232-4a03-a69e-08db032f118c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: n5x7r1SY1HQpuHaIw6rlFW7EW0J846prxR5DIZv3T3M/JnLyRG8oUIxI7vWQhe3OmFCmNkCk5A7jnsdz+h9ATweelVkXwZLjH8w26aikojkx6ZL2aEDGm5j8Jvag30v1FazYT/bi+k8RqsKFKyhqw+oelYG6x57dy5Qm+cl7N5e0jx+ydQAXKVkbTJYS6t1dUqWTpAbG5p5cT6l07+qpTcwJDOJDfEARquMVH5xktADFbLr7rFbHxsvLymAxDSoqTwc+KPFpcR9zPuEClJZlaq6TSH8AO55LreaanJQZiJqo4I6WElPk96hHvTyYgBYhVujbcENyDapTME66LnjadV5yLEs+DBFePbebv6f+6zA6zy08weoKac9nN081BwPcJvzS8VnO9j2el9q+8RDcj4jZwV5oEzBRAhTVQPd0WX9IzLAalpHpU5xYczsRbF0jLU0uNivC+9WD2Yaz3Qt4DIAKZ9qOFGCWwZotUp1zhbKDKO9zTJPqgw5tuX/MO7bDOgj7f44FoCtDEDGE+1vd8gpFhOnLFuhcKFInazC4YmyDotY7WZ9xBVImIhVH8xYeBE4sFfrEjb+t9VVtDh0DPptO388zHdOmiIp0W6UDdZ4k8xZ5f3wZxKYhtqTWeLc0qeumcXRW35APNLH3rMEeV4clhKX2koSQ1V5WHdVbgxYe6Z+zwp8OLAR7I8wDKtvlGtP1fKQDE+EbH4NUnM37hw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199018)(36756003)(2906002)(83380400001)(316002)(2616005)(8676002)(478600001)(52116002)(6486002)(6506007)(6512007)(26005)(186003)(6916009)(86362001)(66556008)(66476007)(5660300002)(8936002)(41300700001)(4326008)(66946007)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Ly6i9Q/GAHW7kSGws7+fdzQ6HJEJru3ACoUOJkoyCO7Lh+7YqNtR25AJm+6cQXZNyjAr0Br2Xdwv9SU9Jp1SpFD0EEfD4l7sUqcqo3NuFgy80t2UttCpDauZEeCNAKSEXl9IaJdGBiWWBbNFfKVcqGXaFNpJsSq3yHT2kMAWuwIYcp45CbUUAVMBGKQIsvTPpRWI7XXu+LFqB3xUoCeMKWMQSMHXltBPfz7rqIKmb/sd/sVOSgV+Y8Etj6zGpHciME7bKVsyFgywoEV7NM5kpNFylH1tfEOoAOa3eh8ZbtQXGRWr38RZKL70hX+QkFvDlSrYAsL0tf9MJZSK6T11WYnxfb85+5Yk85LT8ScX9tVfaxJsWmdv2EWXOOGh2w5eoUdSGvmJzajDPnx9vQEx7oNIBs2XlMQtTji6j1qVnl4g3ZJzAVAJxFAoY03zCYeQLtrQEOIL1/ErHcdp1q1hj8KErdstsJEejYs/CEpYNeUNrM9WazLIjoxMmFNP9USNXkLfaVt1p2FE8Ck9h5UqY/F3gc9ygPpOIhqDHTMUsBaa+CntyNCy40d6h39tE3k3p+lLjiGXAqSP7M8rX4/WpHwf+Slb7Of3M63tYzW8iaZUNFhvtl10gHjVzi2UT4VynbP47MWb/PypsYqIZiSOUA1eQ2FNnQbUwonDhA1MMqafv/z8Ggi1bC4NgRT2QnS6YMbLvhICEp+vY620jlcCMovRK4d/MM4+HVfcXl8YuUJs7tCtEsSbV1VQ1X1jt/+WzsPlYTSv/KG7Iq+3nLhjxqLS8yYtTie16l5joEfPAhKGGVIF2mZDKIG/Q1Uzl6zRvI6eL3TpfO2A3gmZqk+NBXkY7aQG4O6IL9uXRretN9Dt3o6sSBkkjlwdpcDKyzTXdy/x8K+YplTtPlXVh4BsVZhrpvQ5jrFV6skEarYEgNB9d13p6EavZHAC28JxhD/04UGh5W3hc321+CNP9PkaceaznVjwPpy2hDMf40r+p6VYl+btLPTdOydq8oRTe2GOum1CFVbUkym/oqf1MmcuFyqp/MEYpCDwiu4cWo+1TSu2mtGkuqr4eKwhyF3XuVN4If7JT2nxn6vPWEreoSaxHV8Xy6unWu9n8Ruhc7R5BzLxJ6g/O7OK/Tf1W8tSGXwOJJUjvcITsE2B483PzG0+bYrQ01Aj8aqfyeJs/NQGV4f+cP42vxmQdEJkWz10qM4rPFZ7Jcea5uuqC7jcz9v8JY/H4aFc4iTDh7Lell3Vvv7p6BSzyVnhJSQMtROXVRSyvGqSSo9rNre6Dl/0LwDe1BQnAFZw3evCoB3KVMYC0qd7HZpBMpPSBuCAW6GQVIaGz683uoZ5U9IjrIK+7XO6ucZwPf/Q/kePqduKJOVYQA8+f16eVWy/1Rs6C9hgLLJM3VYQ/D9meOSZ+Y98WtTVVG+9+h8/+X5ueEeLdj9ChyJJ8/p8QBbLAVivFtwLKcnMnEniUnj3jBvXraFMgnyZ1dNfVxaBhx5LkE5YgKqTRnLOzb3n60SWkZpZQGdJXz8u0SXL3P4559XOfeypDwO4Rh02mloDhW0xX0YkpCSSmug8nD1LDTIPhgbTCe8rD0kvMNayBeegTNu8M/QPqI+0vd8LsSJf6gUlabRL2Qx1GnM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 66f4e3b1-2232-4a03-a69e-08db032f118c X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:01:29.6771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dAWZjPQ/LBx9IzvjqTWr5ZRcW2O8scMgedQ+pACpIvhT/dx1kQWItCLCyTQJ3NdFCG9r0ToDtlQr8Hnx3cYeaTE3rciE5T3DDOkq2HwQBu1+X21L9OigbfvT0J7mK00i X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8464 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax --- sound/soc/soc-core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e613698824fd..71b022f7edfd 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -553,7 +553,7 @@ int snd_soc_suspend(struct device *dev) int i; /* If the card is not initialized yet there is nothing to do */ - if (!card->instantiated) + if (!snd_soc_card_is_instantiated(card)) return 0; /* @@ -695,7 +695,7 @@ int snd_soc_resume(struct device *dev) struct snd_soc_component *component; /* If the card is not initialized yet there is nothing to do */ - if (!card->instantiated) + if (!snd_soc_card_is_instantiated(card)) return 0; /* activate pins from sleep state */ @@ -1915,7 +1915,7 @@ static void soc_cleanup_card_resources(struct snd_soc_card *card) static void snd_soc_unbind_card(struct snd_soc_card *card, bool unregister) { - if (card->instantiated) { + if (snd_soc_card_is_instantiated(card)) { card->instantiated = false; snd_soc_flush_all_delayed_work(card); @@ -2126,7 +2126,7 @@ int snd_soc_poweroff(struct device *dev) struct snd_soc_card *card = dev_get_drvdata(dev); struct snd_soc_component *component; - if (!card->instantiated) + if (!snd_soc_card_is_instantiated(card)) return 0; /* From patchwork Tue Jan 31 02:01:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6B79C636D6 for ; Tue, 31 Jan 2023 02:05:42 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EC474EC7; Tue, 31 Jan 2023 03:04:50 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EC474EC7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130741; bh=K5+vsxcXyCenEqEs4g7LZmiHRlvK1brdSaJcFKmIDrM=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=K12WKh8b7FmIXYTlOEYo6exHU73DWjDLVw3QrfZKYmSGor4nAgEUb/QWnlpGn1N3B XR1mk3u0yE9PaucxOqFT1wLyCS1biLOijgd/j3rXm7syJYZvRhCcV//nPOrWSz5RnZ WWyQ1p15gwbomCb731IEkGgRUWmBZOnd01NoScjA= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 5DD47F80496; Tue, 31 Jan 2023 03:01:41 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D9AF1F805D3; Tue, 31 Jan 2023 03:01:39 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on20716.outbound.protection.outlook.com [IPv6:2a01:111:f400:feae::716]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 48DDDF8007C for ; Tue, 31 Jan 2023 03:01:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 48DDDF8007C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=SW24CfFq ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l8fHcpd8z2aC+u2bCI7zdGClST224K1BkGL86HAvbG35ITEku9dmYORT2KZTNAxFJ+YvFnv3saHIdsm/rUYR8RUBKITBR+CGsL3SNYjcI/F9eOnUGR9ziQm5EKR1xJxdH1oXgHlntNYVQK5j2O67+MLWO1mlPjuVjck30q9zJLAGLHIbH4c4ziya7YX72lKsTUD26sWtUiK3kzdnNKTPar6cUae6LwCagSP8Z58N0Kfv7yEvVRSO056jKadQ61bJVGbYeSMgOEemxOqM0cTvUu1Z0iciwi0EmZ4PA2a28H9OIDFrYM1RnYZo4VwwrGE2/7kLkzv3JsJnhqweVd1ewA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uGc0opdrznm0DhXnWEbsMnR6kkYw9ItwtlVP/5rn9r0=; b=WBeqwaQILN4w9XihG29BU4BhwGdwlVa+nkS5W/HnFvXrQNDd79JNNbHFeK0gM0lU1pb29C1mquMDbX8U8J3G4LJog1rVgJpdrfvOcP7VRPYhMnWnoDG0vDPw/dXHV93CdsmPGtFGE0Fm1rEdIM0BQHcjTIwoKvWt4BCJ2zQmAKgVfe8lklSFLGRTtQ3lYOliHFS3mqBafGQy+73RQ0KvkgIT0vFQVL72quTlsOa/IXlOC1Z3+fmlk43xr3DGOtGxRfUqlWaPa08U6Yz4e8s++jZnkfkRxSXll5HzZrJLP2Cfsa3i+TjxhqeTaP949Wa76cGglLMYIKtvAcP452AFBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uGc0opdrznm0DhXnWEbsMnR6kkYw9ItwtlVP/5rn9r0=; b=SW24CfFqTYIIEeHjKkrV44Pzwey7TW4rN+9Qs+Ba6eH0ReKgsvOvvvzEhdQBQNAsXlcGvdgkZ1rviWQqGNCcpxR4jZmUF9SWF5scWuU6o9KYCQxxO/0NXCaZWEKr6DflP1Au2VE3eD7ecWMlYXbMExogAdJ3wG68tOZ5pMSkczg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8464.jpnprd01.prod.outlook.com (2603:1096:400:173::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:01:35 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:01:35 +0000 Message-ID: <87ilgnea2p.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 21/25] ASoC: soc-dapm.c: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:01:34 +0000 X-ClientProxiedBy: TY2PR06CA0047.apcprd06.prod.outlook.com (2603:1096:404:2e::35) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8464:EE_ X-MS-Office365-Filtering-Correlation-Id: 843e04c5-7845-418a-fcb0-08db032f14c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B6tOs6hab5nsVB1/m5IFfdck5MMDEbKnckt75BOq5jcOPCYLIENZRhvSi37AWYcbFVMzQle/LKmWnvH6tZpgtj3oLYSE7nc6G56nDL0MF++zViYN4c2jgcZ1wZjy1qA0PUEUQyCxI27MfTJgfTlmVNwEbGh82jU74nyWbyiowfq9kGH739yUaT/auJ72ULPjK+OjKZhWKD5gvLd6c+a8a5jKvN0aFXVM3IeHjZt5EbFBz0QsIUYbeQgFNKe15RO8L5mRaFSPj+vu+Rjqj81tNqPPXh6fAcJDBQp3dxne911yxZ3cR10oUSSFibQ9BbsBzPBmJjo18rykUxnk/yjUzM5lUR/RmztvP4ybwpBLhrKL1WHtOF6FMqfpQtGQTXV1yrWGzKzRWufkf32x9ZDDBqCWfxCMg6twUSDhi8nWoCUlFILnM79G8wF820wH03SdLmlTeivYuimf0Kg4/G8SMxWYC5ilNGY58pfLZIPHDqMmgyyTRQ9yZMoDfPcz+xKk5s92Tw3LHiNo+OKc9ouEoW7TxSJvvHzmTrQQNrR6YD0bmgcZUd4dOPd4A1wtz1VOo6cq9sS4x85MGXWUXyEAyh2BMMzH1cZrr9PK36F47ZsSM6kSha3JJupDgxgkTagQLIXgYQpuj5v5tYzb/VkzfG7V2b0KTjTSSI+JAbzmTeW9EFKZfrBsUAcY0RHVnThamBLICHwfWae0kiIDSMaBdQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199018)(36756003)(2906002)(83380400001)(316002)(2616005)(8676002)(478600001)(52116002)(6486002)(6506007)(6512007)(26005)(186003)(6916009)(86362001)(66556008)(66476007)(5660300002)(8936002)(41300700001)(4326008)(66946007)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tDJndM5u3AHzBejelwMhn7JpfL4h6QqWYOmi9yC7Hg9yK77ScdTlI8LuElrAxOTdRJQ5Hny5MC2F74Gt61EKsCFYvlOzbVlKJKKEgQfUMPD/goQKkZ54/s2EtKnTccZGQJunlECM2IQe/M44yOd0ZbklIYhmpw4jMexJSiVzymiFnreAzPZb61Tv5C0pK0qiQEW95be/ue4C8WtwSsNoPxCQzJGbf+YlDBOUKIFAexW4TTpVMTVYBWKMl1eBZcfjYzzDmOQUm7mcdeNdKq8lGonODIqB4IGh6vcJAVhJck07BFI4Tpw/EaryeyKeDDERLwCIrdzM12jV23YFVxUREnWaR5QiUkt0DloP2BUzdQqVcput/S7fpOX7Iu5Tsk854f7EnMQOtVVs2idm9uxw0GkuXjVZaGRFbW3/AMmtk5vpSDg+Zh9q0PyS2Htd0LAVg/KgpYc7yD10Vf8hzZ8ZQgTxeVog8X52jzf6G8aqz7x5w+zQ+wY8QPiuB1ogcHonGr0sedshqbq7tcgkgWtINXnxLnN8JfxJVbjwh4ZgcQ/Kvss5RbyMF/+IGl/vlUbThhNTnsEoVvggJcdo2FNin1ALphOX3jYYZxd9eKDIk7er4HPi3h/q3BE3eBnz9ZaESnsTaEL35MIlteh4uaIz0GyhkoZWo5nbiDNt6bV4mDwiIVgvSiykMhSB9RO7HdYE4AFfhGU8VyQf1a069vLaiIO6ZaKG5xjPtujpPgygNYeWu0sZD0W0BSn16GLw8EMxv8wuIit11g66FujBHlu5Ew7NSFNaxiqBdDnnh2BKC4+xlES/wt0cnHKYwhtKPAJaEbEHOkqIMUryumd+bii50QFMDS1hcmdbBzkSFVSgdjIV3ryJytOKMiNzXesNJnSbivFZDDsWNb8vm8oSb+t3WaaKwDRxPUUVteHfaCpaamTE3Mrr0FpqcvALocElGOUlL/dp7KesXrRdT9ts3mtFD+bU/HyLaOfNfhqfa6Glt0P+Dpk/I0bRL5yO63vWRx65fTd3ARNj/VRpoEQhmsOfy5F7qvq4sbCN/rrA4tBQFfWsjsRvBkIXTqQGorxsRSveKFL5Jr4pBunHDusy+E4CLnHOGGz+iPSxEKlfABXBySmwuBHd65xHOWUbBNVn6xHko6HfpdrBwtwxq03+H7KCnx1og3P/RQgnwlkFmP/yy1l5w/Cf9LFBgKzdC2UYHqTtcT1sq5emEunX/Cai3qqaDRX8pHVgeinMhDoCkySJMphObxjCI9ERZdHkz/9VfAvy5CwQw4Gm4O2nPOJlvymjrCwBKvkm8VH7Ss9i3uap+5s7PMcFpuqdM2M+URt53OXqYRC9lJpYLuzwwmGorZHFdhkftAkD7HItzCAGFGZxZukCDisWUniAdQK6yTGYqT/Hx1eSnF9KGO5c67jw3Jcjy7QD0CTGJTtDn3cwkQe7Zs0GYCFW7oB87LBUX3lyimJVBtFlB2CdpVcARYMi/avowk8EIL8b9pFTSk109GFCZ6zXorrx32Cy5YHzEvFnd16bnwpNzM53vOeGyXkg/76kGlDi3Fod5tn3e9eW6rK+k6lEvh6KoIxdFP8sRXsDgromlmvTRDgp6HBgnzz1AhfddEtj3k2c/hD1LDqSVgOYPm8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 843e04c5-7845-418a-fcb0-08db032f14c0 X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:01:35.0977 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7Nmy8i1nfsaKFSCv6x6iPaiEdLOruqCvIrQvRA5FzsILUzF3MLeFYVBM5AiwGqb1wnuABZ5eb6Xkz7gtFJEpyJvFFNkMdUzx9P6KBd9Th6DXxA6FrrdmOed59AbdoadL X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8464 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax --- sound/soc/soc-dapm.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index f61c8633e7eb..5d9a671e50f1 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -149,7 +149,7 @@ static int dapm_down_seq[] = { static void dapm_assert_locked(struct snd_soc_dapm_context *dapm) { - if (dapm->card && dapm->card->instantiated) + if (snd_soc_card_is_instantiated(dapm->card)) lockdep_assert_held(&dapm->card->dapm_mutex); } @@ -1297,7 +1297,7 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, enum snd_soc_dapm_direction)) { struct snd_soc_card *card = dai->component->card; - struct snd_soc_dapm_widget *w; + struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); LIST_HEAD(widgets); int paths; int ret; @@ -1305,12 +1305,10 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, mutex_lock_nested(&card->dapm_mutex, SND_SOC_DAPM_CLASS_RUNTIME); if (stream == SNDRV_PCM_STREAM_PLAYBACK) { - w = dai->playback_widget; invalidate_paths_ep(w, SND_SOC_DAPM_DIR_OUT); paths = is_connected_output_ep(w, &widgets, custom_stop_condition); } else { - w = dai->capture_widget; invalidate_paths_ep(w, SND_SOC_DAPM_DIR_IN); paths = is_connected_input_ep(w, &widgets, custom_stop_condition); @@ -2614,7 +2612,7 @@ int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm) * Suppress early reports (eg, jacks syncing their state) to avoid * silly DAPM runs during card startup. */ - if (!dapm->card || !dapm->card->instantiated) + if (!snd_soc_card_is_instantiated(dapm->card)) return 0; return dapm_power_widgets(dapm->card, SND_SOC_DAPM_STREAM_NOP); @@ -2908,7 +2906,7 @@ static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm, dapm_mark_dirty(path->node[dir], "Route added"); } - if (dapm->card->instantiated && path->connect) + if (snd_soc_card_is_instantiated(dapm->card) && path->connect) dapm_path_invalidate(path); return 0; @@ -4229,7 +4227,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, return PTR_ERR(w); w->priv = dai; - dai->playback_widget = w; + snd_soc_dai_set_widget_playback(dai, w); } if (dai->driver->capture.stream_name) { @@ -4245,7 +4243,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, return PTR_ERR(w); w->priv = dai; - dai->capture_widget = w; + snd_soc_dai_set_widget_capture(dai, w); } return 0; @@ -4339,16 +4337,16 @@ static void dapm_connect_dai_pair(struct snd_soc_card *card, int stream; if (dai_link->params) { - playback_cpu = cpu_dai->capture_widget; - capture_cpu = cpu_dai->playback_widget; + playback_cpu = snd_soc_dai_get_widget_capture(cpu_dai); + capture_cpu = snd_soc_dai_get_widget_playback(cpu_dai); } else { - playback_cpu = cpu_dai->playback_widget; - capture_cpu = cpu_dai->capture_widget; + playback_cpu = snd_soc_dai_get_widget_playback(cpu_dai); + capture_cpu = snd_soc_dai_get_widget_capture(cpu_dai); } /* connect BE DAI playback if widgets are valid */ stream = SNDRV_PCM_STREAM_PLAYBACK; - codec = codec_dai->playback_widget; + codec = snd_soc_dai_get_widget(codec_dai, stream); if (playback_cpu && codec) { if (dai_link->params && !rtd->c2c_widget[stream]) { @@ -4367,7 +4365,7 @@ static void dapm_connect_dai_pair(struct snd_soc_card *card, capture: /* connect BE DAI capture if widgets are valid */ stream = SNDRV_PCM_STREAM_CAPTURE; - codec = codec_dai->capture_widget; + codec = snd_soc_dai_get_widget(codec_dai, stream); if (codec && capture_cpu) { if (dai_link->params && !rtd->c2c_widget[stream]) { From patchwork Tue Jan 31 02:01:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648935 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3922C61DA4 for ; Tue, 31 Jan 2023 02:06:06 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C1C77EDB; Tue, 31 Jan 2023 03:05:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C1C77EDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130764; bh=7mZWjQ4fp1dg5JNlK8wz9IjlABbmDB4KQ1ag6hWRokQ=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=FpQjHY8rzEToGpnGNIJIOMMw6iaaQpJgjozoGZa1x187poOJ4mSDk0vaKg9pnFYqE 2bhH2r+GMzHXIpRrfK7QtydufpqbvW59sZymdsBi7Soo2FbHqb1slykJJNQ25/x/Ep p8ds5SSEzmHPfos3Q9oKm55MVVVaFxxu2wL/0834= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 72DF9F80568; Tue, 31 Jan 2023 03:01:59 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B694AF80544; Tue, 31 Jan 2023 03:01:58 +0100 (CET) Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on20731.outbound.protection.outlook.com [IPv6:2a01:111:f403:704b::731]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1B12DF80544 for ; Tue, 31 Jan 2023 03:01:55 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1B12DF80544 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=JUevQMQ/ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TSXkMGc+5HiniOeWVSEM43ky4CNEAsBQUN35Vr7PRvWBiQVqNLGYi+xuoSQb1GSTXvBBlp0YYIVlz7eaoQQ8RImqfYvP4VS56QflThycMe4Yu6cv5GfgtW9hSiofyzr0sza0FHWXHRv8vAoj1GHWK0N7MC3ex5bI093g2Se22snNEnRH1sHwQOBY1VrR1PabpBvel66J3HyxdOwv74sLsma1S8KMLkSCpZuIGXZMXJ6fgiZXr2wXGsw8WkhKHGVhxOu2tPlkJIFkDObJAM7f23T79+PVt4V0Ti23NbDTrazTiEl1hUHMsnv8AiPqYIRAjPk54YLdlx9PV2E6aC288Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cfkKzFD7/s4hHgO4XxNiQf2/pTQBB5WEJ8gLM3dsFSw=; b=F494xxSiN+fktMgMq0Qhg3ibXepw50VN/UlmpLJXfCmD6tb5aEJXHNCUSOxGMDoIz38PO3zAgBElNtjXMwdwSm3ZB4/glNHiAXRw2r2FTtFVKiBMWL3FLGgGIDlYbCLexa6F/lvo9DV/IhDwJuPelTrqyZzz+7wirWkzMpySC3d0/jn8ZGmlFAzFMDexlNZdTVKj8JkbrW7WTCvWXHIKcv8DSs3EoEBaoMzG7RiAolEx1+mK1NYYSjX4qBB43yGvHq4y07p/KjW/YlthzZyFiVFoQ+DmhaGYGiwwvKPyj23tCF77TlNSSv/QZ2DqV6EUE3184qTuxitahnsrSWSvkQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cfkKzFD7/s4hHgO4XxNiQf2/pTQBB5WEJ8gLM3dsFSw=; b=JUevQMQ/50bvJxIyDg+n0AfZFxbG8CJv8w3rxFkRh2o/rrFbEKWO+FILSH4aL0ckjKgcBn+CB8AyqvVw1vxGwvKdjl1n+Rv5xXP7SNWODtIh+WME/1e7vm/8v8Bd8Dfvsrqz8dQFzAQyV+CFO+vuxTByZkQUCn+HyKV4+MbtCfc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8592.jpnprd01.prod.outlook.com (2603:1096:400:179::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 02:01:50 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:01:50 +0000 Message-ID: <87h6w7ea2a.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 22/25] ASoC: soc-dai.c: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:01:49 +0000 X-ClientProxiedBy: TYAPR04CA0011.apcprd04.prod.outlook.com (2603:1096:404:15::23) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8592:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f42af00-3bd8-40bb-08c2-08db032f1dac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vivi91yUa17YRPafezfcjjIol8p0wxVO7pK3WqObvTvlynezIL1qzSAuyf4Gva8AIsYSkTyKQNicSq4m6/+405Vo0dxYLzD299Q0dmcGZ/TRWK3FaiYrh+f4z1zDknJhyx9kXdtM/YcGtS1PNslurMPDCqsX0uC/jnm8CZtWB715Wp3BAgdUowXZEqPuT5lwz8pYUSNYwm36fEhB/IsDicYRKcQUhLHrDFmaQ9CLpdAZSvdmdJShFNXQ8KNKqodHP+HWGb4aQim8BWcch827W7A+Rbu9HZPNUSiVOVtIXaThgyPq48YGqgYhzOjAzbrIRyMavrR33l4GEXrcTTJpIXXK/8JBuE3B5LOO48zpIUoGmr9MDb98uNL2n8beXQxJgXFgGkvTaPRKDz9SRdFdgcgvHpetyzSrMYPmecJvdpzU2tPiQ+ESQdzUgnHMRXbpbf4eytyQ/2ScMI91D8HKwWPj3teNSXsHXLvC3sz6vsE9+X/Zb0DRtFrEdzkWwGmmGqOkYN7YUQ0s36tyLNtt7flQACFYqT6RMQRUvkNvvf4keakzu0BdF6f6XJPNXRZKMvEeH6CTUm3hZmO1DFAEPem8Sxq5ccO5G47lDqQO026v9rBDcaV+qbqpma0KbQh+NhaPpwomXVLPgJiLleA7O6kKPZ1M4b/9S/Lgf89UWlnqAaSqbB7H6q2Xf7+BxA948aw9K5rkrBdsaM7mX4QGGWxyFtPULUMnjv6jtPHZzy0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(451199018)(52116002)(6916009)(66556008)(8676002)(66476007)(4326008)(41300700001)(66946007)(8936002)(83380400001)(86362001)(478600001)(316002)(2906002)(38100700002)(6486002)(38350700002)(26005)(6506007)(5660300002)(186003)(6512007)(966005)(36756003)(2616005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LRq8fOuxrlvSvEpGbnIoUMyrjthQgYC/Dq4qcJzzy7idx6JevTIBaTBAseDUlzp7AIwsos9BPPXiluccff/Q2jTWA1Pk3m99H502V5Noa9vb01z8I1d2CQ4Uq129lDeXqnUwYsSkLB2cKLbg4Vf9yR4VJurrS/ix+TmWTdqN7Gr3HhkNu9e4nAkIUUcaTzQzunP1ndaIoUlOi9QxLhdHqQXF/iML+1L1n0onFNk7O26OU1P0TXd++ly/PGEt6GrIaPaMiqeOsVbuNiXhmEBgcaa53/vbVmsT1oJZwdy4EnQW6hbPIHOvTg1xLUX/XvpYTytLc8pR79vmASH3i2wejUrj+Ar1o/GqRPvhsC8EDY3QMo2JY0sjfBUWaOaiCu64yxBrXPrb4ewhcw8/6DszY0zFV8LEglH3RQ5OYnSEgAg9+s11TqoT8sThDHmWAt18Vmw7FDHbF0IJaLA4vEFK9fpSCAHkaXqc5FFGY8LG3QeXQf60/xjBDwAoSKGmWGvYM6j0oqN2qDVD8rOBqATrq+4lRym76o5LF1j1ZWwB4I9XsB7vv7obBKHN3Ftiicli8WenpXPRccXBm0E0USxYdja5zVCYvWtKyplgyiQeZyf3K0jwrziG7HcZNe791nYGmmFHoTBGJplzoi+0h0Bv8BMowJKdcqP75mXJShPvKjAsPKezuUILebWpbheKnRNPol3AMfjaMb6MEDZaYE+/Vc23R5/qkenKzKOCpN8H3XfQZml+SuiMkulPmOmoBpY03YyD2rbx5x4fJUzh6oUuB4jVmu2HROruRPQaKdgjrLGAhQozC7HsryOzpgRyo1RkMGUX83/y06FguMQcjFtDVej3I0mrczvHOmvGi1phPcoNb1mTjW6axAvgHYc8tGwszkygCKnQ082habSufyQmCJUckyMH+NoGPHWEmOqRflEN0xqTf5omiDd3RjJs25I8I6reweAXUjQ5ckLQlrt8VEJ5rK1dm24J2DAEDWJZrlZFrNzT3cptYUuFe3cqkIoPsCHYP9EBMghofzlRnq6zz5+eqhxZoZgsG0NphLyaACL2vnmDdQk6Wi7Atjcc5Fzw1wZuZ5gY/5pWsxK055iaAjRquWVnunCanxsJ9wKA9niBZVfccp0si/we+mZcJqdb/TWLIn6OwWr+eP1R6UKOaNxYwWvQkhirePO2/LuxveeGqy+YmWl5y2Bz4K/6hUD329UJk+KQCxF8K2LE1y7mXeGBC/AlGyzs86sA+bSONxCjwReQ4WQbh9JNtohKA0R+6nhmKZGagcY61gFlQ00rvyk2Jh9BC0RC5vRZtub+oBxp7tJnpiMHnKOQCMAOhIi0LZ9v02PCmeu5D9B7Pwc6JcF0sQ3VUgPdqrTq1oiVXpbqLc14Kfu2nO2MS90DfDVD5UyhIuL6G0yZ8r8HBbCRAh9I/qxnrpq0ud1OZYAlOrbUQs4Jy3WOMlr2tSMyJD6vXSioPl6OUEFj/q0BPuKq8WziwytxKAOsKsc0v0dFHHOCBULByWFFQHh4qzfwCuvsEXbfiv7ulBJ6B21iB2nxzUCZfHVtz1cUcQOofKQr3HcweSBY6vAxktY2JcGUNAhnmKjrjWvr0VXtgW9hqPlUIpmqkF/DCi41uWhe5bMKX1w= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f42af00-3bd8-40bb-08c2-08db032f1dac X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:01:50.0623 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: usOV7+J3FCQpPybthE4KNkWhPTCc/7s5JBoUU7uIzdRe5HCRqzg3fc3wyAkkBNDq1tOxYFCmcaeg/Vgg7L0z+Q/JNGxoe8a1EfbCj+QvE4vPbIPjNAaOkVTyGNprNuwd X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8592 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Link: https://lore.kernel.org/all/6f047ec5-4055-761d-c1ea-c2d0b606e53a@linux.intel.com/ Signed-off-by: Kuninori Morimoto --- sound/soc/soc-dai.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 29a75fdf90e0..69f534f0d4bf 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -267,6 +267,11 @@ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, int slots, int slot_width) { int ret = -ENOTSUPP; + int stream; + unsigned int *tdm_mask[] = { + &tx_mask, + &rx_mask, + }; if (dai->driver->ops && dai->driver->ops->xlate_tdm_slot_mask) @@ -275,8 +280,8 @@ int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, else snd_soc_xlate_tdm_slot_mask(slots, &tx_mask, &rx_mask); - dai->tx_mask = tx_mask; - dai->rx_mask = rx_mask; + for_each_pcm_streams(stream) + snd_soc_dai_tdm_mask_set(dai, stream, *tdm_mask[stream]); if (dai->driver->ops && dai->driver->ops->set_tdm_slot) From patchwork Tue Jan 31 02:01:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649223 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12C12C636D3 for ; Tue, 31 Jan 2023 02:06:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 33A37EEF; Tue, 31 Jan 2023 03:05:22 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 33A37EEF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130772; bh=8dGF3GMgNr61Fl7efCpBF4/p9Pxcwb4U3pOGvprWyJk=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=HXDDxu33EqVYNt7u3Cyr2BIXg+IjQblZZDonc+9w2lch6kPVbU5ZFIZJJF1igycZg hkkTJ8Q4k6eLFltYjCjojKXdKNsevSy0XdTgH1/Bco1NB2bg9j/0ZG4SOi27aZUwFF nin3F5A3O3KzotNg9HjyJJmUd2hpgCf4ihZ2KNMg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 17FE7F80549; Tue, 31 Jan 2023 03:02:04 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1FBC4F805D8; Tue, 31 Jan 2023 03:02:02 +0100 (CET) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2112.outbound.protection.outlook.com [40.107.215.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id B704BF805D9 for ; Tue, 31 Jan 2023 03:01:59 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B704BF805D9 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=CqNndia+ ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jgfzctD/DOF/GRq+t17L4gGRMB8eINGYWGS6aIabWdVPsQAZYJHkk3sx33QoilJ46cDrbUmkItPIqIqQyOe4QNbQfeVNCtHZZjJhxmsGm2mKwyY1UO6Qx1orDFLYq21cnd6DVtOkzklhAaQXuKczUApoQYk6bnQwVWi+IiPhFm+A5rlEFKO9kIanIetcEj8szzU5D+FSo0mEnkwZNjGMtEY/K28fT01+peqjy+U0kKDqtMKT3q4cTF2AVqf0zWinJYNlg091wGnCw1CXOxhwIoSYKxKWS1SCIBfTYHNIUMMe0J4HArUaFoQ8cqnQY2uL16mX+/ei50vMZCiGTAhCGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6meeSM2vDTTYQn4gPe8z2vz4atq+tUQQpHtT6CscFVU=; b=P91Ndy1+FR0SD+zDTvzPMwQ11SWwoRqvFjN8y79VrbolsfDeXEZlnbTubrM5Ve8JnDuu8DtYjtRTdVSpJEe5wLG0jr/AKJ4rJGg5K3pfqK1PcMqozijwf7tydmbWLh1IxOS669XC4dorjdO6+djxQGfX8sd5uG982Sx5zVoZCUmAqIPYY25+EFDr+cefacWNy3wfjEA0U63mgk0c1q7tlUppNswvVeNOFitnajmCByghd6sAciB1O4pisz/04Hf69Ztlj5spD6jNg1wQW2r2hi0JITfj+SXfqyETZv/Jr0vPIznFsfdnHJDphWUYFIog1BnD4B7i/wdqeIZ5j+kcqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6meeSM2vDTTYQn4gPe8z2vz4atq+tUQQpHtT6CscFVU=; b=CqNndia+e9f0M/h5lovyiuBBw+tMc5zLEdIx3nueFywFG3CHwuO5qz8uD8yeq6SFAonGMudjMpXkdoP6Gj7Vry64BkkxIDUOUXqYU8reuDKCLINNfNeumZ/YVg7FsMQoOHNLsfhJRPeQVNkQ1EvdWpl2q3oU1ixcUCLaFgSradg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8464.jpnprd01.prod.outlook.com (2603:1096:400:173::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:01:54 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:01:54 +0000 Message-ID: <87fsbrea25.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 23/25] ASoC: soc-pcm.c: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:01:54 +0000 X-ClientProxiedBy: TYXPR01CA0052.jpnprd01.prod.outlook.com (2603:1096:403:a::22) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8464:EE_ X-MS-Office365-Filtering-Correlation-Id: 51fb96ba-dd98-4f91-907f-08db032f208a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7drj5hwJOOHDkA5X66zCl1Zp2LFLVQRW1FRTtdPgnadVq1i7nGcsV5Q2ssMDb5nreTWr/7uybk8ei5q8u4uyqjDXQIXYnGmWzw2814/AdhfCUjJJr4ND4bjO9dZXxak0OzGNleKE57IXq7XT/YwwHcR5Qvl4dps4wwz4Q6Oel7IKmIrQJDeUrqLVkzrHe2sV2D1mqUAeAuW3koDZLRJKb93BUBU9i687qqdL1gBfSRuMse+xs5zdrI7ddYIPW7QQQ1e++ff0VhVJmjb9SovZ597sRYGgY8BU1bZ+iqIhgZ/asj5vFigoct3iAA8Owt2cJ9XDuhUmaVRf4bb6+nnFWsVpZU7VWJVtLSL5NTa9yW+cK1dS6Dk2zcmw3Ag9dwY6IKgJ829FxSy8F5UEokKmYYGa8w3i+kHd4mH7Ami+gyKCGc2ixFQ23/f1SDp7Aiy6YJMbvRPexpefLOIryRjLlI2bjYWaY4NP5HTHbRyCiJgPAp+itD17dEKrUJL+Xz8kkHlBf/EYmzqyxkF1fQUBoviLTvHutnARWp/4s4fkD7BROtH/ISqC3Pe8roBBHylcG0Xw6T6qwSSt0jCSBkrxWEj+B8sHYiaUq5bFnapYfEoO8wZaA0yAIF+GahKSZLdiPOVhLbnjO5ghTBwQoAYHcpKxAKzdTm6TohjZ4P2xE/FyK6Qa0j+nRXY2eGe9jtzD6KR2HxbPwPj5SFzdE7ynXw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199018)(36756003)(2906002)(83380400001)(316002)(2616005)(8676002)(478600001)(52116002)(6486002)(6506007)(6512007)(26005)(186003)(6916009)(86362001)(66556008)(66476007)(5660300002)(8936002)(41300700001)(4326008)(66946007)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fSXg4rcQJvTjLI4cV0gJMD29EZnvkTdivt5WNLfG49Non8+ZJnULgLt3NQ2HJ0GX6UsZdHnDtuUV+Rkgb4JsZ45eb9Hn/4wL51BsmtPeeSfRMu059C7Jw2qPD7vI+KJKeTiiGdll4UVG8TLF7NsZZdDEc7cjeFI0hjWQnISVHm0cvI1MmPW4ONuZm49kvhj2J1J0eGXNhpC9+2+WWqcXuVLmz2OpCJakx8d4sbjC73SCxRwsKff2dg9R4RngRBwoOH00G3O56ARste3sh9mTNvhYesv8u+xQgRKHLo6uMJUB+ZG0kVfJdXI0+qwsC9ADLzxA+BYKGnBS+hFzFM5KSX66R+iLCGQu74PBRsTUP5Ixn3o0I6LIesAIarro2t3DjsEhz/s3WqD2XJvkoRv8ctUfvM9RrBg+kAq4tDmuxEZIIC9w8jtVUmI1HUaMaI+jIbx5RTDciiOL+eZL/rIFy9hpNRgFAaEQ4FVfmGxK8NccVSU5jAvwZzKUNyoaua6f2MDm55/h+CoNePuvS4KzhTQ+m46kMhC5sbzI+oUQGegkS0FsQnN26h59erEY+8XAHBCRtiSZ95AjkiLDGVVbc9rSlJsYbbErS3q3GQyVJbnp0qguNlhJpAPZdCvJOyrqNlkG3FaCcGuG7aVBnSgaRnECc08nzbbLUn23Ldgr34/WXju8KuISsraDxcxDn1zNLDZvc2ztMNdXhek6AuqmQaVn0WV6ERsnLw7LqVml5b4v9ZBniWoMEWq1JNYzmk3J5nvuGmLVK+kW/anlZkZVE9ctdpznHiJabumg8MEHVY5/mH1VblT+NCYtHmF8WlUcL/T+35tmLxlzwPFRzJEkdNCtOHAi/9LVUpOKTiBTO1AviWD/BimciNOTIKWcC/kjA0oQ59FnG12hFoAN5qyZ+Znyk67fHGA8d548/fT++rg4enKf66NE6AdpeK3vtmCCFo8mVhCa3+cEXT+611O1c/pYvplha154Ii/tSPZjTu5gh+7koudH7WmFTxcJ3ndJl5xK1zV5/tNDbdyAUk+Na7sDEjZ0GQ90nyMpEMpOYVwN4FkKTjLyMEAdXIz/bsDVZ1UyIeY4EWgpI+cVgCRN1FqFcQqWNjbLMBsqmpFoFAJwq+ds7bvVnV4LXFCUhqzMGQ6+oXdpdIiFZlC5z/CRaHR6ubbwDj4SLYxIS9c1QWQWJShIz5dMlDc5akJGHHJd9x8i8Zw8oISqXpyxLNqPIEgZaX9pXdBL5yq7MaEGrd8t3/X3wvaSLTJFXiGtoIGtOMDYS65I50dU1uIcw9IXhioZcSqJDCoSQ0z9Ihu5lcT6VzcSQhpT+qyzR1osRUTzuCQyqxIC08VNN62Gfa9j/w704FaIGqbCdTX3xW9GBwA9eyjWIWw5MluVso3u5Gfx8ZRbEOLMhD3+9fYix3+/yR+XsTXQiIr+2ZGPR3pzhkk1UkPp4TiBqVJBfg5I5KgyLujihWg0aguCaMvPov9o5oFe/cX0cxYKO7Jjm6kBVc6DH4s/jzE+qeX2jE3goTieXEKe8q9XFEFGJ7Ae3N/Nu8+/LhnCOUgu6vyWHEzKzvsDNFuMsousAmHsaOPlaDfo9DAqRf2ksbzLmgFMweUAbhBSsw2YFAphv3kZSMYtdFM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51fb96ba-dd98-4f91-907f-08db032f208a X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:01:54.8917 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sUNiXRr9f0IY/A/WfVKMsWq7oGalYRX/j6V7u0srMRTlstsFlCraETQR3sSfrW0zA++x9pDsa4z8jDuQN/hoI1EPahHNo0hPu2plZ/oU/lhXBPi07vg8i1Tm873X+C8t X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8464 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax --- sound/soc/soc-pcm.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 82bb46c7f5cc..8023cc1fe066 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -1012,6 +1012,7 @@ static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd, for_each_rtd_codec_dais(rtd, i, codec_dai) { struct snd_pcm_hw_params codec_params; + unsigned int tdm_mask = snd_soc_dai_tdm_mask_get(codec_dai, substream->stream); /* * Skip CODECs which don't support the current stream type, @@ -1034,15 +1035,8 @@ static int __soc_pcm_hw_params(struct snd_soc_pcm_runtime *rtd, codec_params = *params; /* fixup params based on TDM slot masks */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && - codec_dai->tx_mask) - soc_pcm_codec_params_fixup(&codec_params, - codec_dai->tx_mask); - - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && - codec_dai->rx_mask) - soc_pcm_codec_params_fixup(&codec_params, - codec_dai->rx_mask); + if (tdm_mask) + soc_pcm_codec_params_fixup(&codec_params, tdm_mask); ret = snd_soc_dai_hw_params(codec_dai, substream, &codec_params); From patchwork Tue Jan 31 02:01:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 648934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9AA18C61DA4 for ; Tue, 31 Jan 2023 02:06:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8A0D1EE0; Tue, 31 Jan 2023 03:05:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8A0D1EE0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130791; bh=aBIS9eLwcw2qWqc3fSOiP3StdWrMhyu4mnVwlbnI1yA=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=nVqSLA7+pXaiTqzfOLOovWWjk5EtNQuYI+0ViiCEaFduDOTM+Gh2/gy7jOhJiE2/s /Q9EU9X/5P452vrFsPWUrB+5I731y9UVLeI9WZjz5OK8g0H419pZFRZf6tD/FrQ9fi QRAbey3KoRlQ1IbrFvKcqeMkTzgC/S3V993Uok/4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CC09AF805DA; Tue, 31 Jan 2023 03:02:06 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E963AF805D9; Tue, 31 Jan 2023 03:02:03 +0100 (CET) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2112.outbound.protection.outlook.com [40.107.215.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8F5DDF80558 for ; Tue, 31 Jan 2023 03:02:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8F5DDF80558 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=bGL9/UBH ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cgwsIYOyBP0PRRntlERbMXolf2r7jWpwThllmiINbQty7vKKpCPxY4Sp4fzs/OcxYRG/jCKXG1zaZ9yviDvepKqAvfGSpvDJLGkCBDomKQzbCntSW8ukbxEL0vcCMil30jMTcwKOcbm27g66YCm11VNqOyOZeXJ49Lliu+vXdxwZa1Vyc+Z0phqB28gphfKrKzUey/v4A7tRCGO1A5d5ZlwNDrpV5+LJtLvYoVfn7q/EHpbAih0U70dB8OAv0i03fQ8J+dbVtM4nlr5Wp0x1q+ZWHdGdKXrb7Q0oeWAD8WE6x6bIE2uKT2DblU6s1efmsXy0NRRMhqIWARfWSeeVOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VXK2sxJk8N/3kQByOfVX60fjYZw4VWoFiws6HBc0z5s=; b=hy4Lp1xU24xKo1yDna27DCScc+XDMSreRsOleU7Nq4+x3nQun5PyoQTv6tN0O1qeQnbrpewDbXmXwS7dOl673UyXowpP9/2wJ20sOO+ysfoap03tbPyRwrUsSBGdo6MdGq2ef4tV3rniFyBi0yNUXJF54QYgDzsW19fyY3yPbKTN5eiqSJJqTaPVkpdAO0hBMEHsfOy6PiH4rwP/pNMMoBXBt5O6kygnH3nFyDfa0e7/ShmWHCavR8JqQKzKuW8U1SFTI4WvAIMs7ubZuAVy+XPse2wMqESUppx4+cBO2CO8OC8pwlnolBZZ1N+ICX97XvUq1QmWkUo8F8McPXdaEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VXK2sxJk8N/3kQByOfVX60fjYZw4VWoFiws6HBc0z5s=; b=bGL9/UBHKiW4DiQKIwRYS8nG5h6G4S5+dz6aZDxRUG7ssm60VeOPT8OsYHsi+KjRJVfHDbwoQP7zGUH2vSHsJtgH12mhJSm/gckc14sJrOHlzzkAc7TDZjj20J/F8mLua42h2yJJsFNVVxnrqHlazF7+xxQ6d0YruEwKNopO0jA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8464.jpnprd01.prod.outlook.com (2603:1096:400:173::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:01:59 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:01:59 +0000 Message-ID: <87edrbea20.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 24/25] ASoC: soc-topology.c: use helper function User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:01:59 +0000 X-ClientProxiedBy: TYXPR01CA0066.jpnprd01.prod.outlook.com (2603:1096:403:a::36) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8464:EE_ X-MS-Office365-Filtering-Correlation-Id: 5ad2403a-009b-4d2c-a249-08db032f237c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: muzfNJahB5uBQGfN6J1eI7tr+leRtkeLjDyT0KlF/l1PDFZy5oS4J14eOHJ5OgluFUtZ3qJXNeuqeY1LWKRE0T5sUuo6pc78lje6i8Um4D/5yG+eAgaGuqgjSMOu2WX0Xlc88c/N9RYoBb1AOf+CuzFMPlBfFUWCpGKEhO0c0HytWMt3239evc23NC6wQAVb4weFTGRhP+qKpM3ibVvFbI1+ybtHBgwORfEGSxoNCng40RRIUbW366/CxwNL7KWgev7JlCY4jVb83Yb8WSWzYYzk2GucjgOUIsCbUyGqfYt4L96y3oDoO7EdJ5zMf0SFo3Bg2GXl8AbJfXgU54fhBdPTYAfttcFbqYhbbN2BpuhWhjBMHvLxSM0nP1x6TWLeXw4ux7EDLsDQDv9k/erhMnajiNixOmHhKs+m9U5uk6Fuytg+d4mPu4GCaJlfgoLsk16ABlMS6AgyUAKrmFjcDsaHtTaStrqJiq66XSoMemoyxcMIMFsnOxlAVoKAYUKb4spM1TDc1IeR4M1ONt4x9TNU0Cl+qLJWGZvisbl2I+mbnT9c9KjiMII+8eBzr8joa4JdDX21e+upIW7uH6fLbqXSN2P5VpEueRTlrdnFdXM5HR+w0803M+hAPjRdxYa69+biIhJIv8lf8MKt4HJGUoOjIo+QWpj/x/rxBfKOB25ntnldh7ZMOUq3qhOeSQIeRK+P3XSIubaLHgNj+vOG1Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199018)(36756003)(2906002)(83380400001)(316002)(2616005)(8676002)(478600001)(52116002)(6486002)(6506007)(6512007)(26005)(186003)(6916009)(86362001)(66556008)(66476007)(5660300002)(8936002)(41300700001)(4326008)(66946007)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: i8oCsELjCpIyV+9zrWiBW0TiFr8WttV6w001eeAVyM7H6aapU/ISDLXNg3GzeEP9LS4qLw+HvpkI5O0z9OiFPGDuU/ZRVS3CrJR8t+mMKgOmDtaYlEcYlcTwIY+cld5uWItbGfbBZGJnXFs0ox/OYsi5UVfAl1zOCq0WZbUi6ftcW6kkCzMbB1s3TKh00va7rAKuo11vz6fupzqlbeJ4J4+1OOfbRWM1/bUO6Fy23ETjqDLgZwSWLwnb+xdZxAs3AQm1wkBiXGB+vJxOef0ycY6nABk7k78SRsvepghcCjyYnbI6RQWTtB8WpZbh12U/DVTVtaYR2wodpWBdoaQb5kCB94PuSj3N620Z8jLtJtHGjD7z+ZJF9eiS23L+SIA7tO7dVS6SeabXhQww1bfeIsRpp07WotmrAiCVQnY0FeOoJ8IHXMY5lA+gnTFHIQIgkvgWRKGFWkdCXSeA5s8TXNvL42lzcuZd2Lrv82TDFwl+AMIPwMm5CbsSjEl2f8UN5jDHIlJlyDEqf8ZtAe0z7j9WMEyj9MW//8Oh5iLqL1a0JT3T98MI8aYUT2ezk+/b19AaViqC1zInf0ASJv+GTE+ydE7K1W3Fxe+mgYMI5kGqaLJAmiHmdQ9iiMq7AV88HNvM/q61/6T7OQyykLh0Mzp8EbbmV3cJ32Ga/IQzKe5tRHVinvg18YAhM7Kh7ZeoktPBPEawYTFTHO17vJ3ogwBRvqHhNbNSrhjH6/UQ38nU8uyHIy0t7c39JFkS94h0gOlFITEbbHLmvW64mk3i8+c9KpGIaUfBBkVxD8RFdFvT9YU0gOBOiigqwPKPMjMWsqxvxFuDLPcb4rq5mPWBnfAiKjnSpdut2t3sH7K0nPM9J+Jxj5+QHLulJfYrpkToi5l3xQBDDP3pNWoaSjXWnB0XaS+qkFGk/DN5uMK1/BUhX+IGmSFv7yG7ODPc0Y+Ig6ZeJZMV/hR33WoWb4YgHBYZcELelHneh+McX328XbIN0GVYqNpb6Vdj/792bb0nSHdNW6uec2paXmYf1Upilz09i9UAMDxdjX5SL3DuGFSUPdvGpqQ6+WlFs2Fjn8Mdbs7HuAoFLK4jGTC2dvR47yxHVTSNzvtL9kuvXc3Xvo6ZYNFCDu3Rx3QGfQ/JGWfA9oQ4tEYeJelGKdHzPrY4ZZ69M+2WtSGM8YOmEJPIBM7GXz80ghUrCx8zBXflWioET4VFmaWZztOZjQe3npdfOBreE5dmoBHx3tehYLyqk5tPKJRG7EEOGRWwzQ/R5BOwaWn7he6Jzfjn6Ujd3RCnnHSGOMrTy7/E8mjG3V4EqL7pwCyG6h8TJSuJcFcL7ReL/csUPURY0jA26R4ddPruegyb8FMEYSw1MrhA7LqjRlDTiyrrq95a2SNpW7kaQdFZAIg+vnBTSHVxrpfNPILTt24eVAlpW9buIuVRNJycr0xZE1nqPTLbwD8CYK+j1jDkmQzhzkDOSTOaH0LTd467ASulSnok5IMmHibnqTRrU3oDAK/IuWeEdXn6fJdCpKTQttkdNIURb3y/LYrlDRmRHCc/Dasv5OVUycvAjjatsBqWgAkt6ZNhnKzlWJkSSV8xlTVdjw9DYCg7cRxO0qOy/rdqYQe+5oFiT7ldKTzzmus= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ad2403a-009b-4d2c-a249-08db032f237c X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:01:59.7867 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RrXaLvcitz1rMfkaSVkNijY/t2ilHjHqhlU8fFoY31Nyv0z0aAMQ7mx48wIqT4NN0jjToGwPX9NAQRuxZO8GpaRPldescFUZNQmwi1w8wc24UKDChPmGV0k0WOdM23Yg X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8464 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current ASoC has many helper function. This patch use it. Signed-off-by: Kuninori Morimoto --- sound/soc/soc-topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index c3be24b2fac5..6bb3efcee3b9 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1468,7 +1468,7 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, /* card dapm mutex is held by the core if we are loading topology * data during sound card init. */ - if (card->instantiated) + if (snd_soc_card_is_instantiated(card)) widget = snd_soc_dapm_new_control(dapm, &template); else widget = snd_soc_dapm_new_control_unlocked(dapm, &template); @@ -1556,7 +1556,7 @@ static int soc_tplg_dapm_complete(struct soc_tplg *tplg) /* Card might not have been registered at this point. * If so, just return success. */ - if (!card || !card->instantiated) { + if (!snd_soc_card_is_instantiated(card)) { dev_warn(tplg->dev, "ASoC: Parent card not yet available," " widget card binding deferred\n"); return 0; From patchwork Tue Jan 31 02:02:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 649222 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91B9AC636D3 for ; Tue, 31 Jan 2023 02:06:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 78FF3EDC; Tue, 31 Jan 2023 03:06:05 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 78FF3EDC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1675130815; bh=DqVeTXKXcPs08cYrnDAfKNz0u8s/17iD0wXY44mdbpI=; h=From:Subject:To:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=CGNH70ZO+hlSac2GRxhs2YObXslmVp2f3jYqBjb3NN0kvhH42r5uQSe5iqhxQ2uqo nmtJCNVoVzXxdp2jmRIKRGxb0UqrZU5exfxJ1LRZro9MjI916/cIJgbiY1w78buGz0 oHf8XOE9/LV3eUSHJpM7iXC/ynGleYJkaAV5ZKyU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E05D9F8058C; Tue, 31 Jan 2023 03:02:11 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EAE4CF805E6; Tue, 31 Jan 2023 03:02:10 +0100 (CET) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2091.outbound.protection.outlook.com [40.107.215.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0258BF8058C for ; Tue, 31 Jan 2023 03:02:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0258BF8058C Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=AVoZd+gX ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XNanKT+UtoDEtThRhSZTcJUviMW3aMb2eTZNDlN9uEqxCSEqn5XzvTLJ2kL3fg7s2zjo1oQUBMIrqFqOi3hMyWk1ldMAJgebpCd5Jv3NTSo0J9XH/5hdopUyGygowAiWgiDmELPvunCBivNnwse/Lesd18R2UV1voV2PVbHmprht66C7uW6K0rephVe49HJVtQrD81nHMfr8zF7kEffpgyjowXScyrVDpuSh4EDjmmFiYRGbVs4BNFMgt87DqqPb8INa6qdjKbr0OJz7sBUzkZ6828sTKQbH753CsvGTQVlHm9oUJz84+SgwyfHepEG+wKyltedUvT05JRgYuXTiHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sVMsoh3ErVqYgiv+oQeiaV4zpyJky2+omTZ2rTxvPEo=; b=NNw5zP1oYQmyVym9KQd557y5mOqkkHeB9wPYvLKg4cIzz2fxkSMXKS9toj1mCD1ZfDLQFumaQ7WaYGD7CxNTtwvyhzqnk2+CI5YRSPRZcfqrQFt53Pj1uy+EfbsTAqreQYpld3yMl6fOmSdcfroHLd2mV5SlGY635UJzWJiCuYNzDT8OIBXwFCHAMFbWwV1ExWilmtjKB3brhWa2b5ew3SzDWbc3CbCXNSKuks+//m6CItMgv2zDSe9eL5bWrHD6B5Erbz8LO/+jPJh1FHqAPM43lqdxoFpVHYPzeE/BcwPAOeWSvXPX9RYFkCh7sCWa0/ISMf/MFLjvwGvIWQhMTA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sVMsoh3ErVqYgiv+oQeiaV4zpyJky2+omTZ2rTxvPEo=; b=AVoZd+gXWdWXFvKW/jWNBxsnZvoghWchlOEEL8JEVuuQVbnjtH3JgSIcFipeJfUYomM346Ng9nfscUqJAgnuWOVbOMDAxZMc07yBAyTCzLe0wwSoA4xVRzXN9y3xqQOcl4wezeT1U1/jl95SdfqcoYQqIZBQjefbJU2DL55vPRI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) by TYWPR01MB8464.jpnprd01.prod.outlook.com (2603:1096:400:173::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Tue, 31 Jan 2023 02:02:04 +0000 Received: from OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860]) by OS3PR01MB8426.jpnprd01.prod.outlook.com ([fe80::4b75:8d8e:d89a:7860%8]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:02:04 +0000 Message-ID: <87cz6vea1v.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH v3 25/25] ASoC: soc-dai.h: cleanup Playback/Capture data for snd_soc_dai User-Agent: Wanderlust/2.15.9 Emacs/26.3 Mule/6.0 To: Mark Brown In-Reply-To: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> References: <87cz6vfosc.wl-kuninori.morimoto.gx@renesas.com> Date: Tue, 31 Jan 2023 02:02:04 +0000 X-ClientProxiedBy: TY2PR02CA0071.apcprd02.prod.outlook.com (2603:1096:404:e2::35) To OS3PR01MB8426.jpnprd01.prod.outlook.com (2603:1096:604:194::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS3PR01MB8426:EE_|TYWPR01MB8464:EE_ X-MS-Office365-Filtering-Correlation-Id: 1aa93292-6ed1-4a76-f8c4-08db032f266b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Npt1zvccPppBGddoeoufbyzEA7TwPYipYiJx+BFcHz0mT4pN0Jv+TDDVSs4usgSa6IDZwFKqkKtFs4O8KZkmCOG6Oxz2ExMJEz+BnLecKQTOXOwh/L8UO+IP5R++GyunyzX1ep0eTT0Mgc5ld/3rfG98dMqBO9hmZMwX6PTq94Vq5PLKx4A2Cfr+fTlJsJaXtEBCo5CQaqbXCuMqHyH48jwUo6PKQTEqqT4SCL1d7K2g3bF4+VBfzP8D3h3lnHMwWJw3ByYCMqwIESb9lJ7Hz0OMlYpvX9+uIRo2EYQH47oQg+1yuxjNGfyItILeF79fSyub9+jqaW1C+DUB9jlwSHjJbofl3GDUIExrRweTn0GokXgXmcFSFOMw9P6iKK9Ie9hrCiesFhi4NY8KpMRySzAoDXwkmtC0CZ40HhmutmL9nLE2oj/hz2r6fVjHOaqVo5JbteWTvO+J9BKOLwIay8JnDqiNMgd0ClkPPg6lFPGHzniEPB0R6hDZcS+LTU/5zYeIpV5sA0ULRveiVWxj6b+DfHo4idp6P7rqdx0IGdEJOENxe4ePM9EY5FnU716OYAsuF1mZJZmGSjIw8ZRsoBoYvcXToqG7xkkeQ3CNjWTBxqMVC1CmtWBygP4uyxGFwHlpjAVTXHgJ7OH7JxXu+YPvSvZBJv31GdPiozr+mkj+skjagqVgsq31LZ9lIhsbLGUhNBt80OGB3qAtwa2KQw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:OS3PR01MB8426.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(39860400002)(346002)(396003)(366004)(451199018)(36756003)(2906002)(83380400001)(316002)(2616005)(8676002)(478600001)(52116002)(6486002)(6506007)(6512007)(26005)(186003)(6916009)(86362001)(66556008)(66476007)(5660300002)(8936002)(41300700001)(4326008)(66946007)(38100700002)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ic6bcQ/EISzwk0+4Tas82d4hQsu9GIRIqOruEYh8XpadyrNRGzv33VC4cIXZXltEZ7gvpk+XkZVI3XR8xdLcAdWhdw9rTGCnw/WhuZ0TrhBeAqVTlbG2385EV5QZf4SjhPotBIBlqMma9ioOKEB0WW3TbqVyk7HZVtmFQcJNdYOx450S5WJv4OlSP7qeu1FG74faWdVqheezxVYRVIUIo1eCsThDjVlHkP5boXviSSisN+ox+5n9t1dbpvbVk3qd8J3XTq4/FJSByuAvptAomXAsoOlBHhTxOGIxZ+4fZJz91GwODuyJD5L54Wi1bCWi52JN5bRgu+4iuZStGdgCE4EK8N1y7rLlSk5+caHX1guqCKQzu1wnvDuPrjaj3X37+nqmronlL27Nb4fZkEpUPuGNoFcjMVHaTBkeZa3KxixZ3G2pSqKHy/l9xC/74JbyfmQHdcSmB1kKPOy5YH7ZthB2oeLTuI2rVTMI3mcOo1IYkorUupOSyrKL5PkDEy535XPlUeUw5g7SnnF7c6c9hhmFWRTMNh66zrAclM1NPiZODiazRNl3n/4yY+GVjs64gf+CTorjH/7Ty37tw7ccHnahZymKohsq8vhG08WffE21Igd+qEzUrrYiG06HE1kFt9iWxIBB0Rlrax+2iJijvqbL6iFTdzDLjDAnWa6RyHUPxw+9R6+oAbd9TgJAWeMgD2DwPrC2trUCUf2I2lmHoIsihm32I1MdDcevSRuzMvKi2JFGevS2II4y0Gvua4Uu8Oioq89SxtTjlsoGc2NO6cMALKPpU0U6JUx2o9ucsMVuBCwZys04+4mGtyyGU5i4v6lhtU8lQmSQ/wQS3PH4I5Df/51wb2KWO4H3dE4znv8Iun89z8NW2hDW3xn/5nGCoYyKYlPSMMPVeMog6jPIDb/ITwbbFr8YkFTV6xWsu6nHSZ9PCGPFF2M1ZODVZPmARPfkEnvfMmRQS+MHtjkyKGTG5ZvTcl541pg+8PGK3cCGyQLMWdtInENihgg1e9wArtUDpVeAXTSn/mZOkSoEDmZc/zG6WdJAANxhlM/urK2PPG1u6ZdP6PphZAE/DQC0MoE3+GBY0v+p9tIasJYc3YYRTYx+2nQEdd3qm2pY7vBwmZGxp/xwm5BY7kVkoQk4NnA29YjQV+7V9LxqlPV0qHeMOUQgl1dryOLS4IeGkJ+epilZ3FWaVJkvlgCdDXWj2XKwtfE83TltUWlor5LQRFDyP4PQZAwOrk1luOmSX6ZiuyXs1LK1uQqqtHnipRznxsKrhy8aO0KlMdmN1Ly7lrNUCjOm9w+cFwVpD7LiH3s+M8MahXVR/Xv+B4/zJn5rARhsAMGAO8feC5WPqMPJHVvFxuE9UXDF9/10/Vfjey1wS1FDWyCjfRJ9Z+qziUuQtMh1VU/iw0+mp0A78erXORSGeDZE0GvyorcDLMP8HiU58zEUF12GhvVCw8w1N3l0zBYPbnZM0m3ZMrP00VJ0QDNObAOaeL2ZjAByAcNFyTlV4WZA+fBMooYwsY5bk1kzvSXY/z9V1PSo9KncT1PH3FcZteZpR1J3OM/+Lx7P+7Qe+TvGULMB8BrAojWrUHEaipiE9ci/I7mBPbe/fUVTSoQNKh5YmpvsTsBRXnZxcs4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1aa93292-6ed1-4a76-f8c4-08db032f266b X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB8426.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 02:02:04.7107 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RBDDIuZYhD+mN/ukdK0cej0Xv5oTHa4WtQmFEP4gNXLj9/lfjRfgPzNjEm13T1Djp1ZimX+SN2TxClRFH/uB6DIIWtaRCXwv7wG4SChIeL6g4G715sSizrdZe5W4hQIm X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB8464 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Linux-ALSA Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Kuninori Morimoto Current snd_soc_dai has data for Playback/Capture, but it is very random. Someone is array (A), someone is playback/capture (B), and someone is tx/rx (C); struct snd_soc_dai { ... (A) unsigned int stream_active[SNDRV_PCM_STREAM_LAST + 1]; (B) struct snd_soc_dapm_widget *playback_widget; (B) struct snd_soc_dapm_widget *capture_widget; (B) void *playback_dma_data; (B) void *capture_dma_data; ... (C) unsigned int tx_mask; (C) unsigned int rx_mask; }; Because of it, the code was very complicated. This patch creates new data structure to merge these into one, and tidyup the code. Signed-off-by: Kuninori Morimoto Reviewed-by: Charles Keepax --- include/sound/soc-dai.h | 68 ++++++++++++++++------------------------- sound/soc/soc-dai.c | 4 +-- 2 files changed, 28 insertions(+), 44 deletions(-) diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 197dc1629708..e3906ecda740 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -423,6 +423,16 @@ struct snd_soc_dai_driver { int remove_order; }; +/* for Playback/Capture */ +struct snd_soc_dai_stream { + struct snd_soc_dapm_widget *widget; + + unsigned int active; /* usage count */ + unsigned int tdm_mask; /* CODEC TDM slot masks and params (for fixup) */ + + void *dma_data; /* DAI DMA data */ +}; + /* * Digital Audio Interface runtime data. * @@ -437,14 +447,7 @@ struct snd_soc_dai { struct snd_soc_dai_driver *driver; /* DAI runtime info */ - unsigned int stream_active[SNDRV_PCM_STREAM_LAST + 1]; /* usage count */ - - struct snd_soc_dapm_widget *playback_widget; - struct snd_soc_dapm_widget *capture_widget; - - /* DAI DMA data */ - void *playback_dma_data; - void *capture_dma_data; + struct snd_soc_dai_stream stream[SNDRV_PCM_STREAM_LAST + 1]; /* Symmetry data - only valid if symmetry is being enforced */ unsigned int rate; @@ -454,10 +457,6 @@ struct snd_soc_dai { /* parent platform/codec */ struct snd_soc_component *component; - /* CODEC TDM slot masks and params (for fixup) */ - unsigned int tx_mask; - unsigned int rx_mask; - struct list_head list; /* function mark */ @@ -482,8 +481,7 @@ snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream) static inline struct snd_soc_dapm_widget *snd_soc_dai_get_widget(struct snd_soc_dai *dai, int stream) { - return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? - dai->playback_widget : dai->capture_widget; + return dai->stream[stream].widget; } #define snd_soc_dai_set_widget_playback(dai, widget) snd_soc_dai_set_widget(dai, SNDRV_PCM_STREAM_PLAYBACK, widget) @@ -491,10 +489,7 @@ struct snd_soc_dapm_widget *snd_soc_dai_get_widget(struct snd_soc_dai *dai, int static inline void snd_soc_dai_set_widget(struct snd_soc_dai *dai, int stream, struct snd_soc_dapm_widget *widget) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_widget = widget; - else - dai->capture_widget = widget; + dai->stream[stream].widget = widget; } #define snd_soc_dai_dma_data_get_playback(dai) snd_soc_dai_dma_data_get(dai, SNDRV_PCM_STREAM_PLAYBACK) @@ -502,8 +497,7 @@ void snd_soc_dai_set_widget(struct snd_soc_dai *dai, int stream, struct snd_soc_ #define snd_soc_dai_get_dma_data(dai, ss) snd_soc_dai_dma_data_get(dai, ss->stream) static inline void *snd_soc_dai_dma_data_get(const struct snd_soc_dai *dai, int stream) { - return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? - dai->playback_dma_data : dai->capture_dma_data; + return dai->stream[stream].dma_data; } #define snd_soc_dai_dma_data_set_playback(dai, data) snd_soc_dai_dma_data_set(dai, SNDRV_PCM_STREAM_PLAYBACK, data) @@ -511,34 +505,30 @@ static inline void *snd_soc_dai_dma_data_get(const struct snd_soc_dai *dai, int #define snd_soc_dai_set_dma_data(dai, ss, data) snd_soc_dai_dma_data_set(dai, ss->stream, data) static inline void snd_soc_dai_dma_data_set(struct snd_soc_dai *dai, int stream, void *data) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) - dai->playback_dma_data = data; - else - dai->capture_dma_data = data; + dai->stream[stream].dma_data = data; } -static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, - void *playback, void *capture) +static inline void snd_soc_dai_init_dma_data(struct snd_soc_dai *dai, void *playback, void *capture) { - dai->playback_dma_data = playback; - dai->capture_dma_data = capture; + snd_soc_dai_dma_data_set_playback(dai, playback); + snd_soc_dai_dma_data_set_capture(dai, capture); } static inline unsigned int snd_soc_dai_tdm_mask_get(struct snd_soc_dai *dai, int stream) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) - return dai->tx_mask; - else - return dai->rx_mask; + return dai->stream[stream].tdm_mask; } static inline void snd_soc_dai_tdm_mask_set(struct snd_soc_dai *dai, int stream, unsigned int tdm_mask) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) - dai->tx_mask = tdm_mask; - else - dai->rx_mask = tdm_mask; + dai->stream[stream].tdm_mask = tdm_mask; +} + +static inline unsigned int snd_soc_dai_stream_active(struct snd_soc_dai *dai, int stream) +{ + /* see snd_soc_dai_action() for setup */ + return dai->stream[stream].active; } static inline void snd_soc_dai_set_drvdata(struct snd_soc_dai *dai, @@ -593,10 +583,4 @@ static inline void *snd_soc_dai_get_stream(struct snd_soc_dai *dai, return ERR_PTR(-ENOTSUPP); } -static inline unsigned int -snd_soc_dai_stream_active(struct snd_soc_dai *dai, int stream) -{ - return dai->stream_active[stream]; -} - #endif diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 69f534f0d4bf..0119afbd01fc 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -514,7 +514,7 @@ void snd_soc_dai_action(struct snd_soc_dai *dai, int stream, int action) { /* see snd_soc_dai_stream_active() */ - dai->stream_active[stream] += action; + dai->stream[stream].active += action; /* see snd_soc_component_active() */ dai->component->active += action; @@ -527,7 +527,7 @@ int snd_soc_dai_active(struct snd_soc_dai *dai) active = 0; for_each_pcm_streams(stream) - active += dai->stream_active[stream]; + active += dai->stream[stream].active; return active; }