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: 13752885 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010003.outbound.protection.outlook.com [52.101.228.3]) (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 58CB61CD00 for ; Mon, 5 Aug 2024 00:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.3 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818439; cv=fail; b=FJIUo16VeGHvkJYoQ39Y0g3z0P9JOpIz5EU267DWJ+6FN041ezz4e0LBPdys/KflTk/YU0Kkv/DIot7Tf/ftLDRNOPATmcVtBbMwO4Zg4A6ePAePMVwhjZhKLnoNdFCoPGn4EQSyA4pk/2ET8tF6GIZY0qmrrcyyEtYjp+jbA8I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818439; c=relaxed/simple; bh=pZXQkenLZS4PlIyxVPNguTu/bb3Zm46mzqXGzzF6uV8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=IWZ0EHLJRiri9IGXbYDWu6UAr3CwtjFkzNSEg8ukbEdLvOQCsW8Tose1TrY5So+XhzQQpt/3onOqxUw3qCyZl0DRzK/q9GpYImEsx/03Mx6SWIzjQm4B+xMfVGRdNWRagJ3TIqy9wWnbGLTQG+2Rz483+X9Fk2/NgIZW5ufbWbI= 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=APy78nyO; arc=fail smtp.client-ip=52.101.228.3 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="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) 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: 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/d0LRFE2b0Q6corgiK0zzUjxjVAB/EOxyA3OyWND9HbQpOLEQF6hvOSiF/Z9iI80wiWCuOQYr04MvWLF8SolsCZa7AEvTVDGUUm71imCP1fTqDJ5aUWWKTrXzIDwMEGQ/FP9rXM0UzCzVL3Hikpw4rv9WhxUxWxMa3deet0uH5HPMRq2eQxpK1tGBLJsfkd1cFM1lUEor5PmlSfWwjjjEc4Tqzg92nK7gMVdwaU3GoX/wpxOFfhvlQUdN0f3L+0GR2/r4DTZU50HxyM7iv9EP0uSp1CaGkuWDYucqyB4h27X0su4aqH1FQfuXgElOTU5eRDv2vU3zMBykZoMrEup22Hkw+BcMQxp4DR/DBdFes1xeT67jzRK+ZzamY3oQ1Dz2dzZByc0bWSw/Sr3Ejcsno6bCI/e0xc/1cJx3PhmFBSbjQhI/GAQPETQxSxzGOfa2wvxxDQmr4Jp4ML54+bV23RtsOwPwIJBH7TLOj5mvflYtt+2VgURNVs1MUhj68ZczEw9oqRmqb0naD4wUzQamO5xSC5qvm+YspBzG59VxaLlNH4oZU3Ny/OKfOQZ7pz3a87ZoFMGO6/afkMsQyxxPFPWPu/Jnr/YlUuKxeNkgtiP9tdw3iz5mEfSWH/I6OnWZLZsX/yza55iLNugvrpBf0CsYXyp9luUu+WkF/xJkL6fhI7ubfmrXAO8m5XQifr83ovYVe+6AVEbCONwLXKkGToZWew3LjO0oCdSxo9iJ4F6BEPprvGIFdWsNzQjNy/cDsjemfhmukdhQe4FizL9LlSOqo13ipAU8/GRqoj13HQkoVkWTMEoCawq9Bx76tl7SnK6SLPqeXyZmJGqI4S7z4z2TIk6gSwc907CdDuMdBbfHYtuvSmGP4PYgGIbNMuhQRKqAf7i8v3gK8OWsB1L0wXLt4bsAAAWBxzVnKwZy96ArLn+QrLE7jZ7u+CxBNYH962AhN1javId59Z1pl2l/qNj2loT8DdrDjPFAT3M2mQlrmv9RTwmV3IKwp9DnIkCRvelWPnol7DZrh79oz+145w== 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: DLQFpIj3YsSRvX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7oxpuODa4A0ltH48tpDAG+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 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;