From patchwork Mon Aug 5 00:43:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13753024 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 (unknown [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 B4D6DC3DA7F for ; Mon, 5 Aug 2024 01:07:46 +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 AAEF054F1; Mon, 5 Aug 2024 03:03:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AAEF054F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819818; bh=/9LcLBmHtWn7j2ve678PWR2asGaCetqzDCwbgl2TwFc=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=nODo3aps0WJHMioEeBT6iPYGSJpMmo/eA7FNs1nARIQqc9Ktono1asiA7WvA6xJzT XViTZnmdu5HiLcxgWig4oFoGEgfw+osEA5EWSAGwn65zjsU5HdaX3V9QhjwnwMurk/ L4oaw48pI7L15LbQowIdB/xw5j94bnYiCy9QSIp4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B1B9DF8087D; Mon, 5 Aug 2024 02:43:20 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 13320F89DF2; Mon, 5 Aug 2024 02:43:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 49E1CF896B2; Mon, 5 Aug 2024 02:43:15 +0200 (CEST) Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (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 8B498F89DD1 for ; Mon, 5 Aug 2024 02:43:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8B498F89DD1 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=GN2UVmMt ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ylgb/UgSKD/wtmT8ZQQs1+bw+nBgl4GVs0GdGbRTMIVGEkWm7izWAUK4lDjvzKIcLoli4i8OZu/CsyoW66XWNdaVtGFn5ToYvEx9b3XrIBYddIE+WdDOI2ziwhss4y2B+rA+a3Az08I2QX49AQ3RSEOx5wvkSSxC8ZSlEnVmMtiqndBhh1vGhp0GKSnnD1YYF8UzaNy1KQ95fBjvU4uzwWOciyQ0pfsdJ9PxWglBOGxXQ6l4f0kJTWFFni6wgO1BK1c5Jk455jVobHA6Oyq2fhrWWAtP3yI4fo63N6EmTruLZ1JXee6oC1bMmhzmcXyKdVhB7FNNy82vx00USkJbCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=TKWGReVMNves31USvccMyKWFks/GhepFZiGPLmgy/Jw=; b=e7ku2sVOrgpwP/g9YcFV3PsVoibAw2UjoVaLKtnZZ8Ntl0lxLdX1pzJGGFWAlWJ6oWB0oz4DI2r3jGAZ4Mwcpstwd5pUf+450NMF8A4en65ZBKYE78QSiG0yNgc2OrVdp93Gtxh4oqPf8EVcmbDSvEfEHwtlqW3nEOISKbGs419dpNAC/Uq6mzMVePOSXFwek352t3Pzkj5/TA3IOfCJpVf9s9smVOMoeVYmBavYrDxyPPoaJ0YMo1yJA6T4gDBmcJOcP184C1c/0m9jAR+5S429DXm5QZBLYME0n+yR2zF2ne3bmT52+mHR3lAyj/ERMMKB/XRNw54awQuGZpLfVQ== 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=TKWGReVMNves31USvccMyKWFks/GhepFZiGPLmgy/Jw=; b=GN2UVmMtMtaxg6hmy+F5zCecEa012uExPbgfFoF9zspd3rEO2eeH/CRBKD7pVlAdpcf0KOdRukVog+JbBVYDmu2Vhf+GHm1Q9nACSNGPuRDXx+MOP6juIsGOxJRAA60hRog3qByKd/qYpHaejgE24f/+YTZvSSWusLHbTn2vl7A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug 2024 00:43:04 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 00:43:04 +0000 Message-ID: <87frrjx0iw.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 092/113] ASoC: codecs: wcd93xx: use snd_pcm_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-staging@lists.linux.dev, Linux-ALSA In-Reply-To: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> References: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 5 Aug 2024 00:43:04 +0000 X-ClientProxiedBy: TYCP286CA0348.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::11) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e92ec3f-6794-4e00-5f78-08dcb4e790fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: tksn6VCsuowGg3pwRBTy3m8817ToR9c/m2SphbE6gPzFsntmI3xoq3y8jeAqzj11wEeEu+xljtCQ+idmh6YJTeeX+DDU7159fcWVtLK4sYkGV2AjYKSSlWxwOJdi4dEFMs0PCoE90+QGtqljiE5Bxuo3lZjR7bD4nvIEhRcym1mhJwFIpQrE03jYO8m0uJJkB2NELgpwEDNjd8bG/3E9bSZ/BFvSq0ko9J/j6kA3TbD7waDr1C3W4uaq2w7p/tRDbb3/QDLROyF8IqP7fWns/KPmWtkebsdlYO84SH3oqqkFIypT3Srmj7JoNvGQI0iquYPnFMNLtswGh5JAOpuKuww8LHKzj7AHO7C+6UztWSH++0thUVImz5tSZkzGFmcB55jx3ERNJNw+9rWRwLA8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RV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xlIVekzeVOfTI0a7vew7/GlsZAVYY7yziPTE2zulknVXAhTUUaJyr8AOL5n/QSEFhlarq2OBHaLtryijyfdPAaYO2rtocZGddc3pbLPS2Q6Rh5OmCMQCG1ahIQGxOTFoD3g4hzOQv14IvBd6BphW6IHA2jwQw60y8GwzOG5k0Gmn9RS9npRrsMZ/+gCZpvQl94jNgXZJrpTJ0S8P6hsjVsn++4uctmjPzdD6BI12H5kZPADZwGV/u/JP6XCCjyjr+5igG+5FV1Xr1DX1f/+F4e56QydnCe7gy1Zt6jp2YHuScVL+6l7Q4UklR1O69X4iqvsOrOsftpJQNr4tnRrp1MOMkZSkqYDwgykPFClvzM+7Xb9rg395Q2NYNKOa+pc/OeqNmxdXUZNS4XEQgHUrQ+opJObicWUW75jYXFbxrpCHuwhmDWQX/irBraKIPPDjR70JMQgDmLUSsW/x06r0sn/RAHEJPFZU4Bl/CN0bcv/DiJGTRPzEP4tQt+rRclHrr78bl41jyZFeLOH7wJergTfLw8YwQPGxfVx9JORSxRV02+zOFyAhx9sra1v0w6bAdZtMKlZaa9fcxbWx7l4VQym+pGxRh2Rn8aHwI1bIMfmbY6VnkOuWr0/9HqHb1PoFNUPICWxlavBi06jv6WWlPMaEA+OKzJt+JZRB8tlHa1hbgzAzDt1MH8n1QL822gpEczBkP0VRgDIx4ZTLFYEVYNJJhrbsuymug/IWoP2zjC1vj6Sg4648gakzHXpeRUQvTjB5xcpfdMkUxclYDoiE1JdIYTPYbK5WM1N6kh3H/jFGk3fBgXPxcCXYY47j26bcNFdMIMA18vcLel8f6uPdaxgYZvcCowqNpWiqnhjjXICCKtKdWxknTrDO/CQJTrgSsbTb5H3RF4vP/kQWVQ8z5U/INPEx11qNpXM1nrRC3lohzIXGCniKPA4KlbPrqGiWVtxxWG+2hL92pAL75LVc516mEPfM/DcQeJdAeaCwPBYI3S7gLCkr8HJ1PiJKZ/riycVnhWljb1B0qx79wXynhfj1SgyTPXzW9Zwbkef56lw8eOg7xLXie0+StUk2jR2KvTZ3NArm8pZf+DydPylC0YWuswFeRjv3I94IP3hFwmhnyDNnDcfAoSXqoRsjwnX7jkXxYeZ84eXmSBYQx38oGkbaipk0aJU9IBKh7kaOchoeUqHqG5dHIRB+PL9Ky1M7ihL+MepW/EIW/UmKpLDVd1abnJVIR7Ow6wc25+0NedViQL+HHFlV6KZ1VzGEKlpIUdrSCq+L19ZgewyVl2rDhaUkjH6ogUSOansryruaja9athCKmvIuXMF6sWriAt7XV5QrVLm9DOIG0eKTwPH1uAgnIadCt/OVh9ieXPHIbTxins22oI4x+SHqtqHDdrPEHkqHLS9emzMxgZq/h3pHKnhxpwHv0US2tIdU9Ml6xF68iGFLnCw/CEfE+aTHT449yZcGQgNJvc+ROdFR1k7QbWU5WgTe24kKlq2lQVBgVyJ3uUaHgWoaM+RJ/UDq99dRywl5oKtITxwcZvwN4Tf9cUxoQJGA0ZLmvUpmuWoQzvD8qMOsLjipFIk9DwynfrncYWzxDQbHZcIbdcNYAV+prInqwEF+taeXwn5VV2zCC7M= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e92ec3f-6794-4e00-5f78-08dcb4e790fd X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:43:04.3540 (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: PVvACph/pQX9Zsg8soWUZvkYQyJGqssdj8vu4+y/AQYerVmAHjlL6KgHgppptjwxb0Y5j5VsQZNidpAaut5bAhZh+RWXWm5WhZ0G6UM/9iSnYX+QSManT/NJTVyzJVcV X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 Message-ID-Hash: QOV5GIB4WMDCH4PMDDAD4X4R6UWE6RNV X-Message-ID-Hash: QOV5GIB4WMDCH4PMDDAD4X4R6UWE6RNV X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/wcd9335.c | 2 +- sound/soc/codecs/wcd934x.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index 373a31ddccb2d..f66f4134af8f1 100644 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -1732,7 +1732,7 @@ static int wcd9335_slim_set_hw_params(struct wcd9335_codec *wcd, i = 0; list_for_each_entry(ch, slim_ch_list, list) { cfg->chs[i++] = ch->ch_num; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { /* write to interface device */ ret = regmap_write(wcd->if_regmap, WCD9335_SLIM_PGD_RX_PORT_MULTI_CHNL_0(ch->port), diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c index 291d0c80a6fcf..82894ec51a53a 100644 --- a/sound/soc/codecs/wcd934x.c +++ b/sound/soc/codecs/wcd934x.c @@ -1732,7 +1732,7 @@ static int wcd934x_slim_set_hw_params(struct wcd934x_codec *wcd, i = 0; list_for_each_entry(ch, slim_ch_list, list) { cfg->chs[i++] = ch->ch_num; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { /* write to interface device */ ret = regmap_write(wcd->if_regmap, WCD934X_SLIM_PGD_RX_PORT_MULTI_CHNL_0(ch->port),