From patchwork Mon Aug 5 00:40:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 817095 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 DE1D8C3DA7F for ; Mon, 5 Aug 2024 01:00: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 7DA2938C0; Mon, 5 Aug 2024 02:56:55 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7DA2938C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1722819425; bh=pZXQkenLZS4PlIyxVPNguTu/bb3Zm46mzqXGzzF6uV8=; 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=AuPueaTn7AqMY1XWe3ExHG98NtqE6t/XiRR4H1v3xc7GxecC2i8ME9IWfZj/Zs23N 9fz3EdSqIBvoTCocX0MVm2X9rI4t6g59NzYswoCTi42lvlYjeSe4Bcr+VNzkkJGniD 1r7GzCdqfGzZFo8GaVh7e8kO+XC2w1HROmYjIFkA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 44CFAF89BE5; Mon, 5 Aug 2024 02:41:05 +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 64FB3F89BE9; Mon, 5 Aug 2024 02:41:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B91D4F89B6F; Mon, 5 Aug 2024 02:40:53 +0200 (CEST) Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazlp170100001.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::1]) (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 98C5AF89AEF for ; Mon, 5 Aug 2024 02:40:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 98C5AF89AEF 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=APy78nyO ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VggTISKcacDBxU/USlPW+93fcGuc9fCXoY9F0sIk73vB/qofps0Av1wA1uhknxegrSqZXSomtQwUNfcNDY3yR/Qs3Ie4MQENnhKD23SOBVuKhyI6+QZeDp2ICRK8LWYeHCeom6ugOV2T6Zn+QDdmrI5Lc6C6YJfXSCCeJAtnJjGnm083M9JBZzBN6SxXPP5jzOAmoPGfYLvCctrq5FFYmUHYfW8n9avn+sPvSR4t5dc8xbe618htVij4HKhfSnRPZM84S6RTzMpMt/BoIQQyEGxm0+AkceCYuPH1WocvPV8fodBwTEwuw6k8wD8rYMbUwCgGfRATp925jSU/7GZexQ== 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=IBjz2IzpTVLNw/vY+NfoHHqifRx2NXLe/j1yeG+Uw/M=; b=nOl1LckIobEWo1GQYXJraUlxTBU/S3r1aHJUClA4UvJuPtYFnFXw/8vDNhiXmzKAetziE+a/oIrzlQMWGA7x+dpGhsuIEFZBjVtXF8nM1Bj+ijalmlXt4jwashSkUAWj07BfR5z0EzuXzyi633J6mPXwF59qsCND1NQ8fqOw6vEQUIHKZbqBki98Z3QSDAyYKsvDEzcJvxnT/h8rASQxVpcj7RMAvMsRqkAvoCE+J67CR5GLt1MuAOjic1DaJTRcnniB32j7BrzoOZogZ4Vek+wOPQmjCVKLf1TueNzAekDdIVOcrsHErTBM+pKa4g90f4EHzxvQ0ocU9M00aeSC0Q== 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=IBjz2IzpTVLNw/vY+NfoHHqifRx2NXLe/j1yeG+Uw/M=; b=APy78nyO8GsjoR8qdj+u2g5AyHaE3Se0mkX0MWyQAxonYtz4WcJQQgDZIihzZSO4+tcscPBGPaXPZheHyQqgO4fsX2mwUXAfazfSwzn1/nTsLtJzUItBM3J9QmRdVvMxxiKuZxjwYGZvHBo4/g6dds3mbHPc9h6OCMiiYPbUZvQ= 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:35 +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:35 +0000 Message-ID: <87frrjyf7h.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 067/113] ASoC: ux500: 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:35 +0000 X-ClientProxiedBy: TY2PR06CA0007.apcprd06.prod.outlook.com (2603:1096:404:42::19) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d0e7cae-091d-4ba8-674d-08dcb4e7381b 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: eBAfGHsuZhUcrgNsOBN98TPTKZdc6ONXWCFaaci1qHzGvaGTq6jXZJ3qDGqyxXK4rAHkjG/FMHqMK5tT4wSRt80y816G+kNIzIS1TxOs/Ur1HjSLf9TUphZxrUSCRrOvwWAB3+yrSF/IZPfa5Vz7oaR1llD7/qbBkLuZvEBkn67AaPvEtHYkgA22ysfm3W8sUPY/PDPEtCaROpsaSRBY2gTyCtxaEUXCUQXZRUyfDpS2LwXhITsGIrNv2+VwvZ81y0nXMdjKTiwSHE7mnIaSrLn0OajE+rdmcsleukPhwykkzgeb+EWqzWEwf4XlkPDJIOksf9AfT15FvjzGFWuJJnQJO4NrS6oL5b8uxSNdRG/rkRrQAorp6YqkzehwEJX/d0LRFE2b0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: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: DLQFpIj3YsSRvX41o5WiGui0eSwse9xA9opI68dvxBNRsn9TMO+HB5M+DvbkcHI1eBShbSL8BkyVD0qIRJbYu9Hp4NAE08FcAtOU60sUa/N2wpSTKeywhu10aHfbYvDKXY959tynTHdqGybTrpHNbz4pBmsu90nTlZVYrBZyCvKufxRP8LwpOX0SaHwCBvDf30J1Ea/SUH/8zazxEK9Mg0IjOZowmyP4dU7CpS5Ru/A88RbKbf08svTRgS4KE5Wkrcpl8wrhbaXZru5TpOZVsH6l1Dp0gdrEYdSjdsUrbiYwzzwPX340GqVivYpfkedNweTN/Qkq/sI/A7y/rJ7kdt4dHORurvkaM3v0ZjmRmuXGzn8+asRy/ACPH0hAKAVR1rgLiDfbm3YqKZygFYyuKtDJ6GBLc1cyDKUMuyKBN/C5TekSBXHKGK9rbKkos6da1rKf+2sz+fEtAOjP6fAArk3ePIgJg+n6OOt94F6f6MSqoai3fjL8PmKeu6xk3SZGsvdBv0a9m23sBgaIWd+ybeiw0tfKotVL1la1yEopu39g+qWyI0JBEfmr9HuJARIGE7MxgBjbfZI1MsYEs54W36GzULPAOvYP+5e0RePTfp+28OZrTLVfGvrmuKy1pFVS8xncesLdNBPUOzNyZ2H1a3Tsu8ITuj+/kK5EBO9F3FO4JP/o2Qhp6PwqMm9i9EzWuv88RV8xIJsebF2/N+A2dcv3wIP51Zur0jGnPXDd2257xYFAEV1+bkyRTNBd4B7euTk0CQDGvhfBFfoOH1N2zwcHykb6UmiHrCDbwq0fMedCnOEFNwZ7XIgptYapt8xgrOcVCkNug+XwNXdo6p8mxpaEqTJnGUstZzcvm37xtxCz0kGeX7U0exPBwoYpm43ahjQJqWWk8+swu1xc/oXPhpg4Oq3d/sbHbBJNGeBY6xHNW7jizCPAH5N8JkRltSA5iLMqyzZol+bJNNHhNV9H0qkO0aWQCF/87mbI4eKd0WH4gkHz8v+wSRm5UkRIgd/Fevo+aNdN7+Fs8V3RUbjP8TwCocGCf+6w/LGoKg+YKCBxFV9VB/uzOJwf9TDcriu9NX65veFWc7oxpuODa4A0ltH48tpDAG+10JmuPKrDcUVK3jy8q/Pdj3fNKTwvBIxv4aheAohHkIC7qKWn/Ga24hxcN6G5guf+aA0V8qrn/5HceG4SKZx3HK5hsWEaL0i4bFe+vEhoOlN2QS5bnMPr7Mm1SrgGV2zyvkVRJ625a6lAnu9bQ47bGXAFOTW+vr/I9azJ2uDsPPaGXo23TUw95OCOHDO5BDz4zt6rUOVau5vyEntPU7FP1YMUGNeOX/Y/rBfYzwMvc55BrTt2Xuzgl4Rbb7A21nlfBBpWvJ4xn1teqY9VoHiZ9iE7cJXeqG/FbFn7mFZUXZmBflKxJkh7hbImntjn2GUKQpN1D9FBG188sf4cJWFIri9XJ9t1RYDS3HT/iTUWfsUmsMhFthMc72G4buiTKyWxq6yjmsP35v4k+ihVi/Fx/xQWGIbZ/8bDeCeNftrMWU36SLrsEUh1A2zA8QAiTNmf7L6y9RhuE6Fl3pkgimuTFaBYGwjW+waE5Ccl3jJLuKp9RQo8dqPelSyflElkwCRBUyrseUV0HFY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d0e7cae-091d-4ba8-674d-08dcb4e7381b 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:35.2696 (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: ddMHlX7v8PBhEapwbOwJufqQhnUTBfk0HseGpLamaxYmq8eG1KkQ3cbQCaaYgTjdwX7GYXV98TqxdneNatEkOR0qHhqnzWNUlz/Um0dR56xezHBU3ygdgsyycQcpuq/4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9302 Message-ID-Hash: 3N5HRXVMNQETHN5PMREUG3FBXPVQJR3I X-Message-ID-Hash: 3N5HRXVMNQETHN5PMREUG3FBXPVQJR3I 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/ux500/mop500_ab8500.c | 4 ++-- sound/soc/ux500/ux500_msp_dai.c | 6 +++--- sound/soc/ux500/ux500_msp_i2s.c | 4 ++-- sound/soc/ux500/ux500_pcm.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/ux500/mop500_ab8500.c b/sound/soc/ux500/mop500_ab8500.c index 710b6744e0136..102d4922d6e62 100644 --- a/sound/soc/ux500/mop500_ab8500.c +++ b/sound/soc/ux500/mop500_ab8500.c @@ -203,7 +203,7 @@ static void mop500_ab8500_shutdown(struct snd_pcm_substream *substream) dev_dbg(dev, "%s: Enter\n", __func__); /* Reset slots configuration to default(s) */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tx_slots = DEF_TX_SLOTS; else rx_slots = DEF_RX_SLOTS; @@ -291,7 +291,7 @@ static int mop500_ab8500_hw_params(struct snd_pcm_substream *substream, /* Setup TDM-slots */ - is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + is_playback = snd_pcm_is_playback(substream); switch (channels) { case 1: slots = 16; diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index 3fd13e8dd1107..1a02d66d45cd1 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -312,7 +312,7 @@ static int setup_msp_config(struct snd_pcm_substream *substream, msp_config->tx_fifo_config = TX_FIFO_ENABLE; msp_config->rx_fifo_config = RX_FIFO_ENABLE; msp_config->def_elem_len = 1; - msp_config->direction = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + msp_config->direction = snd_pcm_is_playback(substream) ? MSP_DIR_TX : MSP_DIR_RX; msp_config->data_size = MSP_DATA_BITS_32; msp_config->frame_freq = runtime->rate; @@ -423,7 +423,7 @@ static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, { int ret; struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); dev_dbg(dai->dev, "%s: MSP %d (%s): Enter.\n", __func__, dai->id, snd_pcm_stream_str(substream)); @@ -511,7 +511,7 @@ static int ux500_msp_dai_hw_params(struct snd_pcm_substream *substream, case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_A: - mask = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + mask = snd_pcm_is_playback(substream) ? drvdata->tx_mask : drvdata->rx_mask; diff --git a/sound/soc/ux500/ux500_msp_i2s.c b/sound/soc/ux500/ux500_msp_i2s.c index fbfeefa418ca7..36819fbd66781 100644 --- a/sound/soc/ux500/ux500_msp_i2s.c +++ b/sound/soc/ux500/ux500_msp_i2s.c @@ -565,7 +565,7 @@ int ux500_msp_i2s_trigger(struct ux500_msp *msp, int cmd, int direction) case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) enable_bit = TX_ENABLE; else enable_bit = RX_ENABLE; @@ -576,7 +576,7 @@ int ux500_msp_i2s_trigger(struct ux500_msp *msp, int cmd, int direction) case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) disable_msp_tx(msp); else disable_msp_rx(msp); diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index b7f38873d2d8a..65a2125e36594 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c @@ -50,7 +50,7 @@ static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, slave_config->src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) slave_config->dst_addr = dma_addr; else slave_config->src_addr = dma_addr;