From patchwork Mon Aug 5 00:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752915 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010031.outbound.protection.outlook.com [52.101.228.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0CF51B974 for ; Mon, 5 Aug 2024 00:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.31 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818561; cv=fail; b=hRZzXV8sJkPvFb1BwZhJZxk3mJCwTDWmrSVcvLZDac/3AyQIeKm0NApIYWFWvnyBrXsZ5iHdW/yrvqwPRKxcreUwR7UnDEwisEA0qA5FWu9fWGtTvKDax9+i6mHvNeRDCllpuJ+0VOQFxVkPbYz8H1WVBID3MRN09XBxUq79vuc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818561; c=relaxed/simple; bh=MBwS714mAGBlLfd9PSUcrW08HRMlcirt0EmtU7lhdK8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=EqsPbjRZne93tLuU4EO5kbez51AVOyg1DhIe7h2c0Hb3X0yqs3AhEy9vX1jtFtkQj9MVC+Z2klnQfBBR5T+GBAAjRMD/nSGo3b/pxOLMDxlF3vSalo9Xng6jMR9uPY9FXHziRDDQumsz4yJtbUxqu28hS0MSlEozDvBGabYqIzc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=DThb64te; arc=fail smtp.client-ip=52.101.228.31 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="DThb64te" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LH4DL2JZyJ4794coFv1N+vnVRiHZ4eO2GasIUosOJMZGyesjRK6EuP7ZGqzanvKKSZexQim635D0nrnHQPVu/NxPwdIOZah/6uOUNa8WZgSthJL8RCuAqYnnSk6D3wcJdlRuoiKChoiPsrJpIca6Sio2NHJXEbuHIhL/YVa8LmP1/JLFta1fgeNB80WwsxRtrVPaGe1x7QpdPiRx/5PiPF0ma2y97qa3Z7rZ6iRZ0itjSkefkla/oACO0njr/WO4/yWZY+FRTqW4xwrhG9p65FGzlQIbwEJJon1sa9hVc0W3FyrAy4J0NehDCuRLp2u5hPx2CTxWAV+Azqz3426SzQ== 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=Y8mDYYCu/00Qp2W39bd+KlQwRIQcOzol7h9V+y4bRqk=; b=jA879qjb8a5sl+bNVNAmozrSkvLKPJCszcE3qcUE6GrbUcdXPhFxX1WE1Z0w75cMZjwTyP6Qre7kkZLCmw/nBmnPe1g21i8NYXQ4L/g4e57vkYUxaPxg94jcFtWMm1l/6ZOxmdI4kFhmMxn+e1/KbEgVZIqbDaHJk7hcKWxyreEHunnRqf35cSY0azrbk60YCss7Q1MXHCuGYSqZo5lGk4KCJSw+c9y8i8uNKj8Jk1vPypcBLcybAGzIlNy+67IwQBXaqyJQRqrfAD36dizC4gGE4E9fr/n9IvqeaiJQ/01S48b0nXejdFUib8bCnha96ZsePVlKK1iJuPhthEhIJw== 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=Y8mDYYCu/00Qp2W39bd+KlQwRIQcOzol7h9V+y4bRqk=; b=DThb64teJ5Xt1WD8XfYfza641lXWnrhn8b8py2E71OpWeu00z6jvhmOeDWRQrtdv3vwKUqUs3iuMG2uCJ8GSlm9P5Gvtmc/ORtN+Iq2tTieaRrYaxq+xEp6EeXA6V9PvrySlqSgwPDSYQntmdLesW2h1Z1bKwFymj+KUAdAamZ8= 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 OS3PR01MB9302.jpnprd01.prod.outlook.com (2603:1096:604:1cf::11) 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:42:37 +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:42:37 +0000 Message-ID: <87o767x0jm.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 086/113] ASoC: codecs: nau882x: 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:42:37 +0000 X-ClientProxiedBy: TYCPR01CA0145.jpnprd01.prod.outlook.com (2603:1096:400:2b7::18) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: dcc896a1-acab-40fb-295a-08dcb4e7811d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: D4OnEnn7LwWy/JQx6fZgwjZNQ0Xpw6FCoQ3yHV7tDyIGeqk5wDAKsDrtaKUClJWUSXKBZFbJrBXPb7B4yzzSiH+FqX5R6+7jy9MYfmAg7SLkVB24xZD9/j+fqT08MgdNuwwyir7amVj/H/VgMDiXuWKx266NTcy+V6dMDK1ppodqkw5BxbL3DjKL6xQHOfxQ6v1tOYSEa3NnNx+WtLvYJzEyBBd1/TFI36pzf07/Wh4RYaoxAR7TAbAkezhomkympiRnPmYLkcAFi8ApIIvD8SkIG7usGI3IwU3q/zT1jXEsq85mhEAc+BFQ/2LsOeDBNgQzwhC4ZZJJXvTMRl0UlXYgIVyUYgs4SwZUKpXdX7lztTHKtW/SR0eI8dG0cR+ZM5Hc6en0wTFfHdqMJ2byLVZOOygMp1UMKgjATe54aW1v1EKZ+Nca0RvZ59/VUfeazZPKjte4gAB+joZcMZOPWsQnkJfc516ZMtbXBwBYW8xnsJd0pfMrL8iIxOkYZqUN8wY3FOS2xsETol0POEFvN9+Mff73Q2ybEaGo3RCezlz0wNoN6CuthhSO1eT6V/sSbsJsTCkCco7TDjNTT3rKcktVITyWw7JpGzdun7tFEHp5ADJ+ktRjNpyte6+XxpU43S2E0wJKVXBRtQXLGCdUwO5UKJr4nmGrJ2NdGiR9c8/SzMQYbqZokuWGZvYmd2dBX23RUFXxw56/XHWu+Db0y4gbvFJGDVlsiPtwciT23m7OuLqgoKHSpYV9/e/+AYM9bZVU6BPSQTkKyrjeth5DLSR1OA2XshTu7P57iRisq9qCi3I7Ycx5jpmmPuV6s/Kn6/U3y7w8QzMmu0bOW7kB8IDNu+6hsovr4ix03jBgn25ooTDEnACeOaRHCBa82Vf0OiIoDqVdR7880AvFLYBrsOYYzdaQo8Yskoher9l15PwN6lfTtJDuHViSLQoXtIyifO9N39cGGT0CyQqEmlsXlgalmw/IJ2O1RstbPfY+p+E22hoxGGsFZDkmexw6P3K/4U1/9IYOaLJmOdlI3JgOfsGqK+/B1iePI0oPw0mai3rgijAkT+WQIDrXTwUZcIASkJD7EwEu4hghRtQtgxk0XYHQtBowAVq4bMWt1qL9Sf/ysWTaCbXQdWbyzZdWtIa27MHobs5ynPDO7AGZX2Eo26f+vqHedFR3q9PxPBgfPPkIJbrzcC428gS1Em7tUh2ZlVtcmkw3fVaboZol61Nc7PJ/Lzv/lS4Aq5REaWoGRIY1VEK0qrXUPkH39d/+LYFMZBMZt0pJAcpnQ3lCtpuCR1TmccM3Z4kinfsdh/vLvb1YRMXtTOsMn7Uo2+r3HB0B1CsMpN6Ic+ejQSllnuCS6i+vmDORWmjjaijyq1B4LX4+shvsa0hi9nRHznmptxBaFg7FsBX3b6/FH9TOM+6ipQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DfIPn21IPfN/EH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J7mhxWfs+ngR4YHvpwtFYPYrBEbnL0Lvf5iogs++Vz1NkwV3eD25CvmThtzC8x7CSGorBeObxr4zI70A5eHuALzY/GhFjy+K9budqeIrhDxIpk6+3GYKmtbKtdgOBYlO2EtLkSE2T4+VQTMON5TmkbnTl6A4UED8mJ14z7GN3uwq/xWeOmTOWUn9hVI0MLYBIb1QTg5HLva8tiAWOfQ44u0VSPiAaeyxTytyG/CTb6nJtmxPanoS8V5941tWtNwc/H1QA9zpCFook1y2lC1eWBwVztGEIvKdyxk/P/gNz2BnTtDlcn01J+ZQuEPCNKZTMhpzjmPjfBF1KQzwcxsb09xiG0UZi3BZWeDF1bNVCv9w2HoQ+nVUsKbwM29s2qo+uEdK4EVH7FHNACxY4LkQRqQwggTk1hXonEXrMKikOKQBDzlIRQbPDSTBwcoUMgtIV3bNIXt1Zq2nBO6HqoWx26JzqtAAiIZhSh+XN8rsZ62ZNLoKIngtqu11g/rOChmIbj2jyO5Yql7/l1a2AO2eqNjRR6I2fjJck1pKETra5NaLU8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcc896a1-acab-40fb-295a-08dcb4e7811d 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:42:37.7861 (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: PiRP6en9CWpqjPRvMpBSHtqdkOy+B2qIayrzGB+Vr5UUAFSNJQvgTZhl9Th60FyrpOQSYAagJti3Tt7UdkKp0J8nbDoQdzd6NmGmA4GRjGnk8ZGQe2iK5q6K2n52k/dd X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9302 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/nau8821.c | 4 ++-- sound/soc/codecs/nau8824.c | 4 ++-- sound/soc/codecs/nau8825.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/nau8821.c b/sound/soc/codecs/nau8821.c index de5c4db05c8f8..f887c192b87cf 100644 --- a/sound/soc/codecs/nau8821.c +++ b/sound/soc/codecs/nau8821.c @@ -803,7 +803,7 @@ nau8821_get_osr(struct nau8821 *nau8821, int stream) { unsigned int osr; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { regmap_read(nau8821->regmap, NAU8821_R2C_DAC_CTRL1, &osr); osr &= NAU8821_DAC_OVERSAMPLE_MASK; if (osr >= ARRAY_SIZE(osr_dac_sel)) @@ -854,7 +854,7 @@ static int nau8821_hw_params(struct snd_pcm_substream *substream, return -EINVAL; if (nau8821->fs * osr->osr > CLK_DA_AD_MAX) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_update_bits(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, NAU8821_CLK_DAC_SRC_MASK, osr->clk_src << NAU8821_CLK_DAC_SRC_SFT); diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c index 12540397fd4d5..21cda3b473bad 100644 --- a/sound/soc/codecs/nau8824.c +++ b/sound/soc/codecs/nau8824.c @@ -1038,7 +1038,7 @@ nau8824_get_osr(struct nau8824 *nau8824, int stream) { unsigned int osr; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { regmap_read(nau8824->regmap, NAU8824_REG_DAC_FILTER_CTRL_1, &osr); osr &= NAU8824_DAC_OVERSAMPLE_MASK; @@ -1094,7 +1094,7 @@ static int nau8824_hw_params(struct snd_pcm_substream *substream, goto error; if (nau8824->fs * osr->osr > CLK_DA_AD_MAX) goto error; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_update_bits(nau8824->regmap, NAU8824_REG_CLK_DIVIDER, NAU8824_CLK_DAC_SRC_MASK, osr->clk_src << NAU8824_CLK_DAC_SRC_SFT); diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index bde25bc6909d5..951406fa5d32f 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c @@ -1238,7 +1238,7 @@ nau8825_get_osr(struct nau8825 *nau8825, int stream) { unsigned int osr; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { regmap_read(nau8825->regmap, NAU8825_REG_DAC_CTRL1, &osr); osr &= NAU8825_DAC_OVERSAMPLE_MASK; @@ -1294,7 +1294,7 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream, goto error; if (params_rate(params) * osr->osr > CLK_DA_AD_MAX) goto error; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_update_bits(nau8825->regmap, NAU8825_REG_CLK_DIVIDER, NAU8825_CLK_DAC_SRC_MASK, osr->clk_src << NAU8825_CLK_DAC_SRC_SFT);