From patchwork Mon Aug 5 00:42:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752919 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010011.outbound.protection.outlook.com [52.101.229.11]) (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 92B591CF90 for ; Mon, 5 Aug 2024 00:42:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818580; cv=fail; b=WkadfiSurzOUzNlPH8Djfxc05ty7xwppKzZKkrl/si+XXBfh1LdpeRWfFI/oThPO2hiitU9pSsRgvifKa0RwUKWxOCwSlVeT1hiIphM3JCSQfS+DGNVUWXcoiBw9dSM5jMZXTdhWrziBqkIlFBFfz6HOIBRxBctSdPBIXG3mhQM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818580; c=relaxed/simple; bh=/rURcLGM8cZs2nsyC17JmnNTDfD0uvvMl1RDmBXFNZI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=ne3zVMX6SXm9IlE1JsFMwihpjwV91W4iE9uEjboQ0cQMHM78PauZB/vE29pmzD9EZ1Hq0wi64JEFiQxLDQRXQkfuRHu61aDwE0qwJS68Iw2MCS1HSHeuI1Y+RypbA/y5dhpP8IPNVB2u1aCNRKDxw2A/UI9PyyBqS2cqjhcneVo= 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=BnPVmFLh; arc=fail smtp.client-ip=52.101.229.11 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="BnPVmFLh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cd1fJDFkWpOZZek5xkg+PD4oDTjoytQnHHa+oh5IpepAB5cXpHLi0gJBXFKFCb72vz6jPeboBetNdLAqqt1an9pD0vH/n+FYqWTsNhMslAF80WPVVU30uYC9HJylEFmr4DNdt5tsRnpzJy3G/ne27/I83Oy57jaGx4uBcFf1ImHDoC7xSS/nKQiVl4KbgzEOGaiQgSTWf5Ts4vEJ4OcpHmstiaIX1KWXbqHkAGM1Rk2omWzJiMyX7qGtVrbD8dLA6ZooFYqWwm1aQ8zPA1aL24+Ad6BcLOLcHj9hLF0xzIpnBSnrJ3ehuOwhjAq5FdvaAR74CPNE8ujgBitkl4w8IA== 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=KgbnxrzOCQMQR+GjFfsDvLRjQTXnzso56052Q1xUsF8=; b=B+xPQv41a/G3vuumlVr+zIH1sXofJBDHtPwC3EyPkaKer8/PJsWfCMi+s21GodQRrgrc2TEDDWQ4E5pBDY8a7n7y83p/h5WF6Kf/za6lGhfFOATvNX1Hjd8EUeImMOYiwa6+8oqL0uz2hIJ+gqzaKR1MLThjYN8zbYkAaOK4fZSGiM7UBnwwwvBt9DUFGTlx6F5Tf359JIEDtC8x4Bq62lnDi+TATUX8OtfgFzYBPm64hN3gJ2pbSivktWLtB4fLgYdrmGfTRyXywE2RZFUPuOUOMnn7cpd+Lq4fId5QE6vlbc5Y4VvYjppvlG7KYbBrYn4n8I1xXstDyab5TLTZew== 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=KgbnxrzOCQMQR+GjFfsDvLRjQTXnzso56052Q1xUsF8=; b=BnPVmFLhkwWgFzN26aaFboRgC4YHTG+KwljQcoNOtVl1ibRzm3rDrqYdzXdGvb7XciSfaReSw1G4H4EGFDlrf9z5Pm34ijYaue9mXawXBd4zNFNJw7FOEvEmHMYIr+x9VgAIDFekGmuToDwNJX06g48BDW0G+OZUQ7w5Tq3Htj0= 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:42:56 +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:55 +0000 Message-ID: <87ikwfx0j4.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 090/113] ASoC: codecs: twl4030: 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:55 +0000 X-ClientProxiedBy: TYWP286CA0029.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::17) 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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c4c8b47-2d8a-4c98-18c5-08dcb4e78bf5 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: DOTcnkj4Ng5UOmHPIyOwwahY+sCHQJgpgvZcVP10lbwF0CLAuyx+wS53n/DQ+mQi9WMCQ/2EMNZa8TLhCAVmktDHrDN1D7b98grpbEB5YHN+hYsj31yV+IcIVSzbuqtC7Xq5vaw/Xez8gLKxYXuiE8ME1L002sIdBP3KdIHRj+R5/SdYCR+JsefJH5AX1cuPLPm1VqJBlyrOZHt7Pk48NWAIqUG9GStDzqIc8g0sLv4noU8M2gUYNm9yByRRzHW85c2dOjbpExIsPjZk5Yl2n/rAjBsY6RJfA3H2YaVZ56jVDWvt05EHwd8obc1rUPs/U2EmQgoVtoyRd/NVklFOcbzPkr0hy46PidVktzUzqEfaXA8hfq6pZR9TqlY5pJtZkbNaXTVBGrKHyVEQ2Vk9RGMYmnLga8Ithv4sajIOAetjx0Ou7gvIx90Y2beQ44ooCqDiWLeP4BlO1pUnHG1ymV7WWAjRNl2D6+7REexDtWGayAIcojiwHrmNQc6iNF9B/iBMj3uJw/WL9uI9mPaVMCbeVnhfyxZNXcTDY7H9YSGfHrHOxeKFiplTHBqlPFhktnCEkAbfizmQK8fIUF63VAoTK5oL6EAuK8dYA+rSZxeavDi+183QvSmH9YoYUzyRg30G4l6Y9d0B8MIqFun14gdK/N8ILW7HUmvSYNz6u/O5JN4dgl8BXu4zMcOUG/rffetfYabZTwEnXiMg+dyg+1YZRPy9WLxrUdJ1JL9IyYJq+o+farPjShi0KOT+mJaovdLapoDOrgLnpRA96mgyInq+uUjRtFbboLJjHZT+vMhIkp2RfcQZh8pXiQVI/Q/niRQjGpk35yrVxgZB660CU1SjiffohHRwdNDEbNkrSSptA8qEIXJamCFhKJM9QFxEPfHF+mRpiCNUY1rCg7W7wc6hrn+dL6kRgAFQ64Zo+V8SmGjhg9S5KeGxAYxqsnnOKM9Pmz57FjNCPLNpG8wYO3Qol4fm0OE63Wr1/Y085JLQLXUp/xaFndFt+PElU4SkpstfRQcjNDvDrh1R0pkUkQv1dpHlCwSkLO93CylrFK3kTPL/Tyvb6dQw0gcbcSTdAqAXDxqCWChx/u/nXDtG+kjkWIU9h6yBRHKxLGe2DBe9kKTUb8bj3Gvl4u3PBpXO4ZSOvDqtILzUnUZXexNYIvQJx+ptI9TwX28l/yyv/EFycSAz4puh68TvbeUsUhaAipSBSw3Y+xc4aV09fj3ZO/dgDeQahaNKl4O0xBoeM2uzdJ2ClIMe4baqud6CDClHTRs0OL3IjdNvL6ZCKGBuNFNDjBI8os33lLFZFsNUiy8iiN21iSI7FjhMZuvD1czh7lR4BTDPVmyWDnhG1IrDyFe8sC10C5vmtu4zkDWKZxjlHQRBAYxj3KiHrMo64q/i10RI7t1/NPvhVwYhQ/OmDg== 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)(376014)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-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dQbEyXphIbWs5Loi+2cU/8Z2DdX+xl/P7Xp+nSojNhRSA/3LqF7ZcblovTZ2HYbPwJnsnRyTX8puJ7TRTuad6+E3YALFutr2l0wsxdAWKqKCmTyJb/vnljWU3HPPQmzctvRwNGpsozA+jXH2L9EmhoIBMXTv4kfE2eZjuCjPPgmFpMLXrc0xOvC4410SUN+FEOGN5hT55mMfpuua4Ci9T9bmONufW+e3h8PNgYo23ORbibP+qEOskHxrmF3b/K0yYVsPnSWGR6F2T4LO14DFyas4C4sSK9UPgrIfSe8bDk2yGBCqt/5zO2qRpbXK5kTfYAQv1XIWEGWxrVz2T5Kl8b/Ls5SX24xoB26h0NSRkSOa0ZZi7OjWk+06k0SzdIkaxFo24Jo58wyrdk+pyWRGVCcp5LYBBaI20gYwKGYMVO9Lj3KZxmRGCtG/RMhm/6FIrPyHtIdbBgoVq0h98lFK8hTFc8rjzzDnAeqgbLXpgX8iMGpoxet6kBjzjAMhPJUmX1IBpi3kHvN8hdMdZuMxUGMyRvMGE4j9bcVgWwzi44kJJgFUZV8cenh1i6JnOuxw4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c4c8b47-2d8a-4c98-18c5-08dcb4e78bf5 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:55.9132 (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: T3EBh0gHdXmyCMQyYRNpUd1WyFUsL8FM67a0i8i9Ntc8Dv9CEpvV8RFN47NqIcjx9rafGFb1fM7jyko1+MI/gDfO9dytIlCQlo1qNXjT61WgBKhItLqJcRPIYxt+N07U X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/twl4030.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 9c50ac356c895..a36b34b92adab 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -1629,7 +1629,7 @@ static void twl4030_tdm_enable(struct snd_soc_component *component, int directio reg = twl4030_read(component, TWL4030_REG_OPTION); - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) mask = TWL4030_ARXL1_VRX_EN | TWL4030_ARXR1_EN; else mask = TWL4030_ATXL2_VTXL_EN | TWL4030_ATXR2_VTXR_EN; @@ -1913,7 +1913,7 @@ static void twl4030_voice_enable(struct snd_soc_component *component, int direct reg = twl4030_read(component, TWL4030_REG_OPTION); - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) mask = TWL4030_ARXL1_VRX_EN; else mask = TWL4030_ATXL2_VTXL_EN | TWL4030_ATXR2_VTXR_EN;