From patchwork Mon Aug 5 00:40:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816960 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010061.outbound.protection.outlook.com [52.101.228.61]) (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 94DDA171A5 for ; Mon, 5 Aug 2024 00:40:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818432; cv=fail; b=JffoK6TLMMfrQNPapp1+Xxj47qDSIcQ5+cnyAclFPF8AsqwuLi36+G3voXzTiuFyJmMasUTATvydERfRLPVQwE+H6xIlCd4mJxByuoXJhw7mhtzDqPnv5CO8XqFn2bWOTRlS1mmAKLtFZcOfgsxni+8JGcfQtC1Z2lVtMwp5A8g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818432; c=relaxed/simple; bh=w4POZFC8qzCasyoyfYf3hhQyxmo2cgU4bohFHq6IT5w=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=P84VelWSmeZQFIjwQWtibT1pCLLJY0iL2qm8DyD5nwKuWK7Q0Ne8ZrN1qbH8E0IZZsBlePIOX/GskqG+fUXVJQsBte1BFD2ArvL7WnnOQ6COmd8/76rxUk067FfRCN8OJPAeHvpgeAxckhKKsFKmSQ9trFNaVtpwoAaGCbWrGDU= 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=F7vE0YF1; arc=fail smtp.client-ip=52.101.228.61 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="F7vE0YF1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d+RFLlhGwVMLN2h4Onx88gqsk5Sed6WLPuepHHHwNZpzIO7eJXTa+HiHl5rBjKWVppIF7uDMw4xSva90xPa1hacIae4MqxnB2cbbyx8RDO0A/f+oMLOPwoCkUNxx8Ynh6nIIIXUPhOQeNzetXYmHTnTtjBMCPQ+22Gg1Jk/isEKyKHJUWzxEnXqxV3doNHHLm10bBOpyBFqmJZzn3ziDC975BMu8ryge12ze00JyxnuIiUdAFH2XA8BNyGCWxKwNsHo/bxE5tIyFc4YuY8RR/yETrBr7wttBP6EsgyLqO1bM387EhxVnPxFwepS63FbMSso5L0S6WyoHQVCO0uKeBQ== 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=6HvUe/NFKSULjc/2Zipssjdlc2fWORF+gcJjjGqjJb8=; b=uLbpIyelGBhDTPYDRDheRiRHgWu+dpCW7NqPxJ56/Tmj2AGUKplx5HOtmrfT8NBlf19CuQrh8grV+ZZ1a16y9jFpUaULcRgvLMLMFJH0klmPbV0UhtU7Ov5oGsqGeOIA196OefGFUGeXREjBKoe7n2rYbwtxJLATNOwrEh4bVPHXqDezobjJdKQJNQdJHBNP6dXRB62yB2edNeSmiCn22lD1Jy6OJ76CA5S3xyFJvT3hDCuuc/NxBw1gaQNua0PP53WiV1n+gFWgh/ovfbFxvjgJG0ijDx7j+njRup1oUt3qpQOXNRxS0d9qxTIcfnYq/pd8nlvMTNzlkR1RLIc70A== 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=6HvUe/NFKSULjc/2Zipssjdlc2fWORF+gcJjjGqjJb8=; b=F7vE0YF1Ov8+D+uNUf1NsiXUnrGh7q3CM0oH6eEf44zMxXyyDaFm3zB5CQ9JhDY9mziU55eoYYLS1mzeXWAZYQrwqjdM0KFlMuuRUxTmJzxKnzzPMbxwxAOcB+RS6cGZvKeIic82VkqQDbxELlHMDJoN8hBfSC8mfW6gn0EdppU= 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:40:27 +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:40:27 +0000 Message-ID: <87ikwfyf7p.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 065/113] ASoC: sunxi: 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:40:26 +0000 X-ClientProxiedBy: TYCP286CA0358.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::9) 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: 87160f72-7a33-4688-7048-08dcb4e732ff 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: +RBiRCky5A4H5LRKyAeDNkYDBEAyxyK597MQ6HSdI2r+hrDpinMgmSY8UjZFQAHtSk02Ml1ZMnfBMidD57OmTqGtbZ1IFCHH+NFlZdtoHQa7ewh+mmUVGdp6EU+JLhWk+YSPT/elo5rbsERWR5fDFEPH2yJfi1e31dOKYoU/GKPSsh2H3lo3bKsfuZubp4FgYH0nSBPXJeuk5jiD2cK3pj9/MjieFImFuQ7ZA2bUnSo6mviARW54QUIS+2jhdvJXHauzW+waZBPysAdmBaD9iui1E6anJ6yO7dG6essmAqv9Y9DWiakCCxo2l9iQK9BfeIIeziD9J1ixz+7Uzn2Fhg3LLSt0IY9BRlHt1xfGBtB0QQc1igAnNVJBjbx15dK93293j8R3YYUK2Ljik+Hh2nfgxy/jpG/1g7KFE7+QbfQKK7rZLIlWKUMeUYC5KYrSKSUY3S/PBU73xTCwSPczAg7SMe2QbQ8Ov2wgdm5rYolVSzQY11JMjumaoUuasFpFeNvtHtjjGQMBuZ2DhoC1bMIflQaQdO9Ud5oJ0eq77akKYBmkoOJNvMSw/A2YPHG6b/nSF3QfOKypUI+rZ+EFPesfZ00eSXWMth7mutmOcDrdA7PInUa90K05pGIdUd0QLX4XvyLfTAyIrIBi6fSS1dO9RwBEQXnGnRWaVubcyjhv1Eh6b3DkudTf5f/sY32vXyt/UZGTQWjksCYIRBPdRTEHMNf2sMiamzbU9JoiKE19y9AnkmD4sB6gWR3saANJfzoamaKe86UB1RUSZVUPZKOjKJ89W8TA3cAtgvoGtnEi6U2rb8Fb/X1xdpsObEP5H1PcdA9zVKqXcX33bjn+t1le8UNR15pNgtFA+H3yFwN/41okbWrdFmiVdr9XxxtWeqpXVHMIff4frEyMazbsVfIX8+fGC/YbDRR5Sv9I5YAw+W5lRYsRX9GBoFqO3ZeP+FAZw6SDbNiDhJ8fnN2Zy3ZkCczojkHYZ0parXDGYtvbE75ZGKSdHn/efL4a4GW6MKF3akTYMKGF0GxniqVzPfKuq5YqxYmn4L8H9aUQWlgi0jft1p1rIN6IdO5/o3m5iJI2C41n3eVKhFW/i2fz9Ym8fMkQ2bjOaWCO/AF73xUu9n/rI2T3Ym2fa8sJqTOT9Jh3LelaZQ5n9pc/O4Jy9nSFhuBJaureCmwdCGoYX+TybJT7YnLdY3P1o+pz9nvNNMnHURfllN6Nd4I9iok28afI4GEwgAYP3kQLcbIgdjftqRC+Ngs5tbD7QIf0PvN+zmc6fJXOLJ/spLbW6NuSCFmab1skkNrk00yTim+JJZvhf1N/zkAi9Qil64qz1O5ol1522PQSHHpaTEBd9NSJVXKp/tfVPRJHjbtvIQ20yY1mXuvrMunZtQcW4qyRltntUOSbkiIlRfscelqxqwg5tQ== 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: wcx0lVz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EmId0SYqBunYW+RGWES6ZhJ935BSoddQj8DlLkiEUtQjsny4K+tORX5CczyWwo1VAhGN1GRRCSrfWhbx/z7pkuVaw47OMIMzoU1rAj3w/flRocyw5/OaeV+cFE1jDqq8/1FP8HXHfjF/EywWxwNhYmF9MS1jSmsWroSXvek2YJ7P0dxMp3gBKLNoyleA0vNELNOe7PLRWN8/neAF5m1a9XA6xybwZQCvWgTrc458q1kL6Sov0tuIb9YeSFz1zRuyAKYn53aLXkLevFbShKG5ML8SN/DEx06np0z0WTTP/cSIlHLv/IZiihQcdvjdD0qmdZvONYjDHD+mUo9ZjmcLGFH0iV1t+GJ7IMpgnaKASaQgN0f8bIQ0bA/U1R3l7i+ZmiKfF4pulHrl60inF43xjgccaVDp+7rIT0JAKW3GNGm8siq5ltA/Mf1jXP6lckR0p8B/QaoZYMU3b35SsZud4ZiT4HqLDmQMSBKaHuNwCIdusKsJ+kDdPeIDv21E241Mlh5xBrxLnSgtRzdi07uU+vj5yBix1ZTgZzpa3xCTX/gSMEfLsGDc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87160f72-7a33-4688-7048-08dcb4e732ff 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:40:26.6593 (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: oDP6SxeL8XwQdgjj/cTa/3zn+WXr7wR+6U6K6Z4L2cl4rZOmNa+RX/ytR0u0kQWpcqqr7b3f+Ox/FIwmcH68NwD23JTBg6myLDjpn8fRvQXPKNVq9qlZ8lwBDv8anN1z 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/sunxi/sun4i-codec.c | 8 ++++---- sound/soc/sunxi/sun4i-i2s.c | 4 ++-- sound/soc/sunxi/sun4i-spdif.c | 4 ++-- sound/soc/sunxi/sun50i-dmic.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index a2618ed650b00..edde5cb84ab61 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -285,7 +285,7 @@ static int sun4i_codec_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) sun4i_codec_start_playback(scodec); else sun4i_codec_start_capture(scodec); @@ -294,7 +294,7 @@ static int sun4i_codec_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) sun4i_codec_stop_playback(scodec); else sun4i_codec_stop_capture(scodec); @@ -385,7 +385,7 @@ static int sun4i_codec_prepare_playback(struct snd_pcm_substream *substream, static int sun4i_codec_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return sun4i_codec_prepare_playback(substream, dai); return sun4i_codec_prepare_capture(substream, dai); @@ -569,7 +569,7 @@ static int sun4i_codec_hw_params(struct snd_pcm_substream *substream, if (hwrate < 0) return hwrate; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return sun4i_codec_hw_params_playback(scodec, params, hwrate); diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 5f8d979585b69..0b1bce325f04e 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -1033,7 +1033,7 @@ static int sun4i_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) sun4i_i2s_start_playback(i2s); else sun4i_i2s_start_capture(i2s); @@ -1042,7 +1042,7 @@ static int sun4i_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: case SNDRV_PCM_TRIGGER_SUSPEND: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) sun4i_i2s_stop_playback(i2s); else sun4i_i2s_stop_capture(i2s); diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index f41c309558579..989cebb55798f 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -248,7 +248,7 @@ static int sun4i_spdif_startup(struct snd_pcm_substream *substream, struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct sun4i_spdif_dev *host = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; sun4i_spdif_configure(host); @@ -364,7 +364,7 @@ static int sun4i_spdif_trigger(struct snd_pcm_substream *substream, int cmd, int ret = 0; struct sun4i_spdif_dev *host = snd_soc_dai_get_drvdata(dai); - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; switch (cmd) { diff --git a/sound/soc/sunxi/sun50i-dmic.c b/sound/soc/sunxi/sun50i-dmic.c index 884394ddaf86b..1b662b40b7b6c 100644 --- a/sound/soc/sunxi/sun50i-dmic.c +++ b/sound/soc/sunxi/sun50i-dmic.c @@ -90,7 +90,7 @@ static int sun50i_dmic_startup(struct snd_pcm_substream *substream, struct sun50i_dmic_dev *host = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); /* only support capture */ - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; regmap_update_bits(host->regmap, SUN50I_DMIC_RXFIFO_CTL, @@ -205,7 +205,7 @@ static int sun50i_dmic_trigger(struct snd_pcm_substream *substream, int cmd, int ret = 0; struct sun50i_dmic_dev *host = snd_soc_dai_get_drvdata(dai); - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; switch (cmd) {