From patchwork Mon Aug 5 00:33:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816992 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011021.outbound.protection.outlook.com [52.101.125.21]) (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 C1AA41C36 for ; Mon, 5 Aug 2024 00:34:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.21 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818044; cv=fail; b=OMizdtbMD5XvW8sY4HdM+LQ2e6ICVqr+SB2XSwwtiSvyb93ae3ZbhhgbiFJRAmwQBHo+S1yL5nH12TRwXuox2L0nc5N9NIr4pkfQ0BPv7hTH9/0WdlXdcXh+RX+b5XAiPmbZJYWdnA2aPekT4kYVToERK8sy3HN/jDqhA7I4cqE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818044; c=relaxed/simple; bh=9BMN4WoKMTQrUp40AzXKgLjbg3IXg44C9YOag9OiH2U=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=Ya4OOLJBqwaYRHcKqrNfyQXbLm7qvurPRTszzt44/1Ui3Jjf5n3u6E9N/lk7srpmxQxlNpT2ptxSnw4pviLH4LqCIHKz112lomKoA4AdQpfv+D5nl3HHDzS8Q8XUm5e9ekhhK7fwytjQsl6hV1LRq8yO4BGwb9Up8uNro3RHt3k= 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=aJVgRWb7; arc=fail smtp.client-ip=52.101.125.21 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="aJVgRWb7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RgmHITRTRSYGCTUa1bWm0qNu99sIu1gw3G9rkE2qIU1uZwBDGCsX0J6RgpTiHoi+Aya39vsoDr2QOQ0/YqQ028ZdvzujsJm99PDkeTDHQQm3vxU8kxFXXpuKKfu0JoliXmykrL2Yt0ftvQmZ9SoacVbu0Qq0RyBLFi3tzd5MKzatWi914ubjqoNwTS25gfM0r4JPBUmn0lUrw/zhQX/wKWEde+wJwzB7dCB6hrcZjRy17KXfroWBLknZ1/SfIo82dHx8wQYIZHHsYexBZHAcyTbvX0GdSPz9sVVFqKPf3Hs+NqMJvMHuvahqj4GQwCX3n6LX+c2VRiPZq84avfCxdA== 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=STRgMxUU3+hM8Juwob+XlXbZHALOi6eCpfXS1P5jhEw=; b=MC+97zJO3HXuiH57lZRsxjFzA61TwOxAb5iqymPU7wj9UPcJ2PzBIsDzjPMtrb/CxDyU0/FVft7wkNazZncSVF0+QgqtJjcXVcvduAd7Y6+MOx1vOtNrv6auwghY/KczJcS5bjqIweWw5HWcc8UOqIaJ2znhgykRLYmsMwyLSS4pVAzWv3+bIt2vDn1OwHwdv9KXYmDZT6GLpwyDXljmUF28n65L0EhY6DwtXNUqKRMhF8NyoBHurf/FWvk0h3DZLe4TTJSv8cbQWndyVfy7D/4X9zzI4AnRkjdvhohC38mvsPfbuiGeoTjwLN9G0RUapZwGWuoFiLPTpuy6Y5PCVA== 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=STRgMxUU3+hM8Juwob+XlXbZHALOi6eCpfXS1P5jhEw=; b=aJVgRWb73+Sn9eceDO0GNND+x8RGSR5/77VSbVC3/Net0B9aqmAfJwadhkVC2+DKC7cTlSz5JVKboFQ0LOUM2L9HuhUlsvH2LWgcrgqowWjc51yoUy+n4dDGSXSbW9JpKiCDqYiMvB7nIoVepy7MrqwhbBU1W4regGcLLqLTo2o= 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 TYRPR01MB12335.jpnprd01.prod.outlook.com (2603:1096:405:105::12) 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:34:00 +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:34:00 +0000 Message-ID: <8734nj3j0o.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 001/113] ALSA: add snd_pcm_is_playback/capture() macro 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:33:59 +0000 X-ClientProxiedBy: TYCP286CA0357.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::15) 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_|TYRPR01MB12335:EE_ X-MS-Office365-Filtering-Correlation-Id: 4bc15a6b-aa0d-460f-7b1c-08dcb4e64c8a 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: 5OoOhkkvteeSJ+9MfZQqZb/VgM7s9SF1Whiyo52ldEFv+sJpXjyLAU2chGg7sYD1XomEf7KbclK75sDi82G7xze95cBYvn68wuSnrJbzx4qShFfaIqvpw08GNtFBsCkXOZBx+/+goZJ5SnuaR+Paq+qOiYXCnxyJAM3z2/YsKS6AEAkjzTBujYAk73YNdP1aSTuWbmNRqduqU6ejTygvT/Xk1/0sD/3gzUPcpSxmsc41zhlqATxPFoH0teQzsZBoVYWzga9ZlJiITRli04VLLzm0yV6CJmnsl+qySLzDTN58Hg4XOD/wWKvZxVviGfkEQgyIazNSUMF+i/UrBSwtFbuT5GTw+alxLCeAd4awzqQRj1VZz1uUHWvUt7pZ3L7AvjWQolPsSuI4Tz2BE25BgmeyJYu8P3iWAP8G5uFBBDDoJtFET7PbxWtnq6q/dsvNYvehoOhBaTtOKCgT9Rnfl2l9MGxqcBv3ylxwdO4/pPnKXdL/v5lZnEkDkVXdUGIVRoYycht1aAqWge7soKYCjKrSYhLIbxnjrmJ4vEVNYJ+x+ZoulteJ3JQVuvGKx3o8sFBYGWun/2nrrTQmNyeS/B7IVLPo9rqugByzMmODXbZGDnZcSUjQD21iJ3qAeT0LhLXwL05O7rRoJUZDk1FLJrTP5PiQF1xAWiTXYhkvGtdH37rRUCmRCHWusuMO7qwsS3Cg+Y9dxggSi4QU3BMxyV6AEO61COSeTeugWjPDPkkw7k34WUxctGm/8fEjpQEo1UHBMIBXt78eoX86Abiubf1HrM37KCKtGWlp/WktcREuVbz3vdfuwjskwbujbiDzDX3RisE/jpYzsWMyg9htp+f/Z3da8Ygn/xC+HiK4Y5ghkA9ko7VPqkTdmv1Hke6bxXTW+yxvMM2ITweDRLGru/jTHjw+4/wjmF+TJzSWd0vZ4seuuLopYpWl0jribh3XPwYXhsa0j7F0nzCi90LgQ/6kGOh86hZlLrGQzRuycNg19GR4WPNz4ZMM6To4Da6WvFcXVgTG/rtnx0omhtT0Jythm0gOnMmCa7VFsBjpoBxOd6+H5i2LYlWecaNbpgZGfXhuhmND1zw04ZbSlx56MaqW6kVUP8s2Q9t6EXt06v6NxW6eW5zxKzdQyIEwL/CVReCWHy+l6OZOPQnfzQkguImwchIzQeZTukh9HzRoXjl4vdIC8vEi4AX/iHRj2bJD+jSXkkfEURVm2nQxKKqS5q2PKy5nmC7nij7gzsgvupC0PetYBPejawKkLPwWPHGjqcKxlXK0UtM2s9qqgnuyO7qqwfwxrxDS3sjPzzKEE4EHv9BZLbdM0ZZvrLEbT9Nz9f5zCKD+X3o/fuejiotQnU7aCF6D+ue7ufX+4coKg/5lON099iBVXBlj5KjVVR7w6K34HnOB9xSdQBtoXyFtcQ== 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: agZcM2BOvG/4GI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KKm5cGe/Vy0M8W0lcv65tEATeoFkPwCFu6Z6PCKuWgi+ipxGNsfDiBc2NAqy6zpGwOuqULmapMEreVbpfHPNWURzvSFnWZfVpzCYIT7mEv6pbia++OKVbQtq7mk63auPNNq2ePkZqZmwtilRzROun6C9y2S/hW3Zuf3H/18TVvZatMzZ6QB3fSxZZtyPNQtvQrRKmH1neXlODpjUtklfL9HcFT5RnfCvHpR2DejG+Md2ZUqgR/D0uksBxMqZTtdiMJA9RKaoNM1xrB2sNx5/4LpIB26uxuRbuTXRiPoohi+hvCuiom7xl9TC6uIBUHSnxicHEI/kQDUllpaYi2Mmhrub8vuJmj262yDT4MG/dzN+qz5VjLSeRgX1oeaIU0kKsQxqt8Lht5wmvz2NkcF+9TkkPkkbDky8o3Dmgcy9KFVapqOQuFWG7gjpQX5iUBoNjWP0UF5K4BLUrPdHt7zuA9WmTuF4QxzFtDKh4tzS5sjPnhgaYH9SaeiTJlGgVSlclnrDbfiHym1wcwpmOuft5vdv8lF5D97QcwU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bc15a6b-aa0d-460f-7b1c-08dcb4e64c8a 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:34:00.0487 (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: /p0tLEq8J7tm9fjYeWedS10idxNNQODGaDds7l/YtDBz+My5E9HDeGGpDLQve1SpsQc0ElowULULkW3V2uBf7VZb+UDTH6O78aWhIeBifiQHTDXc4m8IxX6KluO9iRLH X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRPR01MB12335 Many drivers are using below code to know the direction. if (direction == SNDRV_PCM_STREAM_PLAYBACK) Add snd_pcm_is_playback/capture() macro to handle it. Signed-off-by: Kuninori Morimoto --- include/sound/pcm.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/sound/pcm.h b/include/sound/pcm.h index ac8f3aef92052..69e535aeb8e82 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -502,6 +502,35 @@ struct snd_pcm_substream { #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0) +static inline int snd_pcm_direction_is_playback(const int stream) +{ + return stream == SNDRV_PCM_STREAM_PLAYBACK; +} + +static inline int snd_pcm_direction_is_capture(const int stream) +{ + return stream == SNDRV_PCM_STREAM_CAPTURE; +} + +static inline int snd_pcm_substream_is_playback(const struct snd_pcm_substream *substream) +{ + return snd_pcm_direction_is_playback(substream->stream); +} + +static inline int snd_pcm_substream_is_capture(const struct snd_pcm_substream *substream) +{ + return snd_pcm_direction_is_capture(substream->stream); +} + +#define snd_pcm_is_playback(x) _Generic((x), \ + struct snd_pcm_substream *: snd_pcm_substream_is_playback, \ + const struct snd_pcm_substream *: snd_pcm_substream_is_playback, \ + default : snd_pcm_direction_is_playback)(x) + +#define snd_pcm_is_capture(x) _Generic((x), \ + struct snd_pcm_substream *: snd_pcm_substream_is_capture, \ + const struct snd_pcm_substream *: snd_pcm_substream_is_capture, \ + default : snd_pcm_direction_is_capture)(x) struct snd_pcm_str { int stream; /* stream (direction) */ From patchwork Mon Aug 5 00:34:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816991 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011038.outbound.protection.outlook.com [52.101.125.38]) (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 8EC843C36 for ; Mon, 5 Aug 2024 00:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.38 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818059; cv=fail; b=NpoGDIgRzcUVm4kejoXGrdvtyZPYlCSo1BI5ZwSvFnIYznPp/yjflGyEZIFKdGngWtyG8jzH7gJ54k5qsNn9V30mVshAX7fg1V2PcOqwVTYpaDMr4Uh8GOtSnkEW1pkj30TF5RyjPajknU1PQqMSSkGVldHtnm3Xceq/78vt2eI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818059; c=relaxed/simple; bh=7eSIdsafACvoGl0jkQT3jSTsRL5qsJFqFq15w2TTKH0=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=JyttosDZNVvG11xt84dQAyLyAe9mvTCnOQkxv5a/sN5cb8PBlMB12gFWPIuxhq+wfpq7XzggXuAGdfwOSWNdAOQOtpbakw5TdlvFMEbzXD+aAiX+TGIeFB1oJhk72sXcMcwiTr2GEvGDyaMcLa1h+UrXW0LA63K1LThWFJaEjp4= 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=MsIMRfhy; arc=fail smtp.client-ip=52.101.125.38 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="MsIMRfhy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WvwYN89519nPB6hMkEq1SUdD9yfieFzS0by7d3g8gnnLLvnexSaOdOcIxSJpZGtow+72teRZ7H9e1wllCYMH8Zhz2VwT/DEN81WJ41k6fBrGc6/FIRjqHJcf8GGECyUvtPcLTVuyOTBIkx6xmryQYducacWjNCc9+lmInwWrlnqI0lwALsaWaHRH0vDPPGI5B3CAvHRwys3ZgWUtyUR/uzy4PkQ9akCqFeeeox2PcV30zNLAVtp9W0hA2MJYl+gJmI+Sfzs8WfPCMRWEUzB3wL+IrC05eawAypKSbyAWrZKVIgRDOe3tNqBiMsSXO8um9w/xrkLzh+/l0d2t+FEmpw== 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=VjmQFyL2yLF1SSPQGT2bLiUTDL7Z7nshJwz90vu+LhQ=; b=c7+YIMBJsqywoKCmUiOAGPn5eCK/37sZ9qIitwHLxStBn7td3m+UuZK5MvQWSA5PJzd/cWNIpe1ikDn4Y/HXQuYyv5b3lBhm0mIM6QOi0zoJ+GgF7CP9FE4ezAfULVCVq6pKXKA77e67kukRMIvc8QPbS+rCpp0wfvM6gyhztYyhDcNdEwYTFY8ej1YRhg4mdFBOtxv/g76sKjml8Ll3DYpWJpx/QAKSgal0LEmIej4OpUN169zpuwmMCi1+3b/227pp12jXYLjAtkJkcDYOl7TwriC3OoS250AEbApOoe/YeijQOD75bwf/F5vsHwZ3tpRJcKNh5Th4d4vX58vw/Q== 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=VjmQFyL2yLF1SSPQGT2bLiUTDL7Z7nshJwz90vu+LhQ=; b=MsIMRfhyPs+Z4GyTYib6qrGUcyhZrfOvDbuPAGqcaDj6YQ6q47ElF9ig9OGOdDwebgxWwnDKlrUhuEmtSdEKGuCoQDeXVmUxrEEgWQKWo9PAbJZ5cxoMrHJGVKCD596T1H9z4u2n80D5cfQmSVSi4s0yztUW6mL4zkw/OjFfXJY= 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 TYRPR01MB12335.jpnprd01.prod.outlook.com (2603:1096:405:105::12) 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:34:15 +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:34:15 +0000 Message-ID: <87zfpr24ft.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 003/113] staging: greybus: 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:34:15 +0000 X-ClientProxiedBy: TYCP301CA0065.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7d::10) 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_|TYRPR01MB12335:EE_ X-MS-Office365-Filtering-Correlation-Id: f922e9bb-e439-4ff7-ca02-08dcb4e655d5 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: mxQN2ordp20W211yObXnTOoTHFghZyzi3oGdNyOtmrt+qj0/gp7xxtbjzQiGr9rVI5I9QvMDQ/m7L1OgF8pFzmeP+lEagdjlY2LCoWUwD8bUpr+v5f2BPZzLi7ijiEX39AHkcHUpLI6UMt+uzcbT/xWWvi5zPfXxlF4wPq9M5bFs0wtqU+fRF+8EkhmRpG4zJTVnv4szjD4veDL1BoRm1xtqTmvOOEYvQayGTQ0aI/hw5nJ9iAUhfnhmsMwM2HvbJTSWufaqfetwYfoMvuKQkNK87JKXyJl/TPVkvqu2gYbwsk+uo/m0oE2E/Is+5anXls2AET5jFKVqS4v4F1PjjIZIP6wJkGiHU0E9Wu8hdwAVNMXAEXDFbzLCeheplv/Hg5h8UjLepwt7qz+l842mI6nmlxhzRttl89wrAdXNr1kVC8cJv2R1HK3AwopQqRxrJpp1AJA8bRFl4dgfO1A0BLDTYqEocTp8O4rJpZ8BtdvD+Csc54NblNp6KBrX5SUlVVZgbkGpjj56MlBOe1l8iRoMFmpfoF5XY+6tTRnA1uEpR1eBMGHNFDPT9t7iYzIGhDOHHhQtiG8Q0EfmrJmNJAtAAZAFcR3kcM7FmDHLtb1lzpBEgU9Ox1NW3YmY6Ckbym5D/XBlcWJnidDIjBpvgfJbrgbdai3TGrFQ4aMBfiA8U71qeHovbt87Vl2ZYmpBLcLpTlM5s1TFweSL4NNHaxxsKldp9k+eOrKGOkzt0maA1v4ros9uAZtpyPtLBPYEHfnxl6KYO5jtV4/mZV4WaRXRR49Ixj9rYdD3rj1+8VGeFNOpY96/IjAp01RaY7BpaiY71dh3vlNxw0UqXHaqhGcCr3VGfgGpVjGPNScA9HLdxta7FRi6ZBozUti2CfFdrg+VHViE6rBdxJI/kCcckLpB8MXpeGXLZcvIuxiLdSjbUEJTfRGy7aPAESJLw108FiOxqNSggoQ7XOSrkZYkLKmAphhXU6GQmGxtl70ayW+ApuMzCQ4GmtDxlB1d+B5YIO5UI5Lf5qP5yxFDGZ34ujBFurOwkY4WEQc45HjrYT+CpB/TMhKemAf7oF3e6CTHSZ/WVcq4kgTz9Igs3i1qkq2wKaz7tiU5aZnKyQ17AF5LdjYbO0DK74uGAttVAU84ud1jIOA33g2Hh6n9fQqFkTrsizzUpp00lTyubFKsdT/CkqoFpQiD7ddFGVzgLt3RztjsXDyZ8g5UhBaceZN9hKFErxaa5vtZf/W3tuOs7bFWBd8E7bv9E2cAhELKMB95ONrCFlNKaXPSdKQuHSvotCwHg1m/EVK/TMIGlm5CCgQ9GRMQq3Hw67bHfhlgAzbMNW5uEPGkUUeEwfFYHestL+Qgu4qt36oeYNH2C0um48WpEvxMXrL5cH4yY7nrAmASuywwy/4JYBQRF7FkxpCT0A== 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: 9DK2SD/DhZGtiM04aEUXJNVlQKBwaIVP4KQs6/sTCzqAzEbGl2daE9Farq7yOI93CEZy0f7oBrmImFUtMDnY0gS3/VRJ8CDixiCfpJThHKSLqZOudFF2OI+D8MUZUKIe1JlNPqJnwjBuJ25AxvvE0xLk3haSGyeiFYTd5XHXV0AKxEgw/4jRaACHKNcFDdsERX9Fm1M0cY4RNHpQn/olrw7h3EFJ0tO/kzCfDdg0uQORA2AEDIielw/UhznNZvmplF3JWnBf99tqxRKg3hjD2SH6YnibybDqu07H+aw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rmo/IBMyN5rYvjIDJVXdLYheKJQ23QDLx9irtiiFirjaxbtp4D9zmxOPe8sQxjTCpLRe123tEdzdVebCyoXJhSdw0GYJLDENTBCuMYckrtd3rGwpx9khDmCb+9w1XoOIfc3TSHNFYd+2CbqWEqZW3zgKyCZNCyxQLxq7n/gkspdLtQl7W6AMYzk+78wKMCcdjZnF+5xTEFsTNMy1MPgy9IsutS8gt+QCorUuD24i8LIV7Hb11U3BuSo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f922e9bb-e439-4ff7-ca02-08dcb4e655d5 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:34:15.6363 (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: hd4bWABnUNiTOkZlNsBf48s24Hy1mRaSRyRZHrdRdTCrVZtD0qw7pZH1T0byY3R7/VGFouhO2GEBu8xaDOHmWIao89d5JD3CAJ2DHqGs9lRhNcBQReilYcInLTDwCID9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRPR01MB12335 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- drivers/staging/greybus/audio_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index 2f05e761fb9ad..3042a486c0c51 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -478,7 +478,7 @@ static int gbcodec_hw_params(struct snd_pcm_substream *substream, gb_pm_runtime_put_noidle(bundle); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) sig_bits = dai->driver->playback.sig_bits; else sig_bits = dai->driver->capture.sig_bits; From patchwork Mon Aug 5 00:34:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816990 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011026.outbound.protection.outlook.com [52.101.125.26]) (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 0DDF2186A for ; Mon, 5 Aug 2024 00:34:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.26 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818080; cv=fail; b=F+uPMTDiMfeVa/pByr0aMgKr73nd9oiKsaz2qsOtV4ZqUla127PmTZWP+YG3JyyNfnemXK1uWhKMRmnyDcqf4BnRiX93AV9Qm9gCsNCiOGvXO5BYGbW2wV48J9YJOYqhqLXsC9BYdeymol8zgb0GKdkUxB4Z/NHenK856z1h6bU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818080; c=relaxed/simple; bh=qNJCRsLqfzjpUHxq2E54CJB2RRc/uc5QQ4fxmJJByCQ=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=A1e+s1/Ag4RVQcomd9N7BIFT70BJoJ9PmvopyfQS0Ea1AGZTvU6+1f6dE1wbolJBmiWZgZAFnvej4D9LvW+6v+9f5xT/1KLoCT28oCDZXJfqHKMlu+gSHXccbvOdX1YVzPcP65Vpt2+Ytr+Is82ZZHagnujT15ms5Ytg+Ikf/0o= 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=ELljCNhv; arc=fail smtp.client-ip=52.101.125.26 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="ELljCNhv" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xI/X9pJZfnYMmjmE5nGvQ3sNDJ+k4lAMerTbwY4sfb8AKMUWGiKwGc9zfd1iOsr71kiNoKlEWU7xbiLD3xd9pIx9aBOhLlp9NgvmbXoObm10DLDEeSy5SpSknLufFsRKObFCBLyEuhxxuwjayhixqBji52AMtxg20cNzkxDKhXnEMT0w4pd/ZDOsnM/4eb4XvDvvSbKhscUlHnSiK62SERg9NvTnhjLa8KZI7CaWq/DCo/KXZVgrpMuYBkBomlPN35zrCvOk49hZozF4Q5LuIjHVJcJpsPIuYOEK9XUZSap4eVw7ww0bvqbhSZeojbiAModr1hjyOSVsSA96Ia0TPw== 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=mn+aFG8W7K/ky9R9XxqYenET+qsj6NVDkrVCrdtoqVk=; b=hIBEO1n0Yb3Izt/L+8U579wncwzvE5Rh27A+YCVOl+IPwAN1hEmmMfk2RRf3vEMXwKprN4YKtm5wVhrvjjcXZh6druNwZxhf2JP68ri+UyiQ7weqvI//XbVg/QmpY1k+5DmzJdUL94uXPfMmTe6hpkX5ska2zyl9/UJKLYkI1Og/Ckc9Ci1NiGORgLlN6Yad5td2UclViz/268AzUQpoJTvZgOMfQgiPYc9U0ay037R/xATlkNmb1eDz1op7NJbUkLVGjBk3GhDK3CXG3r4VEj41vwADsvU+fUsW2NbjlpgQtc0NmGkhL2oAtjuqsuExixP7YbgfDpUEIhA5MSzUHw== 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=mn+aFG8W7K/ky9R9XxqYenET+qsj6NVDkrVCrdtoqVk=; b=ELljCNhvpUbyiR2Oktaj9JTB7ih442gLXbMNHwL4nkRVzc09AMTo8fMJL5nhebX7wINyNLhVrcd1eFns/c6JH0OdS54vyd5h6rjhHO2tg7osf4dYgM8JIDQlR18t79W/QrgmMNpGxH4c/vMj7EtgdDGOsNkHMWFy1BHxROPuLaU= 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 OS3PR01MB7994.jpnprd01.prod.outlook.com (2603:1096:604:163::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:34: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:34:35 +0000 Message-ID: <87wmkv24f9.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 005/113] soundwire: qcom: 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:34:34 +0000 X-ClientProxiedBy: TY2PR06CA0018.apcprd06.prod.outlook.com (2603:1096:404:42::30) 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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: c18e3242-7169-4290-e87e-08dcb4e66165 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: JKpcdzJtpMRjhofGXfpL4cOtu4+EY7Ti0PPQxUUyHL7C+DIXb5V02Ngq4UzK4+os48uZ9Di1xE4oQgQKZ4CbM153qfZKCtXsK66GrFCk67s4vSEBgd2WLJanFjGJ7a5g8GINsLHthN4zpe5/EV8wl8f68qUdSQXjSTHoMaklsoao49g9ueZJzsdjsdo1AK/HRbPKxJq4uGHrhtKxZL8tU30B0ESFoQMiYDZtufUzNGKpT6kVJV/t4K36XVywnTP/QGjeciIDzZ60UJ2/IhPF3iokeosHomJoBwbwhW1ONh5Z0O8Yhw0Kn+dFT7NX9sxKh+yaDLK3rDUihQ5swwIrkjShthUDyGzK0fherO1buLWaOwXLj7zYwTJWy4nHeQ4edK09MWSj4W98B62CXjqH7k62gRKCutT1NHmrnYWqYkTO8+j7FtUES688dMlCW1rGhal2KgFlBXvt51wcG1PYeux6lpUmnkfY+ef90/zdBeh2ld/rkbz+fogCLRsRXwx6f44jc3goIzFk493XBou98YD7FU2GCwJkF12Ov9pP0gmYTrvYX8kHl9Cuuz/Xd/52GdwOCAES7bjvGK131IruqkMHhb23ulCjP6QmRn32o/Kb59A28rzfgXo/wqimexXKwZgDdqr0q68LqWhsR+n7blHLClZ1BvSLEk0DJQ84dsoZ47nI9tsHVxzybmBL67DgFlamronc7sZSgZSdBpZxuP790mxwfyIFlUYZGc+LADK6TIeWPwQeEkj2SFYVEUgfhRzbgJEAvVHDOGFVTwS3jAw4q4usKuh/fc0nOsvZdT9TNDyM/1DImJEN9H7s357DacePKJ0+hd+49lK3yJYbO8GnncunLfYo6nQi7KxPPlrN43H4gpzZ8cDBw/+cLOgN84bU4vSWORNrh/GdadwTQjw7CcpBry6dIO0xu8xiFmU9ZBZq3ZufkELxHzKUiFXJ6hEh2oPIsQ83EqwpfAsvy8IpsofJsZxwW/xWszMNEyiFas01JUOD+tR4hOM6eJZ/pY25ZWhDrqr3/8qWhmwzO6TX8O821D9dTJgXpDBWWQ4yID9zu+6hcs1SgX9xXNFyYdxE7O8/OMYb4BFN4E1Qy4QU5Y8JbI8MicbCXlEOHivfqezHVASk4PGA3lsAQrd4SBXcgydAC3j0mU3Ux+o3+099in3cqzBxzvlN/TCeQ1GWywHQqtJkBXYT/G6Ocb564JFz/5PZv3/I24UA4VBNe4yEMs0GkZsfz+3Bj4fgrfFeOR1/SIG0UrwOCRfw5KZwiXq4opD7R0bQNHU5WRY6zM7IuPTWYTLtJr+0+FWUxB2Uij4UMTTBjfqnOnByEujchiYfMNbkHxTVDBuyqBSJG51i2W8okQhYKzeDieKBrgCEMk9Xdv7Xt4crjRSS1SPkpWaAjZlwUjnho/4Sx8Vj7g== 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-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5U4xosUl9Rz3ZTs575aOmdZyfRH/tgEKUHMtRPo0c/caiwh3LlzobV0nDW0Wv6t0mubbXMgMe1W5OTNWZKpYJ481Y0gXOqjWSYxhI2OILHhF+PPqrTFpPiTY64vG8IiXW/aZ6W4cqIpV0fE8mWYV30uw55o1o0gCWVG/WiGHg0L7Ny2FKicpxfEBaBTN2z9Ouw5aRxJr/0Ijvi3sFw4lBJIsE4DsdZRDGSrVSJvESZP/4sC51YDS9lPGES/ptGyN4hsqgnBzWPbDQiemyfM2JBHnJTkRZemToeU46YnZ/fxUVsm03x5rYyEjpiZyTXT97lMHtzXu61usE1lClFJ49Z8sOmy6zGvYmCc0vXLPnDaJY5GnTqsIyNh45wmAZe8j1Oy5I+VvQrXoTLjvsiSrHFxelr9Hv6ZTUh5kqfMe68OEcqnCzk101KGGnqSXPkVtAFyUtLIv5SeVCb2ebUq+EMZKB7SrMiKjDDOt5NSUlWu9gSqtGArXLspOHrrH2G9pRrwI0p6/A1tOc9AmbnQuWk1M+8wTRyWfpC79ueaEXjIRixJR6/LwyE4YLljpkIcRS+bEXSbvA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c18e3242-7169-4290-e87e-08dcb4e66165 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:34:35.0125 (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: rzomtmDD0IWFJxNKThCMgBCewSLGr2C7BscYayyrWO9vG7iouIsn909Lx+TBdyAqIBnc2KFDj66I4K5ziAkNuqa7c7E+Qid2AOBMIqcX6h7nIGKu0RuxEYfVoDIFaC0T X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- drivers/soundwire/qcom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index aed57002fd0e6..0b86ee6a4d77c 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -1168,7 +1168,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, int maxport, pn, nports = 0, ret = 0; unsigned int m_port; - if (direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(direction)) sconfig.direction = SDW_DATA_DIR_TX; else sconfig.direction = SDW_DATA_DIR_RX; From patchwork Mon Aug 5 00:34:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816989 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010004.outbound.protection.outlook.com [52.101.229.4]) (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 0C557538A for ; Mon, 5 Aug 2024 00:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.4 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818095; cv=fail; b=u0PxQqYT9iRizmVO+shP333s5wZsOSRso7jPSHU7V636UzJjvBL43NEDodQk0SDSNwKBwzGVPqzp61RJ7/NIq2dkKDqVOLvA0oV64p4FkoyoJxwHqvhiq3p4KbE+oQAxVZIF/zSuX1JHAPFfFg79hx0YtXRsCqSC/0TCiwmLo+M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818095; c=relaxed/simple; bh=HTOIKyRnbGjMMvkGw/4lco2EC26MWWYNJgK6EGT4vYs=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=uFZFMlRixvOQasiz7ZWYYWZHaTu69pfguVzipSxPMew9IH9a8AUN3c0Cs23Tkpu1SDo4qm7imGmlwhSAafDXt8mFqcQYFvKSpG4VGHxmwFf+rhFNlnxodJVd/1JdeIRTqIEnBgGXOovEcN3DxqDkgpFuLQ+m+6+imj56QT0wwfY= 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=YGvOuFNV; arc=fail smtp.client-ip=52.101.229.4 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="YGvOuFNV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aR7612StW2rRWB4EruJaLNnFpjKBzTLFb+s3zHx+jfReRHGj9L++YmzTHUHe+zXQ+cLfhS+E+OoYP/xGvm9LHR8Olgkf+D1ZWBLjFfm0jU1kprXLNyyic6Ez3gzZkESeyHTPGcE64569Eivdw5DBpdGJmkWq3TSP+m1fic8VbVqUU6s6bQoWr6feKpXunxfu6sw5AXs2bGikdm2WlPUhpzlBIo4Qi6XN8jY598TakXIIFsSJgzHCZlKJvHg2BfdC5jj4hLcuizB2+DGUyl+iviyuCy+GYJu4edgwLeEe4b17A8+ZVHdfb7yOSBwpeW2EuFfN/WgtxzCSQCKLNNdgiw== 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=0+2Pv4qJ9iu6M9SujEAQRp7TY80S6LTXNnPMHD4yBvE=; b=tyPnys+TnJ41sHIYVIWPQXPH2BGr/bovvKX8DMA4WcLoJqGVQgP9zY43NnY1J0nZ1jSQ2tmByBbLWoqscH9MPOzO4mLQvVjL9vLPs3nnfDx6jKBKBijUilApC+uJ6/UZMBbplvPuWJZIye0zAQSWFDVgoEwGWPkqWdF5DaQSBHc9IfPXxIwCnmpqRmR3+VI/9nZxe3alJBGMmZIcjauX+atipl5HQvMSMThyCwDLNoqkhRDPkLa+dsFFk165xhtcAKhIjhC97uB0RQ4eh7Kme9RILWvKh1gM3d6Re9rXh7pfRB1QqjaewYIG3xnFUAVRrgd4xT/DQVOXpOCaYYNJ5w== 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=0+2Pv4qJ9iu6M9SujEAQRp7TY80S6LTXNnPMHD4yBvE=; b=YGvOuFNVIxGJQAuv3tEjwjhuOaNFKdrNXm2rOGAoJL3+4qYJu96ctKDMTUFDkeavAJvynho4+dUDflHVP3yj2Y17bE76/vUOFH/ITXEfoSgXTXuPopggXR4uJYkSdHetfGdAHRhhFwNuXJS+4M2W7UVYBlMeWNhkX6/dUZ5Y21k= 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 OS3PR01MB7994.jpnprd01.prod.outlook.com (2603:1096:604:163::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:34:51 +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:34:51 +0000 Message-ID: <87ttfz24et.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 007/113] soundwire: stream: 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:34:51 +0000 X-ClientProxiedBy: TYAPR01CA0237.jpnprd01.prod.outlook.com (2603:1096:404:11e::33) 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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 77db58ed-f799-43d4-6768-08dcb4e66b5e 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: UZWO1tBzTI1Xo4MCInriTFpmjwpfkjDo/KLQ+B8an/kw1jgvE9X0E3x9c3a9R1iR8GITGA2kL1KHKDys2kAPrMo/GofYfCWm1pQzdK74TujHnuFpxpmE21iAfmClbWXFdiHOlR94njDDMFXmVoI5SOfY9oF1lkSC4j3cMPQQ2wf3YXTBt+FPbCWaVcd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Vf9P9Jbouo2Ey0o7tDTm9tHiJxmBHtLWWITExpo1QDlFpEeQM+z3QbOTmcrYYycxjotnte171y5zfAPY373rL4eHaW4Sxm01oMiyHlbUfTqzGYUl8TpKGYoP+yp8YAtVZuDZUPMekpOwtkX5ct8hmzUTXoJpUtgA== 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: bV4Zujx7ALCtwBZ0Mgez+W8zn/AOET2udXpv4V1NkTB72Ehl3OdiXaHresoO8fJ7OBZtkct3/Um/O/RoGW+qFqibJrEbrSOU6iyWF02cZZw1ra+l4imTg/kBvKlVOObr9tmypjfa+lggt/t08i+u5DeDKGWZoezR0Jq5Denc8RrNV/cXeuBBwF9YRV9hwjlNZnYJRXeyTWZBQkZK6Oepbh9scaN3kk3hmtYKpdR/V4KQkALKs1hsFINfiNm6Xm0X8/u/sEmpYNfD3pHbNrFt3UYhTBHFf/ga0U2dBT4M5O4SjwMCtoDqhMOxuzNezbIn04m4Rhb+ypA3fiWKRxZVTd96YzNsAXr+Ia3ne34rJq5SCwhNDkU16euQ9afw+KLsAbtPesOuSIMG6v5qiHp7ySmc3PT2ESmEMC32rwQetjy5KQhIxSrZ5Q7TP++Efxzmm1AUso5EFvBCNvh/QeW791mNATfrCC2rrqxzIi6JvUOxk5+AEVoFpFPUSVIQ7ALRZeW6DDasSGeX+gJGBbNVprPlu/VyLmHhg7JKN5lQ25T2blH5l9b+jXHkcuy0SkttLZsQzC1CGkybb2iYikbvKmn/eSFyjLt4oLzm607GHcGKgxj1OdiXzfOYbB1axy3J5HbudzkE5YvawfV0Uvcl7b1nI/GxovFsh4Rqek0kkLZAuj+Jvze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nprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:34:51.7320 (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: LUkDo73Lay8TbSxlZlizE5J1nI1dCO6lK9wqlOhERANwbFEKQjqOGSgJv+zpeuDbigTBrU4uNZYxgwxDp/d521ZqYeHLSveqq+nmixLxSudajQi15xNrsjWTBjeMFCzm X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- drivers/soundwire/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c index 7aa4900dcf317..d471506327579 100644 --- a/drivers/soundwire/stream.c +++ b/drivers/soundwire/stream.c @@ -1781,7 +1781,7 @@ int sdw_startup_stream(void *sdw_substream) char *name; int ret; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) name = kasprintf(GFP_KERNEL, "%s-Playback", substream->name); else name = kasprintf(GFP_KERNEL, "%s-Capture", substream->name); From patchwork Mon Aug 5 00:35:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816988 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010064.outbound.protection.outlook.com [52.101.229.64]) (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 284BE4688 for ; Mon, 5 Aug 2024 00:35:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818111; cv=fail; b=o+eLSXHsPnGnjcFLdIf4761b7yMuxT6I4LOW2le81b9Iko8tOHieycYyjc6z/UiCYcxhesrqyCyTB9bRVWSA/Axe0rulsTq6KixZ9XOAx/7kuT/OkrhuKsD4MGQLwIkeqrLWVH/ecYgnCkaRL3HKBRu/rwx9TCG2Y5eHnG3o9KM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818111; c=relaxed/simple; bh=IOPZXeXsgRX0h0cqxnL7z7k/O8y0MVDDzhFsYovbWaI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=QA9Him0xFmEOfC0+yuS69UZaz+CvTpgwjk8Mxkt6pblWaWYWdSav8Qn5dGaW6XdtEBRitdZPzwP8GOppwirHWrAUb+Vk/xlgbNqg5rDCqpfQfIbIXuC/P/MsCa6z3Y96N/0OEr36fMhWLpQusIT8qiC1hjg26yPNuMqcm50WBDg= 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=e23+TJCc; arc=fail smtp.client-ip=52.101.229.64 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="e23+TJCc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hD2Bl8wJySkfsn/QE/1cenPyy009TL4jGLuke7ojO6HMRHgkFCJJ/tGeKYhipLv0NEoLno6s10SMVg4WBCI3f9pTtQ3J1IFpntjvBelQWmWfo4kJpkoWgjUmfYNHhL3MbSXRM/E3lVu8NdQFtnHlZKKdURGNrInu689YkadpAtLye9kmtD5JKPEiRYifCcRn04O93jFFZU3GUU1fkq+X0TO9P73tCaxZYF+9L0UV4J8Ym5eQ7vd8N4f8AxOEvB7Y+JpF7l8jprD3QcdfpP8FpLTYRFNp4UmRBH8cBMUoRvEePg5nar/kQNYx6ZycXvJcnU3j43jx0KWO8HVm9bOitw== 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=m0gbCarOVeR5u5TuhQk5OH0N9gggorU44pKSD2LyuT4=; b=TxF9Di4Rl8thXF4BCIKNXRYCYHg/56VmfAA7+oKsXGKggCuFZcfEvvKwC9Pnka0fqGz8E4d137uzgVvyBacoUwtGausLJwX/cKsGozVLx9eOx2TAfNVHZHzpWghVHeA1QeZMgw5R6wh3uCwzdU6Fe2p69MkJa2SPAt23Xue+4C/sGi3bOX7W96z0jRFNIRKUuc3rnrYCRRxteNiyHASHhfbCknhKGYY/ydkwuRKMftMDQRpke/yIKyhA0IwBlFs3PlXPwB/0gIolHh5ABOGtg58cnukr/xVm5FXNgd7Iaq6lAflXPLHOByMYflfI4a8IbKvS2jMfYH6IInHcHyKAjw== 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=m0gbCarOVeR5u5TuhQk5OH0N9gggorU44pKSD2LyuT4=; b=e23+TJCcEU1nNfqUEKpjhfJPsHbCBT1TYKnn34HoH3OZoTH9goJcKrSOBpDa0ylWRbkgbmOsaPoU5j+PPEudc+W8llwsmEEs0XqLyuU9sOu1sn4Eh9enuMpGZxPl2QhVMApq7kTXsLUfK+BeUNIhuaQjZXLsKH96ha2Iy+IJslI= 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 OS3PR01MB7994.jpnprd01.prod.outlook.com (2603:1096:604:163::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:35:06 +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:35:06 +0000 Message-ID: <87r0b324ee.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 009/113] usb: gadget: 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:35:06 +0000 X-ClientProxiedBy: TYAPR04CA0016.apcprd04.prod.outlook.com (2603:1096:404:15::28) 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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 20d65098-8b78-482c-0c77-08dcb4e67432 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: t3NQ4zrAMWlSW47m9y+rDUM8OE6Lgb/a0iL80wYmnPO3yWeULGofCczHSRrqqKYrVdoDub2MNKq+zrAQqnAZpn2uH7maCu+0IjaSwpd28RT2o2e5u2YNb7wa9oHY8+GtMOCtktBjo2kdWLp/kWxIRVjRs39kpT1i2gOlzozGoxjbtm8EAodMKAnggZxecOKy8ldUbycWI8qvRffegBm9WzyaEj/e+EDZ/8+c34FGuMy3wnVc7Y17lTQhNal2Psfg6tS+aBA7j741i4sY+fsr/St5cZl37TzHr3Ot8OiPyYVyBqZKnu/yWXm9YaG+X3MLni8v8nOburRrG/uZnsSbKeImA/3gE/7VM4PUk4wRUboUBe2V31LdJx9PJ7/PHKPGKy3+D4mDB/wKAIVIZBJf1ubt/XtTFBoOLnULZdeOF+c/myJJyYWjWZeJVkunWs8SNqBfP9udrwRw8MpNegT/IlAPLtK2iXyADYs3Ls1CnouuSor+VBTw61OQb6OlMBuMqaoTSJC9Cx3k5R6U+NZX768hCFQYtetFXH7ooFQqpCli+H8SvvDgG59//7EY+rIiSvGcSLW6NQzspNu5Xq/v8jB8NnRviNFxaxzu8GwXi4nGRx3e+WVWHAplkrf9GUbv0t0wb6oPWm56FkGt9Q/bg2EO8Hn1kFMfCHDHelVYPvNrUF9tpm0BthcRyo3Awjwr6zltFnJnv6dgvyAYt7YNm/h2XozQPFIb0AdfipLnWYQui1rwUR8+gxPqDM5lk1iT4A9bAMEg/SiyQEm70t0b6sysjNvLVvis4xBxhhBIMr9jPjEEFDn1jDHneGOceofpQYZ1RLcYWJP8gCYMRObzoNkYbPoyPAr+9TQxmXdCkz0kATHf9Bn3YZ3rQ9mTl8eNBO7LQK634dMXx6cBtuPJu7nt90yIQSEcxUEGffxCNAKiStesVtfcvckbAzSy2cqVcUkcCxHZ1C9ypgi5uJjusTOxlld3/oB84kh3sVoh+QgmMwWA/s13NPLEhgjIZ9LPxZp05qKzciWPzVM7dNaNT5QJc/GsmasawV91+RXtuiAzPWYKCAvoMGUPlWWyECmsh5PzHNBAL0yKlUosdIMtMSurxb6kJKsUsvDXgISNizKq8O21Ljp+kUKw5ccHdBOX8u0jYvbbsz7GmSB84MaZkQvWm+PUjvobgEdbDaIaQlYG4EBQhBNxUJ+GfGYATZ/0tMN1Yb4lYZmRSWnDwGp/9iaTbR/J8xFpuqellFAh3jkwVI9Td2oNwn6Hack5g6B5QQdDvKIJbapo8feMjWWe4WRTGZH4a4CV363ICD1eWAtG9OpciKVd4tZPbf0h8UghE0A2CLPCL+wGG0EynNQOMAOXmgtNqZypEpRk4zemN+STwQX2/XfHM4ftWmwA60Vvb/6mBAjnMpZxg7pq+RT2fA== 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: fpTkmae9ilUm80L1DFB88uWutoeOHV/EThl0gGB0TzydxiHLIfLsnoOyxg1dOoX6TPNJDlfeTN/p6wtbMVkDhLwtrLDOKDwb4uIBCo5NNpDwW710RJu6jcNDisJmNPlFj+UkNbNQPQxYYHoR7K4RD7fx57M8EH0cN5SQIfvsXpZa3fEmpzK5C4zIGFkGHdsXSKGQVevuUW/D5S8CPrHCP11JzlMeVoE0Ff2E0oBBwrS+k/JEMs1vxCDaqSqaqp3s73Jx/aUqPHXcgbfoOucT0uV+TYy5ysso6tp0O5XdvDcDR20KGE+ZAcrA6fWaEANxHR9TgN0v2HNzybWFr46mh+suqMh3P4lsibRShugEkZKncP+7C+C6h4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MPt2h2F4hq0wGr57WNpGFRF9SSvo934LzCVzAFGtnM3W6DeZwGlJ9uDNcnljnABojdZo0UsP6Qfs6CsbSXi/OAFltYdQmRJmyVamEnmPcuZWSUs4wNXc6qQJ8790zmeTA6sEcpFR3r+BKL/L4COL0YKRYxc77EUCi0GtJeRdWjroXbe1H3fGFY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20d65098-8b78-482c-0c77-08dcb4e67432 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:35:06.5435 (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: zK75Gnthdj02EOMWpEFzkaYDM7sqS2k4evPg9GSxdka/j0IEdjuAcCmRE2PTKUHLw3xBUk7L0r66XDxvwHRvSv/Oepd0DQp+TuLaHGeceMPkOBARFg4InxRX7O7T2s/L X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- drivers/usb/gadget/function/u_audio.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c index 40093fa1093d3..09fbae35aea25 100644 --- a/drivers/usb/gadget/function/u_audio.c +++ b/drivers/usb/gadget/function/u_audio.c @@ -190,7 +190,7 @@ static void u_audio_iso_complete(struct usb_ep *ep, struct usb_request *req) goto exit; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* * For each IN packet, take the quotient of the current data * rate and the endpoint's interval as the base packet size. @@ -244,7 +244,7 @@ static void u_audio_iso_complete(struct usb_ep *ep, struct usb_request *req) /* Pack USB load in ALSA ring buffer */ pending = runtime->dma_bytes - hw_ptr; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (unlikely(pending < req->actual)) { memcpy(req->buf, runtime->dma_area + hw_ptr, pending); memcpy(req->buf + pending, runtime->dma_area, @@ -322,7 +322,7 @@ static int uac_pcm_trigger(struct snd_pcm_substream *substream, int cmd) audio_dev = uac->audio_dev; params = &audio_dev->params; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) prm = &uac->p_prm; else prm = &uac->c_prm; @@ -344,7 +344,7 @@ static int uac_pcm_trigger(struct snd_pcm_substream *substream, int cmd) } /* Clear buffer after Play stops */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && !prm->ss) + if (snd_pcm_is_playback(substream) && !prm->ss) memset(prm->rbuf, 0, prm->max_psize * params->req_number); return err; @@ -355,7 +355,7 @@ static snd_pcm_uframes_t uac_pcm_pointer(struct snd_pcm_substream *substream) struct snd_uac_chip *uac = snd_pcm_substream_chip(substream); struct uac_rtd_params *prm; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) prm = &uac->p_prm; else prm = &uac->c_prm; @@ -402,7 +402,7 @@ static int uac_pcm_open(struct snd_pcm_substream *substream) runtime->hw = uac_pcm_hardware; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { runtime->hw.formats = uac_ssize_to_fmt(p_ssize); runtime->hw.channels_min = num_channels(p_chmask); prm = &uac->p_prm; @@ -1299,7 +1299,7 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name, if (!pcm->streams[i].substream_count) continue; - if (i == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(i)) { prm = &uac->p_prm; fu = ¶ms->p_fu; direction = "Playback"; From patchwork Mon Aug 5 00:35:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816987 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010055.outbound.protection.outlook.com [52.101.229.55]) (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 746C44688 for ; Mon, 5 Aug 2024 00:35:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818123; cv=fail; b=Edse7u81Uo6otFuZtt+IqXEMMgUMO8v8H1EgaH5SD1UaheLU2nuBQX1PsO34hDJaNkymT1UvyQS+qU2NTIwEnpZAZ6dNYO9+9hBArd8Kamdmm684wBH1EZE0ai+SfL18Ls1n7b1BhAiL3lJqVsl7k7L21u9Q/A4/njGwTOgr9Gw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818123; c=relaxed/simple; bh=JwQeLh87k0ZNtRknOiUIThCvZPhfU3EM06MuKtk58XE=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=GpuRLiPVZT63D1SaHI14FbyF/LrKOHgVdTco0JH+QPQz//DCtfEz4mJ1UQzuXWjMNBtNyRJM1iMCCFBxoujzJXnPDyTY7xnGABys6TcYJDaH7CZV8sY3c4MXb/jfEXASO7a8D/R9rqI5x/LY453xYOzeDU6eAy9fMxaT146zrps= 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=Gtnln2sF; arc=fail smtp.client-ip=52.101.229.55 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="Gtnln2sF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ehg1XoSvYHTHK/F4R1PDG8elfgnHn56wkio4g1RGNjiwOr1oVOxThIiwhjAOsXd3ToApku29PB5KLB1nUucEwRwetyECVrlMdUDLxWCqc8x21ACUBCwFzpjuxud3B5+uuGIIIEIVVlu124JccIHUYDOmw6ZJOIP4zPNr/MnUMXp+oHYdOfwgqLK48Fi1ts4XP8mgvGNlK1dNZryq/xoxfHUR+pQadKQubCiZG9TrJM0J2oTYjmHwja0tYJkkNfiQQtYh1UuqlP8BAaNmfuN97e8SaXy423R/M+rTd1tZSgauw6LG4KVW2H7xL333os75K0nBvbmOa2PNI6elItXSUA== 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=Ea3L6+QvxQ1xHG0ZXSmOuAoPAivQwWvTxu8sAonKpFY=; b=Be6rq9Fd2NwphZ65a0wyGma0mqFRvw1PtY6uyRhcv595XrAjBnINqoVa3MpjxfGQZKlemY5y+gIyhAYJGKoDF02Md4r9mKPVeThjIhjqi/Eev0sVItFHjQTgeqLMNJm/0jfQvPwhzpz0dV7s+24YoiIhnaxTRq/ggAKiusDPr/ByfXNOisQS4yHagszbIPC4xUNSf+7deQmqYLBQN5Zl5BTzjUtbEfo53IbhM61bDI+CD0xWuoX1OqsiXL7xptJHjkFKtN/eT91mtAG9s6FeCRSy8OMlOwrtu16SwIePVNHGC+S2q1JEKsKXK1jpxwxL4FCIyJ1T7rXHP7PRzhW4+A== 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=Ea3L6+QvxQ1xHG0ZXSmOuAoPAivQwWvTxu8sAonKpFY=; b=Gtnln2sFxCVkWpJPU/fh67kFYKKJnwzPAfEtvRjvx3MZQz8IPoiRvyNVOBAPNVWWXP5W5C+/7iC1iZtn9o8JLeGIbfs7g6jA2H2FxUzHmCzSBkmvCdPizw5bI6PFG2PBvw2kc/gzQIy3/CtRdkd7u72ENTEHwiqnZpgcYnb2g+I= 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 OS3PR01MB7994.jpnprd01.prod.outlook.com (2603:1096:604:163::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:35:19 +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:35:19 +0000 Message-ID: <87o76724e2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 011/113] ALSA: arm: 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:35:18 +0000 X-ClientProxiedBy: TYAPR01CA0141.jpnprd01.prod.outlook.com (2603:1096:404:2d::33) 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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 1f04f71c-9cfc-463d-0573-08dcb4e67b94 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: eaBvDsn2rWNShIww+ZmeAKZ+qc24PzHLkD0HCI8BnxPoIh/9pR4+B2bFHZpTpRY4HxBTFJzsDIrTkAhurhkyy2CFHsfMda46PoL0kaJuQ7LrsmZx+eOkX2kIht5qcNDNW+VU7npRQpLPbFYlk7MiA3Nnakg8lYiAsqeJzJEWmdIilBqSU7KdKv0OEbwWvOLE0h0DleamEKNR+uy5xG48yQJMXLgetXQ8xUP+CV+1QKnEhG5PURzTsqDq7EWyni2JHs6211JiwQmvUz9ZXtYJQzFZLLJ8kk9qP3CJGozA3RCdI4zqDosevEkI1xGg9uM/9SZ4iuZbmTM0O8mKh6PMQGV3a/bWvxk3ecqxbQFWZBUstLuddC6/IBVMbX4VBODFs5g324QVV7m2M58SWwDbFHLHybD6PWU2N2qLiorN6ilF5A0YrNeBnzoROV3JCLCGgMNlR/wjrqMMyRzVAuc6MOgXDxxhe9BVM4ODXcW0gVzAAYPznGNZ0qvH9ptbg0G6VbDxYOCPM0PhOwEHvvHUvLAa7g4PKscKdhhtL0aD9coxoBEBsFje0VY9tB2kqGMQd3s0gNZzdcKIrSGdAIYkr0I2PFHin3b3WMIfgHgrHd7vpfh7rQGlZJV0JugwLyOIIXUBPeNvs7QmDRyId9Sd8qeNd62u8J2mVB0AQO3S8d7YsdmbVJ6OYYV3IvLUJblX84ZA0WcuYnNPfwXcWp9Q58ZEmrI51QQc0POO3AfN40oXaFDkO9HJGSE+apv2h68SrZB84fezTkKiRjjl+MTurmy1vrphACvijKNbSQCkkQEz9K1GJRSQfGBk/RcVZB0adkNYsbUrONdzLHtKY+Zg0FXlRanyOOUtl7wL9Ie6Z+J3Q+5pkFoC3PHI+cbzpr7tLYIeO2XQ3COBwVDG9vUQMN+cX06IJPG0IcCO1yxQXOTZK5ILmCyQgpO0JKqjCx+cLS/Bos1NmC8rGhODEhQ20od70PmAKiM3XRnYmqPbe3ary//NliaUericF2emUCsqr3PqNQIvJmEkVGaWk+m2gd6xLX8wu2eEJQT4wHgLuFRDJWMz4nA1p9gU/7Y6rYqfjiCpvZbElQjwJ0RQLoyvYovvUOU3xvAkUClP5ExO2+Ne2jC7prjI2CsWSHvZvuZR18YpTw312A2SgfqpzqgdyqxZNE47GTBHxSXMO7Tl0rpj99gZzqZiledSfCUYKyu8YTj3H0esoswnInCOFM2FSbtBK3yL/0uSeppVy6HmQ36IXA95YNXg9OaC+DALJGVpNeoi5mxWsOX7Xqww8JcZ904aTu4pzwmrid+cQ6Sr7Au1oKlJ8baIInTL3lRC74f8JeODjBzQNoIaJm5uBf3JazpT66r8e/VCQzXY4rvvisABnotPF2XWCuaPB8IgoNmHfCDx1cH2D1MrxJOC4FHxuw== 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: 5LFQl6s4Gh99UsR8ZfikY5tfztW6g4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f/1dC4a6g4eBftV08NsTYTFoCW/Z6PmWv2osc20X2oZpA0BGzViFnfRzM6D0KHP52gqWNS0gfpbnLCWX0hgPdevbUtrsTcKqMvFdCxnF58hDbAN4NSUfUYJ6+YCeAcGX8Yv2Ii5sUWrM8enN7c5Emjm08Gk9el4PVHS1OFWbAwfUmjlJZZ3KOh/o0ttlxxq7JZBeZKpjcPPzN5tR+tAKk6suB4+7Azi9qRTxoNsiQ3Nc5I8a7gIx2RX0WkXdXRHM8o9iKizV4qYUTTgi1BniS4ui8DtD7hOYKntO10wvp0oLtwBG9S555ETU+SHxxVLCBkId+/ZTIGtqE+fRw2NlcSZ+Ym08WNm2UL6KF0riKLnjVCNjFVEK/IDa3RSQ6wznN2HT4bTjOrdFnMq4o7Cbmzeq034t1aMMOx0oKI+BhEVQwU/O9F4apCDGIRI4Cm30os+QCefbgjb6eqfVCj913/YdCFLo16FJD9AWWGaUb0AKx2+Lg+q9Li8MoxD5AZd1ANW9HlMebMR+0WyYCn/Mw0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f04f71c-9cfc-463d-0573-08dcb4e67b94 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:35:18.9645 (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: /F++eu/7fZcjwMvqFHqoQR0KX3M2CRkkkTXfph3PlzppuHNgxPkDPOWRlvQ8gyX0V/Fb8GkdtSG2rxDEBOm03HUkudxuBlITtBpmNv2uUtuWxDgFbulrhR8TFXR0DYQ0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/arm/aaci.c | 4 ++-- sound/arm/pxa2xx-ac97.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c index c3340b8ff3daf..5542c18cf2191 100644 --- a/sound/arm/aaci.c +++ b/sound/arm/aaci.c @@ -403,7 +403,7 @@ static int aaci_pcm_open(struct snd_pcm_substream *substream) struct aaci_runtime *aacirun; int ret = 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { aacirun = &aaci->playback; } else { aacirun = &aaci->capture; @@ -415,7 +415,7 @@ static int aaci_pcm_open(struct snd_pcm_substream *substream) runtime->hw.rates = aacirun->pcm->rates; snd_pcm_limit_hw_rates(runtime); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { runtime->hw.channels_max = 6; /* Add rule describing channel dependency. */ diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c index 4c367e73b2c9b..bce0c7ca4b707 100644 --- a/sound/arm/pxa2xx-ac97.c +++ b/sound/arm/pxa2xx-ac97.c @@ -71,7 +71,7 @@ static int pxa2xx_ac97_pcm_open(struct snd_pcm_substream *substream) runtime->hw.channels_min = 2; runtime->hw.channels_max = 2; - i = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + i = (snd_pcm_is_playback(substream)) ? AC97_RATES_FRONT_DAC : AC97_RATES_ADC; runtime->hw.rates = pxa2xx_ac97_ac97->rates[i]; snd_pcm_limit_hw_rates(runtime); @@ -100,7 +100,7 @@ static int pxa2xx_ac97_pcm_close(struct snd_pcm_substream *substream) static int pxa2xx_ac97_pcm_prepare(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; - int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + int reg = snd_pcm_is_playback(substream) ? AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE; int ret; From patchwork Mon Aug 5 00:35:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816986 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010032.outbound.protection.outlook.com [52.101.228.32]) (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 ABFD43C36 for ; Mon, 5 Aug 2024 00:35:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818137; cv=fail; b=NJuTknR59D/8vZkOn7L6mh5K97crvuBeLtQS4M5fXLrX+8hZIsvRhfACSy05SMmicRkai0TBeJuSrRcj2i5h0QdMY+ZHw0ZT2/M6YPcFoAZc56i4hSseh+rBK6fvAI12NF7LD60i9PsxuEMpgJpTc8eUyi032GuRGOg1rO8z5oM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818137; c=relaxed/simple; bh=yfgVQiUCgnxLQQ6XJIHNQksmrazJG+hcsEw3Itd45Is=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=N8jGLrUUSX7W6rym0n6o1mC9MV47fk74dILSNZU2F4Ve9sy66betKGIQFu1YPznZMCd+cPyZtV7OxmG9RZDfEn6Q8M99G5c7ObDeFB56QUR+fniQ7x+oiw2NJXku7kZ/EQUWT04hSBdTX5/TX/RI4yp/3RDShB69kNE1XDhIdlA= 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=LG1Lc4/3; arc=fail smtp.client-ip=52.101.228.32 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="LG1Lc4/3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K/wLX4RtSrzhkqh8O66BE5PW6o2Z15zjwLSA4Sqv+937/J1Qh2gnam3doc41BczBCtc+EPYyrX8cjS39gKZC1vGgP5GzrX4ZC1jgsiuwe9tCRO/E3x4wQWN1bjM5o1d8QhuxFRwgsxKgv53lb8dU6FOvPjdVylgk9iSR70f3nIcRuY6GlG7Uh+ZGpbqAwJ8V3tYFEmwMJeimfgMHPtyi9uE8iFqCe5eaReHqrqeVvuWKLC4tAISI04junZIiQwTas28tT5Ece7EnIPni1X5CxW/7zvKxRMCKQnA3jDiDGxTaK8LowNfidfuNjXawSDySWj7MpZtN+KK5T02xbVYkGA== 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=10QEcSqGNEU3Jmr8Q3ORPlOaXXB7ow3Xweb/2Cn1SGw=; b=t8OkbGxUte/+9ec6OblKJTyZQ69ZAOdkPPHPiJCCDkKwScARcoIK7mZf9fNn2V0GY3EN9IpII5T7KCOlBVyrEykhu2VG5qd+DsqVVGC6xwvh9V5RKiUK1mPqfM/k0sC7YiQhcPGCAIktH+ikrhsOcyOtvjYlR2lBTamuWaPdX4zW6gpE06JqszjKTAT32/k9Bk6K0HuV6GLUHmS8iNO6wcZDNufXeLhBW5HZX/TQfTFTLK7MkBb/hv5PkPC908IkeetMRgP2/fJFYG/ZYX1v06GZbNHZS7rgzYs2i2iw+vfWuv4HyaWF0BMggM7scqrRzLl2wmFOatZoqKbGRKc+zw== 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=10QEcSqGNEU3Jmr8Q3ORPlOaXXB7ow3Xweb/2Cn1SGw=; b=LG1Lc4/3hB6QqtCwyyJJwELeDuTzkQd/8c9ZyAmmw5Si5QV59y+6i00SHnfgiSb87yVZith8YJqhUZSyC5NVzzJ6R6PICgFT8JzLgLIHl0FwYycSDnH6UkVVkkka+lNxGzfxk2tc/8JO5Xo4SBM+BU6iUNo1sdejc+5yUeElGiU= 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 OS3PR01MB7994.jpnprd01.prod.outlook.com (2603:1096:604:163::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:35:33 +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:35:32 +0000 Message-ID: <87le1b24dn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 013/113] ALSA: usb: 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:35:32 +0000 X-ClientProxiedBy: TY2PR04CA0008.apcprd04.prod.outlook.com (2603:1096:404:f6::20) 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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 4319d61b-987f-48ab-83e3-08dcb4e683e5 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: B5itVf613Ge4NrMGyHmfZZqu/oJN8Sftw3qgIO0fJIevuDnsugkou0BbRoO5NcpKPerE5QmxweWNvQcf4vh1ZAL++mUrFbguLMBWMGqBameT5PSs8EEENY7Ao0XyhgO/ZXCO64tEoqzRr9yZKwxyBM2atnb6wg64h++RCZgR5uDUu6GLqLfFuW2zbAw+JaL/ek4YldJ2+rAJ5hfOp+bX0w+Dnn7SegCU0f9R+1HZs1LwWUePu+9nJ4b8D2a/fJdbkU4ZOAUZ8ohpNBdrrYibkwi3HWtllQUUw8DGgx9FAm7i1ykXz8SX+vGlitROJvwHSJBEXjEE5bmkTtPUsF5eplT7BMCKoyV2MP07hOoYEqrMR6cVPCQHnKwX27Plk9OemdEe7gbClku9m1P8U3SF43qHGvP0gNAg4LCY6JVBIo9lk/vyuYrZXcB1wdjVTz3JQ8hHqKl0YiALog5mTkE6ZdU58Mby3hi93KM0M/OmU6e5vIUR8VV4rgKjPVeXaoMn9/k79ddnMVxxXsUDZ1Kfr+Gfm18ZuL7auz+mikx09SjaPbuxIVokSYyG8YCqOLqDS3ZdIG2x6QMidWqZ9bSlZD2UYYTFJhdS5nIGP29Cg2Cjj9FX+knB2pQdNbHWEswT1SW8fzq1Sy31sIVKn4HGTuGRrhHW/6v/QIabVmoL293riGV8XJ1k8mgWmhndGgY5ohmohLYLIFiUjzHJPwsjoPNqECAGMkNWjhMczc1fBlJL6xhy8HcYWw6OF/JDrMFE90buzQy1d4XYAFUXSZ8FfRIpLH3yQHh5+YH+l6Vljqxwaty6lMalyrlky7iZTu0gjzhHN0cTgrM3O17pL1iqaW60+D8Ds2vujlkIrc70LnU1B5J02XVI5llHDf/HsoWkQAWB6MM+ql6mytaDar59zEkMaTgTdEAxplVxEjqQbERI9hAJECKbqpwnuc3LiEVyUqRqXoCMe2eYrKShRG8dJmva5vmGivOmrbWJWCj+hHMLiteeW9SgjyPYKUSEPeI9ghZVpVhhTeH/HBcuqOdL2JV5O2gGGLyEzmIm7UdUtO9ksmeKHu3mpr2FAE6C3blh2Rq6OgIWW3iU5v/p5h96jGZnzzJ2U2lXcOYmNmIO+uGcv2+qiB8Bp8JXbZ/u+S4xpe61A6qL0qyz9PPd49t/lhgfeDz0dD0ZtSUmNjiI8AG/AuoyGf9hpfj3tjhm41OFuJfzovWg8hNCW9ezhXci67T2IdXqtTBs9IDdyUSYOlUxARdGMlAzODkP1lhAYIlB20WZhVTEHcINMp40D52jguKeC5a+mslFesAf3soK8K/1bIyRCa/0nwVgFAEwLmifCYVjFQRQY7XadvRZozWWG6323KbegnIGhKuk4M+DTXg9cOTiOoQ3fBoXcURqt5PYh62r6KNFcW853SUt0UYEPA== 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-M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xIkYqyAsEJwCImv+6aI2eIFybaPaxgs1J861y+IU+Q9q0cnMMna/2dcPzqXl6UuYWCPWEyycrZDQimr2SX/IQkB2Rcn0ZdzhfAgt0vBHmg8Lm1D9ZitE40iSaID+Fcr15JRbnZUCqAAk4tG4XIgHPLjSPjc2HO91mA3mUPVSUaAOWa/9oM7tYaAumd51lsNNoBhZw79TwOoeUQ8DKxgCvvucH5E/GuSEc/tFw6WXmUDU/MKGg/ToegWdbSl5G3M+cP89bwXHsN8F6Zw7vmn6HbRAJFDwsd6IvvhthjDlzSRBT8o/8mGvDynxWyjEa1x+z/XQhpOQuqKB962y6I3w99LUqWs4gQvkjLhm6XARNETMcum2DarQb3504Q0jPe0n2zCD/fjdwC2PsuWGuQUKichBZaxGtvLHA7LT/kXHmRYQRd1dBXLzQcRqOEjdPTAm30Ee5JK6yq9vAfzh7qRU6OlYMhi2AYNZohkR5b0XbPsGd5QKNo4MijzsTm66kAwg67HdpUw2rATGGVaPA93KeXzpKFcg/8itW+ALXMWrmrZrZmTrbzHYT+/SfN2g9eHWCZib+74= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4319d61b-987f-48ab-83e3-08dcb4e683e5 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:35:32.9265 (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: WguzEHuXgE8ellqC6CniPcIAKXWer4w8TyL7LKJePY1uV2NMkEH0HJ+9jxEp+nWFOow5ZAj5hoHLIonV725718RYe/mz5wLZYaeOH1HuCF7e9J5qJ196zdy0FFQ8nCV0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/usb/6fire/pcm.c | 8 ++++---- sound/usb/caiaq/audio.c | 14 +++++++------- sound/usb/hiface/pcm.c | 4 ++-- sound/usb/line6/pcm.c | 16 ++++++++-------- sound/usb/media.c | 2 +- sound/usb/pcm.c | 20 ++++++++++---------- sound/usb/quirks.c | 6 +++--- sound/usb/stream.c | 6 +++--- sound/usb/usx2y/usbusx2yaudio.c | 2 +- sound/usb/usx2y/usx2yhwdeppcm.c | 6 +++--- 10 files changed, 42 insertions(+), 42 deletions(-) diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c index 32c39d8bd2e55..fa3dfceab11cc 100644 --- a/sound/usb/6fire/pcm.c +++ b/sound/usb/6fire/pcm.c @@ -119,9 +119,9 @@ static struct pcm_substream *usb6fire_pcm_get_substream( { struct pcm_runtime *rt = snd_pcm_substream_chip(alsa_sub); - if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(alsa_sub)) return &rt->playback; - else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(alsa_sub)) return &rt->capture; dev_err(&rt->chip->dev->dev, "error getting pcm substream slot.\n"); return NULL; @@ -395,12 +395,12 @@ static int usb6fire_pcm_open(struct snd_pcm_substream *alsa_sub) mutex_lock(&rt->stream_mutex); alsa_rt->hw = pcm_hw; - if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(alsa_sub)) { if (rt->rate < ARRAY_SIZE(rates)) alsa_rt->hw.rates = rates_alsaid[rt->rate]; alsa_rt->hw.channels_max = OUT_N_CHANNELS; sub = &rt->playback; - } else if (alsa_sub->stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(alsa_sub)) { if (rt->rate < ARRAY_SIZE(rates)) alsa_rt->hw.rates = rates_alsaid[rt->rate]; alsa_rt->hw.channels_max = IN_N_CHANNELS; diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 4981753652a7f..6996c5e07095f 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -53,7 +53,7 @@ activate_substream(struct snd_usb_caiaqdev *cdev, { spin_lock(&cdev->spinlock); - if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(sub)) cdev->sub_playback[sub->number] = sub; else cdev->sub_capture[sub->number] = sub; @@ -68,7 +68,7 @@ deactivate_substream(struct snd_usb_caiaqdev *cdev, unsigned long flags; spin_lock_irqsave(&cdev->spinlock, flags); - if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(sub)) cdev->sub_playback[sub->number] = NULL; else cdev->sub_capture[sub->number] = NULL; @@ -192,7 +192,7 @@ static int snd_usb_caiaq_pcm_prepare(struct snd_pcm_substream *substream) dev_dbg(dev, "%s(%p)\n", __func__, substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { int out_pos; switch (cdev->spec.data_alignment) { @@ -305,7 +305,7 @@ snd_usb_caiaq_pcm_pointer(struct snd_pcm_substream *sub) goto unlock; } - if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(sub)) ptr = bytes_to_frames(sub->runtime, cdev->audio_out_buf_pos[index]); else @@ -339,7 +339,7 @@ static void check_for_elapsed_periods(struct snd_usb_caiaqdev *cdev, continue; pb = snd_pcm_lib_period_bytes(sub); - cnt = (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + cnt = snd_pcm_is_playback(sub) ? &cdev->period_out_count[stream] : &cdev->period_in_count[stream]; @@ -701,7 +701,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret) struct usb_device *usb_dev = cdev->chip.dev; unsigned int pipe; - pipe = (dir == SNDRV_PCM_STREAM_PLAYBACK) ? + pipe = snd_pcm_is_playback(dir) ? usb_sndisocpipe(usb_dev, ENDPOINT_PLAYBACK) : usb_rcvisocpipe(usb_dev, ENDPOINT_CAPTURE); @@ -741,7 +741,7 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret) urbs[i]->context = &cdev->data_cb_info[i]; urbs[i]->interval = 1; urbs[i]->number_of_packets = FRAMES_PER_URB; - urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ? + urbs[i]->complete = snd_pcm_is_capture(dir) ? read_completed : write_completed; } diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c index cf650fab54d7e..178f70fd64d51 100644 --- a/sound/usb/hiface/pcm.c +++ b/sound/usb/hiface/pcm.c @@ -172,7 +172,7 @@ static struct pcm_substream *hiface_pcm_get_substream(struct snd_pcm_substream struct pcm_runtime *rt = snd_pcm_substream_chip(alsa_sub); struct device *device = &rt->chip->dev->dev; - if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(alsa_sub)) return &rt->playback; dev_err(device, "Error getting pcm substream slot.\n"); @@ -359,7 +359,7 @@ static int hiface_pcm_open(struct snd_pcm_substream *alsa_sub) mutex_lock(&rt->stream_mutex); alsa_rt->hw = pcm_hw; - if (alsa_sub->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(alsa_sub)) sub = &rt->playback; if (!sub) { diff --git a/sound/usb/line6/pcm.c b/sound/usb/line6/pcm.c index 6a4af725aedd2..db1d93de327fd 100644 --- a/sound/usb/line6/pcm.c +++ b/sound/usb/line6/pcm.c @@ -137,7 +137,7 @@ static void line6_wait_clear_audio_urbs(struct snd_line6_pcm *line6pcm, static inline struct line6_pcm_stream * get_stream(struct snd_line6_pcm *line6pcm, int direction) { - return (direction == SNDRV_PCM_STREAM_PLAYBACK) ? + return (snd_pcm_is_playback(direction)) ? &line6pcm->out : &line6pcm->in; } @@ -148,7 +148,7 @@ static int line6_buffer_acquire(struct snd_line6_pcm *line6pcm, struct line6_pcm_stream *pstr, int direction, int type) { const int pkt_size = - (direction == SNDRV_PCM_STREAM_PLAYBACK) ? + snd_pcm_is_playback(direction) ? line6pcm->max_packet_size_out : line6pcm->max_packet_size_in; @@ -191,7 +191,7 @@ static int line6_stream_start(struct snd_line6_pcm *line6pcm, int direction, !(pstr->active_urbs || pstr->unlink_urbs)) { pstr->count = 0; /* Submit all currently available URBs */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) ret = line6_submit_audio_out_all_urbs(line6pcm); else ret = line6_submit_audio_in_all_urbs(line6pcm); @@ -216,7 +216,7 @@ static void line6_stream_stop(struct snd_line6_pcm *line6pcm, int direction, spin_unlock_irqrestore(&pstr->lock, flags); line6_unlink_audio_urbs(line6pcm, pstr); spin_lock_irqsave(&pstr->lock, flags); - if (direction == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(direction)) { line6pcm->prev_fbuf = NULL; line6pcm->prev_fsize = 0; } @@ -240,7 +240,7 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd) switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: - if (s->stream == SNDRV_PCM_STREAM_CAPTURE && + if (snd_pcm_is_capture(s) && (line6pcm->line6->properties->capabilities & LINE6_CAP_IN_NEEDS_OUT)) { err = line6_stream_start(line6pcm, SNDRV_PCM_STREAM_PLAYBACK, @@ -256,7 +256,7 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: - if (s->stream == SNDRV_PCM_STREAM_CAPTURE && + if (snd_pcm_is_capture(s) && (line6pcm->line6->properties->capabilities & LINE6_CAP_IN_NEEDS_OUT)) { line6_stream_stop(line6pcm, SNDRV_PCM_STREAM_PLAYBACK, @@ -267,13 +267,13 @@ int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd) break; case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (s->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(s)) return -EINVAL; set_bit(LINE6_FLAG_PAUSE_PLAYBACK, &line6pcm->flags); break; case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (s->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(s)) return -EINVAL; clear_bit(LINE6_FLAG_PAUSE_PLAYBACK, &line6pcm->flags); break; diff --git a/sound/usb/media.c b/sound/usb/media.c index d48db6f3ae659..3870df7214e53 100644 --- a/sound/usb/media.c +++ b/sound/usb/media.c @@ -54,7 +54,7 @@ int snd_media_stream_init(struct snd_usb_substream *subs, struct snd_pcm *pcm, return -ENOMEM; mctl->media_dev = mdev; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { intf_type = MEDIA_INTF_T_ALSA_PCM_PLAYBACK; mctl->media_entity.function = MEDIA_ENT_F_AUDIO_PLAYBACK; mctl->media_pad.flags = MEDIA_PAD_FL_SOURCE; diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c index 08bf535ed1632..18a0b55e4159f 100644 --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -37,7 +37,7 @@ static snd_pcm_uframes_t snd_usb_pcm_delay(struct snd_usb_substream *subs, int est_delay; int queued; - if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs->direction)) { queued = bytes_to_frames(runtime, subs->inflight_bytes); if (!queued) return 0; @@ -57,7 +57,7 @@ static snd_pcm_uframes_t snd_usb_pcm_delay(struct snd_usb_substream *subs, some truncation for 44.1 but the estimate is good enough */ est_delay = frame_diff * runtime->rate / 1000; - if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs->direction)) { est_delay = queued - est_delay; if (est_delay < 0) est_delay = 0; @@ -126,14 +126,14 @@ find_format(struct list_head *fmt_list_head, snd_pcm_format_t format, */ if (subs && attr != cur_attr) { if ((attr == USB_ENDPOINT_SYNC_ASYNC && - subs->direction == SNDRV_PCM_STREAM_PLAYBACK) || + snd_pcm_is_playback(subs->direction)) || (attr == USB_ENDPOINT_SYNC_ADAPTIVE && - subs->direction == SNDRV_PCM_STREAM_CAPTURE)) + snd_pcm_is_capture(subs->direction))) continue; if ((cur_attr == USB_ENDPOINT_SYNC_ASYNC && - subs->direction == SNDRV_PCM_STREAM_PLAYBACK) || + snd_pcm_is_playback(subs->direction)) || (cur_attr == USB_ENDPOINT_SYNC_ADAPTIVE && - subs->direction == SNDRV_PCM_STREAM_CAPTURE)) { + snd_pcm_is_capture(subs->direction))) { found = fp; cur_attr = attr; continue; @@ -616,7 +616,7 @@ static int lowlatency_playback_available(struct snd_pcm_runtime *runtime, { struct snd_usb_audio *chip = subs->stream->chip; - if (subs->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(subs->direction)) return false; /* disabled via module option? */ if (!chip->lowlatency) @@ -678,7 +678,7 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) runtime->delay = 0; subs->lowlatency_playback = lowlatency_playback_available(runtime, subs); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && !subs->lowlatency_playback) { ret = start_endpoints(subs); /* if XRUN happens at starting streams (possibly with implicit @@ -1212,7 +1212,7 @@ static int snd_usb_pcm_open(struct snd_pcm_substream *substream) runtime->hw = snd_usb_hardware; /* need an explicit sync to catch applptr update in low-latency mode */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(direction) && as->chip->lowlatency) runtime->hw.info |= SNDRV_PCM_INFO_SYNC_APPLPTR; runtime->private_data = subs; @@ -1770,7 +1770,7 @@ void snd_usb_set_pcm_ops(struct snd_pcm *pcm, int stream) { const struct snd_pcm_ops *ops; - ops = stream == SNDRV_PCM_STREAM_PLAYBACK ? + ops = snd_pcm_is_playback(stream) ? &snd_usb_playback_ops : &snd_usb_capture_ops; snd_pcm_set_ops(pcm, stream, ops); } diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index ea063a14cdd8f..b26d1aa12a698 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1685,7 +1685,7 @@ static void set_format_emu_quirk(struct snd_usb_substream *subs, * sample rate shouldn't be changed * by playback substream */ - if (subs->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs->direction)) { if (subs->stream->substream[SNDRV_PCM_STREAM_CAPTURE].cur_audiofmt) return; } @@ -2017,7 +2017,7 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, * although it's really not... */ fp->ep_attr &= ~USB_ENDPOINT_SYNCTYPE; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) fp->ep_attr |= USB_ENDPOINT_SYNC_ADAPTIVE; else fp->ep_attr |= USB_ENDPOINT_SYNC_SYNC; @@ -2036,7 +2036,7 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, break; case USB_ID(0x3511, 0x2b1e): /* Opencomm2 UC USB Bluetooth dongle */ /* mic works only when ep pitch control is not set */ - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) fp->attributes &= ~UAC_EP_CS_ATTR_PITCH_CONTROL; break; } diff --git a/sound/usb/stream.c b/sound/usb/stream.c index e14c725acebf2..b4096a2b53210 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -524,8 +524,8 @@ static int __snd_usb_add_audio_stream(struct snd_usb_audio *chip, as->chip = chip; as->fmt_type = fp->fmt_type; err = snd_pcm_new(chip->card, "USB Audio", chip->pcm_devs, - stream == SNDRV_PCM_STREAM_PLAYBACK ? 1 : 0, - stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1, + snd_pcm_is_playback(stream), + !snd_pcm_is_playback(stream), &pcm); if (err < 0) { kfree(as); @@ -1058,7 +1058,7 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip, audioformat_free(fp); return NULL; } - pd->pd_id = (stream == SNDRV_PCM_STREAM_PLAYBACK) ? + pd->pd_id = snd_pcm_is_playback(stream) ? UAC3_BADD_PD_ID10 : UAC3_BADD_PD_ID11; pd->pd_d1d0_rec = UAC3_BADD_PD_RECOVER_D1D0; pd->pd_d2d0_rec = UAC3_BADD_PD_RECOVER_D2D0; diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index ca7888495a9f4..7026e6a8f023b 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c @@ -816,7 +816,7 @@ static int snd_usx2y_pcm_hw_free(struct snd_pcm_substream *substream) mutex_lock(&subs->usx2y->pcm_mutex); snd_printdd("snd_usx2y_hw_free(%p)\n", substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { cap_subs = subs->usx2y->subs[SNDRV_PCM_STREAM_CAPTURE]; atomic_set(&subs->state, STATE_STOPPED); usx2y_urbs_release(subs); diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index 36f2e31168fb0..56111336d71f7 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c @@ -368,7 +368,7 @@ static int snd_usx2y_usbpcm_hw_free(struct snd_pcm_substream *substream) snd_printdd("%s(%p)\n", __func__, substream); cap_subs2 = subs->usx2y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { cap_subs = subs->usx2y->subs[SNDRV_PCM_STREAM_CAPTURE]; atomic_set(&subs->state, STATE_STOPPED); usx2y_usbpcm_urbs_release(subs); @@ -414,7 +414,7 @@ static int usx2y_usbpcm_urbs_start(struct snd_usx2y_substream *subs) struct urb *urb; unsigned long pack; - if (stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(stream)) { usx2y->hwdep_pcm_shm->captured_iso_head = -1; usx2y->hwdep_pcm_shm->captured_iso_frames = 0; } @@ -592,7 +592,7 @@ static int snd_usx2y_usbpcm_open(struct snd_pcm_substream *substream) if (!(subs->usx2y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS)) return -EBUSY; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = snd_usx2y_2c; else runtime->hw = (subs->usx2y->subs[3] ? snd_usx2y_4c : snd_usx2y_2c); From patchwork Mon Aug 5 00:35:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816985 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010004.outbound.protection.outlook.com [52.101.229.4]) (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 DCA2A1C36 for ; Mon, 5 Aug 2024 00:35:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.4 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818150; cv=fail; b=mt+LgQpkHkuGRJxMIg8R38vKKO35Rj3968c744FbSJVIx1C5+j48pnex5FHV4Zp5i796zCeaIraY4XhJmdrqWD1YfxvCJjaHnVHzC3pgG4zNdkC12BLXNodUqFd+XHxjseeu73WjCYyd7UroMTyV/AyZQU1FLFW82rE30VFOK4Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818150; c=relaxed/simple; bh=AsAITu36a9j4qRtm2uIF9gaX/wMbq5Jd/KowHXXbM50=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=RbqBvrtnHZ26+Q7uu6yiPKQn5zhb09QwFHRq+pU0u1JuowKcrgI+Fpg0xHas72d2KBls2goiMDInb8OSrqeEIfzk3VwLuCI1L+jaSlb1heQRgyAvV1XMVl1oIL0ZWowFRMV3FQD0gX32xJokLtsaul4nM9v+D4qbfMVDEXOED7I= 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=OA1R26YR; arc=fail smtp.client-ip=52.101.229.4 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="OA1R26YR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yvse9mceJq2aJaoM2nAByBBOsXnyF3tJC5LMtZwAvW2J82iVGMVOewV/zXTLHhNlUhc8W5vq81qLZCb1RSxpA0tbvVHhgUGhCn9droWcQz3o9118U5EiRFHDrY38PrlVVIe80NXrOPIi4auo55UrRz9nNNpGYeYnxP+jsR6KXgRO42hr2wReiDo3ztNcg+Yo/vUV0T5xIbBL7+wRnHKJdDcS3JIUOSVkfpSr5ZGsvwFGDiwTwunfAXOJfkQyXHnpfgbA7ZbT/QYmh3IrDQRM7CvxpyBUVFs/dzwxHr7i6j6I4nVEyntheTKuStDZUUwPY8FrpiHPyugqdHiGrc5DHw== 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=6jx7po4Al7XoKH8XSQtSVL52Z577aksXu8OfoXidgsc=; b=cpluQDyGQssZFE6lwLUNEvXGbS82s79URFzGDCHfQHcsSEFibDl6uEI8PaHtoPZ27RW/bRSLn0TTZAQBWvVvrDL1sP/avAXBw4xjXGdgXaHxLZEQy+j8SVuXDZRKCiYziAd6uZ4EWLoUKpcMELr6BT3nXEOHURNjyi8EgGyLEQMGhgl2qUI6cnxavAG3iQcT6Fw54TLFSJY3FhzM2wylfhRxNp97iPdrtIQbn7IxpQsFFj7snpB7/XXva0+XxHA1lJRIZjtUJKq2Roj+pEZhItA0FVv9rhwwjZgySSAlBzFNUZYVTI84VfOH/LdspH3ZQYiMaVhuj74Gq8ENzsaQdA== 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=6jx7po4Al7XoKH8XSQtSVL52Z577aksXu8OfoXidgsc=; b=OA1R26YR1yZvlchhTaHjUICzswzpO2OzfvcV/d1CCemiMgE1fPPmC4JSOlrSGuMVm5YYClhxwxoeo5+n0kYrsddxgk3WQCvNgLn9qHzlusHVwCFgF3aryr7ELJZsskK9CAAzDkNNkT5RNIAGHs0UaGMFzhgl6/Ee5vV8O2modI4= 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 OS3PR01MB7994.jpnprd01.prod.outlook.com (2603:1096:604:163::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:35:46 +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:35:46 +0000 Message-ID: <87ikwf24d9.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 015/113] ALSA: pci: ac97: 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:35:46 +0000 X-ClientProxiedBy: TYCP301CA0016.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:381::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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 79bf6de3-f7ae-4601-407f-08dcb4e68c16 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: fsTR7riolp4ubIu7+JheVHTTe3e3evjDOvl1ShyUh0hOBvRuz2AMKUkgmXSpACCHMnMyTwT1YGh6TMx/Lw+pZ4Pv77yrTXUMcuOux4ojq+mlvabtfQuoqZTLwoNniHuxpXTrD4fdR6WvwbMfr/W4/NZrdYOIUvl0Rgu73KvZwIHBK+jE6SjCdII89cFEqVwU6r5iE+FtP0U5ZXACBfZpWo5fmw5jOMf3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EJeYqOyeO3tNZ7h0a1RyJiyA23UJ6wNDFit887ZtMxKMJlu/F9xgfBdQfALzLc1ZY+YsLSMHQRpujuj0Bec/A7n5WrlqATOB6WD++Ol+z89/xkIy+P/IKjSFOenZzAaKW8Aiw== 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: h2xv8pWEGpLySnCKkuCCVM1eg+Tvk9d1Fa4l/sooT0RcvqFknz9f8DpoIM4u0sumG35r4Z04Ur8sQRstj21/eaMfFo8K+CknXv6zaGmopmEe2icbJdUTBbsXH60IUoErO0msNVlYUv+ANVg6yNHcbnYXHOH267OrPp8p5jd1O3e4B/KOfJ6HcWERVwbXnG9n6uyA//dJpUQ2TCfo0cssvZItJOltjgF9bEbR4qr0qulw9U3tBzSOfv4qYXijgmSdp1RKPEliGlOSwuQthVywQRa1I7PN6/hGO9JjG0TUzL0LcPmxW2nV60WcWWuajWVnx0ifKtME6bwE30kiWyn2z77Q/D2pwfkXtesdF9xcWSowp4KLk3XuAmyYGQ0oROsms7seGH2b2CICVHRw+hN2H5s7sdvbEp0P9S9TOdBSKg0kT8JXJvqE495nkEB0vuec0rm81yNAxMcwNfu7FSonXX/+EVhSAlrytn4+6RrpeCHzYnKgYSF6R8ptWDYrMgc18EztlysZNr9vNqO8EFx0+usiOrtFtjcNWQl8gZ0yx6lSZgB6qBmgzvbmQnWfnjorcsQd+tZ/yE9rAF9fH0ThjxWJ7qUUOBPkC9mS+80N990dibZoGsZWyzajqjQylU6JnKUYqJbFfAFmi+Y0AlMP9MmmGM7DKMPsDFXyK1aEDJV4Ajss5B39NAw12b/XmtKcOaqg6PXI1zDTb3AjAnAs5+m8MaMNjFOvmqvXTmed+rYPj+3wVwRUQUeIpZT0KNV2ScMv/cQELoHG6lnIquW0r9odOc31/BNb3yGkH7vXzwXXLmh/ZxonOCfkrcx9R6EkoTHUsCWQ3Rcg7RozCPIkSINJwir+S2oBSI3RlgdeCjBg95qLhTfGJhUYqPLkmaecd+ex611b+slbONyKqOXcgKgUM+hoN6EFDmXQH3/hRf1O9ZM5g+5WwatqHB5D0IFm/YB91X+FZvDfZaHqah/pq34YsuoffkUyAUfo24I4j+tEVHSZ1UajHLrEYyViFzayFFEAh5gUBJjfXE/0h9CwsDkCvXh71/RCw5PhnSkFm+fi4UIy0287vnsWOd1E0irx4asL2KLqWZe2jG07XT0SB3AEg1eQU/0QTlZs3bPCNY3qRbaqVyA07e+oisNHGzQAclgJ3Yni9kriHLLFqgyE0V7N1SxtYbS0+BBJD3rwdWrXL+EdbsIDMLuLEpSZCztyuTB9JHijqUvQw38b95LicChn9m54r1hzxKZkOd16TFZsZGwJLfxYD/GO2sHlGLRf2EWLwJeVwx/uJ30MInWSopxf5t3jcugVTf8Xe11MfS5bdxM3U9hLvdeiruqeQvtSFji2D/NUbRQ1AKVcztjx2c+T8IWHc44CG2pyiQlE67GBSoM98Fy+AHtSo8dT4wt95sEphGrm/26BuMKlG6f7a/y1AUv6ciqhQYDH8AkYVTwtSiq2Hu0LIJOdduUoz8UEjpqbsrD/ErPdYLmkyHC2WEAZEYywBgFFcyqzyOMRjbnbG56250H+Nub3LVwfSyz6tJxmrvUUFfDAcaJc1KyPYb5bw3vTtXmVVmnY0bBlfo2cZ7HlsWeszgMmatDk7KCn9OMBE+hEe+07EEY/hY/FaDfs/LlBsFOc0pizPpPCOk4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79bf6de3-f7ae-4601-407f-08dcb4e68c16 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:35:46.6667 (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: kldClfVf6+jdW9T3xrB4sQtaMKJfcyrMc8fwqFhy/Q+CZ+V4w6RYDK+jG+yhoGRATOm/KiMRjjLSpEYtNN4tYfmSkC/WyJBX5NPAIzPIBm28LaPGTdVD2OOZOaAupmHa X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/pci/ac97/ac97_pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/ac97/ac97_pcm.c b/sound/pci/ac97/ac97_pcm.c index 5fee8e89790fb..0d29676a8ecfa 100644 --- a/sound/pci/ac97/ac97_pcm.c +++ b/sound/pci/ac97/ac97_pcm.c @@ -150,7 +150,7 @@ static unsigned char get_slot_reg(struct ac97_pcm *pcm, unsigned short cidx, return 0xff; if (pcm->spdif) return AC97_SPDIF; /* pseudo register */ - if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(pcm->stream)) return rate_reg_tables[dbl][pcm->r[dbl].rate_table[cidx]][slot - 3]; else return rate_cregs[slot - 3]; @@ -512,7 +512,7 @@ int snd_ac97_pcm_assign(struct snd_ac97_bus *bus, rpcm->rates &= rates; } /* for double rate, we check the first codec only */ - if (pcm->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(pcm->stream) && bus->codec[0] && (bus->codec[0]->flags & AC97_DOUBLE_RATE) && rate_table[pcm->stream][0] == 0) { tmp = (1< X-Patchwork-Id: 816984 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011011.outbound.protection.outlook.com [52.101.125.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 390EB9457 for ; Mon, 5 Aug 2024 00:35:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818160; cv=fail; b=b6jHCeWx+bSEdvofznY5PI62ZkPSyxp/biDhcs/VbPCv0rbbzK92dK8qhTmjQHNoZ6cFzxeL3ZQy284aib8woAE3HKE2nPCcmu/qLHE9GXEucuK1/0sF0IkpMbdGbxZ6Ori3B0R6vlEVfEQBZiPd6cHqw1Y1yNYDZ8nV4fV7Sj4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818160; c=relaxed/simple; bh=kD5D+JYDLwjUBsmQyZ7K66wTaqtvl3YT1KHXkpIP6S4=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=RdFLW1A8rD+088svq6A7WoZtLi5ckGcTLAeQy2V0ZDy0RqTDDMCdTKyu0G6h1UYtf3tqslTyP1BOy/DU+u8/b6tZvunU8C5MiQS6Vn7Zi995XrCCTaocPw/eIF6pT9RR126WaGyN/trbgXk3fNUohsJPDjZukdd4m2QRLZtUx9A= 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=AMVYfrsU; arc=fail smtp.client-ip=52.101.125.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="AMVYfrsU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=K5E+5sFZdzhLVrPeGIoceXWmkWme2QUZoJJ5WpPRXZQ9TDwzMr+3rpVJULU96IlLFFA7Vgu8UUFSQ3dorqHukwKpfyKoca4TJz4d/ItCCLIxYXfzqqVn2kE/UxYL7vdu+sBZPPpfxG7Vsed61//ajCOJ7JLD2S9rBiiu7tHLV1vEYM0RDDF36xW//vSLlfyxyFTwV5JraQqG44lTvT+4TC9zL0PyjTu7PUsWorGJ5nlWlhDWMHv2pkWYvoCoU2CQOunS83mru4YbuLoBjCEeKKKFL0PgeJkRasHWt9VERzriO9vbCF15Xk8V6rKTLpn1R9ClIygkZomOBal4KvFCGw== 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=+2gg95VKISkFMzk2asYqs52WMb3/zFHpKRS+Gupqwnw=; b=Vw6Nf0hW1deFWj/Bc1A5naqzGAb8Kmw2XULUefQAkRzY2ueBl1hrK2j45nTPW4s2gviR/AExb6i3uxc5KMLy7WggSyay815xMNCFOIjpL8e3Ybp+7meSZ+t2pSyLgQvP9hY6aL8RTZ2JAIj+fZj+KMJun0C7BQs9p6bL8TzGMHzfxjzdEIAKG04t0vWs+rMwHh4XdkeCYauWXyH5pNwKKHenGdxI/kWzjQtQP0dRr7HXCQHU0dOG/BqxB47kGt/zbKHi+NOf0AlI9BTzMYId8aAOSp37albBdAtMFaMb+DTDgLoz0eJLw2qFDoSwEUYZhn/UM/hYw3B6guUj425KXQ== 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=+2gg95VKISkFMzk2asYqs52WMb3/zFHpKRS+Gupqwnw=; b=AMVYfrsU3Ng8/zFqz2a73tGYNxoRhAdpKEPJG3IeLQ+LRokbeJqCVkJymaWvGEJcE9HsE296tHXF+ZeqgZpTUNP6Us9BD9elyVaH3lr4wNc1B3cc/UCpjUKFjy6+xOnRcy9iw8m81uSJvQHlhJULbF+OexG7QNMAcGNmrdQmGBI= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:35: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:35:56 +0000 Message-ID: <87frrj24d0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 017/113] ALSA: pci: pcxhr: 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:35:56 +0000 X-ClientProxiedBy: TYBP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d9f9e1f-0f5e-4961-98ee-08dcb4e691ce 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: 73QCax6oPPwzYNiaQX0uFUT+dRJUhetaDATPWv8Yjmvbt5u6aDj2zhJrlhPCrfLzuN86XB19AbUMXJRxkdMQXW9yF8d9WkjTyQ9rgI3ewNkFmoXJgFMo+eR5LNMlcE6SQSejxx0hCuQ6KaM+ChG8GAvyiCj/lln95wpFFNbPrjv2CL5LT3Swd5BDfnlA0KbxTC8DrnB3zYqR2GU/0R7ssFFc7pml4VwwDHsZI6GJHxpcbTjKWSQPnncPocc8aNXnVgk13Fu/+4bgoRlds0WKZaquSi0jwow1TbY8Czxwvi6GhyVUzby6pIuS9XGkAfYzx1kJ2cFx2auXWb1/OiF60nGHCAVnq+efOTZN9S9ZDFlfSt8zXnSTP1MEVWJGxuGIvudVkxKlkI8B/lk0jOS1u1nfIKkwBUl5gHdFRaX5ywI+wrlWC6SNyIUfDcnEMtUUYXA+AZqOjy6XORxICy8qKIuRRFRMz4CxByyKrArVFW1TXsy2ss61CYS7mYSlqj2TUnfKvO/2qa9dm3erkeILr9ZBr723VbOdTId5aF2j85jMLIQAxCXW22h3G8Ls7PmMC6sc0Jd2II2ZVg3sk4IJTzWRhSx4DlGr5F/VCG39t8wlsrYxiOL9LKwu6UQdDCCn1QaaVkx5pcDF6E8p9FBvaTggC1AavPHfQc4+4UdWkOmb8MFMY+FovMTFPvvZKL40QYY/t1/YrhZ1IaohtQHRZCkjYbVxf968C7jLLNIinhk7q8TREUHGM6me63/RjSW3D5pdTWIrDALd6g25oL/yKVxspPU0hUR8V28MVAUcm0j5h354mw8rLY9+C4/4+QjXyLa9I+2/Q7LDgFEnQw7rOnp/bLy2HlqSgiL0u7GbPgIFwxXefIMTlwaqqIdfLtXAfpIK7BeT7SBadRAmNHHJsjjzfazLTb3klgzOLifoaWTWg1vDWWq2DOhzOmvzYpeZ5YJtohcyzj/+Uc4snZZusxYTmqNrAAv60LZRm6Jbkt/TGZB7HYB2opgOqux4ob1R5l6rtotWZzSwcOceKEoqDvbmoR26k8b2mFi0uN/vlTc8vqBvuiNqTvz2ETkmICY/zLrQeDDLIW2Z5HMxrP5Zwb96jK1Ol4RyamVAzpG6HMPtj2HUwKpLO2/+f01lEv+pY/8sz1RLlp/jc/GnJwnNHufHJz7K75EVMlPWiwbMXFl75kaxGWNGiBWuAbivZsyqbTdVbb18OR1HNrPMAP+Hq7ASbGl5OmdtZYIZBOV4VSE22Gc7zG7AGNz/6D2xTdPeDTfoINy8DepSrYEAlAkX5m9A98niyaGpXxcDqym3OZ2bu1cn3RjUJkN8HJSCfzidO6IC9gU0h6JLmnLd7+EXXq8uf1VCXw2ViuCGrnYwbi9UEDu5ZVoJjiJdvY7Umt4PNWAU2T1YSBHB9M0sBqdZLw== 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: lccAk/del/W2eaWasSTl69e3JdX7dwJmUWSIL7Lfrtr0zOXEuFJwO1Fjre8XtHjvqS/84smApIRY4by4icizw7qbF7IIY4hPWvTYPQMaHB7BOS1GnqFQ9D3T3be5O1nr2WQNbZVyz+EwpwTCCcVcE0UENOiJWI/0cpLU3AD296W7beW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03+u7mMcab1bL+x1LsSM2WCjwHDJcsquNEQikKceLRk/feODDJVn9pyqSLALHo82FTwz58ZEjvR4V+eUbIQZGoMuheyUB9gXL+kWUzuQSuvkDhkVLU2VG+W1/z3kbUxp2yUV7ca8DH9vx4TMVTOvHHrVuknOsxur0WBXhR8R4KFtUHWsohYr51gQBE4sDbGczwUcIlsUr7QKsq/ijQHcFsU6s8QrTiECVjFlvXY+taQKe4nCSXN9gD19uBGzkngocqqZoRxOQ2m/Z91l8UIWqRZSJTtpby8Ac4fv84Zd3ps88SdZkGgHm3a9rltHvxGYt08Zbkz52CdtSZaxAZEeVyDNBDHGU6/hxDBQupyLlZ0cE8SeqqG9S+tI4kn1AMfhUrkCseGGOmccyI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d9f9e1f-0f5e-4961-98ee-08dcb4e691ce 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:35:56.2336 (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: JIgjmFK7dOCoSN+AkvrgTkwuIEYz84zfgOYIhA3Ph1LtzHMWzR0OXe+r/qnWmYrRvv0GnVR45s9a7KGXwy70eHUWIG2z03Wcml9V951x64jWemFOJEaP5ayPW0UY3dIU X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/pci/pcxhr/pcxhr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index 242bd7e04b3e1..2de8ccb33d17e 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -626,7 +626,7 @@ static int pcxhr_update_r_buffer(struct pcxhr_stream *stream) struct snd_pcm_substream *subs = stream->substream; struct snd_pcxhr *chip = snd_pcm_substream_chip(subs); - is_capture = (subs->stream == SNDRV_PCM_STREAM_CAPTURE); + is_capture = snd_pcm_is_capture(subs); stream_num = is_capture ? 0 : subs->number; dev_dbg(chip->card->dev, @@ -995,7 +995,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs) /* copy the struct snd_pcm_hardware struct */ runtime->hw = pcxhr_caps; - if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) { + if(snd_pcm_is_playback(subs)) { dev_dbg(chip->card->dev, "%s playback chip%d subs%d\n", __func__, chip->chip_idx, subs->number); stream = &chip->playback_stream[subs->number]; From patchwork Mon Aug 5 00:36:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816983 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011068.outbound.protection.outlook.com [52.101.125.68]) (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 3DADD8C04 for ; Mon, 5 Aug 2024 00:36:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818170; cv=fail; b=EQ8PBt4H5D0a0b1Kq2NQ1DMqwiitI50a3et18EtJA0iNZw+zfkp1T7ZNvmOtIxRAiHeYp8ay8Io3vWsSmKkUkLz84NNJS8nYtzdnHGvYtuKvwIwFH8ANe4xel+oiHilVJy3/+2z5+BdNTMjwfXVZiaO9aOyRPgPdo7W6HrdoBvk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818170; c=relaxed/simple; bh=HYuIrX8jSKxIxIyHH+Ku7hI056eIRBBYibhNfAmX5AM=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=odvQLIhqXGbaUuchHAojF4qNVZx9V95YWPgnG7avAZwtI5IRG5SqkslcW7aqf5JVgArnMKcyOPMeYNpKGRWxCgZp6kDSLMJImVA7wVtkBfpMfto3AUf9LFSMcuOUrTuWPtIA9567CRqpR5xvU+/Tt4z6jHmLwybJcoUae7nbHS4= 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=JCV4PnlC; arc=fail smtp.client-ip=52.101.125.68 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="JCV4PnlC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CnHpV4BNl/DsnmE0cQ7hcXrAFFLkEtyQ9FWZRP33Mj6bo3iBrkwuTI095Pf0rKkJkvC+DufVp6s/6D9Twh+nnlcyCfbtkQD5Ss+aNqPPxweddcEoI3fU5x0JAbqFiiZgQWDUkK2rsemhkFltqekwpa5SbcfrkIi7xdwQnht3oS1OjP+EknIPfggnKQOpVri6beFBOn6O5GKr8kSfZjpKniuANxSenGZbSkT8tay+oG0NcDiSc++TOBTtqR01dJzQ+3a0vlaJXKmCdR3d0YOVs2jwXZpE/QG0LjXNui+fvEtLc4UQb0vinigN8P//qSM4eVwK4OTOOZ6xWzXx4z4DLw== 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=7YxTb8PPGPqJP9yDIl7LQoTnWX/oEPaYUGMy6gdRE/Q=; b=qQF5sGnjUlOq86yZ5bf6c3c9d6tRNNk3uO7oSoDQV27ZTGhLqlCzmmJM1uJFq32TjVYYTzsdST0Qn/bOB87WsLgAA2myjefTxDKUxx7EJvn/XLYouoJuqTXX4bxIdq49EuoV8BCTAxveJ/PxQblGcuwudL1dsFm6pZMuXGxG6cor1+e8+iAHV14GIApExQEOmXkDS5qPO8FauAJNcq9+/9wWuuthFmWoGwZZMQDkSt6+X/oRTQueWRkB4ECz65IFR0c3UmsuWX6iALiqeiMPl6QkcgwXoqOiA9vGLxQuUy9IdMKSCTGyoHsNE9mxpIGJ+dvcRhEgfZOIDjzluktd8w== 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=7YxTb8PPGPqJP9yDIl7LQoTnWX/oEPaYUGMy6gdRE/Q=; b=JCV4PnlC0RaZcZpngVe+MDrMQRMEkWh2ptbB3R/WXRqfyi4xit2DHTXaKHV1yjLXLgtsRO9vbtosRm0KRiXdZyvIqVALA8R4/u65a4Ap1x7u2lm5QEhRm0GvnQ/0zJD9kTK1HktO5IhL9jnp5gdmHMFyTSyRauFcizRS9jJNzmo= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:06 +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:36:06 +0000 Message-ID: <87cymn24cq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 019/113] ALSA: pci: au88x0: 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:36:06 +0000 X-ClientProxiedBy: TYBP286CA0009.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::21) 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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: f44ddef5-59e6-4bcd-c42b-08dcb4e697cf 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: hX7dL0x0NP6Uo9lB1WSiq8PLeseW+xYsFb7ZTsr7qdaKg2ZgPg5vMLQpU57r4MHQJmMeGwV3XZd/8fkEOC2mgpoBovhJc8TzcE0m+lW22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PhbSspPsxmIap9WwIlPJM3rECc00V/QROpjYk4DwUk1VTDnU8mo9wMfy4EGvCS7FT2wNeeVsqfmnj1cFM+IzAcwLMoa1/3b+ubqMRapBNiFsv9WJvyMwyH9abv4ezdqFqzzzblNN0QHnTfSlCMi2IZA2XDkZ1FkJB087lcQWXtKkQyqj03YQeHTV+Kd6+Malb0ataTFHlbUIbtXcQ7QVgv3DTkCZiiTGCYrAe6YnRsQJ6hzh+WDBGRZAbyW69On86M8U1TdckN6hGjmiMkqGQ== 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: 8+jTANCuP054//tetvXpvVnJtA9Mg+tKqXkyzsM0GHUSgb8CCQ9iopgVCoiwjCaeohVzYqcR8Ic0CqEAd0iDe6UsOnvsJGU8Oqhvplicx6O/xT+7vP7X2vgTtJecqNmnO9s9wd34fA8mYTvHcj/BTInEx9EmbTIjySX9ju8ci4a6jxN0bXH54pYV0Vu6+3mIxvDeozdZwGmTHbMVkXvx9bdYFLPuhAadvB97tdwcRovXD2w0mOkLqPsalDx/a6l30rtdv+mY87+3T2LxW8jhWHUgjO26uzbSsz3fPKu8dNcnR48K8vYC92r6FFo+NSGsV2grR3Z+TiykwRQ/GA3FylFeGQNbYjUMNzrFeRCTBI1j/KG/Zqb8haOVsVo/Gg0UKxXgzo68S8L5nGy9vFVTSE79nalMkMLM5S3nZGUqhQS/qtAsBrnlUf3r0QtZnNI91e1Q0ymg+PFESTbbfvfF2pKbW1lk6Oy8Hu3wk5WLfR3Kqv1R2ATgMwoY4ACwd+m3sXBe7mOLG+ctr06rMLrHQpA0EnPbmrtfd93kVF/tnpdZx6Dmb7MM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xEOUu99lYiyv2fO4O56lgwYw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f44ddef5-59e6-4bcd-c42b-08dcb4e697cf 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:36:06.2948 (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: C5g8VY9qTtryO7t6cjJg4okExfJdZ1xINl5o3ufB62buNr8uKDzQYFv/Pw0uVQ3cpni5yvzvju6fpkcMYTFEgQKtCUr2g9k9dSKE67XEZTxGAjATW1r6zd629VoyFgsB X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/pci/au88x0/au88x0_core.c | 2 +- sound/pci/au88x0/au88x0_pcm.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c index e5d8676373368..192b5fe0d54d7 100644 --- a/sound/pci/au88x0/au88x0_core.c +++ b/sound/pci/au88x0/au88x0_core.c @@ -2132,7 +2132,7 @@ vortex_adb_allocroute(vortex_t *vortex, int dma, int nr_ch, int dir, stream->type = type; /* PLAYBACK ROUTES. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { int src[4], mix[4], ch_top; #ifndef CHIP_AU8820 int a3d = 0; diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c index 546f712206040..53000e486986c 100644 --- a/sound/pci/au88x0/au88x0_pcm.c +++ b/sound/pci/au88x0/au88x0_pcm.c @@ -167,7 +167,7 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream) || VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S) runtime->hw = snd_vortex_playback_hw_adb; #ifdef CHIP_AU8830 - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && VORTEX_IS_QUAD(vortex) && VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) { runtime->hw.channels_max = 4; @@ -308,7 +308,7 @@ static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream) int dma = stream->dma, fmt, dir; // set up the hardware with the current configuration. - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 1; else dir = 0; From patchwork Mon Aug 5 00:36:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816982 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010037.outbound.protection.outlook.com [52.101.228.37]) (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 46B309457 for ; Mon, 5 Aug 2024 00:36:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.37 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818179; cv=fail; b=K8bg9v3+a+XSlAiMR1t4nBxcpfE3EJbVgxnK6Sfa2wR6+y32+wMdp4BKjeKQKwG1FaRHmFpJXdj+sRxjMUyJ1SbrA4W/GyagCkqmoz+sFvVz1huDkFT8dqDxKg1UIe51DVW99SUCNCJvfW6O94pqQLv5BArOjdJM/69F3oRSrGE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818179; c=relaxed/simple; bh=RO9sGYPtH4FnSGA69e1GZXgXLCVyeAgQOYghxEQzqn0=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=lh//irVpxroItQfT5BKbr4EGCuibhdkBvxCXPdChEpBuNC8jySxQpHaRwlpvRUTX/4+gcZPGpNg/pJISbG339oWrsAfK73ICWxMRAsNc63RhVCP1YayUO33ZRfHDgJyeIFwas1KDFNU3jx5AxZgOQBBNh31j51lqHZAixwJxwFU= 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=K64AodmO; arc=fail smtp.client-ip=52.101.228.37 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="K64AodmO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=b+w1u599502mzEY03P7GNWm9eXJ2dZPSf2ZHwo06HkjDpwO9iX9sYpsOpXFQhqlRR3XsosimqtdLgDLJVjKwBVPTMdbwlEJi0df9frL8ZREnUYadLeHpyFYj0lH4wHRwDDBGy1Jopfoi/XgbLKzRuoUFhacrR6QeSOFwueTLLGa+YqdKiackaihcsDqT6wYU+RIHUKBFL6fpfl/VwXOOaoUfqu/iksQTTZeEAWOdo647OxY4HbGSjY1hhClyJhUe6Jsh7GCr18iCJwh5kjLu2kW70tRYXPWS2KcFjgKTyWNoa+I3a2vnW109ob5NZMc1xb/WV/DQewhlOL8quPQezw== 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=Fc0zE345D0DOcFhECJyWKv2hc7dMyEdP61dty9apzvQ=; b=AL/YHHT6M+nbJhEsLviLXZ5DzWhIkyLnoT2K1+NDACop6Noqp4u1iykvRx2DMtUV8iuzwfLI6dymSwbfnwQbNnAjhJus6Rk7kAGdsg5n/IMEedSG80VpThsRPuqIfnIZbzpbY/YMr5Qj4nebU8wloHU/xk7ZtW5o6dKG3QwkjVeLJcfNSdCB3LEM+v0C6xfp5zdfsk1+2SWpXQRwzTtLc5hXuZC9SB9qq8TMHJ4ggczzsjPRXr5ibGAxiOcbvjAD/pvthEnKxWBl1AaA9w2NJkjTFNGrnAffgCOwCUcFApdPwpWoBqj11DuMrGEhMyFL94fxn0NU30wsQce87Xvaqg== 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=Fc0zE345D0DOcFhECJyWKv2hc7dMyEdP61dty9apzvQ=; b=K64AodmOQODq/LIsN/pH/V1VOWvmf5U2X++XBI6eSmUW0Vov+V5STwJE707uACL8pFiJ29LNIvecX5AR/Fb1BatV8voGHc4TSnHDO5gODhF3bsDX/S+ZlizqLni/sZNm4p5eCtIpRo4G91Ij8cOH1HQ/wRAx48Abw3nEgH5bqhY= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:16 +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:36:16 +0000 Message-ID: <87a5hr24cg.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 021/113] ALSA: pci: mixart: 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:36:15 +0000 X-ClientProxiedBy: TYAPR01CA0053.jpnprd01.prod.outlook.com (2603:1096:404:2b::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 382d6311-730b-44bb-d095-08dcb4e69d9e 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: jrk33gdofdEQhNv6HRxC6aTNVyaNDPKyiW7YhJvxnF5Z17eVp6F2gafaUfrTBNimKzW8JctvQ+pQZz13BuZ9uzaCjsmEBvJZ8STWMegQpf8T/HOPoKxxL7luc0m0mQLGpcQoLMGIu77WdlszgAOkKYWUaTt353V2cpOBnL0sOpgYDrtFBAJjI1K7EHr4ahE+AU1goakZSWiq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0Ej0SSCTjHcoMIubWnyW6bFcJbJjSwK8U4yXmabTeFu6/6AQsNPB3cpqLX/skH/nsgIa4YeQQT/1toxvBOzPsdsGZb8c1Jc5okDlYruPAcqvFPdQ8lLSczbnOGL9YJjEPi8aaA+uNGQb9DTKg== 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: ns21YsUeKA2lyyqnYfz3y2WJhDkkL64EB2kX1v8UlzalHGROOfMSSFavVM6ISBOKau/v/Np0va70AoDn0mpJVgRx9DNzcEqLD8e7DNWIGI55fcxldNjl8Fu6HbokOBFR0bs5z0ospfORCUQeSuNsgRctk9h6kDldu0dkIqkiFwH6TjpDn8HWlmCZGep3RB0+h22NiKIwV66alcB/hwtHF3Q0Te86x+IY7hBJr643wyt9HGMnD/976zbKlUmIEqtN3D6H1g+bv6TufOoiw4r0wF+gIC6yzD4Frl8NRpu6DZdw+RVaOb23HSxRwo926zDLtbltmo2gf/ycMPpLCUsZ200Le0MJ9XTTn9MQY9BjwFEfjnc2tDGjj4zK75B3kYgPwMeoOYYrPq322ZiqNhH9YE8euZEy0V7/EThdd73Kul4IYbYMeOyal35X21FALJQWYeQ3brug//ZQurIC25g3UeO+OT1YAmaDT1MR/wmdqrracWzuRpGJQgHqk90Lfh71roHkbd+Syh7CJHhIiP1DkB7KqcQOYTujqPmzWHsVlDB8b3MyG46yjStTiWjhO+UoOB4ZW0v+i9+dhDo13Y+da815eZ18fk1AOspyFD4Reii5no9sYfReU8i004QvDFwyiP/uoytud4f+IpWfw6zcEddjESfEQs2P885+tuqH3S6dDX4q72vWu79/UfQ520TWGvg/gDQ1K1ZjvtNFV7qrqUkBaxAR4L+kiEspkN7EcxMUzEm5aDv7n+AXWZZNnURsjO7HgOGKH2XmtsP8nEoxFRXXwFVzpNLUDlHQaoF/8eKplgeN8k7oLBXscy0YVFfNBPymvu4rX5VZrtOiatWOyOjgqAQAmJXBdumwLI1IXuYZapR7Mu2IXANN1p5OLirUroXKQ2v7z7j5ibZI8kzJIaQyhzdvKC0zIgFglXGBzB+MhSs9w/aLcrn6yoWR+tjuAbuiMuN+1DKxM3KSB4oRfROjjPLD8V9jfD/zwcobcMJdMo7fyKtdwreu5iBBWfG09huMuDYThWC+RNXP0Y7j4R6PkzjF7hh+9VjzBh1adHt5FiyH7VAwH/dBmNYGOTuGNtkE225ApucrxgDnuZBKAoJL7xtWkbkGjr/jnxVlEqWQT24vk7WjitfS0fPUgfPBtWG39UJunRKAjsghkLXm4a/Rpl22UwQsUI9/ImLP7/Pa1Sn94ttBLKP+ZXg1wow5fG3AA+RGswgFsjdoB+Jqg9KuM21KhHOCFOrXNop39YVOEJWPTTpoSw8214JLXIzBinrQULgNQChPYE8iQ5WYl3cV2soh0ozpqfH2eSv2MdAPBW3me0yFH9XB+lxUP3cTINRCaVZBWoI2SlyxVw7WP6ws3GD+4tPRFdGP9NPGAoujnDpy8QedyzDoMnDJhjAJzidI89vxCdmRDfHNPgthk6giH+8hwGjNh2wxkoArvmcx48lt+0OINO8LJkactQCiyncM78x8rk/RIwlNGcCQDGToEFHjHhhoRe07EGpygaclvTJ0AinyGPpC3fR19lzC+5prOkC2OelcBoutmf/3Cknjv4mT//A3cEqKIzZ4tajDoQ5xrP/bAukJyeviiLE3EOqrv6E35H5uY3xJmTdU2rQr/q+TJZJrRfzBmF76U8E= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 382d6311-730b-44bb-d095-08dcb4e69d9e 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:36:16.0658 (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: gy2SxBYi1WX6bd6b8dRw86+aOzGRXx5fnlNDKN1pSiMSn0ds/HQmHkedc+bFt827HwS0N2EPzifJ/99Mm3R2MyRxmd7EsHut0jPJ85/k353UKrB+gcFSdjHjo2nGpAys X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/pci/mixart/mixart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c index 7ceaf6a7a77ea..ed4959c517d2d 100644 --- a/sound/pci/mixart/mixart.c +++ b/sound/pci/mixart/mixart.c @@ -391,7 +391,7 @@ static int mixart_set_stream_state(struct mixart_stream *stream, int start) stream_state_req.stream_info.stream_desc.uid_pipe = stream->pipe->group_uid; stream_state_req.stream_info.stream_desc.stream_idx = stream->substream->number; - if (stream->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream->substream)) request.message_id = start ? MSG_STREAM_START_INPUT_STAGE_PACKET : MSG_STREAM_STOP_INPUT_STAGE_PACKET; else request.message_id = start ? MSG_STREAM_START_OUTPUT_STAGE_PACKET : MSG_STREAM_STOP_OUTPUT_STAGE_PACKET; @@ -608,7 +608,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs, /* update the stream levels */ if( stream->pcm_number <= MIXART_PCM_DIGITAL ) { int is_aes = stream->pcm_number > MIXART_PCM_ANALOG; - if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) + if(snd_pcm_is_playback(subs)) mixart_update_playback_stream_level(chip, is_aes, subs->number); else mixart_update_capture_stream_level( chip, is_aes); @@ -626,7 +626,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs, if (subs->runtime->buffer_changed) { struct mixart_bufferinfo *bufferinfo; int i = (chip->chip_idx * MIXART_MAX_STREAM_PER_CARD) + (stream->pcm_number * (MIXART_PLAYBACK_STREAMS+MIXART_CAPTURE_STREAMS)) + subs->number; - if( subs->stream == SNDRV_PCM_STREAM_CAPTURE ) { + if(snd_pcm_is_capture(subs)) { i += MIXART_PLAYBACK_STREAMS; /* in array capture is behind playback */ } From patchwork Mon Aug 5 00:36:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816981 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011025.outbound.protection.outlook.com [52.101.125.25]) (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 35B313FC7 for ; Mon, 5 Aug 2024 00:36:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818195; cv=fail; b=BSqfjcCakSdqjhvKwlwbxrCgj67vqEn5T3NcVzEE9RDvJ8GIwCP+tJEP95K4HgrJgV6n2I6AasGKWeOvuRmJrjyWpq6DEK/aYbfqBA3PFpJXInYZvd7mrjRS0kIPVUyVogYMOlVWXAyn6a4F0qaZzAeWJ6Qayj5zEKCMSr1LJc0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818195; c=relaxed/simple; bh=i+H+QQwiJLoD8qFPk+b4VJ2qHaZScLVWFztzbLv8GRA=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=jwKzTVGVN/j+st+dx0ZuWPGK9360YxJi8XXyStY6ahfk+a1GjLxo11jmfHQka9hbTzG9UwaGJi4Azs7tU/NpgUSRNCGc8m8vTUHLOFzxEQu4I7H80r3JLi7OLIYC524CldoQdOKjNpBVhi839U8AlZrRsfpDX00HTc+3uSy96tQ= 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=X+PH1z0z; arc=fail smtp.client-ip=52.101.125.25 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="X+PH1z0z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zMhq2l8l55HrNNsrRqmlNMd1agYBfMxhEn+uZ8+S+jKIp0Ernz1HoBFi+3LRSEjdm9jU9IQihN8PIqhbtND2ibiqJUfolATBv3cMMNzzSQcmNo2Kr105x/aWyMvI3fTSP/kzykvo9r7gALfP209/KYfgyE+2lWjkL0L/wGrD3U8lCgUto0fAUfOVBrmIQseJ3ZOyjqnISt8JhLQKtp1/7G8g02GZlu/dLmk1Jv9P401SPRUDOS4Bu9FPEIM69R/15CIkr6qkcI4NXPOHyVLXjlNUwBOwXjNbP+c0mgBBs2+jAUMb0GstDusEtvSDwFqIakyOxSejNW7bpFT7wJokyQ== 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=jQLJLkHykyf+9tjtwn6ySZkkW916yfItHvW05IKs/pg=; b=t9dNUrOzEu/oehNq0lQJP1vAqe1p/DA5oy4EGrX7YDmbKI4jXn5q9Z/LsP61NcSxwGStmKuxxR257i/YxaAUSRmTsreDrkxKX87XMT8x2FUtAYHmGBNxodeAVgjT3W0wTIaL8rOgAGPWGJwUOz37674D7vKnIgpC3kp+wb54pPP9cXECRWhzn/JQi6d9HwFBn2rMMrObA/j0NL4gHalLBUhz49rtBmL5keAA+UHbe0Ct1KbtjTuvZwREM+D4rHD57bZEfPntAFQtuAgewChO7snm1sq+dhmfTZY2QgMwRsPCLTOFv8BQelppiKKhBCqk97uybxjXRXOCu2AZ8E5vqA== 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=jQLJLkHykyf+9tjtwn6ySZkkW916yfItHvW05IKs/pg=; b=X+PH1z0zqRDsqJt34C4MZ8gIi10f1v1o9GjtGMzUY0pitO/XjC33rFb9UKZO3gcMzew/R/pZ4tGmr2KnJg+oPaQ90NQW/Xk3nC1vXJIqBO4wQX69wNU5c155/8Xv6TjUnkThDSCICntavC6QS8BN/fxvXZpdT6ugkp3y8g5zXRI= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:32 +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:36:32 +0000 Message-ID: <877ccv24c0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 023/113] ALSA: pci: ice1712: 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:36:31 +0000 X-ClientProxiedBy: TYCPR01CA0202.jpnprd01.prod.outlook.com (2603:1096:405:7a::15) 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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 78d6a4ff-92a3-4130-9b8c-08dcb4e6a728 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: fZHuL7fdJZHxKZV4nw2JPbrVYngMZNBCqO1Brz17cNsDp1xE1O6+WBbQPRbnGic612CzuIHCmoPDboZJrdeQUEbUnghqLPBPG/RONW2ijSv3GFLlstdE6O+qui3sumir6UGnJ+glw5W1WjSc4xZu/EjouQUk+c0bN9R9UPbJU58HP8MAL4EtAV0Ga2+s0YMn2u376pYUGwGPUt16X0vTh+7JvWhR5FqDYLzZ9haGMctPAIDAzeaaUD/69TYFRRVYwy7RYbHyvqng/3SqNVyFYeGgopba+gZqiH3E2XvMhYZiktQR/WfgaMX8M3BMueof3+ClJaY/0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sbc3Yr1EHRxX4DUDt5wA== 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: 6lQpQiZNoT2+xBAY2TmeMHO6S36eN0vQLkCjKWjefAyc2+7tezHEcJsmAL/YnRyKtlALvHHdgjxoVb3MorK884u5TviQnQbAHwV5ht1OuzXlkdRygDIWmjcFPw/3WGthuXh5fsL/1sgQd/dfV+jp3dK1g8T8mdXVY5cetRgNr+T3S9T6sLaTod5MoOS+e0zucOdhtxxs2AiTggecQXZd/tiAGV82qBIhRcPzb9Ju8Or+E7pkpiVzSThOozamGPAqYzUXwbGK1RwaOzsrlN6WcqwB8RKx/N/wtnEFRZocYwAPRC/JRN+6bauCz0AHtJ14GbmrjTR5IAxllJpQ5+v8LoT2FlGcXCLlTTTpHnrZcPdx8OBPC2L3VhfSVTLhX/DLm2AktLuxn4px2S35x2IPfvr/xNdR6B11J4B61vki+oxPtj+e/pVHuG1Q4LrusJOGwqUK9rH49EtOg27RQGjO9Os7vMERb8MebsxlwywQe8r56OHxjVLtwA+9h954Tk81FdcGLg9dAYBWfGLHiwgEZcVBeF0dP5j1gd1UhetEndPRnEmvpt+7+xBZo89wSyiQqZG9SBEeKbTt55cIWlD51bWxzPizlblxAOXK5INoXt9NbFNSC7p+DZZWWFp0kbJpSsDfJoSt1Osard8ePrfesJ+RQv4hvs7YhJFgdWGBTQM+cRkiO7citeKmDzWdyAleBSHY291wJAau81YiuKHlri3mZmbhg2z9HZ4RODdnIVzgkEusLSKjN36QAce88UeO+kvEVH+qVUGAVCAHUWT8cEBjIFUopp3R0ZHdAZ0aR636Ve3fsoVbOxJFBFy4GUvjhlUu1oeiMO+T5fEh98RxJCi+a1IuvradSmmbFJjRTBbkqNbq3og6In1gls9ob22RF/WPoOhUD4XCEtzAU9AHajsSyoHvTYRKHHDCJEcA1+q1acIAJ5LGM7g5Q41ykBvVhCC0nJEbyS9hEN6eCzI1IB3yVUQb8FAUqErc+U66VH1O9+apxHnbHIKqmgaUTSmY1IskrKluY9M8pLikxLUmDw3cIFTao8Ym7Veaay+wJcmnLox69kbLM/C1fdtiOPFDZBl1Kr6Jdu89Ng/l9PX8jF4+Cy6Aqqspi5Y/zpZ19bBl4aiLx0dFcI5Ue0r1KJ22CceeFw+FoW8C/55YmIDtBy6RhHlUe2siQUfww3OsQ5F67qCRxNcttUBj1MW9o88ZeZvZ8zxUUGxrRAYGR4QbKWPq8eVehRJjHt9IKK8U36ykot3LF2CuoDaIz0XcDBh2KcEZiwB4rF8pitnuTVk5O+ZVML1e4nkpIju5aDU+PPotjr4YtL+uyGpXtee1cHAFE0xZ9anbpTAeQB1w8wuxTKpwFnUpOlySRpXD1z6C7lHok2RUCd1ybgmQ9FKK2RkqtFav84LtUXsKCkOpF9sokmuTs2cmzUCUiiMWAgM3giJuMnxbk2tAzNAIxiw+cg3iCu5nkkP5axS1fGE5P+lry8xku6RVKjThgk0QFgHhDp24xDeTR/jRKOKBlNz6Rm8iI6GZH2ntVm2tDAR4NgSagFperRl9V+5nV+dekkWKfLNYyM0knCoILHaj2kNqrwA02mz3YKYjCKg1yWvV7U4yHtGbQx0P9Q1mUrCUzGOhxY0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78d6a4ff-92a3-4130-9b8c-08dcb4e6a728 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:36:32.1229 (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: pTjX+w+omXanEO5R8pcYgOk/YiVP4f+LiPDGHhqxEdXFYdgywD+U9cWKcFL+wxmwPvb6uSJDC8Eje6ePgmGyd1iF91bU1Ub+K6BXXLDhu+Wgmp16N3PBcI0YlwpyTVmY X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/pci/ice1712/ice1712.c | 2 +- sound/pci/ice1712/juli.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index 3b0c3e70987b9..12f0cd9b8fbb1 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -907,7 +907,7 @@ static int snd_ice1712_pro_trigger(struct snd_pcm_substream *substream, { unsigned int what; unsigned int old; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; what = ICE1712_PLAYBACK_PAUSE; snd_pcm_trigger_done(substream, substream); diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index d679842ae1bd7..b52426540c529 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c @@ -170,7 +170,7 @@ static void juli_spdif_in_open(struct snd_ice1712 *ice, struct snd_pcm_runtime *runtime = substream->runtime; int rate; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(substream) || !ice->is_spdif_master(ice)) return; rate = snd_ak4114_external_rate(spec->ak4114); From patchwork Mon Aug 5 00:36:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816980 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011022.outbound.protection.outlook.com [52.101.125.22]) (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 4829AAD5F for ; Mon, 5 Aug 2024 00:36:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.22 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818206; cv=fail; b=RqWednlCE1+XtqAlxzn4v3bYsOmzNkJM+DD2eV8WsI9PArrFHvUiiLI3y8tUfw9RPe6CEQjoR+SuWXDBG+ToX2cw3cFwX4WyPzgvLgB4dnu0xqblDa4A/vS+sxIxF8+J1gIpcpagnp2oQV6z47KL7tCYkvxpSzNPfVoFV5Vgj/4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818206; c=relaxed/simple; bh=Ovlt5L9oONm6lcpKVxuxML7k8JmtDy2KlGuO0/YvIic=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=eshTwUsgf9gsVS13NcD6tx/4Ua5MdPdx4ao7rJZSpoAkSUFmQBIvvFGpWv/hVfQO3or2CbYuZqi/LPKdJKwxasH4ynfnbM6/LYhPyvu+KCqGrSQempBeVKR3NqP4qZe7wZHHsMbGwfuuF2s6m6JjOJwyNkKZCZb5rJkO09/KZqY= 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=myFiTyy/; arc=fail smtp.client-ip=52.101.125.22 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="myFiTyy/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=S51U7uwx3ZgicY3981iJS19AiYKmaMmnK8v1HF6w9WiDNq9cUIFLYiQxgNrX62g8iuVQWOKV5+5OVD5D27fFzgyQFQcxMkhanTFaua25I0PtyJ/k/XxhSxnjs83aMNJQA1nArUsbjDS/XxnoNxQTnaoGQVi/wavozbFqqZHh0hzFN9JP8ien6xy38rOuSF3jhKFGQci1wa9BRvVJyTLxSBIevQKntQSAbnW9K6QqbYuZ8VV/PwgHpvXYJ29q93DnbT2ou8/wYz/yyz1t7KbHN2EvJvFK3qFipaxtHek7kQrA98ZKp87iPobURPwmr3Petv2eGTrMN0t1OjhCZ89D0g== 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=3n6Oq+EET7nzKlc5BhH687yFBNZAc6VtaoLke/qPZxI=; b=b+UF5Qcn/yQjxKQCedNzLLp8sRa4QLvvj+A5hVQyBNV2MDdzmENhrXj0MZ2p1BU5BdwySgAHw8IBnUrIC8Eysm2uSIybNg1/IOIS4stpEdqESVUm6/Ba6wM9cQlR3g2HAfLzQCrkBsRebjKv3coJhPP8rOkx1KCXxHUYoRjd2hSWHgrTzKjDoXiU7Lpyx4DXp5lDbk+R96saiVeK3U3Uu+GA0aMf+CRaRYRkRvVR3eswfcyhnm7X11HmyoVBNv5UXuXn/p9iTzW9+/0JOtd9Ew8bJP+zlTRRflncMmuP/Fw0l/PdHlY6eO0Fpc1TX2ZYR5Z6Le3SwyNFpKp+oRN/Kw== 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=3n6Oq+EET7nzKlc5BhH687yFBNZAc6VtaoLke/qPZxI=; b=myFiTyy/ynvZ/mHud9feDaVNHBPfFB4mL0Sj48i9dC1vdbZtd0z5fiQ9ok9tq1329F2X+Lv3c5x3PJyVI+bYGUrM0z6aMsn1Bwqz1oisaeIdPgpV1r+eEuqZ/zo0FYRmjbCuiB/xAhB8dxYHL+vFjdBaHe/vntyl6nlRQST3TKg= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:36:43 +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:36:43 +0000 Message-ID: <874j7z24bp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 025/113] ALSA: pci: korg1212: 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:36:43 +0000 X-ClientProxiedBy: TYCP286CA0074.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31a::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: ddaabb9d-5b48-45ca-72ee-08dcb4e6ade6 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: RK/DujiU8+W+Dfc72wfE7mDAW1zrADDuWHNk7nWoacYR0M2hAbN9X/w75j4mh4yDVHkP+7+h95zCaGdCx2BvD1OQcmTnMcippNzMAsAojE8XaLJMIJ9k2I4xTiIwfIMfOH1lLSwT1c3pNfGePWC/gU833tSiJWqJ9rMbO4/7Tuw5FwUINP6Fk5WivUJBR+wgtQ8S1ClRP5NpbkaTO96LWXUtdb+xV3XdFZ77X797pyjteZ37dh88xj/yC+6TndwdepSTRDMaa7CMA+IGxXi44vS3f5C9Rwc5BtTzTV4QtD1O5coMtbP9gOlWDtzad9JuURJJ4fV+KcXGuO7kOM6NuefinKfstlTbb20JPC6BTxCNWrSEMvy+MmRrcLCTsVlPG+Vo2pSQpSrkLdpPd/5u2LQYffvYYbz8qR7jLPMVC4p3ZkAMdymgB5uHSdgfVr4y25TTcgHtJQ+VK87CPjVSfHl9uf/bIJiWTR+JYCzoIr4f8rsAwjmSQV4Jl20XNSvSXyDaX8bUqmXINwBKqQ6CF+c0Q4WYgNyaz5t5eolDxlh8II0TF7MV3RBwY0gvxyi0WVOD/OBrHzJF3LVpsC0wGFmOO4Ls2Bci+5UVYc5nNF4k72T5XGujb+qvjAYpvPUvWPfe8oGc9uEPBbbQcNcHiHmtWeFVF7GruINhEj25vy5sO3wkxG2aKSdRHirTqS9ZeuiJTlPqsysUKGhqEO2GMwc5TJugqogBQuotviJirz3oXjnL1NOH/yG+VC9Fvk+zEXiM61EhQzzq65295rnDnVH5J2dDgUCMKpiNbUcFlAsF82ZgB+92JJz5oZ4zmlE3TJBYvVpKv89qc55Y4bOaz/zWtGimzc7IBcLVbjiKx7XIwIkMOKggq8CF2YDiur07U+f9VlUy83LoL0RUNHrEnBzv/2MMnkUV8qnnEWTRIMl9seoRxP/Sp6e9znz0rW3pMRwd/YC02f3mZA2XYhzRphxr1y9uAv1ZCZEZhSpE8yMQ+OPUs5GIdX2pTE5+HqoqEjigK9WFwCvYmAhfBGAGMG2iayIzW1YWWBj6AcALCnUvEdwEr56EUU6KpL+fwJCZJ7PZqWDGTOnpjRKkpVN33I6lXDQR5OAEa5cVrF/qMM8eTenOJ78/vlTFWjQ+Dt50wV9VLb/1GmuP73YmSNSeR54Cz2UNwjLaiJ9SG9ZQ1k5L+hyOOj4BU9oZE7g9H3qs2vWZ9XIN/0/ComVqPE7kZv1qF0W9qP+s0YiQrmG1bghuUAM68bUgIcLguZ6mR83C0KRr3w712h4na3bL3/XnGrKR+7lKnxwS7lhkPegH3FRimLSDb3kXB5TSvpyoz9c1AnIjwNZ4bO75S81KT2DtQp74T2Mumzpkc51GWBtJ0EfYsWsMZwcCnkW1hIuVeeJjgqAQA/Xs9dgvHx1IE6+XVQ== 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: FHdIhNZwNdh5YsKbKF3DXkmBH+NgYD02h4dHlUwWNMpimqamGjnDM3+k/HdtwK1/uc5GHhsGLwhp84ulsRjxYYGpVq1dteS6uvHJrqOs6ynuquL6Q9GFm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4SKbAaD0hqNciyRPfFFTDmyrdebdmEuzbJUJEIGuaXbfpxEZjxZOgAD95qH6nyVrIHg1hYOWIYcDpQFMkLSQdE+V/YUyyPh4nTYtPNRhyXGT2EEymAQtAwU1v632t1dgy66o9HJWAGxAcl7sF4QcEQXW0CFUZfwDsZrirbHPdrPcnxfOM/6M93v0KhumEKaw6QfH8r/2E2onPT3yCcNB5V1u7EzApGEfSw05rP5ltODG+UTJQcNC4KMBSa+NKZuLVdoUroDBfyeDv3yCw6kuXduwM2hlLcdMtwEciFHG/d9cSvmUDshZvEnp04LF6mpNhENG/z1WY2bg1MKhnBnLToEvtr/UU62KZkMJx6AST9nZAyCMjmY7GPFnB7Z9n5kOYDS7VH5UkbxmsyToIPE3JAZUMNJ8Tz+ZcUUzEME= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddaabb9d-5b48-45ca-72ee-08dcb4e6ade6 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:36:43.3754 (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: JOYJMeX6oldTLSbp25g0pkaB2UWt8Cx5oyZlfgUl/7JJADufI8F4O3NtAbO+hu3GpFxUi3cl/S1S6/zamhyV7FAuGpvmAozc4pkzWPU98TU7qt73iRuHalt19oVEY3zC X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/pci/korg1212/korg1212.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c index 5c2cac201a281..f6c7edd1f045b 100644 --- a/sound/pci/korg1212/korg1212.c +++ b/sound/pci/korg1212/korg1212.c @@ -1494,7 +1494,7 @@ static int snd_korg1212_hw_params(struct snd_pcm_substream *substream, spin_lock_irqsave(&korg1212->lock, flags); - if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream->pstr->stream)) { this_pid = korg1212->playback_pid; other_pid = korg1212->capture_pid; } else { From patchwork Mon Aug 5 00:37:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816979 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010063.outbound.protection.outlook.com [52.101.229.63]) (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 E5943AD59 for ; Mon, 5 Aug 2024 00:37:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818225; cv=fail; b=PzY8ImyvqyrXk7duws0LfdPGwuJH9MzhpPNqli2W/FwDjBbYe+ETGAWJBJiaYiArwGl8JryEn7UYVjB9DvSMMgfPNXcuWaNV/B3y4ex/Y9Kb21pInBDfqbvD3B8QI7lfRfa6qch/yumPSedzxs54wKhyK+KYUImtFZcDiRaXcgE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818225; c=relaxed/simple; bh=CaYz35U0BrwmCo0iOY5skcYXkbmMfwDHib/aBG/5a3E=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=p6hjZYEvbj0Xl+zl2qguTQEiIYIPs1UNou3IX4djcRHgOE4XXXehsaRw6T+CXD/8WzEphrNoRc/RtV8ctukpChoK/7RstxpMAuEuiQXfmNqKO7/HcMMKOLlCxYNRaJkmYWf0s05cyCLv/yXu8dLaIK9FHpe9zsqqjtmKjbMscVA= 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=kM70r7qo; arc=fail smtp.client-ip=52.101.229.63 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="kM70r7qo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CJDfgdsgD7IPtAApQwBHjJFfaBBcNbp71Dmf7x8uWXO44mth1DhM/53glToQ9V2AdSuB1YP1P+S7oHvKb2cIz406JaPjUTiDQVpeJR3Ea2qkX9iqgOJPXFIjso7BpHruk6TOKz+XARYJ/YilxvymtSY0NIalt8shnyB8Ql08NexWK2rBg4Xae7DhRWH5IFq5gDqa4rJ4lrTVEw14sL8vAU93G4CVGydT4yswJxRJb4sAcPGQiQMUcBlVjd88V89cMf6iZSS20RPMzQTdbwsuKJ+na9RsvGcTABMCsmiXOH+79539DJx2zrloHzRb1Z8UoY5jC8AIuEWRGRQ1Q6+7Cw== 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=j5aejhi9EUF5c3ufjhP9ssq/Ihfsj+f/SlWVNf6wNVA=; b=j29dIbrpwuamE/MrCy0SxLUok64Cxy7luLCL16SUphleCtW7BABpmGOmMla8P+bHe9xfbDyzXe4Ut3tYh5WUTxbZSmGKI1XmQ/hmrw9N03Lk+/87Kj3I/M/IPg6adkRh77SwfWLcWVUXCogi85ooZLTTRFZ1sMBWCWjDCDlM3uf3tuv725wHdRwpjvayUnsGn5sAkZ6tIKOreRW3HFEaZS5BlUb0WIDtr0k6vLMpMae3Q8g+1XUOe8R5zr8PhFcAEsohkzfq42JEdTgW7RLdUWkCK7UJ6IlVl2tKU1v0yvzry6gOQnrykDHFkGU/gMUfKttuUx351XYJiJNjTOZUpA== 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=j5aejhi9EUF5c3ufjhP9ssq/Ihfsj+f/SlWVNf6wNVA=; b=kM70r7qoOR2xJTIfQcONaITaDv3A1jKrHAv1zrtfRcBdXXEII54zgZn9YypE7HojwGU+TBHS8yBotVIpodOOEBrhYLKVDRv4OplRdDyhJd8hCSTQu31kJONAcu+oJ1bfOayz6/W7ZfLRevILdUQpZShbVlba/7NEMDPT/feDubE= 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:37:01 +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:37:01 +0000 Message-ID: <871q3324b6.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 027/113] ALSA: pci: 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:37:01 +0000 X-ClientProxiedBy: TYCP286CA0243.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:456::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: 1bb0c2cb-e5eb-498b-c9da-08dcb4e6b8c9 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: u93rzA8ZTF9hDvGeZahsw6NjeGg/eRvSX/Zrox9SxzEsEbwYhBqcnv6Jo4pNbBoo4b/1l+L89bxF1RvHYxW8GCV1VFMPKK6HxImvl40k+LI1NAaXxwPPfoAFpbtUUqi5pDA6Iryb+xEy79yVgiwQwC+gg92xdAgX/ARcJEhx6//MiaGT/LuHx0hWs1xbXV0EEtywO7VTmBbnvjFbqRPRcCJeAmRXLIFuwCB+L4orK9QrOzgP59VF7ECaXwZBvA6HH5JvNXwX6aDsTcd8S5rWaQDgY5o//QmM7bDjoLko2qHiuorBgvMe7md0VAcV/rbbeZ+1R7kDOf8Ye1SSr7Ttl/XfAADSRN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P: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-MessageData-0: 7kGw2WNobXcRY57KUbfRe2cWskazxEqm/5KQ/GVfn15xTKLYa/PxbG2NL+GqHcWbFfniSGDhDRMYCZlRvl7RSmniGj4hz8tlhwC2BKbBnsx8zAukmv82ozkgISgLix2/czkRkCl+AHPRbWqxMnviuUlLB+AkZbcsk1j+Ryuq9SyOiF84GmwXIXtwqqcNmOZGv/l/htP9BYDgPWUNmYNmM4ShcTxk4gCPjec9/EgRWJnInHIoPaVZF1e+EqONCnXaIWHKyjdhFWJJEyYd1TGFAuvyshb2udcz+mz2a/iukN0fDfkgBqXnPLiV25N2pHYKqsaOQqT/UiqzCpWU3dQaG8OX0x1YNeknltrdjxgEju2Nn81FW459lpf7iJKRokjz/Msaa9zzxExKSUa+p4Wzb2VGCZxZf9IctpSDD5ru4iymBMjYqW88nwZF6mG825nvdn5264M1v+JobGEiwdUslz+GW4LdidJMfNVvzr9T3mxvwfySy7LpWJRuI7WBE4tspjKv8A1KTWGzY1VGA36tZJVlHPRiJywbX+G5hGGytccyUFP84UsrrazXtblHIOhp+aDIUqK5p+0kgA5wC+/yNsCMzj/2rjDt5I4FRLzL8yM+xG8rqL5gSjUTY6mtpCmNNVtUO7TR+rF7uzrvkbhF8D1eq2pLHG5hmhxT/A6655zMP7AAORy4bCKyQ+PiSQj15ZxKUOjiLdODJVButslaugwJubGz+9MIP/JwOyxI10t+iH0tvEAT1+9NtlsiNlhKLwIl6MY0kgxssM/NQoOZohFwnDQcJPZfxS15n9EeznYKScgy0/pVx6eYfs/PN1q+8Ev8NP4sOENaOD5D5+2yYwPpQr5+nujTFqdZavUyTDkJKCkezcc91rDhRdl/xfYeFIkH6AX56W2ds2w4ljm9HNMJz7M7VBO6hoBFxVNrz/Rk2vzg/B7l3GItmnFp+VJ4/u+BiCiXweVuvodIJFSisHO09mA5aMziYZSJheix7MvgQngWgwtctyDY5K7BkC29CVO9slQUcGhcQJuf5NHTPHtlXyAsluIEjJQ3kXH58NeDv0YoaGhKsHKPsvpySatBgFLaMgvJK/HkAz0SgRwejqA+U51seytxLFLo9mtRmxGIJS6ykrJHcQjpg2QObJhcjXG+/pkIBoPjDo+ZjWaBgopwxzeOXtiE6nuySLHJwvIC8KcqafDif1p+PpluCh23gzQoA3/02Xm2LtzwAPSWOuaeDOwDUYqmbA1Cao48Qe16tIxzwolid92Nk7EGFoppyD82KmWVNc8oLY7zM/Y1dbruhcrF6QfAytdU1aSpW9b9G+bZLBTLu7qBDJh0ncCmWiahDqyLgrFlB7rIkfuNnozWnkXknhx0aIL9ybQS6V1dXfZ4I0bOnT52SPqAiFNAT+4DRq0Tet+tjcz78McDabP+xQWCmYlkP0WrRWS1YYd1wf1YecP72bWwuQlZnq3Esx1G/DIp5GiF7oH0Q83MlsWCrk6G9VtQQRjCngTEKyAVuIHM1GG3wSFVwA+8uciqn119Gp/YEmsFsIlF6aa1tFL0bQcQHB33Ae92jM3Qsy/pwEVqPYmxJ4U+aHmVnxRq0KMWMGscvNr/dVsyDEZX0DnE5CIwFxiwFcaRwkypYDo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1bb0c2cb-e5eb-498b-c9da-08dcb4e6b8c9 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:37:01.7843 (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: O9gFd7BwIlUyUQgE0gPF+ZY8YOx26STLS790Ho5MF1ZwzdbqZ5K+J7/GVl/+EcwOp0PXeWOwhoFUvv/1oVQYlNF2eqjGqYfbImfN2q19n4DlGFCGtU/GAkvzf5cQRryy X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/pci/intel8x0.c | 2 +- sound/pci/maestro3.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index dae3e15ba534d..d9a6a9477bccc 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c @@ -838,7 +838,7 @@ static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd fallthrough; case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* clear FIFO for synchronization of channels */ fifo = igetdword(chip, fiforeg[ichdev->ali_slot / 4]); fifo &= ~(0xff << (ichdev->ali_slot % 4)); diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index f4d211970d7ec..28634b2d8e5bd 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -1130,7 +1130,7 @@ snd_m3_pcm_setup1(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substrea int dsp_in_size, dsp_out_size, dsp_in_buffer, dsp_out_buffer; struct snd_pcm_runtime *runtime = subs->runtime; - if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs)) { dsp_in_size = MINISRC_IN_BUFFER_SIZE - (0x20 * 2); dsp_out_size = MINISRC_OUT_BUFFER_SIZE - (0x20 * 2); } else { @@ -1416,7 +1416,7 @@ snd_m3_pcm_prepare(struct snd_pcm_substream *subs) snd_m3_pcm_setup1(chip, s, subs); - if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(subs)) snd_m3_playback_setup(chip, s, subs); else snd_m3_capture_setup(chip, s, subs); @@ -1724,7 +1724,7 @@ snd_m3_substream_open(struct snd_m3 *chip, struct snd_pcm_substream *subs) s->substream = subs; /* set list owners */ - if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(subs)) { s->index_list[0] = &chip->mixer_list; } else s->index_list[0] = &chip->adc1_list; From patchwork Mon Aug 5 00:37:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816978 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011064.outbound.protection.outlook.com [52.101.125.64]) (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 DD0C84A01 for ; Mon, 5 Aug 2024 00:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.64 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818239; cv=fail; b=SBIMMB5jjP7jYdBsrii7hmx+ewx4oHbbE+h4RR09/Xj3QJnAQ5UAqPcQeXCAqgoQ5puoK1K6N8SIAheJHhEDXPVz2d15RnXG7Eh0c1l3CUMDpFO5h01kGFfzz65sBdHhviSs3DEgom3ekdd/k43fVzsYTp232U32RDIUMjABY2k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818239; c=relaxed/simple; bh=M1Aa293H281GOk1E3YLu379G+myrg67Q10m6OI4Y4Iw=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=EHYd3sJXGkPyNu3W0R/OXKXqpDGWxE+futVzZNtkES0UxEvgu+dsE7SJESxxYH8OyE/fvMmKIK8MuVB4BTvbdrKJEhDfauQ4Su6EU/af6IEx1r2RH2pOxD7/q0wJQUCoib2qxPcwyPjGIitO3ZSE3OmkbTJc3QnRwmxzXPGBSQY= 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=g5wIKwcr; arc=fail smtp.client-ip=52.101.125.64 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="g5wIKwcr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aZFsUazANDMXfVKVzOH4jKy2QJ4vwihgwLzWRGsGLZUIrRyVs0r5nuRtvaf6mtK3YyifiXhy1VqSFBFIL0cuGnygpYRGHdzqQnU6tiVz3ItEWSmayYZC/BV61D4ZW4T41c/ZcrnkvT4XTw7vsiJG6SuUMnpuw2llokMXISUFArmLbkkAXtXnOUax5V4W3M2ker4uY48tL9ziQNfev2huEUl4CiWvTT1yHaEWto6hwwV0RosP0zwaRztltU74CPSgs0No2uoWhBOXL0OH1hUTfJ1SBNmoi9HAJx74ASU7X6wFoCM9bL2ZVw21/sljdu6M5mKLLMdNpOu7eEqko6b5mA== 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=Sw4Syn7tMEI16fc+eE7GoMZvdS+tChLGFNwG5VAeIAQ=; b=lFivKm432Mpj5R2Aip+v8MCJJEIyQlF4ckYblcZ3BhagHwOd7YO5ZIJw4f8Ae9pHXDeC/u5l+mTHSxqSdiCKjZSn/YQiCyJrXzRwvh/8CLTlUCe4zfmzSEidZs5DgNnIh089w4D0/gOUT8bqNgEeM8a4DvZ79KpnGZm3J2nbfDdLNK8jmJpUpzAOK4i67B73pTcFkt7J/H6R3rWYFOoa+kkvwIEVqR9d+u/IrkOJ+pr48tbhiBK5HtcmqKYiT/rGQuvt0yuZaBNzE+Qme43qaacctjSHCgF0etzC/T2EWXu6CNTct91XCgPZuLZHHsSAFszRPRQ6Wof8gv+ujRXO8A== 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=Sw4Syn7tMEI16fc+eE7GoMZvdS+tChLGFNwG5VAeIAQ=; b=g5wIKwcrjpfP9QJoU6IgH602wnRvM8ARnnifSeQVSNSGastBn0fiZiE3HZTrJsB8DisqYk27H+3yeoVAEowEdFjJ6j0x5DLylwSKis2H57GXB461pn94wBPZmFYpog/pyMGdr9KyVoizFKR4zrio21qKNQ4ytTw3M0DfggE+9KQ= 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:37:15 +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:37:15 +0000 Message-ID: <87y15bztxi.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 029/113] ALSA: mips: 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:37:14 +0000 X-ClientProxiedBy: TYCP286CA0277.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::7) 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: cb6fed99-7014-454f-20c5-08dcb4e6c092 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: GdNPgzVXi8tPKS8FG1JaHW9PdGVbJlAFcgp5dAeO/GvVBirSXZtZWq+MdEEpE3brSZqTXHMkgzgbcaD9qr0PqJ6R3jMPXQzUk0sQHYIBouNkFxlM187GNVGxT5P/TafvHD3izh3J6gYuHe0lENPMqyQGuvvIrFl8oXQyxRAlwHhibU/oaS/V5Qrie10s70IBxmh/ZewFUcViPmiswu1nAIIIE/AuHDo+FQUaV6GWZgDKpRgz8hFymJ9rrkshq/EeymUc60hCeLTkdChQ1huezHTh5FQn2fFcJ5jt2HSJ4IMIZtCuDi4A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2E6OFbHTzm+4UCKslCYq9yvV5rRYEgvyFew== 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-MessageData-0: yVzfyB9pf8IkB6YpfOyxVBBpQ83cDOUj+j0SmINJLWp75xC7/F/rUNXMQTdBX7OCQrfavhzh9R2aqae7RxjUDETcXr3SzXCyXuFQVRG2wT1B7WLX4tfwWj9w4fODUys9N89uDCVGmwXnyWxqzWlyfEzfNmzuqD3fX1nLTVyIpWrq6dp6m1or3pGrNbm/Z2FmmWwDxv6dfdt/ugc4r7SOS3Alu/XNBF5i9Dw/+kFhSoDHCHlWoCAlgT5XQZsWPQ57K40E8pCoZs+z1gzx5fTCA6q0P4s9znF0qZ9TMysUWELT+w9I7bt8TGXCkwIkVsk/oVDBZS6ovTvBROw7kssRUre+ZirY9+hgHx+SmD9IDg8viFTbeTkcoEAFCG+PadJ2V5d6kdbTc87d3tyzgQ8/F3Ys/BhFv9ZlM2ziLfVIb/ZGjSRlgxQPnslNR3gfbBFnkU2orhYvQyO4wMlx9G0IZ3tzc3ddJ17X5xjSzC04EyuNg+V2uxvgRUSFYSJrlNVBKDMv7cbuobAy36aORZKI0D8awXmuhI6CuXHBWCerV71smbMbhgdQ1oHzUSYmAy0fxwdI0fEJRz0wIGu5vzAUpJ/U/hjR1YypE0R755FXOeC5XaPl7YQ8geBbvCTc7l2s4gojl3Z2vWsk6y2CPnsUAifKqoBjupNtMQ21TeNDay9zU+u0eIA5e2F3iB+Xoi7GbM5xbJw43ZuLWk4v/svt3HauzLDeu8LxS2GsYcEUqWRdvJM2DZ9X408aMyuXWke1fFy8fF2lc+WLiv9VbsFBhasGrdL7CNShY/55wc/t4UPgFlcPJEDPl6hdHvMseZCXHTKG1VjADFVvKDa9kQpwg4EzQVK1up49F8AvBRTTJq56NhCtgFdycnnmL+uejXIRVi9A0ozRVzfRbm3zPXwoxGHjq96FlhLjjE/MSxCTt+3aCALaHNADImQ4YuRFtOo+I2EZLAA8s4FVjzmq2tkgqs3/AVEGy/WgP/K2y8MAckY5FkzIkWkvLFrGHiQMxAeH0Omusm0zfzGThNuuyxWiLqm9+4/SeNPr+D5JmZ8tkxc38tduhDmNFqFDmx/1kFmXxLuvSDf1LdBFC78prsmhVlSYVk5mUG/qkHfp+sX99+PJ6DwSX9PRar5VAEkhblXmhsuyEtkRim99H6Ux7qNTZIRnsU29If1qX4u8Lj3fCXV0lVoeeS0JOayy/VfD0XVYg9GHDsYyryo16+xX7tH86O1xCVTedhvYAjE/886Uqf+84S0TcpjNsWlEDdH41tXBBBVUrQRj9x02MURkA0CQz5PjSj+ZkmTJl6iseVMIBestCF5zIzDrO+SqRd+rfiB22ESXeLlFWgRknP2P5N1ZJO8tbdiylMtlcU4HraTqTUmZorLRwSfWx2FKfKx/fxvFBzBUG49ge+qfWgPUmxDYmMCG0ia66QelOxzp0ilhIe+FL4eoAuRX1lNJkbeRA7kSi2GwkuWVzgJeVdJ7Dl0k17e1QogLI3ymVqy9GtoGRZK7NF7EH1Ai4WWKYvCl63u082S7TwcCUEFvZXaoyh7sH5dJ0djy6A2bVdDyANaRIhLO4+PSk7Cg91pU9iKamMuQcLpuR9m3zRFwRKzNSoaF80W4VeJ8hNe+4mYBRtA5Edw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: cb6fed99-7014-454f-20c5-08dcb4e6c092 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:37:14.8075 (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: DG9SC2iSPAi3iQXr7LsCXpstusoc8yfF725NlfwJpNZhYZO77cckT/H+i/D8WkC7gxtu+xtIwBMvz+KXvHTlDJ6W3ALBfWZz4wYmvNZS5CW08EJ1RLpLBoxYW4Lq7sjT X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/mips/sgio2audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index a8551ccdd1bf8..a16f63f21dd18 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c @@ -447,7 +447,7 @@ static int snd_sgio2audio_dma_start(struct snd_pcm_substream *substream) udelay(10); writeq(0, &mace->perif.audio.chan[ch].control); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* push a full buffer */ snd_sgio2audio_dma_push_frag(chip, ch, CHANNEL_RING_SIZE - 32); } From patchwork Mon Aug 5 00:37:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816977 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010045.outbound.protection.outlook.com [52.101.228.45]) (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 5AF82AD5F for ; Mon, 5 Aug 2024 00:37:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818254; cv=fail; b=r2r/xEu9lyV6tEBb6fJelfBL0oG9gu/U8HXU+yDsmlv70v5iGukgXla2NXKh2VKBDuP7amzSeHEtjNpFc5Tejctzz7dEHqquLeTliZG5Ontm+mnNZ9jSys2/qQe70+PAIAIGHIv/QlJmFzYG1vFtMrSVFoJ6BwPvCJA8rGKjezo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818254; c=relaxed/simple; bh=BZvktJfse6DJvdv1KZoBYZ/DlJ6YUma/3x69Hgn3tHY=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=GkEcvXGU9XPh9EvJwT4hLosAXevPRXsMsWzcaWL+SUT3V2jSo4qexmR+/WndE0qaa1OlJ8HnQBE/YNgm/SY5YZAvpbL46V3/s7HeGY/iVcTlJ4kQQorahCQQUjnUOQRmYRyivRDVm5vyLsK9Tep0LwgYp/UM80fTyM3asTgEPEM= 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=dzjgFphK; arc=fail smtp.client-ip=52.101.228.45 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="dzjgFphK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LOGp/HEc2nzEByAmShfx+Au9yxNnSffzAt2hnd1rxybe4ullej3j6OJTCWZS7m9qywUxf6p3gLDPxCfA4pHvIbTUx0HtS4tFXUG/YcSX1wePQNJMApjSDLwEgrmjROkcNE4IedaI1R9oM52Nj8mrpnuYlA88v7MmMlDoA4s7IWo21EoRVjXJO2HsOSR0X1RTXdJvCYj1jRkpC9X3PKgw/hos/K/mfLvvCL2Z9LjP98sOA1jxu9zUVbXm6TdqWd4onaMLFd5IiQ8pH+wQv91feWIktn7GMPAPThkSnhNgYk/crZMhL3nU4BhFxpYvUSIY+Ld+W8PYtk5nkOtN8RbsXw== 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=cU8s26hr/REx39uwIqvIC6UC8Mih1rf08xzWkM0Mq3U=; b=LVtUQdRhS60h1tkGpO3efm6qljAOJkOkF69oZj6LArbqdk0ShikKjzbUe5xaSZxY20QXLXpOp/iPBrUr7q9L9g4JVHkVPvGoh2DOotABUvYMfpAFKKBbhyZNEuiK1di+xLR5Hr5b0n/lsQUQ/01iX6ys58s+8W5cgiumCDdMl+Os+NOzBiAKjQ5TtcFQ4hoUhDlwq5qg4a4AryA3/Lq6MLiRxZ125kwRtxsHhNClF8XP2uL/HSp8LI96tiLwJUnQrlkXI5NNuqcA3xWYeieJTuoWEyJ2KpvxoMRtA9yvu74qGb7BmMq7UIA05Ve1NJZiKrsTODkqgKpr1IVkNQpt0w== 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=cU8s26hr/REx39uwIqvIC6UC8Mih1rf08xzWkM0Mq3U=; b=dzjgFphKVn5QqQ7ooyXurVP7ra3+UgofyunfBWCkNpTXaij+4iVoTG+AemQFtRKEdq9kdL/pSWavT2Blj93/O/tV/wfpvQTAhxejzDAM62d423dYhxRFy3P6zl2memiKFIZH1jWFDj/R0ZwXEPQ4qqB3s4aqW8REZKoXLnLMurk= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:37:29 +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:37:29 +0000 Message-ID: <87v80fztx3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 031/113] ALSA: core: oss: 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:37:28 +0000 X-ClientProxiedBy: TYWPR01CA0031.jpnprd01.prod.outlook.com (2603:1096:400:aa::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: edc7e49b-ab78-4e1b-772b-08dcb4e6c918 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: 8h+awG9Ihi2jOe4vKB8dAVS5sL/epIDj4+8Vtp00Sqy4WJqNIVfTNThGHGun9drPrt3Qz8wMka/2wx9t8AJh3WxLM+uDIV5OMThFtAjhBmvDvDuq1q0aqjGqp/l8/lahS2KalRkqfKXZjfpqVkWD3cmhw2wg00KLB6dFOibXAnOB6e9ObVKoLfDV37MfREImvAmDkrXKTTROOw8QDans9SQ/06PPjCXJZTctnjquA2e/GqZ7d9PPweXZejcpdwqgSTVqYfBzEZ5ZpZT/rpR4MFMFBWcZiZHmDVu+5Sq7Vp+bVSgnb5rZpqQPZ9KZD2moOUxDKwnheZmBPo9K2p3zP+Q9WHAFI4Gdv5Zyg8xilBMPuqDZV0haMuTHw8ZyzfvF53tfiqbh0gvEgFHdMJisZ3LlH8+/NGS8ABvL4bjecnY+PLUzeNT64ULkLknQOtq/HZRx3JTKQIYxJUrjYtkAWMtBJY/IsdbC5qs237b5okomTWaHX9m3aZMGaYjnpUajXLn8FzfCasvnfeZ2fuFqm6IFAd2NDrcfNA3nP/QV0C2r9eDpzXH/xBZXQDF92R0wbyucCaKaxIy6BMUgJF0flCE4oHeUAy0PHp6eW5GYiXHQ1FALXTPzG47VceJsuh6DL1wxz/HFHAblVDtcr7KgC6madorn0MSEFsYaJiyqDZW02iNUXJulQMuTPzHIdB4Z9gfAL+6pLUFiCPpwNEQYYZ2cUZZWADkvofpOGcFPJEuOy3y+ai3hFpoUTqsGgp4KMWQ2z+aozCq4VdOOgW20iwI80YbS8t3e/4CV26LZs9DIR7T0TeWS9HbCEWHRyUvAy3NZCm59LPUEZkqFWvYjCzC3LnhVs1lzK0bI141V45h1YhUmxY1sNR1HOU7lLyhtjDX3Gj8HH1YMcH+lat40/3KoNSz+JMXlhfqMACP7bp3i4MZGol32REbndMY5axqKWG/8h11dXXHke0++ovLEHxcbjMSE/C3xYKH1tr6borknI0Ks+4SKfGAoDfA23NRSlAFfUbReKEhvnVCsxD3vnRTBQC8Hwvsjep0Wk3RoJfCw+EZavsQDjE1fm55J8ksnJ/bJnTJbSsFMSRhNkfpVPFijv+ics6qm8WOZ5nYfnfmlqzWeUCBi+D3OJ1N1f6vsD7MgzNBLXTmDkd0k49T/nhSl1CgYU88Y33ZpCRzAv2jqFbMP1CdjykDS5SJeJ8ERdxW+VWXDRMtQbxm1nyN92Y5temHiUK49GgcUwnz6fSaHioeVMM3FPnbuYZJH/CXwKJc559/M35herxqsQob54qGSIW7ZiUGWkcd7/kPtxiD1DG35ak+qFrgVviKtt+hn7bSOsxPaAB8QrdHOdG994PP1UABlXlJZGDWGwihcPcoxfczUEEjlIKfOXyooNumXNNXP4/M6ZejkZtEEBcYj9Q== 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: 9F9tzpZK3CAaetxPKEsCpDIoRsWucObyyXmDeGf8QoY+n01kXhJOuWA+B8JjMIsguUZvcx2htU/UBgaQ/y9ugVA1qpeb8ktMm4Kzk2XOtDhqkoZpTrcPZRqpO9dbFvLZhtee6hWhEFmDltTduYijWKbyR8SiA8PemGTDBqGUKciKRCGUPsKYQO3HFGLr+zCMxKG0CF4ZqaSBBKXRM6NH0iwHSa59LukD84AiTLAl2ZgtL2QH6c8M+rp/S/dJFNTNaVO5QJ8B7AOxzkmgkhoUiy9xapRfJLfucVvI30n7Dk401oiriFLx/oSe5inrxZ6PyCkN45tNprRBRwXeMyU99idmpr3r3CppWyApCWKpXgt7htQOkkxp2/grHflVTnqiTpfUtLQTHzgV2lB3QShkbPUWoP8R/JMgA780B9emZE4Ikic1zRQo9Tkj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lrgEL92muEiA/4fu2z6zTXCTV9988+0GEhrldK7ww0pCeLMzKUoikexbcwPv980xeNx/NKqABGs6bIs1mwLc29ilQsNd5MfJiDLYU0i7lAWtGirPa0yVcgT5PD+nw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: edc7e49b-ab78-4e1b-772b-08dcb4e6c918 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:37:29.0137 (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: n0yIdWpWn2E2KmJSVD13k11bXHxGVwutXTbGWvqeZEWLMTH6Lh8l9u1NrHojK0B7uohcV69Gv/gsJ0xHsGs2+VMb52dXWShqsxEMJllWIZ2h7Q2owh3vSoNjcCb5hmT5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/core/oss/io.c | 2 +- sound/core/oss/pcm_oss.c | 20 ++++++++++---------- sound/core/oss/pcm_plugin.c | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/core/oss/io.c b/sound/core/oss/io.c index d870b2d93135d..86d25f2e01ea6 100644 --- a/sound/core/oss/io.c +++ b/sound/core/oss/io.c @@ -128,7 +128,7 @@ int snd_pcm_plugin_build_io(struct snd_pcm_substream *plug, if (err < 0) return err; plugin->access = params_access(params); - if (snd_pcm_plug_stream(plug) == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(snd_pcm_plug_stream(plug))) { plugin->transfer = io_playback_transfer; if (plugin->access == SNDRV_PCM_ACCESS_RW_INTERLEAVED) plugin->client_channels = io_src_channels; diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 7386982cf40ed..aeaf9c69e791f 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c @@ -986,7 +986,7 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) "snd_pcm_plugin_build_io failed: %i\n", err); goto failure; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { err = snd_pcm_plugin_append(plugin); } else { err = snd_pcm_plugin_insert(plugin); @@ -1003,13 +1003,13 @@ static int snd_pcm_oss_change_params_locked(struct snd_pcm_substream *substream) sw_params->start_threshold = runtime->boundary; } if (atomic_read(&substream->mmap_count) || - substream->stream == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(substream)) sw_params->stop_threshold = runtime->boundary; else sw_params->stop_threshold = runtime->buffer_size; sw_params->tstamp_mode = SNDRV_PCM_TSTAMP_NONE; sw_params->period_step = 1; - sw_params->avail_min = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + sw_params->avail_min = snd_pcm_is_playback(substream) ? 1 : runtime->period_size; if (atomic_read(&substream->mmap_count) || substream->oss.setup.nosilence) { @@ -2017,7 +2017,7 @@ static int snd_pcm_oss_get_caps1(struct snd_pcm_substream *substream, int res) return res; } #ifdef DSP_CAP_MULTI - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) if (substream->pstr->substream_count > 1) res |= DSP_CAP_MULTI; #endif @@ -2201,7 +2201,7 @@ static int snd_pcm_oss_get_ptr(struct snd_pcm_oss_file *pcm_oss_file, int stream return -EFAULT; return 0; } - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &delay); if (err == -EPIPE || err == -ESTRPIPE || (! err && delay < 0)) { err = 0; @@ -2225,12 +2225,12 @@ static int snd_pcm_oss_get_ptr(struct snd_pcm_oss_file *pcm_oss_file, int stream n += runtime->boundary; info.blocks = n / runtime->period_size; runtime->oss.prev_hw_ptr_period = delay; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_pcm_oss_simulate_fill(substream, delay); info.bytes = snd_pcm_oss_bytes(substream, runtime->status->hw_ptr) & INT_MAX; } else { delay = snd_pcm_oss_bytes(substream, delay); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { if (substream->oss.setup.buggyptr) info.blocks = (runtime->oss.buffer_bytes - delay - fixup) / runtime->oss.period_bytes; else @@ -2272,7 +2272,7 @@ static int snd_pcm_oss_get_space(struct snd_pcm_oss_file *pcm_oss_file, int stre info.fragsize = runtime->oss.period_bytes; info.fragstotal = runtime->periods; if (runtime->oss.prepare) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { info.bytes = runtime->oss.period_bytes * runtime->oss.periods; info.fragments = runtime->oss.periods; } else { @@ -2280,7 +2280,7 @@ static int snd_pcm_oss_get_space(struct snd_pcm_oss_file *pcm_oss_file, int stre info.fragments = 0; } } else { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { err = snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DELAY, &avail); if (err == -EPIPE || err == -ESTRPIPE || (! err && avail < 0)) { avail = runtime->buffer_size; @@ -2429,7 +2429,7 @@ static int snd_pcm_oss_open_file(struct file *file, continue; if (! pcm->streams[idx].substream_count) continue; /* no matching substream */ - if (idx == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(idx)) { if (! (f_mode & FMODE_WRITE)) continue; } else { diff --git a/sound/core/oss/pcm_plugin.c b/sound/core/oss/pcm_plugin.c index 82e180c776ae1..47168e175c966 100644 --- a/sound/core/oss/pcm_plugin.c +++ b/sound/core/oss/pcm_plugin.c @@ -54,7 +54,7 @@ static int snd_pcm_plugin_alloc(struct snd_pcm_plugin *plugin, snd_pcm_uframes_t unsigned int channel; struct snd_pcm_plugin_channel *c; - if (plugin->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(plugin->stream)) { format = &plugin->src_format; } else { format = &plugin->dst_format; @@ -110,7 +110,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames) int err; if (snd_BUG_ON(!snd_pcm_plug_first(plug))) return -ENXIO; - if (snd_pcm_plug_stream(plug) == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(snd_pcm_plug_stream(plug))) { struct snd_pcm_plugin *plugin = snd_pcm_plug_first(plug); while (plugin->next) { if (plugin->dst_frames) @@ -174,7 +174,7 @@ int snd_pcm_plugin_build(struct snd_pcm_substream *plug, plugin->dst_format = *dst_format; plugin->dst_width = snd_pcm_format_physical_width(dst_format->format); snd_BUG_ON(plugin->dst_width <= 0); - if (plugin->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(plugin->stream)) channels = src_format->channels; else channels = dst_format->channels; @@ -567,7 +567,7 @@ snd_pcm_sframes_t snd_pcm_plug_client_channels_buf(struct snd_pcm_substream *plu if (snd_BUG_ON(!buf)) return -ENXIO; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { plugin = snd_pcm_plug_first(plug); format = &plugin->src_format; } else { @@ -586,7 +586,7 @@ snd_pcm_sframes_t snd_pcm_plug_client_channels_buf(struct snd_pcm_substream *plu for (channel = 0; channel < nchannels; channel++, v++) { v->frames = count; v->enabled = 1; - v->wanted = (stream == SNDRV_PCM_STREAM_CAPTURE); + v->wanted = snd_pcm_is_capture(stream); v->area.addr = buf; v->area.first = channel * width; v->area.step = nchannels * width; From patchwork Mon Aug 5 00:37:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816976 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011051.outbound.protection.outlook.com [52.101.125.51]) (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 454BAAD5F for ; Mon, 5 Aug 2024 00:37:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818268; cv=fail; b=i3lzaFlmDlUIBFLP7CrOMxyIvfSmScDZu0lg1WAqZzdYx2/5qqIvrw6BzHS5Z2tNhbEV0d91hNbMXxBGc18tXPvPv31BwBeiWiVrTi+RMH4vhkqyMqVMU3tj4Zq4x39AgsaqcVgmsmv42BDt4Su4h5jp7jClHV5+OV1Cm/l6Wis= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818268; c=relaxed/simple; bh=Vfl2XXpBnoEHmjsFNmwbqI5hkL1jb1VrisnAdZcKyRc=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=DHXwWOhmM7NEZskiLRwX3ZVxF+nHdX9KWx180JSm7o+fUneyxzTnVfgMsGxRl/vlBWtKJL0eFisVNp5M1XEzAHzZdOZuF6XR82cHz7KCPLwfAell7+zNnoh2eMMxpE0zkzxV9zDV9UFb8ArbmFRAiNkFU8vibaFxnSAX9ifRphE= 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=I74AZUSE; arc=fail smtp.client-ip=52.101.125.51 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="I74AZUSE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wsdu6dVfjo7PH05mFR/IHGnJRHRETxgBx/43xVxVx+y/kY1iTVv84Kzi1MLKCNbrI1tt78Fl/9MxYLUlAPVc7inrwptCZwv4StaDKOjU4pDEzHIILJsUxKum27pUtEsXxGkTUEpJo+jUP0fbqosTMD6M59IO8kgbasXO9ulX+qjvH4sYep8R+uzNWkbTfroRdJOYewSNiDa0uRA9R7d8K+R9vez6Q6rKp618NvbIueoTAhx6T5vTjmvKJ39DuWh+Fkf7ez4a8j5nX7C/a28sKQJ8MOrrv0RiEQfzGgFzxDk+4uKCxyKa8DrOwJRs+4PPf/rck6GpFTwMIZ8eXH2YeA== 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=J1Sc9YszcvEF6fexWzWsYE33pDn8Fx1LiXX+I3bls9I=; b=uXvz1jqBDw9WEMaNZ9Q2eUjknmUyZFOHj6MIXo9E+HVVgKSpwb3a/DuyoyHjH5vVirzGve5ajDJG+lZiSKMH81qD8gIgsjuNIEwn5eZJtgKSnQBmETNfEIAt1Gte2valnT1bKVa7PCrHRdBV3I3y4RGBHoF0wDCyKZeS77IViXLxTHOjl680q7LMREtCGyyqQvmKwasLK64pRB9vLs0Vmgchx/hHzMYIxA4ba3SmWLMVjZdikrCJ2gymXvBXQhSchgLGRLAOq7GOwR+YzjWtZlMEfy+Nk5LjCbjyGd/6gKGI7VcSF0nXzoa3prLZfdjSxCz1vlwzV41ty5q9B+8dCg== 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=J1Sc9YszcvEF6fexWzWsYE33pDn8Fx1LiXX+I3bls9I=; b=I74AZUSERahQ0ZM8xeUgCoUb1hHmX3oiMS/EtVJ6MuKSAsJZ87EXLTegevQuFupqz1N3CcVxaUDEUXhMqpU/w57VzweTIvW5WmWTfcq+ZLxJ2xNZNKEhH1k4i9CUMaS+DkRbKoC4S/m7GXedRKt4uLFloovATNEVFFi4Scu1iSU= 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 TYCPR01MB6318.jpnprd01.prod.outlook.com (2603:1096:400:7a::9) 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:37:45 +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:37:45 +0000 Message-ID: <87sevjztwn.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 033/113] ALSA: include: 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:37:45 +0000 X-ClientProxiedBy: TY2PR06CA0042.apcprd06.prod.outlook.com (2603:1096:404:2e::30) 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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d42f780-964c-464e-d554-08dcb4e6d2cd 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: IUhojVQGPm4gbtnHeFF1q3AzNl+kcCHEp2UFOWWzKLoqSat1EXEpXtfC5lL3ABA50M7gh4d84hX8PKeluGC+JoztjhSzY+CL3tMdEsKOL5lYe7MupFNrPtnYEu7JYEvcVTj1hhaiK5VSRolN4A5xJEgJbdsohvtI7WKPmhHvenpiMmOQBBWr2QLpIiiYnxYfJHYshxl3GxtJ8INNKTpevBIkyQ3fjbxa3pqxnNBfi1DL2u2Dh9vuGAbNCY9IWMHlda2U/A3hloO7n5rEVAPUNzVp+dZSA4DwnoAdifNdk1T4rKTpZnHLYAcSVVywCt9biWmmb1rRHpg+fyFF/yVyec+nKt5JbG1Da4OSh7DgdmuyQx0qVpAKnVuZNZ5Ely9vh8OtN7dsbRezx+KryaSSAkoxm6TWmUKt/r4cWzi3Q93Lj9tGevvq1Kaa397fzQSCPVywYarxq035xk3fdRBOqxtLqhxVhmaQKXbnPd0X+MUiyQWS/hDsmEgisni0u5GvNNcTS8aj/t2TY2LEM+/a1h/wz0pah0qqEvlb02CoUYGvB7Bmo1TelccTflwhAtSzzG9bgvnlDq8SmmEHEh4P4hzmntFzFCLohKNHRZB2VAZ/JgXAHct8stPHW0xg+u686wgCttGKOqp565yPFaEcstYFF+oIr/IKS9YZCEILzxwtkQUCArECTyivegDHOtPAwb7+6maUI7t95Cr1d3BhL4vVBn3L0i4OjR/zIhqnpuuaYY0ih1bZpTim5LnfTMBq6HjO4cK/Z7KGcZwSQXXbuAaKBlYE9RQm8ammD0Hl5TO8Dl87hKXpNMV3DOLidVpCv2eZ+Zeptdv8dlW5tYSQa4jQihhZE5hd1ynsUEiudAZtshEdfy2KMvJBxS5+2RDCPvidOUef6CmrOuFVSrr32B45oMMTHJFQY4sabq3q2ce458yuoiIk00UjoXd+sHB0c6lUw8maS+hfDFlK8O8EtHZd6vtu4/2Knr6/PD8V7VEFuLPZ/4f4Jgt6/zI3WM/deD6eNz3QMCFIs0rElntwi4fD1Ize/pBw+dTeLWQ4xVaOeYIdRamOa6GBSUYKdU7VXINkY5H8xpYLf/cMg+W/zqN6XnfCk9sHpAiCp5IqWztFqFJvIXIgrHXin3oAUpn6JLJj7XmYaRyaDH076UMne9Yzwoo+330381OqS8QZAJgYN1UCyBy9UrfQp3eyv/BoFs8WH5UMi7oait45KYQ7qY+LJVsqojuN1uk3npUGq/YmhitF+QpBqOt5J9DUIh3yPzYdtRKjWQG/eFT4TxMglXPbaHJbBbh2x5i5YuLDMgmVoTbs6SvbVwxmGyQD0NtlYCxdqHi/K4OHktumQALdu9LmpunTD6TlDPVptfC0bdF/PC5rttaaG7iJ9+MFqdStX+nnpPiuEeS5WbCvFOHyNQ== 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: nPAjpZ7z0MyYQvYwnk/zgX+Ng0FBsHLfYcVUGM0sQgF2rNFSeIOTVDLC9beBdBHhFl17p+3luvxWBUKM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2CSsqsbOTBHmxlx4xJ7J4tb2z80/vANqpF4wTZTNsi9JAjBND1JWi1dU7sc1j59tzmI//nTiVuZSShZPDJN0DfA0Ap4/izn4wIm3gNHyxViSWRbh6p91YjVJS6eoz1ezWacTvGLoYk75WJgjFau/sFTLiYexZjKAY5BUH0s6GOTA7+vgeSeQuBMpUozEKrzHfDoxLU5ff1AwPqyCoJ5kVuoYyaPKdSK8fgcu867XZbi/oyzyy6CUyKC1wOLcRJbXqOUMWPawWI+p4QpzYkVzYi7btT7mwkK5tqqAwxzoTOVZYAjs5F70sICpGhw/HKC4/ulGQMcFZemdBaZxcNKENO2PocEOfMzj4PTXrTV+sBZSrWmDlvcGI+BN8oEZLGY6gYdV+GyCuCzdYWoYh02R3kX6elqpDSO/U3o0ACtZ+37hSDyjuQx9J/4xONfjM9rgX8Gd4Ykzg2uPXDYEscwAIO2qc= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d42f780-964c-464e-d554-08dcb4e6d2cd 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:37:45.2564 (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: Hc1iaU/QyOtWULfVXc2aVqUiVhnT8iMYtaaedaUhy4t59O60EhPBRSbCsFuOdsQ0sEqM/IdE8Tmt0A3TnARq8SfAnfqWyvW8kr/S8LzSS23ZkvRCx4Lp9ON02lmTsQ3A X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- include/sound/dmaengine_pcm.h | 2 +- include/sound/pcm.h | 4 ++-- include/sound/sdw.h | 2 +- include/sound/soc-dai.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h index f6baa9a018681..3b2e31922f0f1 100644 --- a/include/sound/dmaengine_pcm.h +++ b/include/sound/dmaengine_pcm.h @@ -21,7 +21,7 @@ static inline enum dma_transfer_direction snd_pcm_substream_to_dma_direction(const struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return DMA_MEM_TO_DEV; else return DMA_DEV_TO_MEM; diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 69e535aeb8e82..00603c0e568e1 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -734,7 +734,7 @@ static inline int snd_pcm_running(struct snd_pcm_substream *substream) { return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING || (substream->runtime->state == SNDRV_PCM_STATE_DRAINING && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); + snd_pcm_is_playback(substream))); } /** @@ -1521,7 +1521,7 @@ const char *snd_pcm_format_name(snd_pcm_format_t format); */ static inline const char *snd_pcm_direction_name(int direction) { - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) return "Playback"; else return "Capture"; diff --git a/include/sound/sdw.h b/include/sound/sdw.h index 6dcdb3228dba6..ab752dadea3bc 100644 --- a/include/sound/sdw.h +++ b/include/sound/sdw.h @@ -38,7 +38,7 @@ static inline void snd_sdw_params_to_config(struct snd_pcm_substream *substream, stream_config->ch_count = params_channels(params); stream_config->bps = snd_pcm_format_width(params_format(params)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) stream_config->direction = SDW_DATA_DIR_RX; else stream_config->direction = SDW_DATA_DIR_TX; diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index bbb72ad4c9518..577bbaede90af 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h @@ -476,7 +476,7 @@ struct snd_soc_dai { static inline const struct snd_soc_pcm_stream * snd_soc_dai_get_pcm_stream(const struct snd_soc_dai *dai, int stream) { - return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? + return (snd_pcm_is_playback(stream)) ? &dai->driver->playback : &dai->driver->capture; } From patchwork Mon Aug 5 00:37:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816975 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011003.outbound.protection.outlook.com [52.101.125.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 3652479D2 for ; Mon, 5 Aug 2024 00:37:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.3 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818278; cv=fail; b=vDFDsIg25v6IdwJ78i33Ig/juCt8eHkKdKGVCPHPFS/Sdcc+vENCzsd6Jx8KX2KnPF0lFx4vvBRTyj9qyC2FPCJVNeQ4U/30+x9zkjsZh2ILMqurYpa0GUMHejCgNGt8MNyyJbomY3v5FjE1XZvkYaWKR0SVg18orFuxMjOasUw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818278; c=relaxed/simple; bh=1yEQuyHIzoT2eoAhdru3hXRTCu2g+dQM5Ell5eKAl8c=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=c1+eOmgwZLvtxEmvCnwLUAyqiWhxq9ggcjONzy1J4as3QCz5xy+Cu5LrG/MceAA/6LPSXwmcr3VEDFECtR5V18sN/p5i8y376X2LnkYQH2Z6tOO8uVCUbu+7yhrGEjmXdEIdqct3F4v2Uul7PwUPMMlstxm94TaDwAOc+Zs1MB4= 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=DziOK/V2; arc=fail smtp.client-ip=52.101.125.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="DziOK/V2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OlHVtYHJ0Zobg9p4gdtfLsYQidHmRS19HZvDcaiAKnLRNnkB5lUkN7X8dfsD4eZ4xwtJM8PU41CG8PIKSoEeKx7fQmeHqFmnslfFJmn4ahW+Ewwuc80bsUUm6bMHnqgmSrVP295eKVoOZDhU2japg0AapUKrFmjnUCZjxRmVYKzdluyhCqpmMPqvjJabztsIpd2IsglW4x0SPFPfCrJWcul3EZ5Fk6e4ZBQ/ldYwa/Mxjry5Mux3RSk3/gDYVNawvHbGbRcrstgD1c/bobZLBQ/Cfg4hTs0I/SkrCYa8yJZQiJ3M4Hzuo9eMESM/U0vAVGcM0Eu4bCjUfz5T/9iyAQ== 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=od4JF1EE18ALyLXED/p+4+5yxyPsJ4a+WL1HygEqqrA=; b=vCNxHK2GO7PhZxKYhyBaVh2/f010fMAsoj8Ut835KtzZEKBQLMJCiHv8/yRc5RAcF8gTVDA1pIEAiyKDUs2lJy4C7IIA2n3ftB06vPSKR91hDbExN8Afbqo7wx5lULqbYLLOwZ2Tf4CUU4IBvRyRICCKV7uX+WoBNFtn0x9JJi49niN4iVhr60AGbZLK4VZR/zvMRgLlpJz2jqV9Qy5IqHB/lSCSSGsulELLK1i1Ktkce0QZ50pMiLxTyNztfs1gM87R8qm6rEaBArjCdN71TrH5UVgEd10hdDEZp2jGXBGGLLpQNhI6DWEnAqLrmHKrbR7WsjNGr1CBzpIM93w+Gw== 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=od4JF1EE18ALyLXED/p+4+5yxyPsJ4a+WL1HygEqqrA=; b=DziOK/V2niv9pesDO7qFoNTzzkCZEAmVxSv8mSF9pk3AsB7f6l9AVZY+44LUMmpJ3+ZahuaMO+f7A0+MgZC2wU2x1IfbXIwb5sjlIZ+joe5wTHbVjUAZ9CW3tLt/i7k5DuH+c6Gm3N54ROp56JE/poDlEb1oFFVg8rsZmKJ+tMs= 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:37:55 +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:37:55 +0000 Message-ID: <87plqnztwd.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 035/113] ALSA: firewire: motu: 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:37:54 +0000 X-ClientProxiedBy: TYAPR01CA0053.jpnprd01.prod.outlook.com (2603:1096:404:2b::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: b5af83df-f2d3-4b14-4ef8-08dcb4e6d893 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: gujUsG68Z3GuAwiFkrZnL/mHyvXgojAcIP5/Idid+TxPjeqCn4nKX05+/Au5hdstwHEJ1j2oqaxKbtt67xQuMqjSpn7LPj8Z5k7W0qQL/iKvROu/5f5wyZz+jt4JkowNB/kCCt2hGyGZ0MHOmBLUiwtofmc6AqVygaacRDQ7pHcgSqQRUaUhGX8VVT7o0baCpbvr0OXeA8fDwMPYoWcHH2qU5k7I0NIylAATJf7p8aY6cBOR7Q8H6tLMYO4dIj0MB0pQWN4KCQoz3cgCkFkW7whoTo3q+fNregtmbMuhq/Mq7j6hFB/hRGdTXoI1wb9ARnyRMcKHZRSuR0sYBNpks+keQZfmT7VmpulA819ADf1TAGNSAUtKMaBTos2W4C7y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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-MessageData-0: wxve3N1lrD4Nlr19LGvcxifevHMwNQStD5QMZEuiVEeZPEjSSVN6NAWIKN02rRsfdirC73jWtIPnsWdTTDEvEnI6G2KI5+sfdJ8CPm2aY32gCmTniHIQbL+dm8ixdo5jBR/KhlWUiojojL1r+owlPJJp2kU530REhLFDLX2+wUenHPxkDNz8RXDvbP8IdXckt/YEcN5prpx7CKL3m5dMDfj0CK8CqeJZxUT88BtT+JNsgLd8adEtukkDRl6gjVVDDNTdjfkB92pr4tn8XH1JfQSGU5NqAHceddG5l1ILN3eGpzcSo/kfJC13g8pc3kHTwzecaQIlScfabteEcQHdr6b5gcn0v7eBnSQyGYdWuMm/lbIXLt15KKbrpPCwH4ovRZQsXsujc53kZzOCbPPrjiAfvEiQf3Yij/w7k7hxDkCth/YKQCEYtzkFBSV+CJTsrY4UYzrfLdCSHXxz4DtGX6ASm0mJGgCJfXRzZXav7FdbuYmZdGRMjPd5SiqjZkSODdWJzb19VjrldjChUpG2oZXa3ReB3DxxtLu8Rn6ovCbpjQlP8j4uba0+vcznN19Atc/T8/6v0FRNhPLaavxbVgBfyyc4OLyfee18Xj+EOuqyXsQMIQmdire7RhHzEgH/7ktAKA3nc8YroRN9IDHQ2gaD0dDiBtkhtAa8Ppcg9g/+Hr9GSmp0aJHexDYdjtRbuepgNxAftspQWFWRJEspgYyLSeyk9YOGDf01LjuAFMZUK7QWWRvQbCN2yMlSOL88Lo6UiExxLOYr+L6ntUKgyWyjmv5dgxoL1+Pb/3zuPcS1rj36WlJs4utprN3yRTydNT6+Rs/eDEhgV3VPRFXGzFFDvZmbf8Y0/0sEQGMmCcNrCPuJ8pjoy3xBAs9WztLq6qj9fbwV5UZER1U8H5RfrqjRqLwQKvx9o+Dgf31cQ2Ge9AI4pXTLpkx19cPFV3gruGQGdK3Hkvl30quvU4PKrJfnNG2INpeMoqdDYP7bRrRn0FRChWOuxaBK2GHAouwelGuJdgvV0bE0RxCd0yU/4XWiHHFwHhcgSJSzpgnFScVXqvrv405zMh/UeljFYFcxkGf9nZLsbBywpDi/9cw4pLaWAiHlfRarzQn0YG4+EMeQjIHQq+qW+9jj5df3pKBFzD/5iy4+H/aO/HIoXMlZabSVZtHN1llPi4V6hNLdAfTLdhqyTpGDJ6HBQfrhmxFdU/3LnyFXmos1W1SXt1R3c+qk62Isvml3KBaVjOXVfEs4Dd0cA3KYppkthwx0N+wqc0K6sWb9kUjB0lyj8+XTw6sQcx1HB+2YBulptUZEElXIpczja0UpFHtmWprwzDqTiU6z1o1LV8i7st1yHjYfwUxgfDMPf34cnXLEaZWUXOHcV0u5NroiOarzmrxrEQd/aeRpMwW+nSv9I+QjPJ0b7k6fyQiXAMYhwg4XFNsAeo3BUwOpqlPDcKnnGQ9AtjUX2DuZQr8SEmgTTEVJa2r1tT0MNqeMyzJuLSl+WPVmRskolb1kbx9m5hMIU4wwRjZRwtr4JpFs3I7Dt7CdQ5HOUxkWzjxl/DHrIY7pXrmqTDLWYCeVg3CvvImWJsnAZwthmioxa4fKRabhGrzmPJ4KwhkuT+44MwgLkBkSyM0H9io= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b5af83df-f2d3-4b14-4ef8-08dcb4e6d893 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:37:54.9494 (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: u0g0ZEdnN2BUoIavW7FSOMMKN+76Ipt/pG10ygmM44MCF+q2dc14u6SHlK66+YURzHKFLgF7SEql3lZGxmj8MxEiQYuGSn4y87tDNx03hFPOj4Bj3e5iS0wS03fqdFUU X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/firewire/motu/motu-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/motu/motu-pcm.c b/sound/firewire/motu/motu-pcm.c index d410c2efbde57..411d2b3dccbb8 100644 --- a/sound/firewire/motu/motu-pcm.c +++ b/sound/firewire/motu/motu-pcm.c @@ -101,7 +101,7 @@ static int init_hw_info(struct snd_motu *motu, struct snd_motu_packet_format *formats; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { hw->formats = SNDRV_PCM_FMTBIT_S32; stream = &motu->tx_stream; formats = &motu->tx_packet_formats; From patchwork Mon Aug 5 00:38:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816974 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010025.outbound.protection.outlook.com [52.101.229.25]) (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 A56FF79D2 for ; Mon, 5 Aug 2024 00:38:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818297; cv=fail; b=d8t7Z4JAZeG96fNV1+2DljK6sAeGhtJThMgP1PYNOFy8/EFihQ4rpSUNklUihNbmLCqD3oRWs67s+Dp9W6dRRxzrYdCe8rFxyEQjQsFJeCsNO1tZ4By+rG4ZjuHDlHoWXIRSKOUayWPUzcJRQBU6AtG5Y/7XXHvj/FK7gw9nrXY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818297; c=relaxed/simple; bh=bAV5BV0q06/Z0Yt8or/mXIzxAHdygLVgFo0G1yPUBoM=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=FufMlxTfA4diKnTxy4Jkp+qGb6rS9BHtO33QJkazUBZLGdv1SVK5KPtP1GUnmXedmZuQLp2Bpsyggw1Z7QyZTbP239kxC6bOjNyMeU7Mquaihs1wxMkSc921V7MlueYSvkhNfA7Ih3YJG4NTyZ6O6lCFul2vPcBhyKzAyCQfqsM= 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=HiYNh3/R; arc=fail smtp.client-ip=52.101.229.25 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="HiYNh3/R" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YgSvy/IWG2jDEec4gCf152IcftuhqFMhxS1hmDLur2sYQJz4Uhidf8aiqPOucLtXuo8HPl7A9crZmTjtJvrYABSAAR7CiPVYhzQ/lqrvFYFvipICN7dXgqRB3aREHAWtFAgIagaiFiAoWMzkPSZD0OpuYb+mk2jDosz0NOenDiTq+vx4F94xxBT6bXGG3gp7vS5c1NWgzjknWFQFBekPqnu66HX/gXmQUijg0iOkePPURZglwenM+PVNBcRdqFA68kgQ9tv5WXtauguggSAzJLQOgqKcR8MCsFF3JWKb1GwDcFAIliq6uHo54rz+8MvC8Md1qFbTuGCHqb2nGykpsQ== 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=oW6KHFXVwx8L0pEHeBT87ZUc3ogZn+4saFVcPvn+Cmo=; b=u3qHh22Dqvmmk5ntOsJdFepoeIvfQzckuMOSWJpf96DFbkqTSPu+444Pcs67RZuhh3J0Q78vcz3zPU/LFKTPzaUHCFyPZwI8KOu9oqak2dDvqw2VEfX5yO3NHFgrby5jI8svRgIxZM6BGt+yjB0SVqgEk+546aQ1O9nSsdLKkBXNlwal++IbaT53o7dX1+653FEsJ0mJ9gOpuf7HfGQVAdPTjBCdj/9qUrU+nQW08XOif9WdJh1C9TBoS7dkXprKYgBqC6Uov6QhDYtL2zFSwHVsQRE8UcifEMKS8GrRQKQ/glNubqxgnF424bbtn4TZP2UQBIHpNo7dJx9xim4f4w== 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=oW6KHFXVwx8L0pEHeBT87ZUc3ogZn+4saFVcPvn+Cmo=; b=HiYNh3/RouNdCGcHjrTEMM+a3guXaMvbWkxAXxZABKOaI4kNxWGxwvriCDRuiXf6kDyDO8BwrzOQhJ70KxhfrSZdSColTkGJqgA1jqBKZ16IziiINwVupkthHJyZP3n89N6KjNC3nxUgRCJa1AzryV4ZjRYJ6HS5VskYTONw1qk= 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:38:13 +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:38:13 +0000 Message-ID: <87mslrztw2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 037/113] ALSA: firewire: dice: 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:38:13 +0000 X-ClientProxiedBy: TYCPR01CA0009.jpnprd01.prod.outlook.com (2603:1096:405::21) To TY3PR01MB10906.jpnprd01.prod.outlook.com (2603:1096:400:3af::14) 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: c7574b2a-e52b-412d-7830-08dcb4e6e38d 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: 5d1fGPFSU+gfVJwdLp+n5E7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B9uOENrGOO5ohAHaeUFDF2q0BN/nVBJJ0+BFXDK/lmQANnEjic3cl15uVG3HE1G0SYNtcaQoOvKOqv6Oa+CHvAqcWp5PUUm77PcpisVS1aq+xq1LPhllgdnWOBZjl9vuWX8cZ9G/4hCQbY/TmzZxfwojTyakS0oJwQcScMGzSHyBUM8seSkk746KJjqMCJY7yC2c4j/1dKVteMYObASmB5WXgZ6JhJJIqe/YqqWjLzX/GA5IT34sdoptoZPWodoYEQTKVlLPBUDRnY7u0h/VtiM9Plij56/Bwn7B7JMNdZkQD7bBoSdq+y3xWNcg+oL93f6kFcA== 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-MessageData-0: tvNizW7iq/mOEAHkNicvxfJukZt0k6z0K+DgK/O24VbMoL7cWQ6T2IlyCBE/9fRWI0d6bC63XhynrM6uCzP6Cmd1J9drlr41sT9HixykCB1/ro1Ed5KjR53yDwtJpDrwxtLytOSfmuaiik/TcD02ISQC1ENk9zXacwjoXV54zZCC6VM/RLOf/aVSI9rI7zoPpx+LJbnyHHUwgRtBj/4exaM4rILiJa6TaA5Mo3vRSMgA74P2B2G/j33L3I+gyPkSmJeq/G45uiSDfd31CG3TiSK+jEjBQF8c83ZMWq6ipJMGDxM9Ss3xv5nuQ8vgQK+gtkJ7A9xIJo4byfQvO+waVYBi5osUFByofWxXfl3htYONWfN8i9g0RE0Y98yncrv07byDxLx7ujgg7qNKy95HzLY8zhSfH3D3zIbm7cYvo9goPw2UZ8rvvbXbE7nGy0J4RFe1sLF+FzMOSvNK5M/8hkN7sQnKs1ktogEq/LXyXZ5ePxEeHLqOMF+xJGhicD8ryxPUkxVR/8RR8le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IaQ8TqLKI33y0DY4plG5kxFMdsuB2upy2lyimlpgw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7574b2a-e52b-412d-7830-08dcb4e6e38d X-MS-Exchange-CrossTenant-AuthSource: TY3PR01MB10906.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:38:13.4970 (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: kvLNXruFDlb1pcZPOu2okS2qblOzcURHQsYrLJlzKGlE3Jk2XSNsCS5eNJckrU8Lcbj8zbDJVPFifq7yKN18K2Ow6fiW3s0NX8jOZnMJGd13da+CQxl9yWvPuaiDdx9g X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/firewire/dice/dice-pcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c index d64366217d572..063e16d153fa5 100644 --- a/sound/firewire/dice/dice-pcm.c +++ b/sound/firewire/dice/dice-pcm.c @@ -26,7 +26,7 @@ static int dice_rate_constraint(struct snd_pcm_hw_params *params, enum snd_dice_rate_mode mode; unsigned int i, rate; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) pcm_channels = dice->tx_pcm_chs[index]; else pcm_channels = dice->rx_pcm_chs[index]; @@ -64,7 +64,7 @@ static int dice_channels_constraint(struct snd_pcm_hw_params *params, enum snd_dice_rate_mode mode; unsigned int i, rate; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) pcm_channels = dice->tx_pcm_chs[index]; else pcm_channels = dice->rx_pcm_chs[index]; @@ -132,7 +132,7 @@ static int init_hw_info(struct snd_dice *dice, struct amdtp_stream *stream; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { hw->formats = AM824_IN_PCM_FORMAT_BITS; dir = AMDTP_IN_STREAM; stream = &dice->tx_stream[index]; From patchwork Mon Aug 5 00:38:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816973 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011047.outbound.protection.outlook.com [52.101.125.47]) (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 33CF811717 for ; Mon, 5 Aug 2024 00:38:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818307; cv=fail; b=cfdNc6395t9Q/MbAq612lQCOhISU04WvXC4HOpGDIVGYU5VjHcOfkWCJ9asxN0TpwW+SvzzCwHHLqiWOqlJIgY57PMow7Bve+7WyVgH+RKSUbP3aDh3diU5PrpIF90wH/uJwCvFwJBe/GONIv1TNJGkZlrol9SYXGhO0cNKPUUY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818307; c=relaxed/simple; bh=pNwjQfUh9E2gDRg5VcfvhdkWk5SaXFwibPehWyuFWzc=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=V366mu+/x/mIAZkW4ssD4Yxuw4O2nrGC87rni6voJ0whUR6D7ol6plAZLwbLNNrSkJ0f6o796R+L6Qbx0lTDGd5khV+NmP0flmTfbyes4gw6aItd2jZJ64WVMQ5D05yPbSaVJZYxRofVrrqmpqrd/zp9Y3wsKhV4PtAyDw3LnJw= 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=UQD9ookZ; arc=fail smtp.client-ip=52.101.125.47 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="UQD9ookZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rPfphjaW+D88UYjTYk2VxTnqOE+plj10bqBpxZOy+fQBp0fphbauITzVcR9XuVPDv3Vbo8rtZLj97HQBKr9jiceAirFXY6uTcSMnOZokfD8oQ01XGVNgECyTv1ghW4OTWSavskNwxoBUOUSf6JtC9N8wAqBlA3jUA3BRcUTaCkjDzPoRD8uw2ka2ByJgzzOSjMTj37UaHXPeXb9oAjRI0hOf6D2VABRA+nrf9VeSXIHI2WKDLj3yZEFMd33DxdcN/7UWzxHhhfAvBftJwAZ6raZoFt734TiFN3YTKvvdo2PDr8qZbsU5bZQeJfSrgrJvBq8jAfz4J+yweZ/bsIcvog== 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=wp1EuzhDLeCRQKsEz63bZ06RiCbh0qYe4w47qR2AS/k=; b=julXJLIPwVPWYsvsy40PZtbydP6tYA/XxiQStWL+s8MHZrhhSFpZnnkRGmdoAxeGkoy8U/AXWcEk1TinZ0q3JwQwaz1Sa5394hFT0o0XTfL41gy3Wnkh3tKRb24cw4A0DSLjN7lqwj7aljY3at/8yIOFrOp6xTzaK2REhy9ryDX5EU/H7XZOqf7T/Vp20ZoQmkEjDfjnWfDmxOa1E1kYeq/dW2YG8By0o0sHKHkBYt4FfSz13qkW9a1NKLvIGgVkAQ4eKgJ8oKu8H8zY6Rmw1zd6iEQ0dM27ztRNw14/LZGTINOX5lSORnpwGHE3GHuUgjRyxZOTYKA20XuWp1r+uA== 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=wp1EuzhDLeCRQKsEz63bZ06RiCbh0qYe4w47qR2AS/k=; b=UQD9ookZ1U+9RTqZ+9mn7VQMCti8sDtZwcyuGANplpYIu8TaBC/s1vPbmxcMD38vRppgHCYo2KG2o4zy+JfJJlQ/T2qDNgel4W2P1vAzaFeHtW5YSl3AyVRz5zsWbxEpzp5r+BqtNMXIMcogwzIduj+dDjFTKwmiiivuX19i0Yc= 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:38:24 +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:38:23 +0000 Message-ID: <87jzgvztvk.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 039/113] ALSA: firewire: tascam: 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:38:23 +0000 X-ClientProxiedBy: TYCP301CA0054.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:384::12) 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: d6b67132-90cc-4ffa-fabb-08dcb4e6e9d6 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: MQwDWzKkfOj7+lzD3l4Y4MKjT9kEosCeSZ3k9CggYVvJu0DjKAZccbtITs8hFgzqNTAYE/DrMY4hs8TTCH682KNINTShmnYycarsa+wjXE+4wv0898AQ5f8NJtU46kKJ2CJg170FimahYlEmbe/f/rojdJUZongYdel/mIaGv/ppVrB2U5XwGSbEQWWVAqHKZSCf2Y/7RhDT4UYWJrgbJ0ndQANV14mmC113197iHaTYV9qfU5DfymwU+nrKOrn847LXT2RNgMyPpWY/Jr4nGSe84ehDJ+uI3ery2k+vaYVLs3/OexdU6QYMry4FEIq/hKW8xGisJB7pZJnnIfIq8N2qVa60jnPINYzKm0yWDgjbm4ibgCkxiIq8nQqXu2vM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; 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-MessageData-0: 7sc34kxOcaoXvuHWEViytn+5+9Ln8r0Tm8nmQEodw6tFosuL6p/UNmZNoqxuBtEB8UMCH8JJ0hTNoHDaxWz9jcNfyGdfRrJBNot4xGG2bC5pvlx8o/7/Btud5r/HOjoRYzc/mnqPhMPpFRQyUpEqaa0MY2hCxxMTiHclODsCCOuUWGucOEecGVW6q1TmXoPcvytB2YqjOMn8fLaw0733fVBOduBpy4K5ejo6lD+lr9+TWvx2vDH8HNA5evfPpjP6f+sKHGg+PADst87CpGBxd2NNAyw1K6yAkCp1bakO2hcd94XL/NCbj6r1wQ748yCtsWdUgOsBNNBv1RRRy6OagmOZAr+wRFxAGj56eYxR5QfQvzis5uFVCWymRPsN6qf2Rsk3bzQ8uJJJUhg/LCp2tfao5bldefbjfPEJCyJhdhJ1PRY5KdhmYh3qQn/DBU64RTitzU7xamKVlgmfZAJkFJ3dHvhEoQooCYrduMxMIfaH/+56kEjASxP+qQV/qe0fcVp89v3hFxPFm7fO8BXXDL7WQAFnnNaER98IJFS8tGOhm4HmWYKzdGqnPvxnFLYvRnhOduGdaTuktC42pGZ7qxGnJQf40BonjQYiYBYwx8xWd1nghSYlrOEtU/5JnePrXFT8eXNSzQ48AQRln12PAf9rdZmQ8kNeKaE3ML+tNyCZblPPcvMfr4tKSjp0LjmJHzSpQpfIfNe+d0hirXQ4jkXllVvdWWeyaPXA1z4SMXKT1p2dWc3oTGCDli1YQ/UwKChZoBxAirVeEzFDMNk3m0Am62jkIh3hGLo4S96xOetfgnWNMHZZXSpNqLVUsUZFRgllR2HOUuPTgk1CoxdT8Q9IjltoYE4ZUEX6OLFQepIhwtFE/IEq+zZ8asrlzM/tXoAGX466nl0BoN1lu6KWBgfpRpda1ns3pO7Zenm4G9qYkxeb3wyYPs33jkzBi2Wvd2ns5tH1wnZT3i6gFHP9w2x7W2YxlVJZNQPXsDdX+CSf7XE1bRfEd1z3iE0bbkQoxZNuQ+t3y+AZjunvr4iVajwe7DJ/icIX8lKvj/DXRSMT5Eek42nnC4wq9C090It/Y/TH27/YhSRUV5z3DB6Oc8CUfxZz3wix8ulIRoF/kEZ8FAf5byAovRcAFqq2DVcJjmeWbGG6FOlRWKIrTvr3fNkg5AtgBHDHg88BayzOMCHe1a3RSw8r2hEm98mYIU6iNtDljaChH7J0imZuvXz2wHPYI0ol0yEoGr2Wegb2MDYOTV3xoxahJImJL1yhQ/6SUd8FjFgOi2/tFMXEoYMDRGn88tBUX4XqRkVLeiRxIHMH1VQk3aPJxRrs8vlj07zARO1MVPJfetiA8vFat8lyrBYULhMTWLuD+mYg8jNz5IJOh7bHEXJjNTNoMG6DnEfnnIYzLKFCabKRGog9sbqSJIqN2AzTj8wAOaqrUqFH5Z2mJq3XVYszuA1t5AqHSFDRDJvCb8SGTncozTJ6NoZxXwdUfTsPrt1x36oou79+bf3eCMSFsOzWZH12BVvsKlPAPu4lzF+OOKOYu5jnFs6XZ6eWy5NWRnBptf20X4L+9e1Cqq510YbZXzsKN1Fu8aL1jj7xEkAY2ZelR0+uIftgR/QHyckFSVYqlg4EmwQb5YI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6b67132-90cc-4ffa-fabb-08dcb4e6e9d6 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:38:23.9076 (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: D78WBMP8LFwfsHN4f+oomLr+3C/kwhmlsBmP+ZGLp2wODI2zS/YaHuIGR3sLYEnuHlhpt7Cp2ca/wWxSkWgiOo/8cRzPmomeTMx+BVPW1eq/ZjZvbq8nXs8z6lE0tdEw X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/firewire/tascam/tascam-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c index f6da571707ac2..29a8e7db7c30f 100644 --- a/sound/firewire/tascam/tascam-pcm.c +++ b/sound/firewire/tascam/tascam-pcm.c @@ -15,7 +15,7 @@ static int pcm_init_hw_params(struct snd_tscm *tscm, struct amdtp_stream *stream; unsigned int pcm_channels; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = SNDRV_PCM_FMTBIT_S32; stream = &tscm->tx_stream; pcm_channels = tscm->spec->pcm_capture_analog_channels; From patchwork Mon Aug 5 00:38:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816972 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010032.outbound.protection.outlook.com [52.101.228.32]) (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 CB390156CE for ; Mon, 5 Aug 2024 00:38:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818317; cv=fail; b=pJMuahapwaHy3RILHqC/nq98VECN19oP0rbj/4Ei88VgDzhyYMFV7vcPDzLiw5uEIGqv4lOXEq/E4f3UiS8o7pQ7bXEAYtPtrfwEjzSjuOjxhUH3agzM/fiD7LmX4m00gtKgZ2NccGIgniNVFn1Rhtm4VBTJjdVD3rozed81wi4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818317; c=relaxed/simple; bh=2XKVwY029ACuwzgxudgKtOh9IfCaKw5UPLRQp32xCwc=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=sX7FFFfcPDrwbGLFZG2zfCQqBBlQUGBIjJuenFJc35/N0JlXOS3qg9EB8rafyINLqgV0P/CvkO5PlZOHLVcnWi7Q4pkLGTwqz7fyK0zfIboqxehHPEUz9bW7pfbXEAeC3MLVwFMC+zWyPA8QEsFMAIoCDRkMqnyxjz7oKZzyd9U= 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=HKl14j+f; arc=fail smtp.client-ip=52.101.228.32 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="HKl14j+f" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iu4ila11lRul5NeqFxW2Zy2aqhQPdN93eUTZD2Yc+8iO7E6H3oSJo/PJW2uLu0JQ7CdDAn/jiNC5hyuxG3Ln+jdkh76Mzg5b07ai2fH6wEFLJ1/E+4eDLZsR/ifb1FVYcYdNSusyuAIlGtvy6ye8ET21NZ7mmM4PJkk5WH1KJwON0bODjXFI10rruIfddicXn39k6W8J9coFqiZ/uL/LgllWI9kvDhe2akEYGV3h2AGhwNd7S4IxcB69YfrNjc4x+wy4yz2FvkgNtxQ92U8Faplh8KLWCiMC9ay2GMtbiLdGfD/AJZO3SiWY1Ms/sGeRHmkRq1WgTRPX0/NxF7wKXw== 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=EwWBPIrvEEzNINeAu0VYLeEdb6PeE3NTbUPzBWPw94A=; b=t2hNUvzTMLy1ekm3QMMkyGbpOdslrgzjU7yjiiaZJaY92UiQ4JOX2XRWIdwx7r7t1um6rMccY0x9RrpmVEUlHLiGB9EOBuqmP1Ud1tyIX7gNpQlgSSL+HlyTEPLdTqvRuIhmRrzJ9JvisAus0SeS4JKuU88678/e7u4gyjjEXtW+vPxQ9FuyZ2EocI8Pu9B3EyLKqMmx/ODrJ9ArW1tq/0VnO3VjVH+iFe4fTv5BFZjw1G4d3EiXk9gD9OPunQaSzPfR5K1w1hsMQkUQOHbLU10UOLelyV6X9Z9nuyZKx4FseWTwtTMli0f17bK3oaV/v3G47lY6P+YFpSGVzlA5ag== 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=EwWBPIrvEEzNINeAu0VYLeEdb6PeE3NTbUPzBWPw94A=; b=HKl14j+fb6mtpduYW4BmunXDMD2+W7hsl/+H6psVGHXKLPFnzBt0pJlfuTfRsXUJKg1EjJQ62mqRKGnRxyr8gaG0BI53ruVekRhP5TbhqPO3FCrToWJwbRxct6BuR/4pYXop+I76FkpFW3YsLwlrGQ2jRrNO7CGTFatOx/NPrf4= 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:38:32 +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:38:32 +0000 Message-ID: <87h6bzztvb.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 041/113] ALSA: firewire: fireface: 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:38:32 +0000 X-ClientProxiedBy: TYAPR01CA0109.jpnprd01.prod.outlook.com (2603:1096:404:2a::25) 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: a486d03f-102e-4161-ac40-08dcb4e6ef1e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|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fAKyMhyw2bofxYxJfN2BwO+boqxsvNomSSRJh4Vwd3x8ZH+rDKcs4K7Sou++N1OiF8ZYreIiVAQfZHridcuh3mh0r+RAkFrVsBxqtA2oUyRwOOq7WXQhkW8ISpUDlEjNhwof+OkL8aXqrRqnjWwNw/W2X3o4905utr6YmOPqoJi7UdMER3RJt+6dolKSWunjLj1wGdvSUmqGuocmudrurOYN44jBf124Ivj95+NJctTXjWF/BVtN+GBy4DfTGUbMIWhvfQbmrPoJiJtYgVD364pqQxiaN+v5rwgaem602L7b/D5u+tkXEweWUHLSinwCAbjVZzHpzzrNq53QsHPQ8uo8us6c4D5VkxgYk70g8IvZ+a4rJOCzggoQ== 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-MessageData-0: bPhW7M1e5+px/mMX0VVKu0pH7FqtTROuJkYlHwjvBEC5bO5qeHClRZYtbRDsu6mmwAR/0/4dnTZwq+pytVhQU4daCfYRmbMx6wNk8rsT9JKIs4uutj2tN9z18gC8bqluoHocQE9KKTf7DfMGxvX0YptikJ/5/ggR7MzMOIcwktXoNgBHYOX6iYT3YlZv4thbqnXjy3fFvSuUc8VFteugHnhnPMQRzBjmGUl8PUp6QeL+kiIulmYGB5av92O87fRnhxPRXZ3mcH9AHc6xIokMVyOZ9aY9nZ5KhLfwvOwahv0Ll7Or8nue96haoe9K7GqzAPi8sOs/B537cZcZqDqTRBfr8myS38iaR/Ed3zHwx05Aa6pklWS8bIRaFmCEKPNDOos/mSfk97M8EHDSbw0F4T0O5EXt4h64QDaa7gka8L/ByYLMDbMJO8Ux199wUK4Od8Q6OkGdE7oVrysBHM8uoIdsbaYm29UZO/r812e/mAL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T3CRlgs6qXRceeuo2VfFZnfF/jLUjO37eY/WPEn1wGuFX+5D6WL9CiGaOIlel+Dh8kZGlJBl9U= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a486d03f-102e-4161-ac40-08dcb4e6ef1e 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:38:32.7772 (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: a6UWD34KXrof7i4h2te2k5EThdw5WyQtr7TuDR/hIaSTEu41WUclyQG8vs54Ma2+LKYZTnyTORDTPLQ07b+Qd9wx5BSu9ue2gdMja2/bv63xqKpLZyMEm0ibpW0dXNPF X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/firewire/fireface/ff-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/fireface/ff-pcm.c b/sound/firewire/fireface/ff-pcm.c index ec915671a79b3..d17abff5bb1e0 100644 --- a/sound/firewire/fireface/ff-pcm.c +++ b/sound/firewire/fireface/ff-pcm.c @@ -109,7 +109,7 @@ static int pcm_init_hw_params(struct snd_ff *ff, const unsigned int *pcm_channels; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = SNDRV_PCM_FMTBIT_S32; s = &ff->tx_stream; pcm_channels = ff->spec->pcm_capture_channels; From patchwork Mon Aug 5 00:38:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816971 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010004.outbound.protection.outlook.com [52.101.229.4]) (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 5BB7AB64C for ; Mon, 5 Aug 2024 00:38:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.4 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818326; cv=fail; b=UK7ho1DYRQhNzIGSNrHaPnSGxoh9i/H0xzCDOAPj9ZWnyj5Qsf5uJ9tDrEBwZPNjXZoN7t3DKMU+OYRnO4fJUx5cvYiCptLHKs2pAFxBsv8HDBuuGm0tCraMBz/frv+fJSUl3soRXUWEdrlNRJ2IX5fQN2j0eRiljwzNW/zMQF4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818326; c=relaxed/simple; bh=yby+K8sbLa1AzCJRJC/iAu2eKcIg1c7Eq/aZvkozcT4=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=PR5b85VPiwqYOjm0X4QpjtT7o9Vltz59FeAIzU/ex/IKoRxfdLdTb4zFKNPhsUMfLbNoSAtIVcB30xbnX5HvCstcSRSRh9aFwwq2m/F8jFp+8GhM1K3FADnxUAPNBfBog8m2JGZxemSxicp9l5a3u+6ySyc3Aymer3E7xZsx3FQ= 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=YEukzmwr; arc=fail smtp.client-ip=52.101.229.4 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="YEukzmwr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PO9uVY8c414K3GHr0Ek8B5dRLOaSwFHKt9bMmh331Mq6sIvBTT3g+GMX/E+GmGG2YSBkdiIliVtxBCc25go0y/xl+c3yrYR5fb1uqlIbB3EOw5eGRPJh2Q5yeFHBlaZHnoJyfskrHFSwTGaI+Jkat8nY6RPFdjoveAbmiSlAxAH2Hcs6bOwKROlk8NMkBkupIGrci3E28bKilCRcwOAyY6PQhH4iP9L5815c2mf0Wcd2loENwh+p3h4nka1QwCuPl6Ce1THjCOj/XIigQTYBfl269Y2Y3cyA6SblcmP3/4c9FJ3qzqvSJajB9/eHiOz3RlPSFBZXaYYQNmX38lE9dw== 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=Ch1ishbVL9mT6gtObRicFJ4osR/ashHveJ4Eei6CYvE=; b=FCdp0UjQcHMAff3KceDep+xRLaG+QlwdEfFcUw5zs2Nzj2SRtyHWTIj2dyJVZeaFHEAUPePWEnvPa9H6qj02+YHPVUjxYbc+2cz0TQAjaQHNealvQiBdHfsyHlpW/nmHwtem54+X0uiD8ebQZKh6S86Z+TQeNdnOWb6IscJY+E9tVd7ho13geksbtURU5J8/kZXIzWDl+jqMq7sn2hvAfrErvL4PufaWwsjdKYdOrjE0skbtKSfWw23PC86/BuaV/jpCDweKFOOmw2t1GKXdh/GULyNITJQ6/N3ZRaQJIjcb2bHR+VkpVhlvHoigolwP1IXPUwkUjdVIMNiFUlexwg== 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=Ch1ishbVL9mT6gtObRicFJ4osR/ashHveJ4Eei6CYvE=; b=YEukzmwrgKNmy9Yo09ydTSXtk7ftqLG1BEbdwWc+sCaX+gjIRKYA02MT5/DwWCDtedZMzMneihbXobSshb2CqbZy+7NJj5+g7mafzPNsxx6WAeKe3nBjOCi04gewCfEDNxbKaNORkRWfGqGMjR2tr2XrL489RQ+YywEJFdOk3RY= 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:38:41 +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:38:41 +0000 Message-ID: <87ed73ztv3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 043/113] ASoC: ti: 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:38:41 +0000 X-ClientProxiedBy: TYCP286CA0340.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38e::20) 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: da5c1b24-e2a1-4efc-7dea-08dcb4e6f426 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: IsyP9jq0snHLyq0fXEtAnzn9Ux6D0jGj5KX3qjtu0j7EKHKeYuW8yY65+O/e1XeV0GVxhoe0uhEXp2bnSz+0+2yw/2kj4DqxVndDgBBnjiHXaUhq83pBcMlXFREoh+lQJdvvRoRx69m8hBwSn3KQKGp6VI2w6ENIxTGRN5G4FgkT0WmWd54s9lfncjs5qnS0Ow09+HV990B7k0BnjQAETq0H+dA+MM4/OVvfIZ3Z4RUGNYien//Q6DmhiUFgYxZnDZOkPGHk7hPK0sOH7VvVGLF4lL93tDbz4sovF34X495Ldx0FfJOTATEzHDKtzJH1x0UqkZMLFDOwwfrqnpCMOsaGfsbCw3IoIVtyKN2/YxsC9MJIPEojqmMolYlwz+nNuv4v9kL0XrVt9N1mWsn5zre7QkSBE6G+XM7Gs6HAyfhLyFYlSQDfjrV1kAxqC2jHfQaoJPYIe0JPNSXtxj4eeFDsaFfAzjMJcC4NTLscFBQsK/wLJp2c/T0sB1a8rMnZX+ZFJqw1rONKIxyk1PVmMhKtVP6HvqpXQQe1KlsdAVdo8deSn2E1ML5A4LOSS/vYOnKGmkGCzqUir4si2CPBYs/SknKTEkfx6GbLYK7LTlStOkZXnf28NtxUnzCmVBpEX3Q5kkTI/kw6BMxqm2G6PUmRok/pzjQ5YhYrQ7pxG6OB3Y7GgsL7c3Mu/6PanG+6/+6HOsWxHTDBW6yIWLA+ri1ayyk/MuegAOGg7+H49zpmqcFXhl8vSKM+jnLDuoKx6lYpxX49UnXU+fFy3eZOjzorxi8FsoBZDpzhVxJPF0HaDhg5Kp7lZU6qcLXG/FhpGXJl/tQi2voq0l5cf1beU8I5pD67nfm3O427/rvqrHuJU0jffDA7WixpAPwW0xqE0Mx1UwIxnUvijJUwj67hlHiA9ixDwEzRU/AR1oEtdYH9oCTgCiiXqV4qW5a7m6IN23cQrOHi61DrCe/b+S8dBmaDRDPS0/LaPwOkQ+5HZ//tFp+Ub39tlwukr0UxYuanT23p8hqbCkWvPp0VVqZ5YgUBi7p9lxZzIVNPXY8tUNPutGyh3PLt3vVCoSwCXgKTyD12yiuu8ZlUcNIvuGVWpkn5gbIoecGAATNPZxwUg4PCBFEBeveuTq+R+NozchJgcq1cbIJd3L2S66VNa+3g0/YA5/VLg7w63xnZyQuD/joUsupG3VjSfL3e+6syVEEnCv6395xRIW0XC1Uksu3VDcoNtz2JiCLqBLsulgcCg99AM4ssAnhSjv1lZGy12kuQAHeO0t5Oz/mQFs9/wvCYzC38HINV8LrRrRwIhA0B93uMcrrikNLklwyWlEXDyFI5sV7dWc2W3cQOCFk2VoobAns9urjzrONuDi8m6cpfZQctrbJ9eBwqlx6T4HEVqyGfxncj8ge6amnId3RG8q/+JQ== 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-MessageData-0: 9rRSb/MJgYKByXiGCoibq3Fn+xrF3JdBpHU3U3qoXMFTpnufHuMPRSI8xaYwZlpTJbpXish2015+aD7K6JqMlLCbxZZNA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/w10ZTJVPdBGvCkkgPhVfM7kiReSbixQZ4wxBec4paQ1fnbWPPlr6eMpPrGUGeZJVp04Tqv6lj0pQjrdVkvE1MuidXsCBU2Q2zdCppOvqAVdwXeEntzM+6FqH20rDM9y1JpdCV7fZdZKDgeMfMX5TaN5UCblAV703USNheRglwyXrB6y5S/su4YizYHmz1ISWfu0nIaZwpTWBjfRT7RszwRFBJ7qE8ga0ErkgI0c25DhBQFhFQzoFlyGfmFJRJFGsOJlHIOgNOw705tH4j5uWfLMvdFVpMOUOwx66XIrOdGTj7WSi5K7+m7CtLa8NLBdkE+RFT+I7PSrSEmHOWzr6i4GN44Ibl3pdj4NoEbZTngLrCs3NR0gRDORf6K4ibFqYctcW10t6P+lLeaSP7XZzTVPQnpMNnwrWRAqztZBPHQag8J80l0IkaPiYx5WghxtNd3GeOlL8BfTFUJopetM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: da5c1b24-e2a1-4efc-7dea-08dcb4e6f426 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:38:41.2332 (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: roQeIffJd7pS7EjF6B9xxsC55QTogSxOcAaLmgnmdzUOQFBxwfJYJX5O5UA+D6FMqdJOHxnsnY1DvRwM7Ll1SbLjbMVPBCkl6J3XwJLtCZP3tEvNigxOh5K+JUR7e8ug 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/ti/davinci-i2s.c | 12 ++++++------ sound/soc/ti/davinci-mcasp.c | 18 +++++++++--------- sound/soc/ti/omap-mcbsp.c | 18 +++++++++--------- sound/soc/ti/omap-mcpdm.c | 10 +++++----- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c index 0f15a743c7982..f509aaafa411f 100644 --- a/sound/soc/ti/davinci-i2s.c +++ b/sound/soc/ti/davinci-i2s.c @@ -190,7 +190,7 @@ static void toggle_clock(struct davinci_mcbsp_dev *dev, int playback) static void davinci_mcbsp_start(struct davinci_mcbsp_dev *dev, struct snd_pcm_substream *substream) { - int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int playback = snd_pcm_is_playback(substream); u32 spcr; u32 mask = playback ? DAVINCI_MCBSP_SPCR_XRST : DAVINCI_MCBSP_SPCR_RRST; @@ -485,7 +485,7 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, } /* general line settings */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { spcr |= DAVINCI_MCBSP_SPCR_RINTM(3); davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr); } else { @@ -641,7 +641,7 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream, xcr |= DAVINCI_MCBSP_XCR_XWDLEN1(mcbsp_word_length) | DAVINCI_MCBSP_XCR_XWDLEN2(mcbsp_word_length); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_XCR_REG, xcr); else davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_RCR_REG, rcr); @@ -656,7 +656,7 @@ static int davinci_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); - int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int playback = snd_pcm_is_playback(substream); u32 spcr; u32 mask = playback ? DAVINCI_MCBSP_SPCR_XRST : DAVINCI_MCBSP_SPCR_RRST; @@ -700,7 +700,7 @@ static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd, { struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); int ret = 0; - int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int playback = snd_pcm_is_playback(substream); switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -723,7 +723,7 @@ static void davinci_i2s_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct davinci_mcbsp_dev *dev = snd_soc_dai_get_drvdata(dai); - int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int playback = snd_pcm_is_playback(substream); davinci_mcbsp_stop(dev, playback); } diff --git a/sound/soc/ti/davinci-mcasp.c b/sound/soc/ti/davinci-mcasp.c index 2b1ed91a736c9..e7eabbd972e79 100644 --- a/sound/soc/ti/davinci-mcasp.c +++ b/sound/soc/ti/davinci-mcasp.c @@ -289,7 +289,7 @@ static void davinci_mcasp_start(struct davinci_mcasp *mcasp, int stream) { mcasp->streams++; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) mcasp_start_tx(mcasp); else mcasp_start_rx(mcasp); @@ -354,7 +354,7 @@ static void davinci_mcasp_stop(struct davinci_mcasp *mcasp, int stream) { mcasp->streams--; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) mcasp_stop_tx(mcasp); else mcasp_stop_rx(mcasp); @@ -873,7 +873,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, if (mcasp->version < MCASP_VERSION_3) mcasp_set_bits(mcasp, DAVINCI_MCASP_PWREMUMGT_REG, MCASP_SOFT); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { mcasp_set_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG, 0xFFFFFFFF); mcasp_clr_bits(mcasp, DAVINCI_MCASP_XEVTCTL_REG, TXDATADMADIS); max_tx_serializers = max_active_serializers; @@ -913,7 +913,7 @@ static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream, } } - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { active_serializers = tx_ser; numevt = mcasp->txnumevt; reg = mcasp->fifo_base + MCASP_WFIFOCTL_OFFSET; @@ -1026,12 +1026,12 @@ static int mcasp_i2s_hw_param(struct davinci_mcasp *mcasp, int stream, if (!mcasp->dat_port) busel = TXSEL; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { mcasp_set_reg(mcasp, DAVINCI_MCASP_TXTDM_REG, mask); mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMT_REG, busel | TXORD); mcasp_mod_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXMOD(total_slots), FSXMOD(0x1FF)); - } else if (stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(stream)) { mcasp_set_reg(mcasp, DAVINCI_MCASP_RXTDM_REG, mask); mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMT_REG, busel | RXORD); mcasp_mod_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, @@ -1190,7 +1190,7 @@ static snd_pcm_sframes_t davinci_mcasp_delay( struct davinci_mcasp *mcasp = snd_soc_dai_get_drvdata(cpu_dai); u32 fifo_use; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) fifo_use = davinci_mcasp_tx_delay(mcasp); else fifo_use = davinci_mcasp_rx_delay(mcasp); @@ -1509,7 +1509,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream, * Limit the maximum allowed channels for the first stream: * number of serializers for the direction * tdm slots per serializer */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = TX_MODE; else dir = RX_MODE; @@ -1591,7 +1591,7 @@ static int davinci_mcasp_startup(struct snd_pcm_substream *substream, return ret; } - numevt = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + numevt = snd_pcm_is_playback(substream) ? &mcasp->txnumevt : &mcasp->rxnumevt; snd_pcm_hw_rule_add(substream->runtime, 0, diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c index 2110ffe5281ce..bb6a01b41ac86 100644 --- a/sound/soc/ti/omap-mcbsp.c +++ b/sound/soc/ti/omap-mcbsp.c @@ -217,7 +217,7 @@ static int omap_mcbsp_dma_reg_params(struct omap_mcbsp *mcbsp, { int data_reg; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { if (mcbsp->pdata->reg_size == 2) data_reg = OMAP_MCBSP_REG_DXR1; else @@ -413,7 +413,7 @@ static void omap_mcbsp_free(struct omap_mcbsp *mcbsp) */ static void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int stream) { - int tx = (stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(stream); int rx = !tx; int enable_srg = 0; u16 w; @@ -472,7 +472,7 @@ static void omap_mcbsp_start(struct omap_mcbsp *mcbsp, int stream) static void omap_mcbsp_stop(struct omap_mcbsp *mcbsp, int stream) { - int tx = (stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(stream); int rx = !tx; int idle; u16 w; @@ -742,7 +742,7 @@ static void omap_mcbsp_set_threshold(struct snd_pcm_substream *substream, words = 1; /* Configure McBSP internal buffer usage */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) omap_mcbsp_set_tx_threshold(mcbsp, words); else omap_mcbsp_set_rx_threshold(mcbsp, words); @@ -797,7 +797,7 @@ static int omap_mcbsp_dai_startup(struct snd_pcm_substream *substream, * smaller buffer than the FIFO size to avoid underruns. * This applies only for the playback stream. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_pcm_hw_rule_add(substream->runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, omap_mcbsp_hwrule_min_buffersize, @@ -816,7 +816,7 @@ static void omap_mcbsp_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); - int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(substream); int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; @@ -839,7 +839,7 @@ static int omap_mcbsp_dai_prepare(struct snd_pcm_substream *substream, { struct omap_mcbsp *mcbsp = snd_soc_dai_get_drvdata(cpu_dai); struct pm_qos_request *pm_qos_req = &mcbsp->pm_qos_req; - int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(substream); int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; int latency = mcbsp->latency[stream2]; @@ -896,7 +896,7 @@ static snd_pcm_sframes_t omap_mcbsp_dai_delay( if (mcbsp->pdata->buffer_size == 0) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) fifo_use = omap_mcbsp_get_tx_delay(mcbsp); else fifo_use = omap_mcbsp_get_rx_delay(mcbsp); @@ -944,7 +944,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream, int divider = 0; period_words = params_period_bytes(params) / (wlen / 8); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) max_thrsh = mcbsp->max_tx_thres; else max_thrsh = mcbsp->max_rx_thres; diff --git a/sound/soc/ti/omap-mcpdm.c b/sound/soc/ti/omap-mcpdm.c index 1a5d19937c642..43637ce12b665 100644 --- a/sound/soc/ti/omap-mcpdm.c +++ b/sound/soc/ti/omap-mcpdm.c @@ -265,7 +265,7 @@ static void omap_mcpdm_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); - int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(substream); int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; @@ -305,13 +305,13 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream, channels = params_channels(params); switch (channels) { case 5: - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) /* up to 3 channels for capture */ return -EINVAL; link_mask |= 1 << 4; fallthrough; case 4: - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) /* up to 3 channels for capture */ return -EINVAL; link_mask |= 1 << 3; @@ -334,7 +334,7 @@ static int omap_mcpdm_dai_hw_params(struct snd_pcm_substream *substream, threshold = mcpdm->config[stream].threshold; /* Configure McPDM channels, and DMA packet size */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { link_mask <<= 3; /* If capture is not running assume a stereo stream to come */ @@ -377,7 +377,7 @@ static int omap_mcpdm_prepare(struct snd_pcm_substream *substream, { struct omap_mcpdm *mcpdm = snd_soc_dai_get_drvdata(dai); struct pm_qos_request *pm_qos_req = &mcpdm->pm_qos_req; - int tx = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + int tx = snd_pcm_is_playback(substream); int stream1 = tx ? SNDRV_PCM_STREAM_PLAYBACK : SNDRV_PCM_STREAM_CAPTURE; int stream2 = tx ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; int latency = mcpdm->latency[stream2]; From patchwork Mon Aug 5 00:38:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816970 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011063.outbound.protection.outlook.com [52.101.125.63]) (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 1B11914A8F for ; Mon, 5 Aug 2024 00:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818333; cv=fail; b=Rl1878FFLBc81Y1Iiec8ZYPJe9ahO7QkLrPvgeZYYF3/QFnQdCalOEmr6ez/mCaJbHPl0twzB/cmh1sLLNo48q1sL7/mnfQZjiGfLXGa+L5kF7bFT4jTTON51IaakjpS49LW7Po8lUR2+joD18/ctZllRUJoqo+pGVxCRV22bu0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818333; c=relaxed/simple; bh=eQhB/6wMjwacnVwEX/cour12gs6QnRl6GHsflHPXrAo=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=uBewnUXszWLScSF4sX9qxotq0Vva2F1jV6F9fxcbpRS90lO8/yz72UGrnKeeFwytwa1ISMm8vl2RRDZkJ7qqnSgfsOY994tDhN4bPdjiTP/QtGH4lz087g/4CMZJYQhaqGxTh8y9CjPoY7VRt70m28+oUWPZr3bPxwH9ADCWvLo= 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=GoEJ84Oa; arc=fail smtp.client-ip=52.101.125.63 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="GoEJ84Oa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=T9YBAkiOH2uy/CGLPmgKyB+F8lLNf56W9vBdd7z/J8CmKSMuM0zMGQyQ0v+INqLnyAmQTrBJEqkSBiZa7lHTPg91X3Tsi37glZefTIwdlcH4CSeWOWYD1dSiTTm4yjTcKCPM1xibUiEsR/NGo6iFQasUhaLBITF56xMjCFHlNCGgdZ6zI2UYAqASe20r3hjuIJnPpWzP8q2aCv6htJq7FRuBET5sWTteJA7V3UYWsZo0g+nFwPlN5vGV2pzt30Sbo7mcXQO0mKXfI6nD2wTxcxVjkm0Zh6dxzyQ5Laq3OUxdCwmmhLppt1HTkm5VFSh3Y3+dwMARNTpOplevJalF8g== 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=FwcdOztjSz00QX2aKUocDnSSeb//2DkuyFlFOYnZiZk=; b=Ntg9WfB2ehd3n3cqGuro+AT9Peh7BURockb1GfQV4nkvU1nZTC16pEucmob2lJFAW3ELTMpqPssNMWclusVMCWikNtOgM+uC2mbpIXAZrGmMo/nU1hItOGq+Voo9AbPGE5nztePNuhhSCAjedwbZyMKUQgv7HFOM4C7ibyz05vLNn+aGflJaBYmLn7uB963M/7O2ueHoPZEKWVNHRP41QFS0Sl/uG0WoHkZ5hAQanX1bjOP69JpWeZSU3jwhoCwdOtr09fNgaZm0XU8iQlyLuduvOjw3lLTDkj5g0xezHg5poj4KgB9u9wHoCfXwPdBRvcI2CVI4XVKHYkWAQaPoZg== 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=FwcdOztjSz00QX2aKUocDnSSeb//2DkuyFlFOYnZiZk=; b=GoEJ84OaU33RqOT8/h+H1SvH311X9ox+3UfzKEe7bGP96eC3HBnX/GOdL/quVL3zsW1VhKSoCF6BFf54Oe90KexBheBdvDnLXid4zJ1Z1g4SXVXAVO9EU4cqL1+vvAo3/t5GfT1xs57dL5ZHHIN3HqZlow8bnVlZWqzH2/z28sI= 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:38:50 +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:38:49 +0000 Message-ID: <87bk27ztuu.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 045/113] ASoC: adi: 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:38:49 +0000 X-ClientProxiedBy: TYCP286CA0242.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:456::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 3484fce0-ddfb-4035-72b5-08dcb4e6f950 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: dlbtg7tntTFhO2ag3CFKD1Tei6GkTpwXXATKnAo1GD1g2hUmx9hChy5+hO/iMmnihnnQKzXjSW+W0tX8A4DxtA/r3xPwAbIbBhsufUTGALQztMYDyzVVfEDopFz7kDe4OGrCNgjZml63mm9HTR4xOGpxDT7XQ2JCSiBBsJx5JpzSu8tkB6bDMYZHa8wSsC6vcblGwljdWoskklQfy3We+8NSb9aMb77bO0obNuUF7eArM67C+BFHnFIeU5a/zEDON4TUDiXMkbCFJ8Kx5kL4LveeiwbC+bEe/x3qtm2ro65mjLD5m7/39KXgpKiNBXXdqfI3B2UpatjWrgo3LiPgqaT4k8bWVH7EiIeixtkVbCX+1qgaRkiFeYX08O93eOr40gSeQqsmSgmMg88nVrZSbRCX9WTkQgZNUQhdJN8rfvfrGfhOS/2C9YgowxG4UAQEx/+vXNH88rMB+YKWUttzMfDcEO/dYw3aUpZUEA6J22ceYaQm7/qcfx220PSH6VJT5CPCdGU/UtVRRJORBUDZZ7o9r3OgAaCZ8PGQwO4kUNwXPxoRstkVO5c83l19nTXA7CD39K4jVw6Lxg05zh+XrxMqCOODvB6OvQuNnkBVgAPD19mN7pPIjqeInyVuSb7+HGxW2Y8EtQFDcov0QDGM6MrvnSKlyazE8/eXLAaTqRdzD1xXAsnxpkYpVDyGGZGfXbNrS0t1WUnhZVA8vjzkfp0GNoTo6a5NW9GsfLwvTcq5/3bR3C8yzisnJyediXTltm7YQl17I++T06C7qMXo6jtskCi13ULr3u385A6oz2ZnbGwden4ecwK+D3xiQkEvqYaSK9NTa33WE7V4YReaULxQ3ia7K1nfpZ0HRfcmjrm3UqR4YqMoqCRQ340RRvgdF+g2nqDlU+aFKbzv0wpbda9UolZGtbOfHFDHNVVo6lREN/zZ9WgBaXGMg4D6/flSasfLqNRKEzpABeoXez2ve2KDylYAq3+l3Ns6zTPSXYhrQG9cUR7vlI8KuOVXiRIo0x51jHDf9+4106oaOKnVbcdQGs66BzmiLGXtX801CJpIn69y1aaWj/BC+19Wns7kRpA2K+aLCiBhrrOpe4QiSqGhk66ZueKl7ZoWR/sIxAvWrQtdUzfbJfBA9SPuWp/GRUIojP72fUGElEiQVMZ0O477ppef721oLyHKyh2QTMfacfZ7rlNw3I5PIJnhRo2dpDd8GdWB2a9R9Rh/z0yagjUQUxP/11L7/ycFZwYe058RxyPkiSu1kQBDABxoHJkTF7N5k4H1MvoFgXA3UTyRfrIDmYMHt2IwOhxEr3viuU/1lKw38dECD3KWO5BovmpbnzDIeZ6ou1c87gTTXtF4DQjJfRlHMLoe6LitM5cZzn3ETCKs0RIeqtWZLI51Ed5e2Ay0f84EkJKeE21cejfaCQ== 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-Exch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ASg6sQhFRAuZrG/ImG6SM7Uzf/5aauG48N9xTVXsDBM8clZZf4hs3X0Iik93ZzVquLtgHrJEiZ0gmP0RiGvJO5DweXU4NbI0asuPEeabT1lhW3cuP/92Hx191z1xCETimXtKHkDh+Kv02rvxHTLRrWxOlnWHvJ7Lww/uaTDP0DXhlai+XSJ+uAOYnonrTDfpGSPx8p8+968fa2XMaWWL86nL2rcCDS/0jvOdHsSJrDYw6FvTm/AufUX5TyWrgnH8pa1531zjIAv7rctPBJBX/oN4X0H1H9gSXqSEs3prLpXhY3iepT/LfZmfTQJBQzHSGkEMFl08RV3R4Kj50mDJ3+2Zzaxi9T2VRuqlDmCBINQQYtWa1c47jzSODgKg7ExoVvfYK8nfRPnEp81QP4iObNI5C+EIodTjwaGlaaxRkF5uZb9zJ28Y6rAHihNjY0kqnSK5qorzJw70bU/2VVwtVNxieazt2CBSWiCHZNshn8tOsuzNGEQaSdZcoWJm2hfFjzIIXpWYFOOH8Ea2V1cEHB1BAcx1kmBgExgrHone+CX2mONGl8cX5hgLf9rVrODrrl1cUeo0V9ArR+QoIiqQNeSpOjQaybCg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3484fce0-ddfb-4035-72b5-08dcb4e6f950 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:38:49.8912 (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: ZlHNmintQtfmFCJDXhwMTpvF1hAmB8ehMH5hCuu7Eg4yeL5kO6Mpd7454Erx/OxyYWupF5QPDNnT+FF5RhVVjV5HWKNdwnNOLxhMjJN5tQUfKhQUxi/rRWb1OUNvbiCL 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/adi/axi-i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/adi/axi-i2s.c b/sound/soc/adi/axi-i2s.c index 7b25630757436..7c950a7b71eec 100644 --- a/sound/soc/adi/axi-i2s.c +++ b/sound/soc/adi/axi-i2s.c @@ -60,7 +60,7 @@ static int axi_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct axi_i2s *i2s = snd_soc_dai_get_drvdata(dai); unsigned int mask, val; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mask = AXI_I2S_CTRL_RX_EN; else mask = AXI_I2S_CTRL_TX_EN; @@ -110,7 +110,7 @@ static int axi_i2s_startup(struct snd_pcm_substream *substream, uint32_t mask; int ret; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mask = AXI_I2S_RESET_RX_FIFO; else mask = AXI_I2S_RESET_TX_FIFO; From patchwork Mon Aug 5 00:38:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816969 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011045.outbound.protection.outlook.com [52.101.125.45]) (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 0DBCCB64C for ; Mon, 5 Aug 2024 00:39:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818344; cv=fail; b=SkrUu/hT6RxESEHNf11xYGbvjlGyqAdREh/wdGpuIJmhB+fmw50SrGcG3/pyf/OGTpfBIIO3HfENiTpocCxc/6PtQBsA7jRT19tpcKnoD4I/lHM0BMmo5kNEYfNev1x6AM1WWKN2wBkyzex5N/m6hty353SieGVfc5brmvG1ozc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818344; c=relaxed/simple; bh=lHHTxCnS9bTf3K9AdSEqvIbgw20Dgp3DPBVMxGIxFUk=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=X0/zHlFq2oCU68BN6I1i5RMWjV6BFb4j07emkgRq1RTSJTgkFBTH4B9srIv66ggR9VTqdFRs+ZrNqfQjFBx2D4k+nFebQyhtOwuFZc90QSfMNrtcXzdn3ngH8Pgkwms9kfa5rLy3mzouvgW2LZqXXdgXONMjwSeu8zZVXQ4Klf8= 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=RNYyF1xn; arc=fail smtp.client-ip=52.101.125.45 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="RNYyF1xn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yEBsiIY8FpZvv+1Ff4KuE5JI07HOSc6isb8PRMaLbv0zax6uNHnAS3L/lQCTnIx69dq814QvWN8TO8igcA2dhSsZYs6RnAfK0pqoanRw1DW8SPv2rDX4ubqLL/LP9mi6RWcqAmmyTcvLPoMiS7dgMpYBAhhTh4Ne+UFYPUZbi0vK4QfoKsweZeDWqNP2iWiZ+hYj3q0Att0BmyRWZmsIYfjMhwpuGFNiw+cZnmzV7BLv40GsKYXvaG82E2ujw968LWdCWov/NcpGQVn6GQcImjqdt8DPid5ScSbig0KP+rW2R3IqhNryci+O+07hUAjSA5iDQty6ZtomUqMTWRWVMw== 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=5Lej+1Z+Zoj2ID9gW3Ofwd6ys/YEwEu+ljlQzCJ4DCE=; b=mguBjebz9thcw0kBq7LVCfktASvHJtJ117+e2xlWSe4V+EhJ318qe5z1nxxRBvAB02ieiDy5tIoz9MFEpWTAP0foKeH7n+HyNuZJbOAM7icKhXlppmgy3fcQPRzlIRt6s0Ps0ve21w3BgaE+tuRwD8avTm9nTfjgHCmutUI18463vlBTYXIeCq4K+q6QfPWtEGLHiN8JXWZzDfI2mhLL2Be735HT6NUmiS8yTNO971zQq4ICVM7+FaVAjLFAbJdaYG/DJvwHQM22hlUO7f7ZexOqGjP56JvKHy0XxTXY/9bmzgmsr02FKy/ZQqNPSOUlYZ3ok49IjXy6Bnv9XgIQIA== 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=5Lej+1Z+Zoj2ID9gW3Ofwd6ys/YEwEu+ljlQzCJ4DCE=; b=RNYyF1xnypzj1ZT+dRHNy3JzxKTaxUjKO2VxfO/7vAEw0QbvOIXvibZ1RXqCOBCqpmeNKbEO9SRRXq3sJVNaLp8Wy9J9ZBoc+KCqmHZzl6+qz2rX4KGPhaHeppGfJZ0Z5vrp4UNarVq0KTf+lxxGdja54kaOsDe43M4LF05WHdk= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::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:38:58 +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:38:58 +0000 Message-ID: <878qxbztul.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 047/113] ASoC: bcm: 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:38:58 +0000 X-ClientProxiedBy: TYAPR01CA0181.jpnprd01.prod.outlook.com (2603:1096:404:ba::25) 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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 755d8321-a599-4951-b0ae-08dcb4e6feaa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116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LQYSN2Pw94exulxmi0+Cp/IsaOQ7ZchyAK5DtqYoSpQAzvZD1vuyVfHceQ0J6K0wq5bGZvjqfxS1fkSrLqMgUKLiJkAlAO46rBTf3LupZIachX90PXpAz26IqcL12P7WU+xOkHs9RtNJfavBaIXVhw0TrXaEjPZ7oNWNr+4wUzTi/lEe2DZqe9KRLt7r+f5uW5CTBQNJkcerAe5hArOkkD3DqJTLadbYx64npq0VuGaRdFAk/gd+n8UUKG6jE8w+GsTrk6ZDaeHZhYfWH4LzKwZNbldNnUI+jwCin7QzA+QBEGL2H0oHtg0Ps/ErB8fC0Gq3TAYMODTyYIl/W4RchSMtjouXJc1c07Udpxxlag== 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: w0BP9eG5++J/Qew6uUJMVTJ67e1a7L6OuBnNy3U9DTrG5nUUdOQQvCgMdSy8lymNBgl4ki9b2E8JQ9DLHVK67xHgUxPPh0FCBA+5QbGOVgMomx2eDuS5w8JpYXbaGLXsGzcQWkoP93CMxs6s18d+aOV7MrKaDzi8WPA5+UxcgRqLzPftZlVan9mIFNP6xc8mR2YM4ItO/Vv1bkOEFRJDfTGUCkkl7/tnDaiW2ETSaraHUIdGmMGb2JIsKRff9CJzXwOvuNqNlSY+npJ+VTIXWySonCgwQ7FYBQuCtYhdumHHZR8sM1Kz2Xo9y8hDWv2Rf01sangJbqmYepRQpFyorTFgAE2+emlARnkDNMpjDanJRR0geRkb4xqdVB/xfDFoxVSwtgy2MDNARGvu71wb0Nd6UTmDiEw8NlYMxIAu6PyFHcQM0r6Z9TZUkM4VcBcblybNZCdbOLXJltFeTx4+oi+wytVbaKaL850P2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oBrj1W83thDy2adJnCwDaqUiMDGsmjhalsGxi5N/UdBNKxcO+9KYDsIErJO1hCQJxddHf2vGIlJCMo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 755d8321-a599-4951-b0ae-08dcb4e6feaa 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:38:58.8692 (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: 1ndOELl2kE5t7VMfbBdr9Admgk6FWLk/iJ3PveDpHsYfVcxip89S1KI3blWYZVG6FGOQk/six5u+aLT7Ibg0ovCwKO6zsxDCIOnifKTSeb8RcgyER64CHfBQ8EB2EF0h X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/bcm/bcm2835-i2s.c | 8 ++++---- sound/soc/bcm/bcm63xx-i2s-whistler.c | 4 ++-- sound/soc/bcm/bcm63xx-pcm-whistler.c | 4 ++-- sound/soc/bcm/cygnus-pcm.c | 18 +++++++++--------- sound/soc/bcm/cygnus-ssp.c | 12 ++++++------ 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c index 9bda6499e66e1..54fcf85a1158c 100644 --- a/sound/soc/bcm/bcm2835-i2s.c +++ b/sound/soc/bcm/bcm2835-i2s.c @@ -628,10 +628,10 @@ static int bcm2835_i2s_prepare(struct snd_pcm_substream *substream, */ regmap_read(dev->i2s_regmap, BCM2835_I2S_CS_A_REG, &cs_reg); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK + if (snd_pcm_is_playback(substream) && !(cs_reg & BCM2835_I2S_TXE)) bcm2835_i2s_clear_fifos(dev, true, false); - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE + else if (snd_pcm_is_capture(substream) && (cs_reg & BCM2835_I2S_RXD)) bcm2835_i2s_clear_fifos(dev, false, true); @@ -644,7 +644,7 @@ static void bcm2835_i2s_stop(struct bcm2835_i2s_dev *dev, { uint32_t mask; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mask = BCM2835_I2S_RXON; else mask = BCM2835_I2S_TXON; @@ -669,7 +669,7 @@ static int bcm2835_i2s_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: bcm2835_i2s_start_clock(dev); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mask = BCM2835_I2S_RXON; else mask = BCM2835_I2S_TXON; diff --git a/sound/soc/bcm/bcm63xx-i2s-whistler.c b/sound/soc/bcm/bcm63xx-i2s-whistler.c index c64609718738b..0980e35d12830 100644 --- a/sound/soc/bcm/bcm63xx-i2s-whistler.c +++ b/sound/soc/bcm/bcm63xx-i2s-whistler.c @@ -93,7 +93,7 @@ static int bcm63xx_i2s_startup(struct snd_pcm_substream *substream, struct bcm_i2s_priv *i2s_priv = snd_soc_dai_get_drvdata(dai); struct regmap *regmap_i2s = i2s_priv->regmap_i2s; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(regmap_i2s, I2S_TX_CFG, I2S_TX_OUT_R | I2S_TX_DATA_ALIGNMENT | I2S_TX_DATA_ENABLE | I2S_TX_CLOCK_ENABLE, @@ -146,7 +146,7 @@ static void bcm63xx_i2s_shutdown(struct snd_pcm_substream *substream, struct bcm_i2s_priv *i2s_priv = snd_soc_dai_get_drvdata(dai); struct regmap *regmap_i2s = i2s_priv->regmap_i2s; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(regmap_i2s, I2S_TX_CFG, I2S_TX_OUT_R | I2S_TX_DATA_ALIGNMENT | I2S_TX_DATA_ENABLE | I2S_TX_CLOCK_ENABLE, 0); diff --git a/sound/soc/bcm/bcm63xx-pcm-whistler.c b/sound/soc/bcm/bcm63xx-pcm-whistler.c index 018f2372e892c..e8542b2009f63 100644 --- a/sound/soc/bcm/bcm63xx-pcm-whistler.c +++ b/sound/soc/bcm/bcm63xx-pcm-whistler.c @@ -81,7 +81,7 @@ static int bcm63xx_pcm_trigger(struct snd_soc_component *component, i2s_priv = dev_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)->dev); regmap_i2s = i2s_priv->regmap_i2s; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (cmd) { case SNDRV_PCM_TRIGGER_START: regmap_update_bits(regmap_i2s, @@ -153,7 +153,7 @@ static int bcm63xx_pcm_prepare(struct snd_soc_component *component, dma_desc->dma_addr = runtime->dma_addr; dma_desc->dma_area = runtime->dma_area; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regaddr_desclen = I2S_TX_DESC_IFF_LEN; regaddr_descaddr = I2S_TX_DESC_IFF_ADDR; } else { diff --git a/sound/soc/bcm/cygnus-pcm.c b/sound/soc/bcm/cygnus-pcm.c index 2d1e241d83673..3dc204d0a34c6 100644 --- a/sound/soc/bcm/cygnus-pcm.c +++ b/sound/soc/bcm/cygnus-pcm.c @@ -252,7 +252,7 @@ static int configure_ringbuf_regs(struct snd_pcm_substream *substream) aio = cygnus_dai_get_dma_data(substream); /* Map the ssp portnum to a set of ring buffers. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { p_rbuf = &aio->play_rb_regs; switch (aio->portnum) { @@ -299,7 +299,7 @@ static struct ringbuf_regs *get_ringbuf(struct snd_pcm_substream *substream) aio = cygnus_dai_get_dma_data(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) p_rbuf = &aio->play_rb_regs; else p_rbuf = &aio->capture_rb_regs; @@ -317,7 +317,7 @@ static void enable_intr(struct snd_pcm_substream *substream) /* The port number maps to the bit position to be cleared */ clear_mask = BIT(aio->portnum); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* Clear interrupt status before enabling them */ writel(clear_mask, aio->cygaud->audio + ESR0_STATUS_CLR_OFFSET); writel(clear_mask, aio->cygaud->audio + ESR1_STATUS_CLR_OFFSET); @@ -354,7 +354,7 @@ static void disable_intr(struct snd_pcm_substream *substream) /* The port number maps to the bit position to be set */ set_mask = BIT(aio->portnum); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* Mask the interrupts of the given port*/ writel(set_mask, aio->cygaud->audio + ESR0_MASK_SET_OFFSET); writel(set_mask, aio->cygaud->audio + ESR1_MASK_SET_OFFSET); @@ -404,7 +404,7 @@ static void cygnus_pcm_period_elapsed(struct snd_pcm_substream *substream) */ snd_pcm_period_elapsed(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* Set the ring buffer to full */ regval = readl(aio->cygaud->audio + p_rbuf->rdaddr); regval = regval ^ BIT(31); @@ -597,7 +597,7 @@ static int cygnus_pcm_open(struct snd_soc_component *component, * Keep track of which substream belongs to which port. * This info is needed by snd_pcm_period_elapsed() in irq_handler */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) aio->play_stream = substream; else aio->capture_stream = substream; @@ -615,7 +615,7 @@ static int cygnus_pcm_close(struct snd_soc_component *component, dev_dbg(snd_soc_rtd_to_cpu(rtd, 0)->dev, "%s port %d\n", __func__, aio->portnum); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) aio->play_stream = NULL; else aio->capture_stream = NULL; @@ -652,7 +652,7 @@ static int cygnus_pcm_prepare(struct snd_soc_component *component, start = runtime->dma_addr; - is_play = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 1 : 0; + is_play = snd_pcm_is_playback(substream); ringbuf_set_initial(aio->cygaud->audio, p_rbuf, is_play, start, periodsize, bufsize); @@ -674,7 +674,7 @@ static snd_pcm_uframes_t cygnus_pcm_pointer(struct snd_soc_component *component, * index (for capture). Report this value back to the asoc framework. */ p_rbuf = get_ringbuf(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) cur = readl(aio->cygaud->audio + p_rbuf->rdaddr); else cur = readl(aio->cygaud->audio + p_rbuf->wraddr); diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c index 90088516fed01..73c231f5c1ed8 100644 --- a/sound/soc/bcm/cygnus-ssp.c +++ b/sound/soc/bcm/cygnus-ssp.c @@ -642,7 +642,7 @@ static int cygnus_ssp_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { value = readl(aio->cygaud->audio + aio->regs.bf_sourcech_cfg); value &= ~BIT(BF_SRC_CFGX_BUFFER_PAIR_ENABLE); value &= ~BIT(BF_SRC_CFGX_SAMPLE_CH_MODE); @@ -736,7 +736,7 @@ static int cygnus_ssp_startup(struct snd_pcm_substream *substream, struct cygnus_aio_port *aio = cygnus_dai_get_portinfo(dai); snd_soc_dai_set_dma_data(dai, substream, aio); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) aio->clk_trace.play_en = true; else aio->clk_trace.cap_en = true; @@ -754,7 +754,7 @@ static void cygnus_ssp_shutdown(struct snd_pcm_substream *substream, { struct cygnus_aio_port *aio = cygnus_dai_get_portinfo(dai); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) aio->clk_trace.play_en = false; else aio->clk_trace.cap_en = false; @@ -770,7 +770,7 @@ static void cygnus_ssp_shutdown(struct snd_pcm_substream *substream, return; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (aio->clk_trace.play_clk_en) { clk_disable_unprepare(aio->cygaud-> audio_clk[val]); @@ -932,7 +932,7 @@ static int cygnus_ssp_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)) audio_ssp_out_enable(aio); else audio_ssp_in_enable(aio); @@ -943,7 +943,7 @@ static int cygnus_ssp_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)) audio_ssp_out_disable(aio); else audio_ssp_in_disable(aio); From patchwork Mon Aug 5 00:39:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816968 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011021.outbound.protection.outlook.com [52.101.125.21]) (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 53AE7C148 for ; Mon, 5 Aug 2024 00:39:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.21 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818354; cv=fail; b=ah4AcYfYrvq93BaZGqWHutKDkTXNf3wXL/Rd/VTkNGy+NLMP9AI7FkNAMMHay5RnxcKqgkF8jof0b0wSIXKsS5+VgmdlT8MFfh18CXjo3K6Z86ksOD/p4/wTQ1OnUGgYcy5w/rBvnRcidusO5jVpXJkf7fxrGxFTR5IEmVh3zSU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818354; c=relaxed/simple; bh=AEYQUOgiS5yuT+dBqJNW/fvf2fI9wTxUFOXKEwt/mzk=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=iE979F6J0Lcnv4nYfudM06t/tDL2kSLYPZARCcTknKHSWU4gW/VUoemxgtOb+rm4rogmRwP6DaJKxWqJS1zAK2IxHCPkt9g1NvxvllpZKAkeRbPTEqiLuQvoC5sg/8PYUntkFJTFyrfRZ2x+S8qtzPPl67pgG2S540iEYeQKRos= 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=UztbJTu4; arc=fail smtp.client-ip=52.101.125.21 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="UztbJTu4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xrq7aWdyE5CGPTjjte8GgaUvtlXWxwCFCkHxi2ibglleeGVOcR4okhroid7By4DZMZE9GCGBmOCqqsuOGRjnvgQCiGsERtpC6BPn/GS6JFkVJPjAUZ35JowXQWiU/ZpnRI/bdJNxEEOU74cI7A3E1JfFwI79SHsLZJcgOe2aL9B4ZAE2LUCD5M/5Td2jlYklX7nen8w0pzL4K0Hu6hWNsNQUTSuUTXpjKhNVmJeiV7k37HSIbJLroH7eRHGEwhEh9GRvo1fjAds+3Tn7C66RP410F296sLJzpl1XFpamIAmT7/Rjbt9tXU7XwKvHKKsfbHoN8ClJk8J6t2zkPID9ew== 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=8NXzQS+bnHre3ul5uJipiQYpp/sXDiGAFdpM9yOOK8E=; b=EjjLWI0qrq09lwKqs5A2T6h7+Yk1Ao8tUNGgXNXRnSc5wTq39JonSGFDlgS08b4GtYdpCNIkb8BnsCQ5807lsgK4L48c4/r9zvfunV5fTbdrqWNWxo32uu4p8ojg/hP/YrCHRTr8fyU2IO6so/ydS8Nyw9JuhF794dAwXWWe6H5IgJbm6jpaOKiBRQit3UfdfanemmjOsnKmxwEaCz5Bpcm2xvKks0Cw0y1J3WnAQeWF0CRKgsJxNvmydo3oJ6oq1C2kLBUobE/0xAhCOMnYnVrG2a/+vM0ba4znWLpFxdlNkdk1XmoXeHGQPAXmKXnadF1EQzL0kkWXp3/Mi/X+PA== 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=8NXzQS+bnHre3ul5uJipiQYpp/sXDiGAFdpM9yOOK8E=; b=UztbJTu4MmIo8CCyr3HwyCjuwwKobyKptVmWo2wph1PWf5pP2l4FRbUnOiHXBWPsnlK/kMmzTEGTV26kDVdB53YDxQc2X30kFdtHwrI2v1KKwDcqH2keXzYbG1Q+N5kqCx1Kj/4RgalHF2+A/Sul348PtAjYcRGxdW8+h3lChmE= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::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:39:08 +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:39:08 +0000 Message-ID: <875xsfztub.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 049/113] ASoC: fsl: 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:39:08 +0000 X-ClientProxiedBy: TYCP286CA0115.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:29c::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 0106e995-1011-4c9b-899c-08dcb4e704a3 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: NUUKWmhMkFK8eOBmS/7Nzm8iqcx5oFDwmc2vSdDCe4/47NlpBpsjKEz4iZg+GpgIObrLpddJeIOnMgytm9bdhL6KSk2X0KSX1sVX4OXWcxpTEeIFyvgZAK4wL4BJD/XiBhO0THZPlNvddr2kZoWG5mq0CBABqXg3ISnaoBxhwBE/hSaaztDQBiTvWr+18YUm+Wd0yVD9S58Gos91voyQzChVLOvObIM51DgA33sV8t9TPJsYj66SmKxt/iqquC5Xd6N4ujtjJjxasBOkSvdH1rPTMouyF+GvbDKkJtNsiqH8M2XqKclGGv/7s7LilEAiETtyH6F74DnorY5rRjDzzoS8Gtu9JleN67qmt/gX5ne0yyB+jZIMUss8AgMVADvkhtNtLKvEa1Y2wnxyw042vco8EMRalNGBaEH1BttTNWLvjty7hQEsmriyVlg95jnDxENFxync2e90wd9kuDlYLayQKKdm7ksNu2va3rY/zGf1gJbq64Y0Knwol66Gwh0idH0Q1XcDP8NXdXRm6P0gYyrRQcV6viQ9d421yT24YzkraeDEYHoVB9cuQZ7kLPEaat/MWkySAq3yVsrnPi7FzPcq40G2Kp+eD87wu26DjxljSCx57hK9xmMk8aWmg4BwdfR3fWpMtI3zl3tgcOTAIeHUJ6zJRQBNUg2BUUj8sNs4isHq8un0F8fGCa30Y8rLWOq+zAvPHxm69SL3HbHurFdyq1niX92Q+YoMQXTfSFt4m+jXHGyy8GC0AgcemAgV1VqnIgp1Vdo4mhjH+vWu/jwL5ZQE1fBmTi4bpIsDXVa8W9EOD2y9t+3xo55ZBwg4jlIkVgT0hARj1QJqD1BIraaIg/3Kq1kGTwwsq2nSlmYJC/g1bPJPc+IUtVZRFuAAngr0oGh96KD7i0dvfCLhebk9dcyU45YkxboErzj8Rnq6CwBszPA6NJLHY8xIxJ8bXamTFoSW64NCz8s366U8BsPlImyAAHXiJClcQxlI2NyTYi8YYjvpyWnH4OMPc0Y/CYCPRXsEeSQTiTDlA4E/RyVXn5/u+83y8LOoRXJKSQE9QpUmJFOEK0sMinXJBmC3ZYYKDXHhKRu54EwNOHGSeSCa5NaFdh+c/y+XHW1zTrBGxQvCc+Jg3xC8LNUZcy38jEHzQvkPPQCSVVahhRw3aCSlARV4MPd9ez6J+8z3eMQowFJslOpxwH9atDJ6172IVLYSJm/2ZnvqqGBJeFxG+D4fgxuf3BlNynxf35CBJ5fK+6yiC9P/05JKIgKRqWJtKWgMhYXVUP2UxxJi5+ZECiAU9bxfqSozRPZoxZ8cWS28GSczBqf820trH+YwxICoVrCPGqFVLM6zcw/G7iY3pmOP604Z4hXjzr+b0fPcJqfSWgxZIOVM/sbGuKaUfZxp8rLhTdpTH52ydfafQFlKPg== 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: zvUMPAygg8e/ZVOGgMjlDT1Abj2TCqsPxxhTXJlrGYhENwkifb+rdXykoRe84BO5MIJ7e1E2CgTZ8pg0EcguYXohO19kZ2XI1mrQH+KU9zSGdSK2CYCwkS0GqwUbYohl2n+R+wQwgwoab3Sb7JmZtzj6IvrSuOpZGSAXM1aV0+lgwK3pa6HCscXwxTk38x/yJMimLi/3S8Pq/m6tHfpnM0lhgr2txVCWqOUFIW3046MadfahjClNAAPPskHegtiUOolNGU7gejfXsh4OzW/IOYqKwtxbmwKgzDWPoLRYfnLBAocJTb+fhCGpx4sJEyUfACDWfpPnIHXp1+ffE6WpMpqGicgkHk9r0WR/8qopWmC4LRBMO7RWS+sKWsZI2BTzVhcppZ0Bl1AbbU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XCfmmHUMOPhkpu/b+hJkXyJTV/LCKyJAvAUmDffKOGvHuqh0loqP3wo34X4qebkbgkESwSznlE1AFcLyE4Y5e0xBf2tOpM1e/UrhfitQkilZNoAqL5qkYtD/OYdoWBryzMlDHLlbxPDUGUv0DND2vDVaBWi0nP6n+WOfAw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0106e995-1011-4c9b-899c-08dcb4e704a3 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:39:08.8920 (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: FOXmqjkN2OydSOk2wCSh4kUqIHXRC9QCQcPOJsi/Bk/8kjYbftmSQgY2vT5weHR4VVYXiQSXUQbWm5b/6WomXKgeJZofmbCL4HJNOa0E2vMdI3VUBCsH3sTS76rfgn/z X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/fsl/fsl-asoc-card.c | 2 +- sound/soc/fsl/fsl_asrc.c | 2 +- sound/soc/fsl/fsl_asrc_dma.c | 8 ++++---- sound/soc/fsl/fsl_audmix.c | 2 +- sound/soc/fsl/fsl_dma.c | 10 +++++----- sound/soc/fsl/fsl_easrc.c | 2 +- sound/soc/fsl/fsl_esai.c | 4 ++-- sound/soc/fsl/fsl_qmc_audio.c | 10 +++++----- sound/soc/fsl/fsl_sai.c | 8 ++++---- sound/soc/fsl/fsl_spdif.c | 8 ++++---- sound/soc/fsl/fsl_ssi.c | 6 +++--- sound/soc/fsl/fsl_xcvr.c | 8 ++++---- sound/soc/fsl/imx-audmix.c | 4 ++-- sound/soc/fsl/imx-hdmi.c | 2 +- sound/soc/fsl/imx-pcm-fiq.c | 8 ++++---- sound/soc/fsl/imx-pcm-rpmsg.c | 24 ++++++++++++------------ sound/soc/fsl/lpc3xxx-i2s.c | 10 +++++----- sound/soc/fsl/mpc5200_dma.c | 10 +++++----- sound/soc/fsl/mpc5200_dma.h | 2 +- sound/soc/fsl/mpc5200_psc_ac97.c | 2 +- 20 files changed, 66 insertions(+), 66 deletions(-) diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index f6c3aeff0d8ea..29f32bf65c19f 100644 --- a/sound/soc/fsl/fsl-asoc-card.c +++ b/sound/soc/fsl/fsl-asoc-card.c @@ -171,7 +171,7 @@ static int fsl_asoc_card_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct fsl_asoc_card_priv *priv = snd_soc_card_get_drvdata(rtd->card); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct codec_priv *codec_priv; struct snd_soc_dai *codec_dai; struct cpu_priv *cpu_priv = &priv->cpu_priv; diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index b793263291dc8..42d08db984e17 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -719,7 +719,7 @@ static int fsl_asrc_dai_hw_params(struct snd_pcm_substream *substream, config.pair = pair->index; config.channel_num = channels; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { config.input_format = params_format(params); config.output_format = asrc->asrc_format; config.input_sample_rate = rate; diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c index f501f47242fb0..abde5badf8383 100644 --- a/sound/soc/fsl/fsl_asrc_dma.c +++ b/sound/soc/fsl/fsl_asrc_dma.c @@ -55,7 +55,7 @@ static void fsl_asrc_dma_complete(void *arg) static int fsl_asrc_dma_prepare_and_submit(struct snd_pcm_substream *substream, struct snd_soc_component *component) { - u8 dir = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? OUT : IN; + u8 dir = snd_pcm_is_playback(substream) ? OUT : IN; struct snd_pcm_runtime *runtime = substream->runtime; struct fsl_asrc_pair *pair = runtime->private_data; struct device *dev = component->dev; @@ -131,7 +131,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component, enum dma_slave_buswidth buswidth = DMA_SLAVE_BUSWIDTH_2_BYTES; enum sdma_peripheral_type be_peripheral_type = IMX_DMATYPE_SSI; struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct snd_dmaengine_dai_dma_data *dma_params_fe = NULL; struct snd_dmaengine_dai_dma_data *dma_params_be = NULL; struct snd_pcm_runtime *runtime = substream->runtime; @@ -308,7 +308,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component, static int fsl_asrc_dma_hw_free(struct snd_soc_component *component, struct snd_pcm_substream *substream) { - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct fsl_asrc_pair *pair = runtime->private_data; u8 dir = tx ? OUT : IN; @@ -329,7 +329,7 @@ static int fsl_asrc_dma_hw_free(struct snd_soc_component *component, static int fsl_asrc_dma_startup(struct snd_soc_component *component, struct snd_pcm_substream *substream) { - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct snd_pcm_runtime *runtime = substream->runtime; struct snd_dmaengine_dai_dma_data *dma_data; diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c index 1671a3037c604..1ee3f8f919695 100644 --- a/sound/soc/fsl/fsl_audmix.c +++ b/sound/soc/fsl/fsl_audmix.c @@ -283,7 +283,7 @@ static int fsl_audmix_dai_trigger(struct snd_pcm_substream *substream, int cmd, unsigned long lock_flags; /* Capture stream shall not be handled */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return 0; switch (cmd) { diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index c4bc9395dff7d..6754ea7372da0 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c @@ -166,7 +166,7 @@ static void fsl_dma_update_pointers(struct fsl_dma_private *dma_private) * system, we also need to update the ESAD bits. We also set (keep) the * snoop bits. See the comments in fsl_dma_hw_params() about snooping. */ - if (dma_private->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dma_private->substream)) { link->source_addr = cpu_to_be32(dma_private->dma_buf_next); #ifdef CONFIG_PHYS_64BIT link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP | @@ -395,7 +395,7 @@ static int fsl_dma_open(struct snd_soc_component *component, dev_err(dev, "can't allocate dma private data\n"); return -ENOMEM; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_private->ssi_sxx_phys = dma->ssi_stx_phys; else dma_private->ssi_sxx_phys = dma->ssi_srx_phys; @@ -473,7 +473,7 @@ static int fsl_dma_open(struct snd_soc_component *component, /* For playback, we want the destination address to be held. For capture, set the source address to be held. */ - mr |= (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + mr |= (snd_pcm_is_playback(substream)) ? CCSR_DMA_MR_DAHE : CCSR_DMA_MR_SAHE; out_be32(&dma_channel->mr, mr); @@ -633,7 +633,7 @@ static int fsl_dma_hw_params(struct snd_soc_component *component, * get more performance by not snooping, and you'll still be * okay. You'll need to update fsl_dma_update_pointers() also. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { link->source_addr = cpu_to_be32(temp_addr); link->source_attr = cpu_to_be32(CCSR_DMA_ATR_SNOOP | upper_32_bits(temp_addr)); @@ -683,7 +683,7 @@ static snd_pcm_uframes_t fsl_dma_pointer(struct snd_soc_component *component, * only have 32-bit DMA addresses. This function is typically called * in interrupt context, so we need to optimize it. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { position = in_be32(&dma_channel->sar); #ifdef CONFIG_PHYS_64BIT position |= (u64)(in_be32(&dma_channel->satr) & diff --git a/sound/soc/fsl/fsl_easrc.c b/sound/soc/fsl/fsl_easrc.c index 962f309120918..ba577bd9ab477 100644 --- a/sound/soc/fsl/fsl_easrc.c +++ b/sound/soc/fsl/fsl_easrc.c @@ -1461,7 +1461,7 @@ static int fsl_easrc_hw_params(struct snd_pcm_substream *substream, * Set the input and output ratio so we can compute * the resampling ratio in RS_LOW/HIGH */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ctx_priv->in_params.sample_rate = rate; ctx_priv->in_params.sample_format = format; ctx_priv->out_params.sample_rate = easrc->asrc_rate; diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index d0d8a01da9bdd..000abee37d0da 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -537,7 +537,7 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); u32 width = params_width(params); u32 channels = params_channels(params); u32 pins = DIV_ROUND_UP(channels, esai_priv->slots); @@ -758,7 +758,7 @@ static int fsl_esai_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned long lock_flags; esai_priv->channels[tx] = substream->runtime->channels; diff --git a/sound/soc/fsl/fsl_qmc_audio.c b/sound/soc/fsl/fsl_qmc_audio.c index 8668abd352080..bc7eef100c8ad 100644 --- a/sound/soc/fsl/fsl_qmc_audio.c +++ b/sound/soc/fsl/fsl_qmc_audio.c @@ -250,7 +250,7 @@ static int qmc_audio_pcm_trigger(struct snd_soc_component *component, switch (cmd) { case SNDRV_PCM_TRIGGER_START: bitmap_zero(prtd->chans_pending, 64); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { for (i = 0; i < prtd->channels; i++) prtd->qmc_dai->chans[i].prtd_tx = prtd; @@ -513,7 +513,7 @@ static int qmc_dai_constraints_interleaved(struct snd_pcm_substream *substream, u64 access; int ret; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { hw_rule_channels_by_format = qmc_dai_hw_rule_capture_channels_by_format; hw_rule_format_by_channels = qmc_dai_hw_rule_capture_format_by_channels; frame_bits = qmc_dai->nb_rx_ts * 8; @@ -566,7 +566,7 @@ static int qmc_dai_constraints_noninterleaved(struct snd_pcm_substream *substrea u64 access; int ret; - frame_bits = (substream->stream == SNDRV_PCM_STREAM_CAPTURE) ? + frame_bits = snd_pcm_is_capture(substream) ? qmc_dai->nb_rx_ts * 8 : qmc_dai->nb_tx_ts * 8; ret = snd_pcm_hw_constraint_single(substream->runtime, SNDRV_PCM_HW_PARAM_FRAME_BITS, @@ -637,7 +637,7 @@ static int qmc_dai_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { chan_param.mode = QMC_TRANSPARENT; chan_param.transp.max_rx_buf_size = params_period_bytes(params) / nb_chans_used; for (i = 0; i < nb_chans_used; i++) { @@ -672,7 +672,7 @@ static int qmc_dai_trigger(struct snd_pcm_substream *substream, int cmd, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { direction = QMC_CHAN_WRITE; nb_chans_used = qmc_dai->nb_chans_used_tx; } else { diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index d03b0172b8ad2..c0bc992e22b5f 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -525,7 +525,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); unsigned int ofs = sai->soc_data->reg_offset; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned int channels = params_channels(params); struct snd_dmaengine_dai_dma_data *dma_params; struct fsl_sai_dl_cfg *dl_cfg = sai->dl_cfg; @@ -721,7 +721,7 @@ static int fsl_sai_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned int ofs = sai->soc_data->reg_offset; /* Clear xMR to avoid channel swap with mclk_with_tere enabled case */ @@ -783,7 +783,7 @@ static int fsl_sai_trigger(struct snd_pcm_substream *substream, int cmd, struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); unsigned int ofs = sai->soc_data->reg_offset; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); int adir = tx ? RX : TX; int dir = tx ? TX : RX; u32 xcsr; @@ -868,7 +868,7 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); int ret; /* diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index a63121c888e02..d860e54b1f5e6 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -622,7 +622,7 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream, regmap_update_bits(regmap, REG_SPDIF_SIE, 0xffffff, 0); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { scr = SCR_TXFIFO_AUTOSYNC | SCR_TXFIFO_CTRL_NORMAL | SCR_TXSEL_NORMAL | SCR_USRC_SEL_CHIP | SCR_TXFIFO_FSEL_IF8; @@ -650,7 +650,7 @@ static void fsl_spdif_shutdown(struct snd_pcm_substream *substream, struct regmap *regmap = spdif_priv->regmap; u32 scr, mask; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { scr = 0; mask = SCR_TXFIFO_AUTOSYNC_MASK | SCR_TXFIFO_CTRL_MASK | SCR_TXSEL_MASK | SCR_USRC_SEL_MASK | @@ -706,7 +706,7 @@ static int fsl_spdif_hw_params(struct snd_pcm_substream *substream, u32 sample_rate = params_rate(params); int ret = 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = spdif_reparent_rootclk(spdif_priv, sample_rate); if (ret) { dev_err(&pdev->dev, "%s: reparent root clk failed: %d\n", @@ -737,7 +737,7 @@ static int fsl_spdif_trigger(struct snd_pcm_substream *substream, struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct fsl_spdif_priv *spdif_priv = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); struct regmap *regmap = spdif_priv->regmap; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); u32 intr = SIE_INTR_FOR(tx); u32 dmaen = SCR_DMA_xX_EN(tx); diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 4ca3a16f7ac0d..ad02a9e0154ac 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -680,7 +680,7 @@ static int fsl_ssi_set_bclk(struct snd_pcm_substream *substream, struct snd_soc_dai *dai, struct snd_pcm_hw_params *hw_params) { - bool tx2, tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx2, tx = snd_pcm_is_playback(substream); struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(dai); struct regmap *regs = ssi->regs; u32 pm = 999, div2, psr, stccr, mask, afreq, factor, i; @@ -805,7 +805,7 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *hw_params, struct snd_soc_dai *dai) { - bool tx2, tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx2, tx = snd_pcm_is_playback(substream); struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(dai); struct fsl_ssi_regvals *vals = ssi->regvals; struct regmap *regs = ssi->regs; @@ -1109,7 +1109,7 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct fsl_ssi *ssi = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); switch (cmd) { case SNDRV_PCM_TRIGGER_START: diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c index bf9a4e90978ef..f89f778a0d89a 100644 --- a/sound/soc/fsl/fsl_xcvr.c +++ b/sound/soc/fsl/fsl_xcvr.c @@ -437,7 +437,7 @@ static int fsl_xcvr_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); u32 m_ctl = 0, v_ctl = 0; u32 r = substream->runtime->rate, ch = substream->runtime->channels; u32 fout = 32 * r * ch * 10; @@ -562,7 +562,7 @@ static int fsl_xcvr_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); int ret = 0; if (xcvr->streams & BIT(substream->stream)) { @@ -614,7 +614,7 @@ static void fsl_xcvr_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); u32 mask = 0, val = 0; int ret; @@ -662,7 +662,7 @@ static int fsl_xcvr_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct fsl_xcvr *xcvr = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); int ret; switch (cmd) { diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c index 6fbcf33fd0dea..8e03eadc33888 100644 --- a/sound/soc/fsl/imx-audmix.c +++ b/sound/soc/fsl/imx-audmix.c @@ -74,7 +74,7 @@ static int imx_audmix_fe_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct device *dev = rtd->card->dev; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned int fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF; u32 channels = params_channels(params); int ret, dir; @@ -113,7 +113,7 @@ static int imx_audmix_be_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct device *dev = rtd->card->dev; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned int fmt = SND_SOC_DAIFMT_DSP_A | SND_SOC_DAIFMT_NB_NF; int ret; diff --git a/sound/soc/fsl/imx-hdmi.c b/sound/soc/fsl/imx-hdmi.c index fe47b439a8183..b6ce395f91bbf 100644 --- a/sound/soc/fsl/imx-hdmi.c +++ b/sound/soc/fsl/imx-hdmi.c @@ -34,7 +34,7 @@ static int imx_hdmi_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct imx_hdmi_data *data = snd_soc_card_get_drvdata(rtd->card); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); struct snd_soc_dai *cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); struct snd_soc_card *card = rtd->card; struct device *dev = card->dev; diff --git a/sound/soc/fsl/imx-pcm-fiq.c b/sound/soc/fsl/imx-pcm-fiq.c index 3391430e42532..9005150012c15 100644 --- a/sound/soc/fsl/imx-pcm-fiq.c +++ b/sound/soc/fsl/imx-pcm-fiq.c @@ -53,7 +53,7 @@ static enum hrtimer_restart snd_hrtimer_callback(struct hrtimer *hrt) get_fiq_regs(®s); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) iprtd->offset = regs.ARM_r8 & 0xffff; else iprtd->offset = regs.ARM_r9 & 0xffff; @@ -93,7 +93,7 @@ static int snd_imx_pcm_prepare(struct snd_soc_component *component, struct pt_regs regs; get_fiq_regs(®s); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regs.ARM_r8 = (iprtd->period * iprtd->periods - 1) << 16; else regs.ARM_r9 = (iprtd->period * iprtd->periods - 1) << 16; @@ -115,7 +115,7 @@ static int snd_imx_pcm_trigger(struct snd_soc_component *component, 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)) atomic_set(&iprtd->playing, 1); else atomic_set(&iprtd->capturing, 1); @@ -127,7 +127,7 @@ static int snd_imx_pcm_trigger(struct snd_soc_component *component, 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)) atomic_set(&iprtd->playing, 0); else atomic_set(&iprtd->capturing, 0); diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c index b0944a07ab470..3653eed2d5bc9 100644 --- a/sound/soc/fsl/imx-pcm-rpmsg.c +++ b/sound/soc/fsl/imx-pcm-rpmsg.c @@ -142,7 +142,7 @@ static int imx_rpmsg_pcm_hw_params(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_HW_PARAM]; msg->s_msg.header.cmd = TX_HW_PARAM; } else { @@ -195,7 +195,7 @@ static snd_pcm_uframes_t imx_rpmsg_pcm_pointer(struct snd_soc_component *compone unsigned int pos = 0; int buffer_tail = 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; else msg = &info->msg[RX_PERIOD_DONE + MSG_TYPE_A_NUM]; @@ -214,7 +214,7 @@ static void imx_rpmsg_timer_callback(struct timer_list *t) struct rpmsg_info *info = stream_timer->info; struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; msg->s_msg.header.cmd = TX_PERIOD_DONE; } else { @@ -237,7 +237,7 @@ static int imx_rpmsg_pcm_open(struct snd_soc_component *component, int ret = 0; int cmd; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_OPEN]; msg->s_msg.header.cmd = TX_OPEN; @@ -291,7 +291,7 @@ static int imx_rpmsg_pcm_close(struct snd_soc_component *component, /* Flush work in workqueue to make TX_CLOSE is the last message */ flush_workqueue(info->rpmsg_wq); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_CLOSE]; msg->s_msg.header.cmd = TX_CLOSE; } else { @@ -353,7 +353,7 @@ static int imx_rpmsg_prepare_and_submit(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_BUFFER]; msg->s_msg.header.cmd = TX_BUFFER; } else { @@ -382,7 +382,7 @@ static int imx_rpmsg_async_issue_pending(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_START]; msg->s_msg.header.cmd = TX_START; } else { @@ -399,7 +399,7 @@ static int imx_rpmsg_restart(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_RESTART]; msg->s_msg.header.cmd = TX_RESTART; } else { @@ -416,7 +416,7 @@ static int imx_rpmsg_pause(struct snd_soc_component *component, struct rpmsg_info *info = dev_get_drvdata(component->dev); struct rpmsg_msg *msg; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_PAUSE]; msg->s_msg.header.cmd = TX_PAUSE; } else { @@ -434,7 +434,7 @@ static int imx_rpmsg_terminate_all(struct snd_soc_component *component, struct rpmsg_msg *msg; int cmd; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_TERMINATE]; msg->s_msg.header.cmd = TX_TERMINATE; /* Clear buffer count*/ @@ -530,7 +530,7 @@ static int imx_rpmsg_pcm_ack(struct snd_soc_component *component, if (!rpmsg->force_lpa) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { msg = &info->msg[TX_PERIOD_DONE + MSG_TYPE_A_NUM]; msg->s_msg.header.cmd = TX_PERIOD_DONE; } else { @@ -559,7 +559,7 @@ static int imx_rpmsg_pcm_ack(struct snd_soc_component *component, info->notify_updated[substream->stream] = true; spin_unlock_irqrestore(&info->lock[substream->stream], flags); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) avail = snd_pcm_playback_hw_avail(runtime); else avail = snd_pcm_capture_hw_avail(runtime); diff --git a/sound/soc/fsl/lpc3xxx-i2s.c b/sound/soc/fsl/lpc3xxx-i2s.c index c65c17dfa1747..536ace6de0088 100644 --- a/sound/soc/fsl/lpc3xxx-i2s.c +++ b/sound/soc/fsl/lpc3xxx-i2s.c @@ -75,7 +75,7 @@ static int lpc3xxx_i2s_startup(struct snd_pcm_substream *substream, struct snd_s guard(mutex)(&i2s_info_p->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) flag = I2S_PLAYBACK_FLAG; else flag = I2S_CAPTURE_FLAG; @@ -107,7 +107,7 @@ static void lpc3xxx_i2s_shutdown(struct snd_pcm_substream *substream, struct snd guard(mutex)(&i2s_info_p->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { flag = I2S_PLAYBACK_FLAG; regmap_write(regs, LPC3XXX_REG_I2S_TX_RATE, 0); regmap_update_bits(regs, LPC3XXX_REG_I2S_DAO, stop_bits, stop_bits); @@ -197,7 +197,7 @@ static int lpc3xxx_i2s_hw_params(struct snd_pcm_substream *substream, dev_dbg(dev, "Channels : %d\n", params_channels(params)); dev_dbg(dev, "Data format : %s\n", "I2S"); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_write(regs, LPC3XXX_REG_I2S_DMA1, LPC3XXX_I2S_DMA1_TX_EN | LPC3XXX_I2S_DMA0_TX_DEPTH(4)); regmap_write(regs, LPC3XXX_REG_I2S_TX_RATE, (clkx << 8) | clky); @@ -223,7 +223,7 @@ static int lpc3xxx_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)) regmap_update_bits(regs, LPC3XXX_REG_I2S_DAO, LPC3XXX_I2S_STOP, LPC3XXX_I2S_STOP); else @@ -234,7 +234,7 @@ static int lpc3xxx_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)) regmap_update_bits(regs, LPC3XXX_REG_I2S_DAO, (LPC3XXX_I2S_RESET | LPC3XXX_I2S_STOP), 0); else diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index 345f338251ace..07ddc3cd31890 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -137,7 +137,7 @@ static int psc_dma_trigger(struct snd_soc_component *component, */ spin_lock_irqsave(&psc_dma->lock, flags); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) bcom_gen_bd_rx_reset(s->bcom_task); else bcom_gen_bd_tx_reset(s->bcom_task); @@ -160,7 +160,7 @@ static int psc_dma_trigger(struct snd_soc_component *component, spin_lock_irqsave(&psc_dma->lock, flags); bcom_disable(s->bcom_task); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) bcom_gen_bd_rx_reset(s->bcom_task); else bcom_gen_bd_tx_reset(s->bcom_task); @@ -219,7 +219,7 @@ static int psc_dma_open(struct snd_soc_component *component, dev_dbg(psc_dma->dev, "psc_dma_open(substream=%p)\n", substream); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) s = &psc_dma->capture; else s = &psc_dma->playback; @@ -246,7 +246,7 @@ static int psc_dma_close(struct snd_soc_component *component, dev_dbg(psc_dma->dev, "psc_dma_close(substream=%p)\n", substream); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) s = &psc_dma->capture; else s = &psc_dma->playback; @@ -271,7 +271,7 @@ psc_dma_pointer(struct snd_soc_component *component, struct psc_dma_stream *s; dma_addr_t count; - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) s = &psc_dma->capture; else s = &psc_dma->playback; diff --git a/sound/soc/fsl/mpc5200_dma.h b/sound/soc/fsl/mpc5200_dma.h index d7ee33b5b9a8d..42460f2b3906d 100644 --- a/sound/soc/fsl/mpc5200_dma.h +++ b/sound/soc/fsl/mpc5200_dma.h @@ -77,7 +77,7 @@ struct psc_dma { static inline struct psc_dma_stream * to_psc_dma_stream(struct snd_pcm_substream *substream, struct psc_dma *psc_dma) { - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) return &psc_dma->capture; return &psc_dma->playback; } diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index 0423cf43c7a02..cb96b0ff74396 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c @@ -151,7 +151,7 @@ static int psc_ac97_hw_analog_params(struct snd_pcm_substream *substream, /* Determine the set of enable bits to turn on */ s->ac97_slot_bits = (params_channels(params) == 1) ? 0x100 : 0x300; - if (substream->pstr->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream->pstr->stream)) s->ac97_slot_bits <<= 16; return 0; } From patchwork Mon Aug 5 00:39:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816967 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010015.outbound.protection.outlook.com [52.101.229.15]) (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 45FBDC148 for ; Mon, 5 Aug 2024 00:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818368; cv=fail; b=Drgk74RmA1cYKKAW+cS5eQgRgOUkPHpx9yyAPGCG1GtlCFKhE+6/6y1HXRGJlCOKuxzD1fW6zEumsFu315E8lBh9rMZ8pzKYoAJqC8pYRZL3t+1bKF71ycI+nzQulBp+QsK6cy4It2wISjznJfBxlRf5lQDQk2WbSaOct8z9loU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818368; c=relaxed/simple; bh=rOD3TXk5bj4z3mjxuC3Fl8S8+so7WHyaz/Otlstnc9o=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=dPjt2wytOBArYRCDXNW1OgL7UPk1kX5MuzCrRUrHPmdHokG2LWBU1b0oeYE055uEJN6ng+c3uW99JfJnE5QH0NptshRn4DBecrZXxQVH1xd6kKgXIL4nuQgN4XYVEy5MjETIVxPG4jgUcCdq56PKSPUiiArMA5q7DHfXceQQuY4= 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=fflcawm7; arc=fail smtp.client-ip=52.101.229.15 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="fflcawm7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pc5JQdFDnbH4Ze8A5ktTav7wgVpAzguCM+rQ/zBRGa6vowaaKBAiVyyysLjcqBMreXV65EE/tq6xi+HmNpeck0tg5Npt6iz4Y7eIkM+W3kKPvhP/V9bRGiD83oslg3uUpb3fxDdSlGUpKTUTxi2n0WOQFI71QUnPDCN+4tZrj7W6iDNlp8USdjQns4HX4Ug75LXoetrFWBEVyqfIwRkudQRm3w7lmrvWUAY4uaAAfBI2yhqkXx0rSEQVcF/WEfIn962iBexhA/WLuQAV2soT0h2YSUUYnfKAl6mpvtBpkV1yfvCwnuyhCK3KD7+U6yZcDNjWDyQK2aBBD7ag0rg8Jg== 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=zWB17jvfIiZnDthuCCeUpJuGrjhGo9LcHQV0ke7wCSw=; b=rsmueK9rs4Ikxbs5vmlxnWucvMirEItWwLza1N2mQaiO509sNAtIH2GXojvmssDlCxr4XkFHijrvvgOfdAFgoyss1zLZ+/hGHh2sN+4zo8SBp+1+Ymebx2nh7QORwsqp1vNqwN+diCf7ZKeivFdvlUq3OS3rVDOHu984Zxx9zgthFSQ9lACNrNMW2/8X/0YD+EBVVP4l6NIcuFcYwJatUjLGfv6KmQlF5iQi7uBL1hH6kRGRRh7v8+KDBWwTo9FKCpjoEcV0OOZw2cjEkhwFHUH3OQoFD83EYjaCSZta2oBLy1V+ul9wCxbVb19nFP40ZJxmBClqjq3WRjiZLn8DqA== 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=zWB17jvfIiZnDthuCCeUpJuGrjhGo9LcHQV0ke7wCSw=; b=fflcawm7jhydYrzqsXb3FjLIeg56wth5ufZpNa2nBF9Ypkp/jod9wcyiKrcaT2F6vMzd/RWwyHtruaKAAkJgkatO+O6jAL0Z0okCvz8O2yZ07MF3wfYlJ0FlS9ZGvGUxPkUivPHmPzhiTjOHLdh8O8iH9IAVMeiZShPkjpOhqcU= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::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:39:23 +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:39:23 +0000 Message-ID: <8734njzttx.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 051/113] ASoC: pxa: 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:39:22 +0000 X-ClientProxiedBy: TYCPR01CA0060.jpnprd01.prod.outlook.com (2603:1096:405:2::24) 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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 79567008-06c5-4f1c-f7da-08dcb4e70d15 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: mhcU0bb8DDkdKTVQf/pJGgXN37Vgc9dHbAmpgk7cN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hlPvhNM4I82hJtEiBr/X/g2Z91sYo6RX7jhZ+CvdiE8wNBXeoq2A03udo9tGxMmzBuSeJO67MQckgaA5mIeJAgVl7tMj8EkEEZqgjNh+IhjZ33VSKP5o0aiZS49al7kd30/Sddd8OsFwBSSYFZe3fTjch3ih1HaStUziOXhUuDmKtiUbeACv1l/mBAOBOAaRTF44MuBHMr1xIkRowORZ/higF6wwQQOEKAQfQ3NIVdWMGUYnXVMDg40C1Uc5IsoNvcM/XY3qivEzLWS487WqstwhbjUvRdaLekp0cbxJIhrw5fs7DEK7qpqZMqsgmgmUvDrt8Akg== 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: j2y8At5Cv9GH3H65VKFsoSnGU8ZdnassQPeEsI7PNII70uqBf3Yf7z5jQhuAp3+mR//Y8HRu/S3NSOkCO3Gc7CeXHEDsgFdX1nEcdwnzniAzV+pJm19C9XLy43B4GTbOeSANez3lryR1QAPpgCquFFv1z20wn3wlnjQVoD4Ph4cLIzimVdGWj4YYZilw+YnSJ5dJ+KIkT3hVD8ADdXmktvZkgMQjoE8bZ8chSWa3c1tm+nkuv/LTPXn6+sRnSi6BY+SOeDOnbmHHXWNXQsfOvrWvGfpD8AppypoWldpvXfYRqxPDuBdDTWfKjl5nTc9vY41F2leSoAskFuFuX1Y5neaLU4MdvggnaNdlsy4wOpOe7BstSZCD2v9DhcM29wUYHNiW3v8fo0HOY/+KuDLoYyIKa+KKUn/e3fI+rmUwMJsjabzHu6aylUIUCzPw8VJRtJyFzKw+mMrcPu7+CMUWVHlbbSJ5XZonpY0FOgFqgJEKt8ZarDBkyElwqszTxQwkrXzPGLMc1At+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pHh3LlbVS3NEmSVECrRkVXTBledgkv4LoWsx5Airk1BR7QOk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79567008-06c5-4f1c-f7da-08dcb4e70d15 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:39:23.3937 (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: ufUd3M/A1mN3/mjrHDVOpIkw9dKkvjzs6rl25u76UzSb96DVMjqZMHVVpivxoTSob6kGKr1JMBj4K0n2wyhcT9qpkCsWv/agQTWD1J7EkSfRdKhBmkhs79NTpcZ4PSJl X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/pxa/mmp-sspa.c | 6 +++--- sound/soc/pxa/pxa-ssp.c | 6 +++--- sound/soc/pxa/pxa2xx-ac97.c | 6 +++--- sound/soc/pxa/pxa2xx-i2s.c | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/soc/pxa/mmp-sspa.c b/sound/soc/pxa/mmp-sspa.c index abfaf3cdf5bb6..229b1ebe720d9 100644 --- a/sound/soc/pxa/mmp-sspa.c +++ b/sound/soc/pxa/mmp-sspa.c @@ -266,7 +266,7 @@ static int mmp_sspa_hw_params(struct snd_pcm_substream *substream, params_channels(params) * bits); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { __raw_writel(sspa_ctrl, sspa->tx_base + SSPA_CTL); __raw_writel(0x1, sspa->tx_base + SSPA_FIFO_UL); } else { @@ -296,7 +296,7 @@ static int mmp_sspa_trigger(struct snd_pcm_substream *substream, int cmd, if (!sspa->running_cnt) mmp_sspa_rx_enable(sspa); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) mmp_sspa_tx_enable(sspa); sspa->running_cnt++; @@ -307,7 +307,7 @@ static int mmp_sspa_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_PUSH: sspa->running_cnt--; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) mmp_sspa_tx_disable(sspa); /* have no capture stream, disable rx port */ diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index b8a3cb8b75978..82f91f951619a 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -88,7 +88,7 @@ static int pxa_ssp_startup(struct snd_pcm_substream *substream, dma = kzalloc(sizeof(struct snd_dmaengine_dai_dma_data), GFP_KERNEL); if (!dma) return -ENOMEM; - dma->chan_name = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + dma->chan_name = snd_pcm_is_playback(substream) ? "tx" : "rx"; snd_soc_dai_set_dma_data(cpu_dai, substream, dma); @@ -551,7 +551,7 @@ static int pxa_ssp_hw_params(struct snd_pcm_substream *substream, */ pxa_ssp_set_dma_params(ssp, ((chn == 2) && (ttsa != 1)) || (width == 32), - substream->stream == SNDRV_PCM_STREAM_PLAYBACK, dma_data); + snd_pcm_is_playback(substream), dma_data); /* we can only change the settings if the port is not in use */ if (pxa_ssp_read_reg(ssp, SSCR0) & SSCR0_SSE) @@ -683,7 +683,7 @@ static void pxa_ssp_set_running_bit(struct snd_pcm_substream *substream, if (value && (sscr0 & SSCR0_SSE)) pxa_ssp_write_reg(ssp, SSCR0, sscr0 & ~SSCR0_SSE); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (value) sscr1 |= SSCR1_TSRE; else diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 80e0ea0ec9fb3..9a8e08b30ebfa 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -95,7 +95,7 @@ static int pxa2xx_ac97_hifi_startup(struct snd_pcm_substream *substream, { struct snd_dmaengine_dai_dma_data *dma_data; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = &pxa2xx_ac97_pcm_stereo_out; else dma_data = &pxa2xx_ac97_pcm_stereo_in; @@ -110,7 +110,7 @@ static int pxa2xx_ac97_aux_startup(struct snd_pcm_substream *substream, { struct snd_dmaengine_dai_dma_data *dma_data; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = &pxa2xx_ac97_pcm_aux_mono_out; else dma_data = &pxa2xx_ac97_pcm_aux_mono_in; @@ -123,7 +123,7 @@ static int pxa2xx_ac97_aux_startup(struct snd_pcm_substream *substream, static int pxa2xx_ac97_mic_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *cpu_dai) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return -ENODEV; snd_soc_dai_set_dma_data(cpu_dai, substream, &pxa2xx_ac97_pcm_mic_mono_in); diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 849fbf176a70f..664116396e8ff 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c @@ -163,7 +163,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream, clk_ena = 1; pxa_i2s_wait(); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = &pxa2xx_i2s_pcm_stereo_out; else dma_data = &pxa2xx_i2s_pcm_stereo_in; @@ -179,7 +179,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream, writel(readl(i2s_reg_base + SACR0) | (SACR0_RFTH(14) | SACR0_TFTH(1)), i2s_reg_base + SACR0); writel(readl(i2s_reg_base + SACR1) | (pxa_i2s.fmt), i2s_reg_base + SACR1); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(readl(i2s_reg_base + SAIMR) | (SAIMR_TFS), i2s_reg_base + SAIMR); else writel(readl(i2s_reg_base + SAIMR) | (SAIMR_RFS), i2s_reg_base + SAIMR); @@ -218,7 +218,7 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd, switch (cmd) { case SNDRV_PCM_TRIGGER_START: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(readl(i2s_reg_base + SACR1) & (~SACR1_DRPL), i2s_reg_base + SACR1); else writel(readl(i2s_reg_base + SACR1) & (~SACR1_DREC), i2s_reg_base + SACR1); @@ -240,7 +240,7 @@ static int pxa2xx_i2s_trigger(struct snd_pcm_substream *substream, int cmd, static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { writel(readl(i2s_reg_base + SACR1) | (SACR1_DRPL), i2s_reg_base + SACR1); writel(readl(i2s_reg_base + SAIMR) & (~SAIMR_TFS), i2s_reg_base + SAIMR); } else { From patchwork Mon Aug 5 00:39:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816966 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011007.outbound.protection.outlook.com [52.101.125.7]) (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 08A6717577 for ; Mon, 5 Aug 2024 00:39:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.7 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818376; cv=fail; b=ZREs3tVJbBgqG/HP4XDH1HtHM7MwqMKo2S19dBVd+deLnF3eiJS8xrQmLtOfPHBYuFppPM+H8hGOF5eqdbBwgNp/NQgJUMiwU1JUG+p3mEZVvNqXrmFlT/Up4dawxmgwL0MpDb5oKT59uh28nTjdNoNgGDkE7PfV+0R+UMHvDhQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818376; c=relaxed/simple; bh=MrHl/wFqz544WiV37Y+wTgj5w019RkGulZzw7fG22+0=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=lHLoiL/N5/B+VoGNkeSiEG5nQJQSybXvoB8YwhPAcrssp+ypiU8n8jhho4iOwkyThiKtF2OTXXXN+S8Z/QTz8w//cFifTFDkuv4OeYi3EKYJn483ozK5cXnVUPcz/ow0jjeMe293JgW3b+dVRzJr0WLhljG3TfeO6Iv7i2GmzcM= 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=aaJOL9OU; arc=fail smtp.client-ip=52.101.125.7 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="aaJOL9OU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YLBswOE90iVRHAlWDmB9BFKK33L0ktmCRWVMt7u/u8P41lZD2Uy/uNH8EZ36iHJi0ZTsTuqaK0McR4Oi7mY4SvPSGDL9B3crzt9+qp7P3yA8v9sJ/amGRliYhDEbB3t6hB8aWVSOTsEcSsH13wxUfeIvMpg85BK1EvNN4AWkKmaUKNoJ7Cs5+yF8nssbQJXCXBVNw6MYR4IQNyvJYgxC8N15+5ueWFhnF9/OBUgaPFRJsmIByOqnDbJfbt2ATmJIm3GXq4mzLk13P+0fxEIg5iDzBSZ3CflD9gx6EZrCeh2tC4Rm9QiJZKFE8gMiyxs/AaIcqdtpdjs8w6J/SGsEyg== 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=Wzvkin/sh7n7ol9McnO397vFmn+9c0d3PNkl1UBzJNk=; b=Xy69s3/SWY+etRzcM2GwWGv7D1yKyEEzmAtcd1miJ1kJcW3L+LbMb4aHo1Thn9wwhPLV37QVtXIQF6gk9rwUXNDB735m9oS6VvaGKwSoFPAbI/cM3IDgGEvEKm0/e7C3+EGzUSm6r4TMw7+51B5dlOXRvlU6MK5ovimDoUFjsMio0u0fTW4ASje6CxrZWHCWbONN0l0cPr/tsmpBjTU8nbueW2/KTA6+XOekd7Bz1gc7rIIh6DM3AnbBphNwGZPwY4MiDnRkPMlRG0qnm5ITzMTmAKc1ugf0Irm0RH+iBeFKceOwgngVnYU636hdDWJlZSFSWaQVH7pc0GbgQeJ7Ig== 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=Wzvkin/sh7n7ol9McnO397vFmn+9c0d3PNkl1UBzJNk=; b=aaJOL9OUaL44qTpoBcfrfuLYbE67lKmQs7djpJCkw36fErAYHPSnlD3s5ZPDyD4mP5hFrCX078O/T1XnJwxWoE2Da/c+EEercws1F4H79sqLcpCwYkuXLpOSn0Mbl8ahxtws5gmcshGDjoFSH28CR4MnNWo6/K7Y+1bv3zxUYo4= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::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:39:32 +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:39:32 +0000 Message-ID: <87zfpryf97.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 053/113] ASoC: stm: 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:39:32 +0000 X-ClientProxiedBy: TYCP301CA0002.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::20) 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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 7053ef70-af0f-4dd2-7315-08dcb4e712d7 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: luXP+S75Ltxqs85jYbuywxzRaQVTAR3e/z10gf5bgxwolhfvrl+h/tLw1FG2y2sDeRQJOPEr/NyZ/D5KO/+jwESF5D3TOUtnaHBDpRC1vk1gmlBSN4BJNdqOhZKxURB9JNsGGWGp8K5ZrttCc09YJINhBUPcRH0QsyfQC1Pkrb76OpJi+RwVXqJemep6jc07zeGbXx1fWtr2w147vVwX/w1Rl3Y2NrY/wdUEP8yL7dNf7CDq898A3bDdz4pdySU7yTTIIQsHaZu0/FKPLJlBKoMYfgsUgTE2jIe1DTGpoG2DIE/oPSb+Njjn/ccGVtllKT3QWxQbc07D1Mces91vtw6lAysN2Nm8KKfSn32xAg6oFqmVFibftCKZXaxHgK7bDbGGlJergtvfrqfKWEJSVvtzdIzkf/zuBYYmuIA4qh+dKkvGtcC6wQ8ZHHzBRMHpwd1rOJjPBEFflRLzQrJBoSOZNR8jY9hCsc5buDY1LDuQpqq7s0FW61Vl/bFEQU/dYe7dA4Vmze1hu21N92JK8pUkwX96col69dS7utCbcu/0496dN+utvxggHLJ4DcN+xIs19kVY3OXCQh62aBZ0srqG9o8cfNXjwuJjjRChdpzz072r7o8UuN+vwt2wegbBrE0ZfCw3zMAHT58f9osyGUS5D/yGk0NTOd0sstVWfAfgaOQHNLPEnLLK8/CuAGTyKDuUR2YpjheHmyt6IY3/J7yKC0Md6x/1aLjSqYxQ9QcdhO/lqbwjxx+lAHdiltM3YUHMYpcIwMcN9PfvmZJ4Z4pcSqJ/wDkS8eN/hRHoZX3rRSrcp7QjV85WH0oMXPoFopEuz+LEEtRVpLVKwiHfzAes464F/tAyezxb0tiNbmgF28H005LD1+XaPTEZ7l+fFIpSAZpydj69AkCwuaVCDFc8e2BLtdJ6Jar1nV4j19hiJIGXsbWnPfpIgnXW5rMdBa8VXl8C9ro1Ticqxc2p9ducUugZPgIb2JFlT+fJQAX6lI0IjRTZDTIvif/W4f26jLx4MvPNryqbRnTEF6Tmfyv7uzTEajetiSMbCT6xIDa334uQkn6RNWhV6AajFphkrFHKXHtz1gaHWkSR/9l85FYW97dYNV2pWIjfu+uWTutZYUELsXpPYBkIuUgEBsjt3EohlS0b59W6dsITTvFSlGNgU5ZDQiGd+GNNenA6+DmJA5A49FYCNm/BuJCVBGH5OyzI/ucdVwr+RQ+WQzmTyLSRk1OKoQLvmbA650fb1/1x4831Wh/Q6XQAZPc+RELtTsx5nxFJLfneVVRSJFVSxOHjmggYg/cus2ob+UqoXwUET5JzCTsBfXndQ5YBJ2JNwuVH6Ny/g998Y96jh3idqpatRKuDN0eEsXRqVyIR8gFiUm+UkaTiOoZ2Fg1Ruqzjlj28bXSi5MT5Q4s2Eq657A== 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: D/TofCWSOdLuqp4BkB2mKhx1PZWXquU64v7bf5s/CTjBwfjYf7JUXL1TlonjyFTDSibBCbp84z4oUk8OC4uv5W8IZqVmx2onredWr4g94EUedtl9xROPzd7FZq2WRNA+mUzUSSxTSeZXw388nQpFD1EZ9sKcbXjx0l/AcT8/r6vxSv2Tp4Beiap5cekOJ08Ke4PSitWTnOqikEVTJSqxd0EeenByqfZqUxVFAA2fcL8CYm4WYIztAR5TXAe65CL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oZypBOTJzo4EDEXaTA8lNEGWdbgDOWN1G4O5zt29ED+EGBA/0kHY0b5f2p3HdnqnckY81AekVcE+QqNe0bghlQ4cGABZj2ORCiSbDnGE+lLmyE8XUKJpTcbkpeUwpC70CkMTRQsF4Y7Yog5bhciE4026/Ec2fOSArLgZXeu60+PC7zlpmSfYCHXJdJyYnq4ZdVvtQ83FUdKroPr7PfIBZq7wf5ytI+b9TwK8B8T4tk7Vj+Mjcv5vgWpoZBO6TAc/FDYeaiYNkZ86N28f1TeU3tdZGjnOEFNttSc9y0xyuAeclE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7053ef70-af0f-4dd2-7315-08dcb4e712d7 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:39:32.7240 (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: ApiAjgKGyvHGMt3T9HQ9egOuhupBy405GO/FUdK4Y1pV9MH2YQWeIW5Szjo3Nw/4J9wxRINz1/8GvXZimuzdtjc203qDdrZgdTxQbREJiLAFtDCLKoMOUI2Izw+M8Pmp X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/stm/stm32_i2s.c | 2 +- sound/soc/stm/stm32_sai_sub.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c index a96aa308681a2..d6654fc9f1a7c 100644 --- a/sound/soc/stm/stm32_i2s.c +++ b/sound/soc/stm/stm32_i2s.c @@ -813,7 +813,7 @@ static int stm32_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *cpu_dai) { struct stm32_i2s_data *i2s = snd_soc_dai_get_drvdata(cpu_dai); - bool playback_flg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool playback_flg = snd_pcm_is_playback(substream); u32 cfg1_mask, ier; int ret; diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index ad2492efb1cdc..ff8d98e574f2b 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -38,8 +38,8 @@ #define STM_SAI_DAI_NAME_SIZE 15 -#define STM_SAI_IS_PLAYBACK(ip) ((ip)->dir == SNDRV_PCM_STREAM_PLAYBACK) -#define STM_SAI_IS_CAPTURE(ip) ((ip)->dir == SNDRV_PCM_STREAM_CAPTURE) +#define STM_SAI_IS_PLAYBACK(ip) snd_pcm_is_playback((ip)->dir) +#define STM_SAI_IS_CAPTURE(ip) snd_pcm_is_capture((ip)->dir) #define STM_SAI_A_ID 0x0 #define STM_SAI_B_ID 0x1 @@ -1406,7 +1406,7 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, sai->spdif = false; if (of_property_present(np, "st,iec60958")) { if (!STM_SAI_HAS_SPDIF(sai) || - sai->dir == SNDRV_PCM_STREAM_CAPTURE) { + STM_SAI_IS_CAPTURE(sai)) { dev_err(&pdev->dev, "S/PDIF IEC60958 not supported\n"); return -EINVAL; } From patchwork Mon Aug 5 00:39:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816965 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011010.outbound.protection.outlook.com [52.101.125.10]) (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 B1C39156CE for ; Mon, 5 Aug 2024 00:39:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.10 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818386; cv=fail; b=hQG/Sa0DPCNc1VjybBCMnRVKzrjqTlpHaXQynERNWM+L/SdCmePEIb1gm9Rzo1OOkQMYwZN5RGHdspxXOl8ehSEQ1ViFa/Evs0NsgcKnUCKR4LZbSxoFGizXaQTTbUV0/CI/LPRLNIwX94NbwNteHiLFhPWKmxJVuZZ+GKqWo2Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818386; c=relaxed/simple; bh=ikIGSsWHUrXUZKIgtKDkxZAyIvpk7G63R76DSix7veQ=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=ax2rv60bcCTUS6Jm7yVWtu/nwk/qMOO+/Z0YgD9N91sY8QX+PlQuhPVt4F9TvNMBkQ2GxtvhRy2RIrTBE99P/QTCF3WAyA1EWfz3jM4KTCfHayEgot11t+6QfFTmQYz2RjAuECFrekUjsEZc39CQBk/UyOEXsEd5QJtrN5y/AGA= 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=TyPhwEea; arc=fail smtp.client-ip=52.101.125.10 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="TyPhwEea" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tGb77omZaOAdTS6e0P24Xu0ifwFpv7gAEU6sYJZ/LaN22d1FBEmKWPmm7UoGbAMS7QXm/Rtzxro6qN0VlTQWCQ125Iwqz+63z0LqSJ1nyNS0ZU6ybeyK7+k4Yx+QZPJIn9Gr0R3/1+Fd5GoD82LGcEffDFWDzKA24Y1V675RS8KFRK+YZFZLHuSmvD8DIZortli6ZrBSuDKnmfa/x5/sAy5n5wKIJbO6iuOqvNt9V6Q1lIpYNIut0nbsiUUCkfo/SEWL5PpfK6hxMs96Imtwl9OsQ+bHyRPTXRL7YHUXvMNxdWOe1LNNH1awgyWf0dIEOm81NrrWZKK3IeRN9wX02Q== 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=uk3WOoxMmhZvyRmuJ4vLaw+rmnTyhnPOx5ac3Ip81d0=; b=TYE+tr421m7/OR8O1Osfu/529I2UNtbW9bfTsazzww2nizXizv6LVvz+5x1eMFOFRjQyoC3fPreilH03r+PRQn/+puroKUyd/z8S8NVncuNtjqbxKOnc0crCSTDvWQ4Pc12IcUXHW7mhYlcZPztp16sQb9Q84++RuAslDtGKr1krycxeqCCTQ6qMycS+islrKeShuVcsoqeuBzsO/WHk3MVhq/oT/rh19xulU7F3iaB46D/SiTWLgq9u67EqRcaL7mEa72KCDUp/qlAjKlZzEYv3Rpe3/J00Lb6wWjIBxqHN/TUOefWtrIOAw2B0fSUvQzlCbtV3JWTfzk5q0rOjAg== 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=uk3WOoxMmhZvyRmuJ4vLaw+rmnTyhnPOx5ac3Ip81d0=; b=TyPhwEeapo8ByK5FoHpwcMp1F3XrWaSKL0a+MTZgy2sy0tFb6mO9CnRnaXjd+MQ0NN41A8TPVBWBbPNSoiD1srhx+Az2s94WPI0GrUCd9jZk/hUMYsnJpiM6U8eOccsLG0uPj5a+d1G5JlAWJyDj1TOzvvjIkpHg4JwgAQ0+0tU= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::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:39:42 +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:39:42 +0000 Message-ID: <87wmkvyf8y.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 055/113] ASoC: sof: intel: 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:39:42 +0000 X-ClientProxiedBy: TYCPR01CA0131.jpnprd01.prod.outlook.com (2603:1096:400:26d::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bf56b5f-c843-4b2a-3b2b-08dcb4e71877 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: ksPoa5Q+37OUgq751yPsNFl0czYHU9LURGPX/fwDqSwvdmIRvCJUe0x/Vm6cjoP49d3T9HddRAcc8fgpaxA4flj+towb1G2a6scNPj6azHTf1RVwY8QxR6tp3HRzRzqYX4YDoK0tYPPi3lL5fTVn6JqHO4WGAExQ3J66KoDQ7JtVP/V8l5LFRinQK9Lj0LVuL4zWByNWz5pnGDihLGu4jJVdETkDBXqkYlAjN+QyMDKiV99168qFcoTYF+29NleIAfoX7BZEFYPGHaLWbU9I9ZgptzLna+Ub7SnlAsKyrPnDZXpkwNY0m9cmWwLRg7fH6A9yaKverTfsM38LIonCTbF+B+6PyuLfR8DKQo/M1gx6QAU/+fKYZt8OWdjMjFwP6p5uLqgs7lcDnWOqrcrw3y93eoBPTw2bi5LCBswe+mXiJYwKQQhZiXZNpNfsnJZBU3Buhr3DzcZRB/eoTld5+cIwOoU0sg2QhQZ8G/lYkzHQFb5nrLGVz/PMYPkzGgH5ALIjvbllVPI2Cv5fwZ3hkx9YV8x395jM+X03ftM5fK5acDd0LwCjfh7oSgD3C0kpNIAsBBcfLAY3Wc4AnrsJw7EgNjqGzd+RaLHk1Oo7oHmjpCvDJDYlWwZE+Q/Muw52ZqmJ0iM2aEI9N/TMWmbL6SfeHR8/EMAAMwc6R8KHv0D3h5Cfla6AMi5M9YA42PNQaKje2M+qbrFPz+X6wbpAK3ZdRkglZL/SgKCqxkBZjNwImQly4LTw/eUmZTZk3NSa7xh5qEq/W0FgcBBT4X/iajAfiTrawl0Uym5iwK42WsksaAGSxxmKAUZ3w63YQibMUk/Mj/6HugtVEsTCpwvmEWX4J7VcPeO0pwAZI/j7YxWXJQRUwJPWIpDZP5Z3udDxax2oW+WxbVeKOyl8Y4V/X3EDSi0RTNvrKbbZQBNzEUoSN+xC5DAS2jMCII1mcRK3Phb7RK4e/0vzw7YXQMua1VH6EXb4Zyc+LyRf4tItNS0/kafJkkK0FThYGHEuuI3DkBQoGRpzXmz5KsJq2eaXKEHE8EVEqRiBiDhfHW15J46F3OrPqK22kfAfDcr4L4WdzjTke01wC+Lxx54ZKfJwOfiGV53NsZSGnSDXpmaEXgFbS2HB5JQYY0+lVRVdC2wZOdERdj2yfX2zo/tUboUe29tRaNfB4BPR9TQ2WSG6joduaLPi65wDM+YIHHnQMxSdFbpStlEYRlQjLuVBAVRcHsMUm7y2DQiJSMkEEVggNyn1+FXcy0xYZdLQAolpmRR0gJ9wz7xMYy4bsgk4ivlaa+MrYxCJJDgY7IcxIuLwGbMf4C7f5amywNvjh5AIHElJWkHqisy3JBbEj2LbbjlTlwS4fOVCeST51CsKVRW2ZJ9tNGfie9l3JAjR5u9KjeN+sWJwkM5l8Nf1vhm852XwEw== 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: NmA7arPcgsSON0Po1fBpzkTBxdELEGX+3SQM2fJSl0VG5CMXnrZ7mtqeBr8y+zOlOVXqzETT8DncBiOhDceMXcnavVSz1wfTfmbaNKNrqAnZndlrfBR5NK7hm8ScR1ltH1Y4bJnqWs36o02n+FPSjD5DDLvnkgjVbEgBpwidnZL2sPvp/P0q6cONLg9Xu7kHEOM2IzMqvf5rojI1lNd4DKG4AJtsdigeJFCZbWHP0VWJtmL1Zw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atXVfKGYev3wal3ILOoxvdP1fEpsXvRs1S0UNJJ0b7cgHr5Ebu79HknsUzQQOo+tKEIE8CL3oNgBbTUY/jmIK+qMuPFxRpBclABl9Kjms64raqJ7HciguDoEAxuMCKHG1TdJi2nQphkbW5bkTRL1NqxCfmOhwQee/rB1QfeeP3dSQ6CwpvPcDFlwet6d0u2R53Llm9utGeBIfzbENa/5OyW+Yz3lr89/WkiDI8ul/ClW8A4tm14X/30EX83xmQcMrf0cj+K3CkqjT0z1KbHPDQNYBmbIXxXZzr8vUCjlV5yviuracWw5V/t5cC1W76wLeyK8MU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bf56b5f-c843-4b2a-3b2b-08dcb4e71877 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:39:42.1564 (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: /ggq3RH9u9vsqUx5EpIud7yuJ0+fb84/68MUGxwiBhPgasUioj+yHhD1YMFflqj+JusmZ2WXjVlKx2sNuEugk+AC7zJ1WpGHyItu+HYmXypfQtLqIk1fIBcn29qrjZV6 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/sof/intel/hda-dai-ops.c | 2 +- sound/soc/sof/intel/hda-dai.c | 4 ++-- sound/soc/sof/intel/hda-dsp.c | 2 +- sound/soc/sof/intel/hda-loader.c | 2 +- sound/soc/sof/intel/hda-pcm.c | 4 ++-- sound/soc/sof/intel/hda-stream.c | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c index 484c761478853..c00fc981f8059 100644 --- a/sound/soc/sof/intel/hda-dai-ops.c +++ b/sound/soc/sof/intel/hda-dai-ops.c @@ -198,7 +198,7 @@ static unsigned int hda_calc_stream_format(struct snd_sof_dev *sdev, unsigned int format_val; unsigned int bits; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) link_bps = codec_dai->driver->playback.sig_bits; else link_bps = codec_dai->driver->capture.sig_bits; diff --git a/sound/soc/sof/intel/hda-dai.c b/sound/soc/sof/intel/hda-dai.c index 1c823f9eea570..0b5d3c5693ab0 100644 --- a/sound/soc/sof/intel/hda-dai.c +++ b/sound/soc/sof/intel/hda-dai.c @@ -123,7 +123,7 @@ int hda_link_dma_cleanup(struct snd_pcm_substream *substream, struct hdac_ext_st if (!hlink) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { stream_tag = hdac_stream(hext_stream)->stream_tag; snd_hdac_ext_bus_link_clear_stream_id(hlink, stream_tag); } @@ -174,7 +174,7 @@ static int hda_link_dma_hw_params(struct snd_pcm_substream *substream, hstream = &hext_stream->hstream; stream_tag = hstream->stream_tag; - if (hext_stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hext_stream->hstream.direction)) snd_hdac_ext_bus_link_set_stream_id(hlink, stream_tag); /* set the hdac_stream in the codec dai */ diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c index 4c88522d40484..f5be61a6f4ba5 100644 --- a/sound/soc/sof/intel/hda-dsp.c +++ b/sound/soc/sof/intel/hda-dsp.c @@ -542,7 +542,7 @@ static bool hda_dsp_d0i3_streaming_applicable(struct snd_sof_dev *sdev) if (!spcm->stream[dir].d0i3_compatible) return false; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) playback_active = true; } } diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c index 75f6240cf3e1d..ec46529974a5e 100644 --- a/sound/soc/sof/intel/hda-loader.c +++ b/sound/soc/sof/intel/hda-loader.c @@ -262,7 +262,7 @@ int hda_cl_cleanup(struct device *dev, struct snd_dma_buffer *dmab, int sd_offset = SOF_STREAM_SD_OFFSET(hstream); int ret = 0; - if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hstream->direction)) ret = hda_dsp_stream_spib_config(sdev, hext_stream, HDA_DSP_SPIB_DISABLE, 0); else snd_sof_dsp_update_bits(sdev, HDA_DSP_HDA_BAR, sd_offset, diff --git a/sound/soc/sof/intel/hda-pcm.c b/sound/soc/sof/intel/hda-pcm.c index f6e24edd7adbe..d5a630da5a218 100644 --- a/sound/soc/sof/intel/hda-pcm.c +++ b/sound/soc/sof/intel/hda-pcm.c @@ -237,11 +237,11 @@ int hda_dsp_pcm_open(struct snd_sof_dev *sdev, * All playback streams are DMI L1 capable, capture streams need * pause push/release to be disabled */ - if (hda_always_enable_dmi_l1 && direction == SNDRV_PCM_STREAM_CAPTURE) + if (hda_always_enable_dmi_l1 && snd_pcm_is_capture(direction)) runtime->hw.info &= ~SNDRV_PCM_INFO_PAUSE; if (hda_always_enable_dmi_l1 || - direction == SNDRV_PCM_STREAM_PLAYBACK || + snd_pcm_is_playback(direction) || spcm->stream[substream->stream].d0i3_compatible) flags |= SOF_HDA_STREAM_DMI_L1_COMPATIBLE; diff --git a/sound/soc/sof/intel/hda-stream.c b/sound/soc/sof/intel/hda-stream.c index 3ac63ce67ab1c..c83b260c35f92 100644 --- a/sound/soc/sof/intel/hda-stream.c +++ b/sound/soc/sof/intel/hda-stream.c @@ -33,7 +33,7 @@ EXPORT_SYMBOL_NS(sof_hda_position_quirk, SND_SOC_SOF_INTEL_HDA_COMMON); static inline const char *hda_hstream_direction_str(struct hdac_stream *hstream) { - if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hstream->direction)) return "Playback"; else return "Capture"; @@ -667,7 +667,7 @@ int hda_dsp_stream_hw_params(struct snd_sof_dev *sdev, SOF_HDA_CL_DMA_SD_INT_MASK); /* read FIFO size */ - if (hstream->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(hstream->direction)) { hstream->fifo_size = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, sd_offset + @@ -1030,7 +1030,7 @@ snd_pcm_uframes_t hda_dsp_stream_get_position(struct hdac_stream *hstream, * is not accurate enough, its update may be completed * earlier than the data written to DDR. */ - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { pos = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, AZX_REG_VS_SDXDPIB_XBASE + (AZX_REG_VS_SDXDPIB_XINTERVAL * From patchwork Mon Aug 5 00:39:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816964 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010028.outbound.protection.outlook.com [52.101.228.28]) (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 DD26F17577 for ; Mon, 5 Aug 2024 00:39:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.28 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818394; cv=fail; b=Y0Mrez5ZR+qAWXUxFCtywBaVLaupKB+IBH2PewAm7dD/Fn1X8HcoBkOsIdlr874XeY65sAuhlDPFgdChzK5rSVBRJ1p48WtonNYezDLk1S8ssbpSJ27tku11wEKTororXl/E1zNgFT5GDcQNrHRDHMIalphxC6MDQTyYGfMT7is= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818394; c=relaxed/simple; bh=8jmCrPdpLocqNKg4z33xnHD6Qw5aZbINp6YoNea6wZo=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=cLxD8wdx1B2rOe2ZTsU1lAV0YXQbCvxs6xF9u86zdo/+FWknxEDax8Z3avb5zQxImPIjwki//KBv5f8gfI2vNxFQkChD2xaQdkUMpjgym/5PJD2kDqAG3Egp6o+cVsLQhnmOpMORM2hXMUTY7OIqKOHruXdUjyPeaW9P8W+973A= 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=QWieQEnu; arc=fail smtp.client-ip=52.101.228.28 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="QWieQEnu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PFyrT7LMrQ0cIEyEAH7vW36DjuGxspIou6uPBoZENr6Tto2xzKMBG80+XzRSVNrjLAujqU7LbFSHNApTGr006D749WcwX7ysg1Gc5arUopAVxBWWXyP5foeGY5xZj0SGntzGwO7ZNAlzfKA1cQtHHMUlx06fv+55WV0PIULZDAw2xQnIoNrVPAZsMLoWdF82Fuosrs9hUCHo3WvlfbywljF8F2+BSXyXTOYNM8FNDsouo1+qLRqJHnO8isD8kWhgDHK4tL8IuyG9aidWJssHxrFu8TYhh/f3B1JW6wjjlKx+Tf1pIAsvm5YWTRy1t2LVo9oMBS997NkAuycMrUrSfg== 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=HYtrNYv/kg2CePMswQDA/S5NZEOx2q29Oodw5gpHO50=; b=GFMixgXIXi1dE8fje/DWRDcDvVKiGtUJXD/n9PfKvhUNijZ42d8Zo8/2T8i5PBvFPHAVR99Yhe84x5pkIBb+W6R+UUVErYLICinRtwDvsh5JmRJnoXZULKNn+uomGD5VYM4qtx1jUqngEJm+xQwyIee8Hasr0kJ7PdRqzD4vCWd585QNkNiqGRTuLbVbWaacLTaan3nLl8vQC7xlvN2TzqLQ3Zc98t/0L5GMZ/KtjasIRg1vpv3sXCYAbv4/GrUx3e3wRZIHM5SUGIWVS7v6JaBB0LEyRlz0PMsUfQUdHkHPxgC8yxdoIaeNX40fpk7G8uswBBfWjpa5mqD3rOXumg== 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=HYtrNYv/kg2CePMswQDA/S5NZEOx2q29Oodw5gpHO50=; b=QWieQEnuQBQx2OyK6h+SWAKwc3u1Om56P4esVkuk4ZFOG+psAK6z5GWlxbT+hitsj+ueUgWBxYGk9Ee0LmCL7ECaSGCQzX1hewRFx3CekwIzhyilRGfkvfy7ztrhqJMirujIG2e+JTZkCTEBr50lNHVeUvnRNSKJOejij61Hn7I= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::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:39:51 +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:39:50 +0000 Message-ID: <87ttfzyf8p.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 057/113] ASoC: sprd: 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:39:50 +0000 X-ClientProxiedBy: TYCP286CA0285.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::20) 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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: de5bf3fa-2cb8-43f8-edcc-08dcb4e71daa 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: Yx0dx/KRkC2Mp/lvAVjDipTWPapsqIlnksheP3SZIDPIGqdHfzo0y+QmKrcikJd+37sc3LKM5hRwlH5iF5FT0vkeLYa9arMaRz9CaLN4BH+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JX+A9WEkChOMHeltaTEYs16u5UBdNp2YAxHj4xnVJE4/lbvrBpJ8F7oqPPeu3Yp+Uf2u8qIPy5p8IS+cqMP6nYItdW/498qkn06HpisfICk7st5Fs9wMK3nuBC0x/a3S7wIrOkFJJLWtw0hw062A//NKehJ8dZvbEbgeWBml4Qr/PjICxp3JJbFvZjGeYxQUN8TsCCX4Tl/iYp2duxDmEU8yR59H8HXqmmyPiCMRYvhRZhUIkgHhG2UxEvWhl51w== 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: ynpFVxjr9an9jdHJil6Ymzd/Zy+TwCRTWGBknoQVQdNso0olWWypZ5O/72zPnhesJlTGdp1hhAtS0305MEgqsV3kYS3UbsAyrJBIEP5gQqU87pl3ibXHqDddDg2ND+aPW0sYueMSeHb5+nNbJnI5A5Fl8OK3OCHk5ZevIbsRookb38fB7Un6YKPi3ssY1XX4CrBt5Ow1M3wXIE3qfBjFkBiPfdyvbPhi8bYEfovGoFx1RQeGLdsxOJQxW+1YFNthQESrRhfXY0NzrMhvDvx50I5itl/8vSQweQwYZX/b7XQwMKTcAQ/J3QIQfiQ/itdn3DeTHmdEk6k8N1M9jkSd/JPSp/U0SeY+PgTMmq5tcggBADs+PPKTu8rTRwnfNcTG/BRBv/KG9eR/AyJ3bxlGfrUqObp4Kw2/X7GVGotoOAd8JCMbzsBlm7O2NOITv2Y366k/GE7EqlSMM4ONg5rlaOTGVC6DuLT1MhPwqgNFrR+SB8HPG9nczNmH1u7fgMmXua6gxAFkzQ3ptV4aQHaUpVZHboQYEjQHORRJP4a6Bk8w0n8g7nxoz/dYAZO2u3OTfuWkgNiKjLn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S-Exchange-CrossTenant-Network-Message-Id: de5bf3fa-2cb8-43f8-edcc-08dcb4e71daa 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:39:50.8842 (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: Dwm793ETU2OErgLQ3pIdq2niQ1NYh3LFw7O3bYAsCOx7OFbJFptfKS8Q211nONii6EwA/fn9/ZRSRpNLWZcIAnAaM3Xbn5pGsNQJ6peHF3lgvOTpL3z7hN2V9dVJz7Kh X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/sprd/sprd-pcm-dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sprd/sprd-pcm-dma.c b/sound/soc/sprd/sprd-pcm-dma.c index d6b96cc2f7087..b7149322b9858 100644 --- a/sound/soc/sprd/sprd-pcm-dma.c +++ b/sound/soc/sprd/sprd-pcm-dma.c @@ -195,7 +195,7 @@ static int sprd_pcm_hw_params(struct snd_soc_component *component, size_t totsize = params_buffer_bytes(params); size_t period = params_period_bytes(params); int channels = params_channels(params); - int is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_playback = snd_pcm_is_playback(substream); struct scatterlist *sg; unsigned long flags; int ret, i, j, sg_num; From patchwork Mon Aug 5 00:39:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816963 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011003.outbound.protection.outlook.com [52.101.125.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 DD99518046 for ; Mon, 5 Aug 2024 00:40:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.3 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818403; cv=fail; b=i6PX1izzUzMwsuy3HmVsgFRCqZIoux+QJZFnJatUR4pO0+09lpboTlvhjbbNC8Yoerzls+EI68ke2feg1iiuZJ5UStvs105AFMCOTAN5D69jkzztBOIavD+iiP7EQa2BETZEp9NyEFKqpZkpq5VJh/7M2UXvfABGr7kQYMIm0qY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818403; c=relaxed/simple; bh=jD3jdd01lywzk5OaFp9sJbRzB9qifED9jzWkT5YfVm0=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=CWTa9NFA/eKaZiT2sTflnUmlUlSvtQi6rR2nPNELqKHIfatU56DxH+YoUEb4z46jvTfFXsxP6XrI0145yvlCXdp+MDsPUZiMcT6DXDj5XOEc1xu+6rffkZ1b/DRs/hWGVJgcRrxPUvrXzzCkm8nvisjmcMhTAiiMTdsjij5bWUk= 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=dW4Zl1Qo; arc=fail smtp.client-ip=52.101.125.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="dW4Zl1Qo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=d3fo1wR/KuoRYzT9RY5qHaLdvUzftet+YDqOg+dsfUyQH7TCGAGg/2KfOCZ9pf8YT9ZKq9Wul5d8rj8kTGRjCUpl3+2EFAofNHHF7TfUlh19N80DMTyp7gge1ZngZbCywjaN/we748UT+mUKiLekr2MEmS8Vd8ORhXWYCFg1R8U8UuZZHEGQIMVm8l7EDjvyScx8zWpR4cVfUx00me4x/DfduIXE1iP/1X84InMwM2wLEMF3aV7nUx4Y+Q3Xd1v4LfgvkL+NOsRC0f6QryJtYskAMFkgcBEzo2cOqcH89y2/mb88O3jdB6x86/JZxcl+KapzXOu5C9bwXyeRxAtYPg== 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=mUgbNhARjoegvwgtNCo7MUNh7GYdwpYywqkR/DU77BM=; b=gqI0ISi9uWivrUTexA08PMqzes0SXt7TiWYfl8MulF2kh8LAyrH5GY1ExS7WXZvER54OaUnI/0E0tPIyTYiAVNFCjZ/6aeLMOlCmHMsUIawJbjiw4hDabq/Uu10BUZy5phg3WpbPW1gX8I6lyn52xLyH2yGiGl26ISLNTxm+8dasKRKGf0LXvG+ABLepyTvOeO5un+2gWX9h6exm0pPLOaE6QyCgPpTB1fkXYtcdQ4ch4SDrZQsT6o/PL5z7ClDZNTOAlSlX4gStfiHVqtc9p3emCqa/mvO0zzlFrT9Ottdg0tj4fxQwUPdqv9s7cMlaY5pKWj/cOyIOHA2r2vGvXw== 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=mUgbNhARjoegvwgtNCo7MUNh7GYdwpYywqkR/DU77BM=; b=dW4Zl1QoyIG5erFgAb/gpnP6UrmYZwu8/D2KTR/uVPHdwV6+Wf4bTD4U/tcbULFi7hw82zZn9tu91OhVj1QEjO+SN8LkQv/FNbWKw2LU2RFcTRm/ajtOTF/9G1xe5PS3UL7NE+iY6P7yBTOFu3/AB/YP9RkbVJW03q3yajiXeA0= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::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:39:59 +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:39:59 +0000 Message-ID: <87r0b3yf8g.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 059/113] ASoC: apple: 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:39:59 +0000 X-ClientProxiedBy: TYCP301CA0041.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:380::7) 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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 10f30503-438f-4aed-c940-08dcb4e722fe 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: /J7+lKX4pgabmcUOM6+l8bLNlVXjN7l12HFsTuGXaom+dckacSrE249ypdghP+yvwRgE0YpIa2mjmgJjL6ho7QFW43chhe8n5stRBmQ25v5y9PdR8g5Z5TKmHpwHkt7FZn4y0AqXLm53skklGhEw5DYFRmugqxLNTPHE2pXNsXgiFGq0tyav24aGLBUgqCWwDIi5j63W02FuovR1/hfSOch+eFZZMeAaw1BPKbr0Ay45YbDzpvfybV4zFMTkbA4AhTWZq24O2RwBgM0MB04tpCmbLHAMzb/OL2yZu/m/4smEtmHJaLhoIOEdxAhLxjHCtsUUc664Ws/weqkohmKW5T2eXwJWv0nTHOQSBn43A/rehhIQnc0XegYRPWDoAaqGbHnnwE+uHNSAkQhmhfHckyS3vI/zz4Jt6j8Pp22Z+Od+fzJ7eXI2OIQbARlyReXsL9Tu9E1Hch4vzvyESu8VrVTIJJJ0E9EPL2NnWggO5RLV6UTscwGIjS72fDGFbPbvro4t55S07oroHb9uppDMNc0qqyuHaxDAG5toi6RUmIZvzhFoNU47TC0jMYPl+zpQJjgUSFK3pvdp33VXUvLvz2yXWK5YuMYKEaGFmzocQm3psGD1yvN/dL8v6bIWorjD7xiZIOhrxcCH1iO5Lc5R6qgnGvmlr/we62CHj25BOmlFCWS+K5Lno4GBbq8jx4SCYNziqbp3p+pTJ3ycuLQUqaXllSI1mpi9v4TaczsC6Hwhe8JuiutNj5tZhY17Q8CGPskygAwm6pxV0krR04wWa+3Z9lP7kr8J+VJlc8pp8ld7PpvK81zzD9Ji23ylQeSRYGWtPbCdRSZAzdur7qm1bn4ToukuwwIYYIs/ZNGjBc6ne0L9Tl3Bs9wZaLcnoBiiduVf6YhyPEcm05GuReIxukIIom7Dj5dMS6WTW+sTs/ObTk8DpqI2bHGJGOP3FreYvGcgFMSVxsH7XtXRsxKlW/9rp7nGcyRG/yPeMEmbSbDLzeD3jMlEM46XBKBJheGL0rHS+MWPdiYy4tGw3Dny83fLJgfnXmb6TfgmP6Gmqlb5F2GXRUFmr7D7sw1eZPuRtDfk5Uv1fOSVLPoofU8YE6/WDTfzw2YLpVPEy9aN/fSWgnwdrbHOzWHMLDXKXRXOmytUPig7CCATbgcoFvgvVt7ztpTOvUFnCEiZ9g67gUmRx7N2FIDDq6pfJUOqOG4AXoHnY4k+bV0tGXlMYs3hOgOTWa2hAs+uq4SuP5fkUxUqsrwcKmVL2Wydeoc8/6Do7ydTqMlRmSG05l7rzEp1hhre+hv5OoqrujMHYOqrpYDK7KS8DA3AxwN8qgXN5VKMP9dEjzwkRcdpucqDSC7i1MEiL2/waLssz3x5xKqiEZUpzdKMPbo2B1rHZABi801pmgJBzvSp5cq8KdGx4sToEQ== 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: l3MRwYl1iEiY25/94oSeprvHabpP6aDNwTTB/t9FjdI9jMhn1HwnNjYo7NHIQn/Sm8wa1c5ZbLVpMxXwV56cavxKKZOKRpAcHffeAlc2VDX+afwXkmY6vuayRqxjQIvxVP436tGVpqIKBgwMZ4+gKFO681hv9iJOvOO8wLVxHS2atkidOB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uagwPbPvYisEhZ6o8WmuiLT8SEqc9HEcBZtb44Lt5+edWWwdT2dtRK6mX9x0R8I2MDc6V1FdGNfP/tNu9VCBukNGlzHFl4u/MFsWftVw25/S0MNJx5DHtqJaQMNC72doMmOEj62XxVHmHveT4v0udKe8oRrIEroVHNAYwLkT1/bdmNs87F+TQyYXEnhfYBJjPxlF0KxnFQzRUy7iVo2zIjbm4TyQ27i7rSPEu9YIoV+v0pwW+/GdLaUs+w2xed0NEqvh7SUi/KD2KcJx3ZDGoSgZBy8NrcDrqhJgCJEocPQCB+yvLXKZu/tHiVRvxMHUVfjHOCCdevJr6kXTPVrMsPN+NKnkWAwbTcZgLLVFIbGgdf3+0J0GQ11yYxdAjbCKefJvRHU4I4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10f30503-438f-4aed-c940-08dcb4e722fe 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:39:59.8696 (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: mnI5APbOwwhKn52a2rEKRbtA9HEi5S/j62XxkmP34LB6VQPtGyaiqH3igG6JE9RYW63+dMUKFgT+efuxluXl1dr8g7rfWnU0aOUK0vTv/f4i+VSQQ1EaqFUcmLhsqe05 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/apple/mca.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/apple/mca.c b/sound/soc/apple/mca.c index 3780aca710769..60a5ecbd5f756 100644 --- a/sound/soc/apple/mca.c +++ b/sound/soc/apple/mca.c @@ -193,7 +193,7 @@ static void mca_fe_early_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct mca_cluster *cl = mca_dai_to_cluster(dai); - bool is_tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_tx = snd_pcm_is_playback(substream); int serdes_unit = is_tx ? CLUSTER_TX_OFF : CLUSTER_RX_OFF; int serdes_conf = serdes_unit + (is_tx ? REG_TX_SERDES_CONF : REG_RX_SERDES_CONF); @@ -230,7 +230,7 @@ static int mca_fe_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct mca_cluster *cl = mca_dai_to_cluster(dai); - bool is_tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_tx = snd_pcm_is_playback(substream); int serdes_unit = is_tx ? CLUSTER_TX_OFF : CLUSTER_RX_OFF; switch (cmd) { @@ -570,7 +570,7 @@ static int mca_fe_hw_params(struct snd_pcm_substream *substream, struct mca_data *mca = cl->host; struct device *dev = mca->dev; unsigned int samp_rate = params_rate(params); - bool is_tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_tx = snd_pcm_is_playback(substream); bool refine_tdm = false; unsigned long bclk_ratio; unsigned int tdm_slots, tdm_slot_width, tdm_mask; @@ -844,7 +844,7 @@ static int mca_hw_params(struct snd_soc_component *component, if (ret < 0) return ret; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) slave_config.dst_port_window_size = min_t(u32, params_channels(params), 4); else @@ -895,7 +895,7 @@ static snd_pcm_uframes_t mca_pointer(struct snd_soc_component *component, static struct dma_chan *mca_request_dma_channel(struct mca_cluster *cl, unsigned int stream) { - bool is_tx = (stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_tx = snd_pcm_is_playback(stream); #ifndef USE_RXB_FOR_CAPTURE char *name = devm_kasprintf(cl->host->dev, GFP_KERNEL, is_tx ? "tx%da" : "rx%da", cl->no); From patchwork Mon Aug 5 00:40:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816962 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010003.outbound.protection.outlook.com [52.101.229.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 079F1182B9 for ; Mon, 5 Aug 2024 00:40:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.3 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818412; cv=fail; b=IYkGE6weWG37TKyjH0cHt4MK5ggEILpgXXSJRtbZOsiBiEIJEGx3wMyJHGl8PxuZfZJtzZ2b8wYONB9lbU6OHG+HRsu2lL31P/13NRND08KE92OGWRYw2tlMnCqVZe4XYO/hsmsV+wSYdRe6Z0Ly8uczMj8ZbNcSjPOEBclxtyo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818412; c=relaxed/simple; bh=8kSWrJH9g+DEF4SgSHltqiTQ27G3P+Pe/lIHu44ik14=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=Pam6xVd24XxydeYvLJheAtlQKp+12I+bTOSmMbgYRgcmjRx525fmeneH8Rt31EJrojqi6Z73WujbJkgH+i4+M9ynOcz5N9YSxl4u1qR0mXoTyqfEoKl1Wc+bRDcIXlB/6XdT/I25IEmkyr5gPkid+TAZ7i8IPN6xyB0lhdpzdL0= 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=caKFOYEj; arc=fail smtp.client-ip=52.101.229.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="caKFOYEj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XzihHn9CoA8nBYK7J6K1ExRJ+49PXpNvUl7Ews2T5Y0XyJbsVVkbg68QEGcBSIvvqyFdMR5WfQEZ+sATTNHR1eTYlhyFZYopq/nIv5INBV58w5PHcMOlgkim1oLHla04LNFg+JHrcYkiXaS3/ycy1NPAzOQQd9OZiX5njFi4eWgOKGWV8DQntnKuoSvIEEcCwK9oSJngpWuzO5UC1u/OB3z+ERpY7Vvj62OGFJzkuD204tLxwpnsxWqJt6kI32oHKwhfyCPBTH2qNcqLjYCNGocODo6GdPbBdWlx8y5xnHHj7zLDWWVUnLUENYAwwqVfZDMK8A5mEK4+hmSBLtp4lw== 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=SiyklXxnwCuOFLk8+hLoD2v6lvVgqnyvDraGVcT1JCs=; b=U6yaAp7UABlXXk4W+KKfxvSGUU+UR7xeJhEDXg7oTSM1u0TlKDpJ8F/WJpVOUJINF3yzp6AU0qqjdFFGlntTO0V6uzHBojdqFtcPB2TpO8ECuALtyJo1TjaTBvelBmjfzrII/Hbe30cDiiQMrjr5bY+KhszaDpQvbf/MlLIKE3EBjIH5sGRNRh5amV5aADREhdhy9xzt1u567YWlhZcP5KzCv4VfTw7VeD5i+5mmS6kAa+EuVU9MJ75OTJ0wWlPuHqP+gjr/O6U4HeO2eOtK/VFb6CJgE+ACwJhFnrfXRU87xIrjAwN+qBKWHg8Ep4t53ynQN4rsC3goiX8e3gSBAQ== 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=SiyklXxnwCuOFLk8+hLoD2v6lvVgqnyvDraGVcT1JCs=; b=caKFOYEjfKjksY+itmlXZq73JhMaTfzYNhenx2uQTffDkb3JsYPPeuIrS4sAN2k3CG5n9Nv76SiSrYN5fL/WdSky0RaLz2eAmqrbYkDTTwhJakbc1/haN6ibQVUG8BDSFAdNup4U6WxMmLs26NUcY2Y81Tcf9chpa+jvKmtvMos= 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 OSZPR01MB9459.jpnprd01.prod.outlook.com (2603:1096:604:1d0::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:40:08 +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:08 +0000 Message-ID: <87o767yf87.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 061/113] ASoC: intel: avs: 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:08 +0000 X-ClientProxiedBy: TYAPR01CA0053.jpnprd01.prod.outlook.com (2603:1096:404:2b::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 78bcacd8-a320-432e-c5f4-08dcb4e72820 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: 4AWmwySw9KvSjuYHRzWb790mi/PwbSEokXXePSw4eAFoVP6eRMu9BGAsHMBN/qxt2hbSnToX6yAAtGlDIN65S1Wu/46oOOM9mzZijXMgL9MSggNHrtoblPZ4mTPhfHcxzRC1K90G0SF2aQ9XFj2aj5C1dg0ZaKoxMfSi2AvbvsFucUy9pB+L4OydEHI5lFuscpXZyqBbsMxrYjlIBL/fNQ1pm3aWepeWXtvYn2to4tMuqRcvGtqaOyGs0NcL66hkmRyXZjFVlGCCrg27HyMfgVLLbT6iiRzWM2bmJ5jF231hw3w4nV8oJf6QIfvkT4+BMwYPdJhx0WA8f8q50up+YCob9VdNRVgGpGMLIY70/Lor7OFuPIRZtNVtIK+GD15DbEF8yoQ8kiavxpEdLUxlbsPeqP7m01xP3tjehizFOqQgZ6LpS5cnKwbiO0Ir0ZHmal7CB1fig45azU5lskFNKzRB/oL8zjgzx3lFSQjAXCrW1Sx/X152LLZ7QSuDbBy0XUUWbaEKJQL1I4c/l8s7PbU42iH0CzoR+MDC81W1Et5x+jUv4w18Q1WNZ6QRFNWZ9TV81xMJla8i9hvTlbcRJb9C58iniUiCYWoWt3EzlxNPz8hc64ZbgcMg6V9DsUEd+YsII7C0U9TKpe8JWeyPnRij19RYW9cndlvp4LrAOyPv4Zt+xt7qwwmn6r/XuO351Mo2UGpVPX6+lJxBDDY1ITJFSTrMi02+XHtbY3F39h4gcCnA1it+MTSvf8zBf1mRVA51qIENQu9gUErrTt1UL230WJPgPFu7WubYlmvOSWc6/rT+m6QCGr6+VNai1I0xzGKN2VrScorFaTuZj2DbOoRXNa88nz6SbOUk1mFxmhFyssO+Z7LOT+NvSDQ19sHTLUtWiGi85Yqur6JbqRVQRfoZiWAhl0bJ9uJh2sNj1e3wahM2Q3QjW4XumvaI4KUfJyJ5W8y3DV2pwhrjj/eqHynqH7IKLwdrfaeSYXkPa0lOzRhZMOGomv0PiT0uGMP9fSSvID+b8DclMAcoWWUXPKrEhkqHJaqMsp6pNY5B2D7Pny6nbzzeXiAcFajaGDUS8tl52hnBkcte4itCjt1EUyqOSzwmSn+X/Ag4UcCvTszi6GuBz3ZyLY0Wb+H5dvlh/T21xZf1a0TA88ueyUzsDS36oqU25USp1mFi+Mt6oZuaADkZxCxdsbsxq0Q8YOTPXtlV9+goM5PN2BrBR9m4FE4jfZUrfufMjG330ILmVpfoc22hMVcFIT4tAjcqVaepB6elgmwh2cXkCf64VPIiNG224+cPdlsadHMEVS2sTufnQ30wMSVD8Rjy22iB9Bz1eVj5DoeSMpAc2//aIbgyjmgUS1h1cVGwyFmbf4ilYitfl91V8GhZafF7mo1Qv8jYbDIFZGQdymIcSnQtaXm/mg== 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: Fw14Sqy8L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Wqnm0eNRESnAxpHeRFApM2MaIamCF5SVc3hcXE+HsObfOqT7hUkE7C1l1+wA1qKdnLluxq3XwcqFjVyfHIzZh1QiKT4Is6CHfYYZq/klhd1UJ98m3byZN8knNsIoWTjGDAW3/8OOe9F3zEoCJz8XW+iyDJFcp8PCHzaAxqykVl23Ofs5b9xsKRgOaRXUo7OcN7CEufOMB1eqVN7pPGfwa9sTy12RWwP1/o6D2woKjQ/eFNmq74/adPif9/m9vdXWpdpEiYvjwleY9XBf1XRzvhbrTWM7elVaWxfYX83X2PM2dhmURO1B5IPQbA9E4x545o+kAeECozbsX/lUJM9YvDWL8c4oNoYgNlnbBpxNSxiGMohxZfyIzZHu2NAERDPd5XRYbkxWxzIjjjnQ0Rnkh7R4WgNgDkssR8pK/5tpXz/zHfcar9NhN0SMVfPRtnkK28UOtuR1Fc9Rx/iu/QZ0AnyMcPeESZu2BFNWfm08vY5aB2tOd4I3Khup178a5axQ1B+r1qKzME2F4N+DGvLqLLsd3Gb5dkbY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78bcacd8-a320-432e-c5f4-08dcb4e72820 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:08.4313 (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: U0JrH+eeGxriQQQkPeBoc+Z2vMrlvqUuFTMsk4WKCm4n99RtAC7ogOHQnvQqiI/cOvPMoiUUkJ5Jd6x8ugUC9+nyBeDMXTMF6FIO3HoZ0BkR1cXi/NxMvXMYu1zhCen7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9459 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/intel/avs/path.c | 2 +- sound/soc/intel/avs/pcm.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/soc/intel/avs/path.c b/sound/soc/intel/avs/path.c index f31d5e2caa7b0..dab52a90f4c31 100644 --- a/sound/soc/intel/avs/path.c +++ b/sound/soc/intel/avs/path.c @@ -171,7 +171,7 @@ static int avs_copier_create(struct avs_dev *adev, struct avs_path_module *mod) if (t->cfg_ext->copier.blob_fmt) fmt = t->cfg_ext->copier.blob_fmt; - else if (direction == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(direction)) fmt = t->in_fmt; else fmt = t->cfg_ext->copier.out_fmt; diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index c76b86254a8b4..df71a0292d4a6 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -40,7 +40,7 @@ avs_dai_find_path_template(struct snd_soc_dai *dai, bool is_fe, int direction) struct snd_soc_dapm_path *dp; enum snd_soc_dapm_direction dir; - if (direction == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(direction)) { dir = is_fe ? SND_SOC_DAPM_DIR_OUT : SND_SOC_DAPM_DIR_IN; } else { dir = is_fe ? SND_SOC_DAPM_DIR_IN : SND_SOC_DAPM_DIR_OUT; @@ -331,7 +331,7 @@ static int avs_dai_hda_be_hw_free(struct snd_pcm_substream *substream, struct sn if (!link) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_hdac_ext_bus_link_clear_stream_id(link, hdac_stream(link_stream)->stream_tag); return 0; @@ -372,7 +372,7 @@ static int avs_dai_hda_be_prepare(struct snd_pcm_substream *substream, struct sn if (!link) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_hdac_ext_bus_link_set_stream_id(link, hdac_stream(link_stream)->stream_tag); ret = avs_dai_prepare(substream, dai); @@ -695,7 +695,7 @@ static void avs_hda_stream_start(struct hdac_bus *bus, struct hdac_ext_stream *h * disable L1SEN to avoid sound clipping. */ if (!first_running) { - if (hdac_stream(host_stream)->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(hdac_stream(host_stream)->direction)) avs_hda_l1sen_enable(adev, false); snd_hdac_stream_start(hdac_stream(host_stream)); return; @@ -707,7 +707,7 @@ static void avs_hda_stream_start(struct hdac_bus *bus, struct hdac_ext_stream *h * re-enable L1SEN. */ if (list_entry_is_head(pos, &bus->stream_list, list) && - first_running->direction == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(first_running->direction)) avs_hda_l1sen_enable(adev, true); } @@ -733,7 +733,7 @@ static void avs_hda_stream_stop(struct hdac_bus *bus, struct hdac_ext_stream *ho */ if (!first_running) { snd_hdac_stream_stop(hdac_stream(host_stream)); - if (hdac_stream(host_stream)->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(hdac_stream(host_stream)->direction)) avs_hda_l1sen_enable(adev, true); return; } @@ -743,7 +743,7 @@ static void avs_hda_stream_stop(struct hdac_bus *bus, struct hdac_ext_stream *ho * left, disable L1SEN to avoid sound clipping. */ if (list_entry_is_head(pos, &bus->stream_list, list) && - first_running->direction == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(first_running->direction)) avs_hda_l1sen_enable(adev, false); snd_hdac_stream_stop(hdac_stream(host_stream)); @@ -1602,7 +1602,7 @@ static int avs_component_hda_open(struct snd_soc_component *component, } /* RESUME unsupported for de-coupled HD-Audio capture. */ - if (dir == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(dir)) hwparams.info &= ~SNDRV_PCM_INFO_RESUME; return snd_soc_set_runtime_hwparams(substream, &hwparams); From patchwork Mon Aug 5 00:40:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816961 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011001.outbound.protection.outlook.com [52.101.125.1]) (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 517C01DA4C for ; Mon, 5 Aug 2024 00:40:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.1 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818421; cv=fail; b=pwIy4uGgxmAtYOI0mxk8AiOUs8d4WN23qm9HNIuIoBa/ous+keXsjsan27Nux2VEyyu/kV8w5XM3Vdq1kQa+veaFkBFlcoWM7OgOZ21t5p+jTeM7z0rXFlCrrFsDTWEf9ii4gmGxz5yywTYQcKxdN9PQbg3Iwz7eRp8NSkhGLJo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818421; c=relaxed/simple; bh=IAMDvzRra5MeuVT1tM2FeOOX5KqdE+0He4WrUT6IZmI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=r8zHNcaBtSUoLhlJYXH364xVjIkw0Hj1MNrcL2Zqqr2rT+DtFfXSHgvn4Zx962OGDMgHlH8YZZ0NWepdu0q0Zmdqf/PGWAZnO3xAuqbiGK9XoygHBhwSd7NSgbq++7zmSM42mVeb89sRix/LxQ9OkkNNGZmzoYTbe6EB2HyYxVI= 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=MdT7GRF2; arc=fail smtp.client-ip=52.101.125.1 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="MdT7GRF2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DQVaUIcdLqm7lG6oml0Q/9HUvjC6NWLBcryVD+cJdsvbsJyhoOma2C02RMdKtweVwRYKIqPxaWT0GSLEcEmL+BWfli02EJGLL0W10fHyUmib93NyrNxgqexI7bUP3unEHDBLJ5JZZ/AlGw8sBBF5PECjsUMQW/l2A41gvi/I7/XXn2mFCwSasnyztzS859L0qwYEMPDugtoC7eDrooW9+xq+Ckwjm/I+n3ViJtKGvQwULal04K1QHEqKstOQx/GzfK0N6ajNzLl0IY89GIOAMYGFofema82njBV1O2JKt+kpvJIR+4hSaxH7DINaJXbq2K2yazm968rDQSJl1O3CTg== 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=FW5a6qc7CqTdA20LP48e5waaE0QSt6DPfGZDBEvYLsc=; b=Z0pX2P+SljSLkxGRhMscnRAHYxYwQE1g7GFA2r0BTjyPysyMgEkA3+jM70vbhEpSe0Rd1cpl/eIg7trc46Rav7BnJ41SEy+UkBjGchpq1u5e74E6WEZmZAKwh1C7Zo7MQ17iF7YbFI2TGQ3gIH39Gv9q9wtpQzaDRQBmFxyBaZYAjjG7sMwP9xd1+ecepi46/xy1wx3lm3GwHBLerv7g6J/uPJeWtnuAgXD4w1G3ol/Jf/s3ydMaJFABHrJRwBkiuQ7fDEjnMSjJXXKb2d2PjcWIDTuH81ObiZ0H2dF+wRntSop4aol0bA1TSCx9k6PXtnN7kOqI6ZGMuuxLeaKe3w== 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=FW5a6qc7CqTdA20LP48e5waaE0QSt6DPfGZDBEvYLsc=; b=MdT7GRF2d+H7sRZgQvnQNNw6jr9b8Wgr/gwzKjCE4rvlxSCI1rjeKD1qv4BqiupG1dTrz0bJZ+EUrxqchaQGdV9YIPRIMW7Rt2k2jVnI+gkXBeYshF7i2i4bqd++IFF3eihCPLODz7GyT2R6BFPNWZfRAHgLtMMWqiOenBXszqk= 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:17 +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:17 +0000 Message-ID: <87le1byf7z.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 063/113] ASoC: soc-*: 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:16 +0000 X-ClientProxiedBy: TY2PR02CA0055.apcprd02.prod.outlook.com (2603:1096:404:e2::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: 880f5b9a-f3df-48fa-ccf4-08dcb4e72d47 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: dwxGdyNrR/QWB+2Nnz5HpIdcYaUF5EuKDLziowkbwdpbhJ2hNUt6a/Y7vHPCSASU+eR5ugTzC6Qicd9Td9X6BZZ1xzbfx1Fs4IvhQ8g3mSBaYFkbwjd1bdxFyuSyTuqkDbnrnpSFA5Bdq5bjmbBXEnVm5GgGOtQqqcKU713mDQk8vQqyDmQnTPh0LsiCgaA0TXiYXeDHDEpQPF8ARAQtM3hxaa59wAI73kgQL9XBO59R5+Hwl95HO4w8dWcK39A7WjQX/AomoUdo6TLAWAcE+jXPjgj3Eh/qRg8lxcDW+ua0ulFDx+vWxDiAEefTY0GKbD58/R4IhDeeNiYsArrQxuDNEq3Yd9L0vEbUsJ9fBkVdBxKXGiWV3lmQKebOzC2hWJ8qEFv6LfwQR/h6/9WMubdX3YWlEgQYAIH4s+Mh0bkBoYOkpwcUToLdkdSIDnsaSdvnqp8gkSxs0NTohwC7ugltcPRGukQDnHz9uCiNhDPTxlZEBBXHrECEvqOlct2xQ2hJ6axV6GuhAc5KpT698slUEkHyD/hmeQVMLgqcDeVWxYQOxZK6+O69zrdIELTBhnX/7KUwLJ14MqSlgyNshC8ygZx7sNzfPsapHqm/ArQqjfJcp8X2M+8ZIscbLdEcr3mhOmAmyMw60aPaWPZctG0bRfQq13Yv9r5vQetagt1EGe0Hva09Fnf8jWdjqQcgtQWH5p2dkTdXkG4O440UJvD7lPLn6ysKS6vB/U6v1syuI4YNqvA8jNqna+1Iod1z4qV50cNi1sidxHuEUy5iD0xRg14vPKgkZWy3bxc+7SBZoPQmJSe3+sciS1WNAXSiZtCrGcodYJql8o/tvAYEpJ8/CpLH+HnWCdZqcgwwRP29qCrGPioGcnxTKrWQXO+YzOpBR8kRYFMbWpANz3QLs84wJuT1KkKXlwdY1AmqwpOrsZj9b2P9goWuKl6766l102Gwdj8PlVPTT73Fe9ICKZ5WZFEbTMkxKlalh2KMF/XKpxby/UhXtr8m0QvfQA9ie9/m8ZRpqY8GcXfgs1+o+g5HDnYaNO1RFpsy2jw5U2MOnOEaAgXpCtPMmLMVNWoYBraGp70n43velWg8+v8umqMuZiRsAM2Ly5RiLlSJifTvPhAmvembb92ekdkg3WBaRx1soXfxUDV+pirkSIpmz3kU9exI7JXsCq1r1QQNbjp1t4DlDk7ABbDo2oUFfNzP/eYGzs9OjffOGLbxqoqKZtvUJMX91FHoD7bZ6c2VJSeu4LBGvtfTYo0QIi8+KAQYlV/nXIRZxtF/QT+LUwZIjIEoKDLGBq0a+Vkob/wzpDndnWzcV6Mm+P9l49x3QO/1pEStvnyEkC5Uj5RAK1J502J74oX2nFCUZGwZletzG6YAGyvaU/yMWDpGVafyQP7yptNKFhN0aVgVjMDZiMU+cQ== 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: PEJWKpj0gUddbFXKdgS5PbcCYY4QRDJzIYs6JfFJ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B1XHpp3TZ/1wrQ8PbqjkSXY4HM7ZMHccQKXD7e3H9gYFZfCbUJ63ThlR5SN15e3gJg/V4ZB2WPuFKCntn5TmnX6WWQatNAGpSCuILo4CJ1RCALGnLnuenjkj3XagR2hfWsxFf9JF5kke8q9b/C2ouPQW3+6Z/wDkiHd/gP4gCyjslg0lfNrnhKSJ2DY46rNf8xIi2U1isK4yzX9N8kDFW7/4DZ7e1OJnaWaSPfqk1FasxjR9w47XGqpA/rLsVmJvvA3JCwPDyo5rjQigyvuRjbPTZiAGpcx/4hhfu0YkKw9WXMJOeDkb6r4hauZpIvntwG2So4GPHzYSOWr50QRJ9G/bBO9Bn9Fad2avULV1bJjQ+D1LPmiDTiN04fJATMGKWaS+8g4swIsjb4nzT1VRNWjDbiI8Xy5bBSOPJrN6Tu+p8M4QUekphaIoEXNDg/vHYLXZ0h3YxanLd6jOocwy5pRlZbtLdzgPz5JiNnW8giE9/yZ3dpBmnEzgLh8OrJ4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 880f5b9a-f3df-48fa-ccf4-08dcb4e72d47 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:17.0775 (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: IH2hkaagf8Oq4sfxXR8KURVMTufKDYGWlxA2hOEz6HqP42IHnQkPf5dq3A6C4zwZqL1IpgipHuR1KpDEYdx4VNyQ7cTVtsOKMm00sH4RkFbJLJwT1p3Bc/oosT/Sjjkc 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/soc-core.c | 2 +- sound/soc/soc-dai.c | 2 +- sound/soc/soc-dapm.c | 4 ++-- sound/soc/soc-generic-dmaengine-pcm.c | 2 +- sound/soc/soc-pcm.c | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 20248a29d1674..286e872ae4547 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3456,7 +3456,7 @@ int snd_soc_get_stream_cpu(const struct snd_soc_dai_link *dai_link, int stream) * CPU : SNDRV_PCM_STREAM_PLAYBACK * Codec: SNDRV_PCM_STREAM_CAPTURE */ - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) return SNDRV_PCM_STREAM_PLAYBACK; return SNDRV_PCM_STREAM_CAPTURE; diff --git a/sound/soc/soc-dai.c b/sound/soc/soc-dai.c index 9e47053419c16..28a0a7a0993af 100644 --- a/sound/soc/soc-dai.c +++ b/sound/soc/soc-dai.c @@ -379,7 +379,7 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, */ if (dai->driver->ops && dai->driver->ops->mute_stream && - (direction == SNDRV_PCM_STREAM_PLAYBACK || + (snd_pcm_is_playback(direction) || !dai->driver->ops->no_capture_mute)) ret = dai->driver->ops->mute_stream(dai, mute, direction); diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index d7d6dbb9d9eae..0d60942f64113 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -1312,7 +1312,7 @@ int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, snd_soc_dapm_mutex_lock(card); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { invalidate_paths_ep(w, SND_SOC_DAPM_DIR_OUT); paths = is_connected_output_ep(w, &widgets, custom_stop_condition); @@ -4539,7 +4539,7 @@ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, void snd_soc_dapm_stream_stop(struct snd_soc_pcm_runtime *rtd, int stream) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { if (snd_soc_runtime_ignore_pmdown_time(rtd)) { /* powered down playback stream now */ snd_soc_dapm_stream_event(rtd, diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c index a63e942fdc0b7..4265e8052d6bf 100644 --- a/sound/soc/soc-generic-dmaengine-pcm.c +++ b/sound/soc/soc-generic-dmaengine-pcm.c @@ -297,7 +297,7 @@ static int dmaengine_copy(struct snd_soc_component *component, int (*process)(struct snd_pcm_substream *substream, int channel, unsigned long hwoff, unsigned long bytes) = pcm->config->process; - bool is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_playback = snd_pcm_is_playback(substream); void *dma_ptr = runtime->dma_area + hwoff + channel * (runtime->dma_bytes / runtime->channels); diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 5520944ac9ddc..8f501178195e9 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -905,7 +905,7 @@ static int __soc_pcm_prepare(struct snd_soc_pcm_runtime *rtd, goto out; /* cancel any delayed stream shutdown that is pending */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && rtd->pop_wait) { rtd->pop_wait = 0; cancel_delayed_work(&rtd->delayed_work); @@ -1517,11 +1517,11 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, switch (widget->id) { case snd_soc_dapm_dai_in: - if (stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(stream)) continue; break; case snd_soc_dapm_dai_out: - if (stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(stream)) continue; break; default: 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: wcx0lVzeLPUAKDE7bqkCnAQ+7htTmprUamEtPV0mjdh3MHXUNRGzTWh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ORX5CczyWwo1VAhGN1GRRCSrfWhbx/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) { 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: 816959 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: eBAfGHsuZhUcrgNsOBN98TPTKZdc6ONXWCFaaci1qHzGvaGTq6jXZJ3qDGqyxXK4rAH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vGIFdWsNzQjNy/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: DLQFpIj3YsSRvX41o5WiGui0eSwse9xA9opI68dvxBNRsn9TMO+HB5M+DvbkcHI1eBShbSL8BkyVD0qIRJbYu9Hp4NAE08FcAtOU60sUa/N2wpSTKeywhu10aHfbYvDKXY959tynTHdqGybTrpHNbz4pBmsu90nTlZVYrBZyCvKufxRP8LwpOX0SaHwCBvDf30J1Ea/SUH/8zazxEK9Mg0IjOZowmyP4dU7CpS5Ru/A88RbKbf08svTRgS4KE5Wkrcpl8wrhbaXZru5TpOZVsH6l1Dp0gdrEYdSjdsUrbiYwzzwPX340GqVivYpfkedNweTN/Qkq/sI/A7y/rJ7kdt4dHORurvkaM3v0ZjmRmuXGzn8+asRy/ACPH0hAKAVR1rgLiDfbm3YqKZygFYyuKtDJ6GBLc1cyDKUMuyKBN/C5TekSBXHKGK9rbKkos6da1rKf+2sz+fEtAOjP6fAArk3ePIgJg+n6OOt94F6f6MSqoai3fjL8PmKeu6xk3SZGsvdBv0a9m23sBgaIWd+ybeiw0tfKotVL1la1yEopu39g+qWyI0JBEfm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V0HFY= 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; From patchwork Mon Aug 5 00:40:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816958 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010068.outbound.protection.outlook.com [52.101.229.68]) (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 0366222625 for ; Mon, 5 Aug 2024 00:40:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.68 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818448; cv=fail; b=nmfEsIle+KTlds1zaMOihQZ3t1PeLf8Zqto5bmnrNmuPtU5/5E1XKLOV5LI39iQjDJJeILqP/hG4ftdO8EW4OyWiKZ5VnY9XqVANd2P5ay0KLWVlkUYmkJUTStxTceqcL6nGoJjAaMe207RLwQL9jRcm6xRkoCBJ31vaauP90xA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818448; c=relaxed/simple; bh=h6h4Lc0XQzhpm0dgpHDg2jGbtapqufOwtymXFICyCVY=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=dOnj4dp97sNF2jYHGDgH0USunTlqf7qUXCyfvuNjuDAvS3BJV83fg3uyZnuQCSfmKzb04FXzwsLPZs+auTN0EAenwxzel0PD+rEZTDgPKMgNer4nsXOMFBoPGqhKAG7ESezZREl3k+WRP2ZVYblPFY37Vt/aO/fBBcNDxE3zKHE= 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=lFWctw5h; arc=fail smtp.client-ip=52.101.229.68 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="lFWctw5h" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xz/n2ThacQybTYP7yJdRjEJpCwnGhonbeQrPwOyE0dAiIcQP1JuuJ6ya5MfvSeqf8+9OUfSQhFQxIFNMSJ5Icazty1xMbM3KQ2JhUbAD/ZCt5yTLpqcE1fbZMVLwyrYTDEzzwOWZgr3RHNwr0HfxMplQZl82pI6KRH/h+2OhTW49HVbmBOKGcu1Q/0RY9KlSEMZUQMV+xAxMn3SBiArrOFAHMT3QaMda8Nx5npkHd7KzCOYIYTwFsdtlq1VlpvKHndeiJlgVu6O8LwgzRu0p/dCF+2bC6sKopoGDRvMP+eCLL1z0L0SNaG0qk/P7/jyAuVlYBi670qRjvIRpW/SHoQ== 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=9bFjK434KIiHYhQbnPwwJ4EBaa4zZ5bC+pzrojzmdI8=; b=oOtB5EvPxeD+uwjR+frYxqSuEZXg3ijHvDgEor58D4n3bVCs7/G80eeVbK3DCJwYB/WcgiWt13ZJbGxCNCXrSCnU5ZjbIbFhPuysTcmCKklWXVB8NOmfPeHyJZthZkwunv4esqj1hDOOZR40hfNTNzuAC4SWW1L1o4XGN3gu7BW+V2OKVRNb37w251gJ0lJXvytriuPBGVTocm2zhDcQ/dpXxLt/jmZ19wZswbcnebtl/tm0sCcP4aSUGpfaVzqfAhkfSbGjGSCwgnHbEVdcf+UYt+griUDlBrA7s9/nOQC8k/mW6+AdJvjvlm9wKSpSmuOPeBfnmm0KGNlI2Hdaug== 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=9bFjK434KIiHYhQbnPwwJ4EBaa4zZ5bC+pzrojzmdI8=; b=lFWctw5h1u9pugAWMt5DQZpFkxmgh6y//NRMZe945hVFqnUsuJ1JkvE18pGCrT2rrWWwNPXYwWQnKfQjcNX0gPiMc8ZciDJJePDkaX6otXQ6y7TR8gTG0/4WvjuISeh7b24O6ysMhbrZFsqdWcJ/9Z7sKdKPaxoDlNy5GFvpCss= 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:44 +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:44 +0000 Message-ID: <87cymnyf77.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 069/113] ASoC: google: 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:44 +0000 X-ClientProxiedBy: TYCPR01CA0073.jpnprd01.prod.outlook.com (2603:1096:405:3::13) 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: b0efbbb5-fb29-4331-d56e-08dcb4e73db7 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: Lp87QsXEIINQsnG3zjUFyL1wRFe5lm0oXWqvzh98qOSDLj9yPcMEi/glZhyUFr85MzIBudV1YovzWYenbM7UdXIriebpfQEX7tRX8j/jRKPlr0YzaJl/WY7T1/dXYX3RNn7uN8OnZZhRAVhOIacLZ/38A00FMQ6Jq49iFWtbpUP4nv+MDyT87wEXsZVVqCUIyBF4j1VgGfMp1M8EQCyDUj/n4CLdC0rXHeYEjaz/G62Pw7+VBGb3sUPK+YMAYRdsxtsW28rZh8+MFzY99v1vy+yNH787kWIbTaC5HosRjNzpb37CqAoKw0dzya9aqalHlBN8oh7FGNEo04hHjO+p4LQauv4PeY9PalgIws6p8WSRdd1myIUbcU/CHfunGy3PvcbXzksrPGkpDCyzEHZOBLvCxO41pnbeJ01tcVHhV3dzoiZzX5dN2e7EQ1e3ILI0cF9N8AujuVp3ZV/6kxWFu3c0RsEz4OD5F27cVTCIGXULVlAk+VbLbCrzMOAWrllO/Pu+ho18WFk1RTuQ3AkSTy1dhrBWjcA91dJvXw1NXkd9noPNMroesyjZHr2JmFFvqGloSqwsiGn+AyUkeds6JFhItRftkcCXNQCzh45PCjOoBdNg6t9shco6DWM1ebKXtm7E571DPygTY+okE68p8tR7CbXCs3uprVWwNMkOuow87daGigSX5zt7v0LNWCv93P5y/CalysW8oJ4a8qqg7wHal5grrsEjeCzVW7/94fu1l9s0wMS5Lkprpw20wx0bhiu5WUbUMdkqMSPcBaW1+nYEreYsuH30esC67cKbyp2QnvCME2NQ8WWdF9ZNSiywativ1vBuHTRaK3X14P8AMX1nIMVwidjdp2+rxxhnrJXeFxpi0wfM43oYtQbxh2+792oPVFdTscdZx5EbnlBswEtuPbH8YHRMztfc55I9vM9JupmpNCIwgVHyfGNAxW94ZycDzkBtXJxw29vAuLeXARcgt3moUkTKxLVNNB65DzaRsFW5EL1dUfbYgzpK6W6OZbPkhMDOmbe/W55ZULGbRT9TIUuEqMrK8phbjQPWJqIxFWakC4rm/yqqsxNI1Soy9jdfL7x4nUkUriZtoNCc1HoINJkwQ9UTQhnrVBjc6oBv1UuIUuXguTCC866NSmpq/cf3GMz7WQYAIiUqw4XbVzpvDBJgtSyA5E9Z3F7uWCmuPkSJKQS7zATDlEN+a8uqyNa9BWi8GWjieZ9565HtJh/Tdf8mkVYLU3mNNAKPvEVNNUZ8itgE5Qj4XdD6GLxDXBawoHc0RFsNg8IDL5+H3vtaCpsBSC68wt6y/fEmj1LLdK8obAYJniRdUbuImrFNoavJfbWDzANTqW+USqAdV5VRjeYbI2GWxFEwkdvaggEe7rjzm8g7TI7eNcDUMFBfHkrsSSffJD13ZuttsVxO5g== 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: ik3lFm/YRqm7/ZEuu5p73C+mKCHoOmy36L9krGwrZmuxPHuA8Ivnxm/aADP9Q2jbTt6uVOKe+QBaJOx38yKXQNHWSLcrLlA0yIuv+g5Mc0PtmSxfpXWdgkqy9ivQEefyvzTY7e91tOqKYHtbIahnQQ7yeARyqBzdbUl8eToK4Eie4qFwHNaVZ8rKobpLDsIRpO8FZvwQa6iT8aX/UxlF+SNHsQX3eixDPXyRngH0XEz+ssogr9BZTFBuXAk48NXbJL5MVaAsMv3JBDG3Qftq2u7IaiYcrjOEgoa0nPVw1Yb1zUSQxwiSNqdJU/kDPDCoYkjqX4C6DHawE7Bbyoe8FO8Gh2V0+qkB0QV0MQAleL3dI5eQBIZxLG7yKQXMGojoAmmzhb7LdbKlvGdaL2TE4+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IIVSZK3ra5t6TAY+QBqg3h64cz3FnwdL3V8MrrtW3IhFV0FOAJt2E3w/dY25N7pOKuJ2fovS4qIl+5arzMCtS79WCf4wjR+PwH5k68SNDMGSbny5kjaHDlmufOVsPjS8yUoy59W0jcR1VQ4L7GeN7A= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0efbbb5-fb29-4331-d56e-08dcb4e73db7 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:44.6497 (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: mXYBiQo6IOxlcBxeqr6JghR6jTovQ+9V315e4uG9cYj/KfhfP7r21KM0sqVUawDZMtJ2jhyFKmFpqx3/9/zOlFLJRVPEbp8ZZYMxBxbwt94i78tqu3IbyaUc3Wv1JSU0 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/google/chv3-i2s.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/google/chv3-i2s.c b/sound/soc/google/chv3-i2s.c index 08e558f24af86..1bda70bcf57b3 100644 --- a/sound/soc/google/chv3-i2s.c +++ b/sound/soc/google/chv3-i2s.c @@ -142,7 +142,7 @@ static int chv3_dma_open(struct snd_soc_component *component, if (res) return res; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) i2s->rx_substream = substream; else i2s->tx_substream = substream; @@ -155,7 +155,7 @@ static int chv3_dma_close(struct snd_soc_component *component, struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct chv3_i2s_dev *i2s = snd_soc_dai_get_drvdata(snd_soc_rtd_to_cpu(rtd, 0)); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) chv3_i2s_wr(i2s, I2S_RX_ENABLE, 0); else chv3_i2s_wr(i2s, I2S_TX_ENABLE, 0); @@ -208,7 +208,7 @@ static int chv3_dma_prepare(struct snd_soc_component *component, period_bytes = snd_pcm_lib_period_bytes(substream); period_size = substream->runtime->period_size; - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream->pstr->stream)) { chv3_i2s_wr(i2s, I2S_SOFT_RESET, I2S_SOFT_RESET_RX_BIT); chv3_i2s_wr(i2s, I2S_RX_BASE_ADDR, substream->dma_buffer.addr); chv3_i2s_wr(i2s, I2S_RX_BUFFER_SIZE, buffer_bytes); @@ -237,7 +237,7 @@ static snd_pcm_uframes_t chv3_dma_pointer(struct snd_soc_component *component, frame_bytes = substream->runtime->frame_bits * 8; buffer_bytes = snd_pcm_lib_buffer_bytes(substream); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream->pstr->stream)) { idx_bytes = chv3_i2s_rd(i2s, I2S_RX_PRODUCER_IDX); } else { idx_bytes = chv3_i2s_rd(i2s, I2S_TX_CONSUMER_IDX); @@ -259,7 +259,7 @@ static int chv3_dma_ack(struct snd_soc_component *component, bytes = frames_to_bytes(runtime, runtime->control->appl_ptr); idx = bytes & (snd_pcm_lib_buffer_bytes(substream) - 1); - if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream->pstr->stream)) chv3_i2s_wr(i2s, I2S_RX_CONSUMER_IDX, idx); else chv3_i2s_wr(i2s, I2S_TX_PRODUCER_IDX, idx); From patchwork Mon Aug 5 00:40:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816957 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010039.outbound.protection.outlook.com [52.101.228.39]) (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 E4F021B974 for ; Mon, 5 Aug 2024 00:40:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.39 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818457; cv=fail; b=apP1kjGKPlAcakJeeIII1zongJVbmGn3grfDo8lv3id/7134/WMlmrX09Fts+aFN+22EryjhdGRZLB2J4yCWMqDKXY4pBHMAly8kdXYWm9TLAXr2Lux1n6XCCu4sgzXjGMvT4znSdJuHUD0cCg+5da6GUDlS12xy+fPDvS+BbN8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818457; c=relaxed/simple; bh=ImsyWURKPtTHbfCJHXosm/KB2Ilacgy4ZEImm91JyoY=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=FiaOtQvZaZAljYeBKo9UA18hTGT6nZwo2EfjQCscVJGFP61nbTPWi+QGwUZ9xEKqL+OpM4rGK0qG+1uqA4unF0tQ0AbNE5IyqhikIHVNWIsMNycBlDc2P3hAAlz+2/EN1Zuv8BAgn8jYlAxCYS88jIe8mcqlozkDYCCpIFqbO7c= 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=LXRDU+/q; arc=fail smtp.client-ip=52.101.228.39 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="LXRDU+/q" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bjt9IxYDqtWf3um2TgwH2iFqfLMqj+1Osk0av9OfoN1UU5ih9ev2gYg37izaamnncPcTywxdfePJyV18IXAQQHSVHkjzGyMko24cO5rsTt3vFDN141lX+DtnYzrzzvf4uSwm54ClnsOBKc19VeRbOF95f9Yvoa9XgxQyuC/u5pcLUPYfk+HUyox7cV2RrldM/QyYpvFiyhVfTVTdancoQMdsJIYpRKiqebwyI5bk+upnt1Ya2NoLJ7wVE8IRjJQ+SY9Xf13X8K4ga0O0en7i3Vca+Auo1i/rbwexhn/w4kfoL/Jt5cxhgOA8cChMmM0dN3OtJ42vlZ74mccLD+1Dfw== 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=jY/GPF9nfFTlEvBx8AASVpfke7bl2sbrIDvWtgzUuTo=; b=R0pX1BT6WyYg2GJ1y0s5igRWF9T0bMBIUnVbNWVBhOJl6yRzeJ+7/8nHYMgqS41/WPdN6fJ5QpZSZg1EZVi3Ukuta12Trmub7d7j0i4QrDhcEYk7PEJTpRJDPDTsX5Q8CvOi6Q/ZuvrwQWNFo4gLCAAOhj/Jj4jTRWGudWhZOEC0Ext3d/1AAQYnXxJS2ZTMg6FacqTGS+8m6YJIBiqH5ZmEIc9DyOA+irFI6oc7XPcDus54J1jOu+QsxZWi8APq5d1FH/jIEuF4GwDkQsxj7VOlcigyHFKpWuG7Bj6ORQwSwf0TYLWd/qzIZG8Dn40GL2cw4reEpPBjetgFSjwTvg== 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=jY/GPF9nfFTlEvBx8AASVpfke7bl2sbrIDvWtgzUuTo=; b=LXRDU+/qMSuBfdTTtSPM5SfenQ3Hml7R1hDU6y/hhP0e7cCpOZbIYZt3cIjuzlHxVOYoiSVjaH7CgchsAVXk9EW+JAweWikEOotcXCpD9akRsBaYepZNHD3d+H7tEaxXYEH/Gymqu/PbVmeRukqk7xfIzBVRZhErUk8SViMnP70= 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:53 +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:53 +0000 Message-ID: <87a5hryf6y.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 071/113] ASoC: xilinx: 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:53 +0000 X-ClientProxiedBy: TYCP286CA0083.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::11) 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: ead9b418-c0c7-4530-efe9-08dcb4e7432c 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: bGf1V0uA6EiTqe6QUIDBmqZp3XSXSLi5b3pw+oGtRgpDE9i0z1SigP9DsapMvnecVa17mWpVcMFgdT/9n2FCE4IrczRIPlvRVewkaKVCTL68cg6wuZQbBSi+Xfpp79ex+6ORNdYwIWJ5nY7zSpI1omQMT5/qYlx2uDhpR8O6uj2o1XqPZEnwqyexC8nkg2x5RhAcew0QrwUSOFDcnGC9S5WE8gdplsonpiSm2LahEGAoJi8M5aP5BHEKe0M25X6zJCvzgXf311RTYFSTeQQJ7Jym6wofJezOIeCtB3wrMGhP4N5norI1LpEYtF/TfZL1k8gNCRvVEaN1YvT+evY1kZEGjGmyXaDU19yTdfMPiV9rgIpNjjZKVQdpEMrCN+fV/iQQiALF5kJuq1k+FCEd8rhwqoN4yZWr9EOXq/lI465suPMo48izvT357S5iVPk1A3fYnfVIqKLvsrkmcP61pMfEqyM5AWGT7o7xxj/OAwrnTJ3hQ+03z6CiKQq6i1LTHlhF0A6KZnq17t3JNUZw3716dsEMc/up68HXmL2c59tFRASL4FHqz1uOt73UAqy/OAN+JUYyfr94s8F6oKk8MfP6CAQGGTpPZyIdqGm+4FtkxrhCFb+LWLJLmmLo1CAWruF38HIwLXOKwiM+bt0WN4Np0apEhf4IZYue1frF6pcvZONM5LF0qyuMi6iYYI5UEjx6paPGCxmlbjmz8sFiZrRY14NYQnn4WI1F5CLF+f4FxIP/oeuJuwu6ZT+N1F78mr4XGNwZla93uiV8yfYZfFkBb9jis6cxQnAF/dLDt//TYTeHXZlDSGofN0nqKvzeflMYH9yLBe9Iw4yQaQwY6qUkSLB0KX9NT2vFEIbDf7FRlkTE0bnBSwS9YZzbt+C536Ygl/8UqX+kNoQUJj9IGh5f6bnVhikojMGHK7IZnd42h1tUoR2N5xfblEoMXDuY80Q1LkGZo6soiyz8Bw+WYrKPWiYnSn965KC3bud8qKaBfzMvh8DY4RJdV0hFU4I2I+40tShdRgFIa8lbic5k4pWuNRIcPubyL5wQQOQedNcWS7B4+JAXjayVL+UA6IOYkDMbd9L1PGXUNqYfUwWe7XsGYnL4C3KqRnM3oDUnaosQ0OIn/PAI/ft66q1l70cG69O93jQ6qjb+1zpsR7z176n3AKxHxWm4c2490bFaiHb4PY32uf6nla8/KWgjiufK71WBbZ7Oo7AqeT6DMJwiBs2+xa36CTGp8fEWHTR4LV0kSC3jryY66nOKbsD8nH1HS72I5oiikMKu2drpXb5R8K92O0gOSXdeVO9GF1DrR8dLnC8L8m0oyuodZboYbOS6u5ydVijYu+r+uwaGaBk8oXLFrRXU117J8qHNvJ4Vd331OW7jiOmp/n0q0PE3Ac1RAz6J1bYA7AbimqchdUHUsw== 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: H3yQ6f5CfET1XZtK67XX9k2LjkBLmWlJ/fKLoPYBlHD/G8McFn3AuXTaT8bopUuk4LslTxIn5ooM2YXd2ZdlGhs8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Hv55tk3aWZbbHyRY9zcwQAlvJN0IIKDB62iv9+PpJJajBMEYztrejqizMs+bD9h5zXUZpXxQqkfk63jPlv7fAxtUhpU2P5gL4XbZzleHarmrbpWlj9z66qtkWj9MabS2CnnHbwjMx3hQvxI3oO1l43wckpFT2N4u2VQqPlqiN/4/qPHkkxkuWhAFZnr1hfLi67uvOIgE7DEwEaNRCSYKX3px+z4M19kf64nzgFCU8p0hYzpl/7q1a2Kkd6tMNrKi20vpkk8F3JyPRAaVPJYMFi5Ltb1zQESl/u/U3x1bN+4CZBu5VVACvTTmOe1PmAE2tjqB5cLjzLzqJOhL+UTrMtRBRs0vMh+rFNUPHRCBMX9RzPpmB+N7FV4/U5gH3oEzofFcPr5vQjhXPT+cvEnOiiALNbRxMP2PN6ocK/f42xglk8wbZADReDxJPeLsf4OXNZNoYIX57W0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ead9b418-c0c7-4530-efe9-08dcb4e7432c 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:53.8157 (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: m0F/BNFttuf1mXGIPuLPYPV0bRhdAUeVyUQoEWANamDpEsGqq2N1vtLFaq5i7SwkdcdfPKlnxMJ0F5pM3dWrYpM6s1YAYVgpxBwBmA3Mqo9e/0dHwLhx5p3ZQUqiWqLD 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/xilinx/xlnx_formatter_pcm.c | 12 ++++++------ sound/soc/xilinx/xlnx_spdif.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/xilinx/xlnx_formatter_pcm.c b/sound/soc/xilinx/xlnx_formatter_pcm.c index 158fc21a86c10..7076d0befb4be 100644 --- a/sound/soc/xilinx/xlnx_formatter_pcm.c +++ b/sound/soc/xilinx/xlnx_formatter_pcm.c @@ -271,7 +271,7 @@ static void xlnx_formatter_disable_irqs(void __iomem *mmio_base, int stream) val = readl(mmio_base + XLNX_AUD_CTRL); val &= ~AUD_CTRL_IOC_IRQ_MASK; - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) val &= ~AUD_CTRL_TOUT_IRQ_MASK; writel(val, mmio_base + XLNX_AUD_CTRL); @@ -334,10 +334,10 @@ static int xlnx_formatter_pcm_open(struct snd_soc_component *component, struct snd_pcm_runtime *runtime = substream->runtime; struct xlnx_pcm_drv_data *adata = dev_get_drvdata(component->dev); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && !adata->mm2s_presence) return -ENODEV; - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && + else if (snd_pcm_is_capture(substream) && !adata->s2mm_presence) return -ENODEV; @@ -345,7 +345,7 @@ static int xlnx_formatter_pcm_open(struct snd_soc_component *component, if (!stream_data) return -ENOMEM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ch_count_mask = CFG_MM2S_CH_MASK; ch_count_shift = CFG_MM2S_CH_SHIFT; data_xfer_mode = CFG_MM2S_XFER_MASK; @@ -466,7 +466,7 @@ static int xlnx_formatter_pcm_hw_params(struct snd_soc_component *component, if (active_ch > stream_data->ch_limit) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && adata->sysclk) { unsigned int mclk_fs = adata->sysclk / params_rate(params); @@ -479,7 +479,7 @@ static int xlnx_formatter_pcm_hw_params(struct snd_soc_component *component, writel(mclk_fs, stream_data->mmio + XLNX_AUD_FS_MULTIPLIER); } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && + if (snd_pcm_is_capture(substream) && stream_data->xfer_mode == AES_TO_PCM) { val = readl(stream_data->mmio + XLNX_AUD_STS); if (val & AUD_STS_CH_STS_MASK) { diff --git a/sound/soc/xilinx/xlnx_spdif.c b/sound/soc/xilinx/xlnx_spdif.c index d52d5fc7b5b81..bf79639081ecc 100644 --- a/sound/soc/xilinx/xlnx_spdif.c +++ b/sound/soc/xilinx/xlnx_spdif.c @@ -84,7 +84,7 @@ static int xlnx_spdif_startup(struct snd_pcm_substream *substream, val |= XSPDIF_FIFO_FLUSH_MASK; writel(val, ctx->base + XSPDIF_CONTROL_REG); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { writel(XSPDIF_CH_STS_MASK, ctx->base + XSPDIF_IRQ_ENABLE_REG); writel(XSPDIF_GLOBAL_IRQ_ENABLE, @@ -179,7 +179,7 @@ static int xlnx_spdif_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: val |= XSPDIF_CORE_ENABLE_MASK; writel(val, ctx->base + XSPDIF_CONTROL_REG); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) ret = rx_stream_detect(dai); break; case SNDRV_PCM_TRIGGER_STOP: From patchwork Mon Aug 5 00:41:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816956 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010059.outbound.protection.outlook.com [52.101.228.59]) (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 7371E17BDC for ; Mon, 5 Aug 2024 00:41:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.59 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818474; cv=fail; b=ebwgLxx2MDsSk0xaV+qMZCABMLUKes0vZ5oW+lTh/0j4ApJNXlpep8g2RsVTx3Zb0LNOLYt4vtOEGJGJGio2bqQUVVo1zY7gAHnAeN1/hqL+FTnm6J2PfCkUOIlUIlZ9A/N4DOBxZsZqy3K70OMe+FxqbkwCE+mY63J+3zvzdgI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818474; c=relaxed/simple; bh=Vb21KBp+qLAAHivLgk0hhRe0Rj+cEeiJz3uTS+eOD08=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=W0zfz7HlgufUPDAenEfi4psPTwkb316TV5sq+0/M3LDyapVhoCjdytwD25rp4L1aLvN6vnnPgEmCfVepb3p8+bcJAGOEjHlcIEP+jVm7puZPEf/ijpqGkvGIPwHsU/aa1t1swwiHG5kXyLxx+a9OcZpyqWk3r1RG3o0/AfNvnQM= 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=Up3654w1; arc=fail smtp.client-ip=52.101.228.59 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="Up3654w1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Yxtj5J8GV3Dnl/NgyuB/NETxFSw2D2MS0rxZW8Q1aY1urX5m7MitTUB3emlOIx56tVULd98YaMfc8PcmqqctjvqLLoxF+bUjl1gS5tdNHQTfep4aRsNgjb2dmypnab3Poni39aMeCH5t4kyNPbuXHza17W9SLWODgWo/ZZK0rhQp0r4FiPRCWEST/nyXCjrk1FcBQt0fipR605g/hRzi8t5CbPEx9jRQUhuM8ZOv81ZIAtc3XVUyN5VyZlsq4ERAsWuXLsWJQKPzKktM6oApAWRVxK5X9Pvl/WpdXM+hl876r6Viuwyv9WoS2+ygHxf3DjRlTC25q3rhgbj8DXjITA== 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=921Mc7bAHlyWkUNU79epobNt170O00T2xV0b51g1rSE=; b=eCV0E8HqWXMZyr50Qo/8ISHPdxWXCe6WZl2cSj/InlUgENKiOqBlK/GY/pP3JzjbhUcW1WFK22CqtmNHVBfzJMUCGxq59JLkbEDll/kVITBvAXA8JS7ux0XjdlzFl5Z+ClujGzBdSRHf9HJmnqkANWxAmRiSQ9r92GmBKAEt9jptZ9r+o+OVsShr3xFSr1OIM/Ci4FjuTHApKmCkogyWOMl8lMzTxTOJIEL94yyPnFxFZyA8pQxYmhqfVYzyFhMkuFHBo/QY2F5Q1omUtNpHcy4zWYDtZN+u/FEFn5e0LGTEHQUVi9io/GBezYfTxYcLtc0XCT3yr2v7+HNjiXtCpQ== 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=921Mc7bAHlyWkUNU79epobNt170O00T2xV0b51g1rSE=; b=Up3654w1d2KOSTO7tmcwC4+NH7QlThLXI+LCXkwGmqfWfAKa8WU/DUCJWWb2+CvdkJruElFqD6pcBQ7fqmEDsBgrEv60xbaJDL1nmzdCWYjHp9yLUYHN9mq+eV2s7ZgHoaT6M62Wdk2M6YP/4p9THfetJYtk/Ap3Galy9qGr5FA= 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 TYCPR01MB8678.jpnprd01.prod.outlook.com (2603:1096:400:15a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:41:11 +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:41:11 +0000 Message-ID: <877ccvyf6h.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 073/113] ASoC: codecs: rt*: 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:41:10 +0000 X-ClientProxiedBy: TYCP286CA0061.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31a::13) 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_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e0b7d2b-846d-4979-fb84-08dcb4e74d69 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: JXoHK6OLsut6WOmej8krTLMsTbRrAzAZHvBHxq31SU9iuXPZFx+BtmglpE2ZOLwKoZNzLOlRDVeojSTnWqqWUibFJi8mTAaNoxlxsVWUZoh+wtuyDCF0ort/QvFsXJ+jn520QyMWZqVCt/RjXlnhHJtV6/STc/kfAF7XzRJIKqPcI+ky61B5NeYyc3yoKXfCJHJEtVX4KPDuNX4aF0v2p1E6W71GtoivLISsz79x2MdnSQzHWA2ZwCMCCNXweIWrEniMiOlua8fGE1sGtiasPIYgAxTcWnUlMuRwXd1ZtqtQ3/LPgY2Xbvje0roaCDP1S+M093mUs4t6jORqN5IPsAjoXkGso72E5nmvpS1BreG5AZY8eyiuGOHZN/G9y8irPRhFs8wLYbfqzZVJ2Evn4FIrUMpcm1OPofasDpsAXJ4AqDIKkjApPfZXTKXlvhCiUr/nt1VgkGgDO3TGiPcmnx3OWEWayqqWRrbs5Jq1UaOK2qblhpcK79YabJgYyAJDROoibYP032WG3tCtNWW1W9eUxRV5Ka8AoVhdEosOPga6jwDgCKlVkDyUELT9/05YBjMpKaLCawIf+JKo4tI3FNKmtp0s0Hyy73kaQ1BM3X/03lRTeDxGPLSOo0oxNydt15j+7XcsCs3K7XNy6v+GZwRgMsujiHkPsQar9MVgMRHGxn2Swad9kg7aTC6ctD70oYFwBug12lCp7oeD1VfyWQu34esYXB56S2BrOm4KJqR/eF2zk+f5EayXb0pHxbvx14nsdUFIO0MXBYlerKAo7M/1g6x59hNL6nw4y4rP68Me/p2auOyB6jLYQnjFoEGP5YzXWgIHYiiBffUIT8VfMDOS/ctWbM0ms+iEZm27aC+L4tVNCXd1q1Y7uzKXK5GCsTq/jziIAPymZRTgOBB/1LMp6r57PnYWLEGiWhfnLUaEAGJeBqiAomtE+z6iqCcfM17C7NMheOPAXVI6Vo9dyQdOsBkRWkk2TgkZvtmLQBppqI1LQhLCTSpDMMTKgh+AGLs0DVP37bu+odixOrKdzNNi5KKMIT3Y0VQVTbvdFOenKj/CTbF+TNdr9FcV6huQrrO3EaAzmf5Sz396S8zG7m0AJ5BFPrX0heWaRWLhVhKXZfjKuFPMFZIzY0cdBLAUVPf+c1dH8cSs5ihGUhKIrj3p1AQk0klI2G95/ZfnlyUJz2tK5vsMTPwfJzMeMdszk4dEdYznkoXOtlJ9txZ9A+G58XLyXbxS3t5MUpLOIMfxMkeSJUVYIQ7m/SlBqLYHCpQoxZ4zOPgwYuI8somA48NMzhJmxvgOxz3g50LgZoqs/XwUIhMT1StvnLz0pWynB6qomXKOk0sa0whAasSH9hX/smhWX64o9135YRBptURUs8m7VdAKexQs852dI7CpIIY+I0ExrDNGzimpWE6c/g== 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: qzlApn8AE+ag3kwgpIXJ0qtKXEP9aptmsx3HG/jJDFVibd/gnFUGplCVihQ+XDZABzRbmlqtKTlgOgvlkkUU8qzkTYzrvswsaGRPHemWQMrSpY6ADv5lKQR75opjSr6HQgvqxCPf3mdIge5uzlLpIkKd1QsCEpVQ3DX+fRNELFZbr7wb+01GCUmlh/hB7jfAUmvhT9seIqMU5nkcEoy0ahe7AM0XoU1F4OnIPdCz97rPzwxo7xvpw0JvL48d3kUWEolaXGOaIAI4ncEc5sXoEotvPXfhSCFbdFK9w30eb8Lh3saPz1iYq48Lxg9Q1qZKt+6s8yl21P0QD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PW6YQnhqZynZ6Flr2856BnU61bAm8ZTpYSlOmPpkFxDf8mLDXNPwRqtma8bOlsi+VQKy7S5BrYB5CWd9GbOdE2Z1CZF8bIV/vYINt1bHQqNjk/pATFdsdbUU6M1TotPlaRDd2/NkwHBh4BgmHknIAkA8MqU9h93E9uoklHh45mCiFEvgiWORT2eC/uH+18I1xKy0wY/F76ni0fe1yN4Uhk5tcwJSSumuuItofYkVeFiQyypM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e0b7d2b-846d-4979-fb84-08dcb4e74d69 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:41:10.9983 (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: kK6prn2GcLXLhDFHbEczIU1bnN1CLbxMK1eenKtkQZi97dzMH464vYttQGD1ecE98jWKJXbBwE9FItRN8aEGiv3xtTQnwyIGRSunkF0Gn6pt6OOZouDQMpzb8hwG1XNo X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8678 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/rt1017-sdca-sdw.c | 2 +- sound/soc/codecs/rt1308-sdw.c | 2 +- sound/soc/codecs/rt1316-sdw.c | 2 +- sound/soc/codecs/rt1318-sdw.c | 2 +- sound/soc/codecs/rt1320-sdw.c | 2 +- sound/soc/codecs/rt5682-sdw.c | 4 ++-- sound/soc/codecs/rt700.c | 2 +- sound/soc/codecs/rt711-sdca.c | 2 +- sound/soc/codecs/rt711.c | 2 +- sound/soc/codecs/rt712-sdca.c | 2 +- sound/soc/codecs/rt722-sdca.c | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/rt1017-sdca-sdw.c b/sound/soc/codecs/rt1017-sdca-sdw.c index 7c8103a0d562a..986f3ab407a29 100644 --- a/sound/soc/codecs/rt1017-sdca-sdw.c +++ b/sound/soc/codecs/rt1017-sdca-sdw.c @@ -593,7 +593,7 @@ static int rt1017_sdca_pcm_hw_params(struct snd_pcm_substream *substream, /* SoundWire specific configuration */ /* port 1 for playback */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { direction = SDW_DATA_DIR_RX; port = 1; } else { diff --git a/sound/soc/codecs/rt1308-sdw.c b/sound/soc/codecs/rt1308-sdw.c index 563df483a466c..aa7cbd8af2f5d 100644 --- a/sound/soc/codecs/rt1308-sdw.c +++ b/sound/soc/codecs/rt1308-sdw.c @@ -550,7 +550,7 @@ static int rt1308_sdw_hw_params(struct snd_pcm_substream *substream, snd_sdw_params_to_config(substream, params, &stream_config, &port_config); /* port 1 for playback */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) port_config.num = 1; else return -EINVAL; diff --git a/sound/soc/codecs/rt1316-sdw.c b/sound/soc/codecs/rt1316-sdw.c index 22f1ed4e03f1a..01a8ad0c4e943 100644 --- a/sound/soc/codecs/rt1316-sdw.c +++ b/sound/soc/codecs/rt1316-sdw.c @@ -529,7 +529,7 @@ static int rt1316_sdw_hw_params(struct snd_pcm_substream *substream, snd_sdw_params_to_config(substream, params, &stream_config, &port_config); /* port 1 for playback */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) port_config.num = 1; else port_config.num = 2; diff --git a/sound/soc/codecs/rt1318-sdw.c b/sound/soc/codecs/rt1318-sdw.c index 319f71f5e60d3..60b29188aa642 100644 --- a/sound/soc/codecs/rt1318-sdw.c +++ b/sound/soc/codecs/rt1318-sdw.c @@ -584,7 +584,7 @@ static int rt1318_sdw_hw_params(struct snd_pcm_substream *substream, /* SoundWire specific configuration */ /* port 1 for playback */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { direction = SDW_DATA_DIR_RX; port = 1; } else { diff --git a/sound/soc/codecs/rt1320-sdw.c b/sound/soc/codecs/rt1320-sdw.c index 2916fa77b7915..563eb935751c7 100644 --- a/sound/soc/codecs/rt1320-sdw.c +++ b/sound/soc/codecs/rt1320-sdw.c @@ -1967,7 +1967,7 @@ static int rt1320_sdw_hw_params(struct snd_pcm_substream *substream, /* SoundWire specific configuration */ snd_sdw_params_to_config(substream, params, &stream_config, &port_config); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (dai->id == RT1320_AIF1) port_config.num = 1; else diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c index 5edf11e136b43..88258390afb7d 100644 --- a/sound/soc/codecs/rt5682-sdw.c +++ b/sound/soc/codecs/rt5682-sdw.c @@ -124,7 +124,7 @@ static int rt5682_sdw_hw_params(struct snd_pcm_substream *substream, /* SoundWire specific configuration */ snd_sdw_params_to_config(substream, params, &stream_config, &port_config); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) port_config.num = 1; else port_config.num = 2; @@ -204,7 +204,7 @@ static int rt5682_sdw_hw_params(struct snd_pcm_substream *substream, osr_c = RT5682_ADC_OSR_D_2; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(rt5682->regmap, RT5682_SDW_REF_CLK, RT5682_SDW_REF_1_MASK, val_p); regmap_update_bits(rt5682->regmap, RT5682_ADDA_CLK_1, diff --git a/sound/soc/codecs/rt700.c b/sound/soc/codecs/rt700.c index 434b926f96c83..575bb6772c89d 100644 --- a/sound/soc/codecs/rt700.c +++ b/sound/soc/codecs/rt700.c @@ -918,7 +918,7 @@ static int rt700_pcm_hw_params(struct snd_pcm_substream *substream, snd_sdw_params_to_config(substream, params, &stream_config, &port_config); /* This code assumes port 1 for playback and port 2 for capture */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) port_config.num = 1; else port_config.num = 2; diff --git a/sound/soc/codecs/rt711-sdca.c b/sound/soc/codecs/rt711-sdca.c index dd6ccf17afd43..a8b29df666645 100644 --- a/sound/soc/codecs/rt711-sdca.c +++ b/sound/soc/codecs/rt711-sdca.c @@ -1351,7 +1351,7 @@ static int rt711_sdca_pcm_hw_params(struct snd_pcm_substream *substream, /* SoundWire specific configuration */ snd_sdw_params_to_config(substream, params, &stream_config, &port_config); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { port_config.num = 3; } else { if (dai->id == RT711_AIF1) diff --git a/sound/soc/codecs/rt711.c b/sound/soc/codecs/rt711.c index 5446f9506a167..49c595f2ae4c1 100644 --- a/sound/soc/codecs/rt711.c +++ b/sound/soc/codecs/rt711.c @@ -1006,7 +1006,7 @@ static int rt711_pcm_hw_params(struct snd_pcm_substream *substream, /* SoundWire specific configuration */ snd_sdw_params_to_config(substream, params, &stream_config, &port_config); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { port_config.num = 3; } else { if (dai->id == RT711_AIF1) diff --git a/sound/soc/codecs/rt712-sdca.c b/sound/soc/codecs/rt712-sdca.c index e210c574bb74a..b36d4a61121e7 100644 --- a/sound/soc/codecs/rt712-sdca.c +++ b/sound/soc/codecs/rt712-sdca.c @@ -1437,7 +1437,7 @@ static int rt712_sdca_pcm_hw_params(struct snd_pcm_substream *substream, return -EINVAL; /* SoundWire specific configuration */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { direction = SDW_DATA_DIR_RX; if (dai->id == RT712_AIF1) port = 1; diff --git a/sound/soc/codecs/rt722-sdca.c b/sound/soc/codecs/rt722-sdca.c index e5bd9ef812de1..5e791a808b654 100644 --- a/sound/soc/codecs/rt722-sdca.c +++ b/sound/soc/codecs/rt722-sdca.c @@ -1183,7 +1183,7 @@ static int rt722_sdca_pcm_hw_params(struct snd_pcm_substream *substream, * RT722_AIF2 with port = 3 for speaker playback * RT722_AIF3 with port = 6 for digital-mic capture */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { direction = SDW_DATA_DIR_RX; if (dai->id == RT722_AIF1) port = 1; From patchwork Mon Aug 5 00:41:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816955 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010044.outbound.protection.outlook.com [52.101.228.44]) (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 68301182B5 for ; Mon, 5 Aug 2024 00:41:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818484; cv=fail; b=klyUbAt9S9erGQb3AJsj3G696DjEXOR3fNbIoHb22GZu/Y+t5zijOj9FiKGYWyadnlOEs1aNc1Bg2satmZhyEM028qGslaFcak0pPfnkxgSOJEijOE5M4xEJtLByYYVMjr9IOpmmT60fp/eh2R2XmtVx9fY4G+4UPQuhpqOLqgE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818484; c=relaxed/simple; bh=vLbdWbNGlwspP5N1a/W65gaSIU6crYYPbR9lM5Q7H1Q=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=qXEfAknDC9i5cjOGQQV7r0m0X6sUlX/NqN+8xUXmofMfQa5cJaAVyL383tsrAvAIDuYaNepUdGTKn6hCAacv1sPTQI7q4845/QDFzZItTfhcepdeGF/TSHfrWAAI6ml/LwOVqQoVo0Kde3mMegMxDo5bytzFCYVc8h1yRAfs+i8= 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=ZH121LgU; arc=fail smtp.client-ip=52.101.228.44 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="ZH121LgU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G2BMBb4OqeMYfKpwuPhdLlawjMY7/RulXdn0AyFlk8eBSAx2Kez8lrRjvMcLfo0O9ByRRDfgYOAAsYikuptfa/jP6XLM6lNJS04ru6koDv4xpnntU9CkiU3fHdw0R2ViEctrHRMRAuUhPFLjVn0f70qHbUYQzzCHHuK3NPRX0YeECjfkIApHIIDfhBwCHykJgLfcnOvxSaTealWz3RzjrGLfUd/P0xT7WWD+DkW3T2j7SqqVJE46xlve6TNkwx/SFLlC1OwUqvVA5UxVl77U2NOMy3RW0uwP6WzpYUg+BwNqJGBjpD5g3+GE87AekKECBu7Mm2RejFuM/Jm/mKbczA== 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=XbjLp0Vj2/Wv1s0I17npIid3Ouh8zBYAZfr5SHL0c2E=; b=h9js3x0+9X7TiduppM55tXr0BoMvrqEGB7EeY/El8E9P31/F7wFEWgvToUFxssZcHJhWipbbGs2FJpHuAvyZAVxOQmJ0vW1hcA+rTfXyGBFmxXdZXF7KPBeVuRpJHWvD0g+KeeZrYrVyNPcG9esEXMn1qva1HMqZEr31CqfT2KdQ30Ey5P09uCFeZB3YJ8Ts5fPjfIfbAUS/XMMvSBcCEduWve+VwyVfgpwF7+AuMwNBgVWQ+LK4JRUiz1wGN0ODUa1yanVbah9zRo2njRVyH50dDnWQ6uOu/bi5GUB1jYVhjpA8WJIdXiLiFEQMhPJ3elU5RZeuqvHAXnXZt3O94Q== 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=XbjLp0Vj2/Wv1s0I17npIid3Ouh8zBYAZfr5SHL0c2E=; b=ZH121LgUjoO/MvjFNHFYhK5LD8YhqvDdehgKP6onFbbDFA5iHsY6YBGhlPvrOzIP/sdY6D6q45wpnUJCQlP9DY8aR+4pw3QXphe20dpWILW8RQU7I0WPbkTpyQEPW5rey3INp81VOHeGGwGF5FcQeGtSIhzOsyYGzbDMwQ0grAo= 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 TYCPR01MB8678.jpnprd01.prod.outlook.com (2603:1096:400:15a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:41:20 +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:41:20 +0000 Message-ID: <874j7zyf68.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 075/113] ASoC: codecs: ac97: 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:41:19 +0000 X-ClientProxiedBy: TYCP286CA0316.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3b7::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_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: 7bd44945-9c3b-4285-662b-08dcb4e752d2 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: jZYbrUgwETpcYFjO6SCuVutDrS3B2Zwe6DfmRBluIoQUYhRdnd8I85zhhWONfq8Fioj2iuuoDb7BOfKiyGyFO8mwkc7sFUh7TgOoAJI3t7nugnLKCnPw8TCwktahOx5iNwDd5Hq6ReFxsLIp3Msl7Pv4KaevOsxVhEtmqbPYLLlBS5OwfE11Qtq6+DqGU8wbDG3wo5vHca/5QEPCXx7or3tlRpH42oHuAFiZrLiDohaLv+jIyN1O7D27jRG1cZiowOnsCcEd3QZ93MZ6uI5SdLYC9q8myW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baVI1zExhd9GfRCNrMK04E7qjNPRffHQvKX1A7X2GkUXsvU6DFCiKZBD46p1dpCb8xmSLQg== 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: ko6ROMSw4zUKL7chvKQH8xgYWfgua9kzKUMv5/bOupXqE3T4XhjR52ivtcGQa6MZrrIobpFm5a4t0kB2R/xnNNvqdkTFi8COHTdN0N+ww2WKccnjPXASLmsP3Ud7RKWuRZv/mCrXGwBG5s1gsDpw0dxp/vNK5H7B6u2oQi1orqTvIAcA5xPQusj5TSc1ur7YJZwv/acp+0mFQQLnL6brDVt0FBKEvNleusZwsbLhjX1BKU8/g8Sdf9StwifFRTXLnSLN4wCEsZUFQOzaAdBn4ppIXeZ3r9E5mzWcT0PS9zDUEZa/FcJdwyZwx20VQMp5CgQTRAJGMerW0TQ6armJyvXkrI23x2cvGrOOtMThZtu+Y8swHh7zvisn+weP5azQZ08uj3AtB7VfAlxLvgGYE/Jb2TUZiqBbrspj1fmUsQfk82Z6dQRXCz8GhjOHvyCsjezZBKiFf2dRJOOvXC884SxDROUAXrVff/YPYPiRMM/3fvf0YJzmVtFaDBGlRPlDb1/fSFS4XNq5DRlT9fPN2YdwyZiuV9ewkEmABJZezU/Cz+dsR9QX7eMilGGI9rEHbPfr5rIx8UF+VHd12WptbsOJPWDpq4tupkDHL1VcEbbwgsZ5/O/59d1azVRA/FRcDyv0Z4ULPqu7Xey+mtQUoL+3NFKYhQtAmES/xfOoAmb9arixg7eDm4jaCcTa4eW/3I9xLspO7x+y/VDEPv8QKLPnQ88IiMjZA+ZvwiYssleGMOPG9JY2n4ys6lw2JA+y0ADOZ7wOwqqneWAsK4C8ST1cY88ORzE7GC3rtZL6HIXYi13U2nxStj+89qt8AnLQoXUtabP7aS/VT7JvxVhLigmUGaIkgYElGBsyf734xmb1ItyMPk0BnLGLx1fYUb4FKQqExsPDBrzSnZkq7xZrExjv0NTpWDk+80TjDnjhGvLXD3+6KuwS6BiXRCnVdy0bFjzc03Y2I8DGSlatZKNPnQWc8q0RlD5JCECQcrV27xppJj0QwSMrU+chalQDbvhKq/JqGEOMNY7Ox8FYTiMKiWeHSwnLn+mMQKBYZMTs9SF5UHLQpJn7XLZGQ8tvn3WhniI80DAr/wKNGjZ7HHJqjVSQ7dqYVg4fhYPzBD7Q3WBiCW7nvSWDNHn+eEj3U763KuOqzCTE2puClbMdAj4zedudRBYitJ+QSyYNZDDsMezdqkIE8thFokqW3yuoXhs5AVXeSUYHnvH9l1RG7JYu5+Z/w36cUlqljH0WlqtcyCb2rz+qtwRJvZhEkiEZ5TPjPdi7sqbNPdxUUV3VNa987HC5tYQhBoBz3SHvSLNEQPkZcTgfN0X/4Puldc0NPAMDkxKUqPodnsvHhJ/USMkxeOFS+b54QFMX8yUpO6ks16T/7qZMbZQmYPm9ETmbZ+M+qDmhSjTNWyElAZ9N2+Gnn8Xbr8QogsLiJR1z6ZsnD/V9e2kwIHB9X2heBTEuLYFJPS2vkXESTc46HYXq+T1pMCxuxYae7domUxoV/MtMDNlLcwnDdGFXA3hMQwzh6/GNMfm21yelp6f2Np7NM2f3TTYgmsxGJt1CoNGAB5N1Jz1cYascTLU25Ry2le3bmZdDxLh8kDiTq51XjN7IMhM0j/34k5VeKn42PjUhHzXoOEQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bd44945-9c3b-4285-662b-08dcb4e752d2 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:41:20.0893 (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: 682UdjjKku0jnmUC/GxKI91G7eVI78aOZAM1MjEanN8MgNFY6DQfkP9f81kjKsPDynRlMq//4A1zF6HTNMSoifA/r9am8v7I/IL4Og/v7C27adA2rOCuwLJ1NNnJPOgy X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8678 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index 0e013edfe63d7..aceeeae518d29 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c @@ -35,7 +35,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream, struct snd_soc_component *component = dai->component; struct snd_ac97 *ac97 = snd_soc_component_get_drvdata(component); - int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + int reg = snd_pcm_is_playback(substream) ? AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE; return snd_ac97_set_rate(ac97, reg, substream->runtime->rate); } From patchwork Mon Aug 5 00:41:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816954 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010045.outbound.protection.outlook.com [52.101.229.45]) (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 20DB017721 for ; Mon, 5 Aug 2024 00:41:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818493; cv=fail; b=Lw/bqi5RYLvWSxoZzZuHu47O9FedvWH5bjnSUjv7DIkxbnV6wNmz+5OLPKk5D1XeuU0LfOTHm3KTgrXz8FAPIih8sD8EGv/96xev5ynElt5BixdjXzUYYq04HvrTuCvwWhAP93eQwgaEbuWr0aYAPOPqqEldaBJuaEgN46QYWaA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818493; c=relaxed/simple; bh=xztf81RT7eIb2/r7pIiOpEcTKOg1g6w1P/oYkbuNv9g=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=ljDB5FY9SHvNm+JZgMBHr3cLNvsu2Lf+wwtN5CLOsKi1835uT9s57qTltFjQqUff1+XtwoBHRi+iisbmG2ok1ZJ6FnOiK675tY/EQRxWyrCtGuvtVeXAdncW+7K4wTU1MzLc934FafhF6xyFGKc7XTcqUn4QiLvYNNN7bTJ7H40= 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=bQwT6rTW; arc=fail smtp.client-ip=52.101.229.45 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="bQwT6rTW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dLLkrzB7VqJbYYAgvPg71BL4FlW5VlUJK132nM6kYKmdCDh/F7VCPetkbwmLu18htK4lMt5Iruddb01dvAQf3/HnO+kP6ABIC4SlcpfiPx4RyNoqoU0XfPfx4e//YhgilZRnr4KvUTI8JiNUQZh/zYJPR1mh26yETCqwEh+OZGozOiI5nZu6w4anIgKrx79WEmkV+F6trlLwdPDzn8b8LKTjE8lcaKfyPTq5WkfwLvrFPTIKZd6GXvBASBChKfVeAHvzrLxPOpwVSSLdZkDnAi6D1GK4LD01d/ERaQTy98u7Upxhu4zAxYe/432w43I/+8JhEcWnSzzCHC1bXnUryA== 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=DepGlOZ9aPM/vHnXBMieZHAVDiMQSTnPwd/2u92ie6E=; b=HHWoc13BIXe/iVQU4t1CmvDMdCx//2C+lhBOWcDPoMBOtPNPNYT1pjivoxtJTKEqK18dlMqIifxekSqe/WD7asKKu3m/hnsEsBYbiU1+bP8wOGTRQLCtf8tAf20R1kGtCdVQjhJrHUkHb5TkCYem3OfKvEq7AYwxqZXANzGkw5wRKLSSBpKdUlu0jsyS1TjlCMniKVtSxYA7aSScUKPL1rWTRzqqlh5dxnwQ2SIIrfuFGHFeb/UVpCDwSTqSvg2d7E9GoCmNKwLltvwut+r1y1vwbzAU6yYnW5d4DQiDRPKUCIFy/U/6Fb5qTnIG+8WpNlbcsQuRR9yoxsss9hNb2g== 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=DepGlOZ9aPM/vHnXBMieZHAVDiMQSTnPwd/2u92ie6E=; b=bQwT6rTWT7rpdhyGR7VXNVwU+CIPkHPcvfHcZkXSOfjSmiZ5AacFsHb0EiH3aYx+V3GCx2nKzo2eX/ftPs5Z+hQpGt3Lzn/jDdyOORd45z4mcnYvkbQudOXy6uSv17qJ/IYyjmHN/rxFNVhpAIMAEL7ktbFLVuRu9VsMh0NEQQ4= 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 TYCPR01MB8678.jpnprd01.prod.outlook.com (2603:1096:400:15a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:41:29 +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:41:29 +0000 Message-ID: <871q33yf5y.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 077/113] ASoC: codecs: es83xx: 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:41:29 +0000 X-ClientProxiedBy: TYCPR01CA0094.jpnprd01.prod.outlook.com (2603:1096:405:3::34) 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_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d3894cf-9b2a-48c4-b570-08dcb4e75888 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: ETFp+nRMzOO2T0VjFIw+oin2541WjoqGReMg2w+l/DI7Ym9miyDuJtAV/krivJzYZytlMXL92uNWJxWuHDCFr2A9pBCWJ1d407Q5aE3RZO5I2quRdBJJG+qsBA60B5aRX5RQFQJ8idcFDlURywrSawmFN2d/mEz5qczi+QrHKzoUe5ob/nxmcONQ7Njp9U1+gCY25nQ6ut1e/nsF8HG4DG5ABG20PDWsO1SbMWnQVM6NAKW5y22hLtALYX9VyN0hCF4fWZYnJKL8tQAvi4/qXr1iIsuLs0tpLwrNjORlH18cLrCz7dAl5tTisgMGk2YmUCzS/sp5SMd+sm5wEe3O+DFF/u8xLOcmirOnsaKzLty5iwP/+2HvZnCPUcgVByGT4yddVGYi6x7rLA0XEuoyr0PO46yeUOmv2TGkUY4SPcIDFkwvUq9kY66fGalie0GsQEEeaGWQkVh+13NrTE2dEO7qcJbfHFUoC8P4qZiNOdBW/e/45Cg3g5NPu8EOtzDmN/s2vnVpfzH4Oum+410oMYVTNQPqJjKKLFXgzA83VFATv/norNv97Ekt1cQGKfmPziDV6JhJ1JboUq6CBmg2kpSk2hqGRZDk3WUVYjDQxC/7RRSdpz/wv9nPJWKdFRQWbJaEP4RAZpF6QlTSBCRsBO4AsORfBVysEGbzyFqeknxqWDKdmeB1klqixZJjA4r1SduTopiWWw9Nm1GBeLTOID8zi8fiLGkIJHnnpElm23KeU8u0xt1RTyvxQmtsl4BtHDNz7iMKNl+gYL6D5xoPHiMaq2FQSsaabwjzuXsy7fjWdblCdwQppv+4macPHxaIjhPCUtgyQUxVC5PvGSxuoTLel02T1jV6ocWfXkJOP8bBSyL416vPG1ZPfGadS6iVjFiAZq5tG8nklSnRVlF4tOVTEOs0sKwW8u4U74xMrYaaAveYjjods45LBLnISIRKW6fNNb+RxIRLHA3Hwz+iXwoLu9KrBqWedNzA7CvA6PLXU/aQVwaLTc9gVX8eAqpMub3jwvcqL7LSqp6WOFLJQ0mOe1ws2ELvE7d+yjs8enh16zkvwh1sDYG0D+/shORfUBzw2sj+OyLayOAQXvJWMb6HkuaRv4K/tk0WO76Se0SD467UkBTUveg45xorNJsuMcU/JCp0KMhJWT+sxo2RDr9H8YuEHn4sEME/I58VordEyXHBvL9/R1+FfhPXwDKsUjxYwfdvC1ml+mQDZnpVMuU/jim3jJ+orhiGQH8pTvEFYZdeNuyPrdPxb5wOds2dnU4pregN91mkkAVecQuSHSiYlsxAfpayEc7rPx5qt5amTvcIQYCaBVtDanEAD2Xii/N3e6qLguyQtvSvV5fdxQrGTUPJCVipOw4GFWG/67SHBkzbyDmR2znI1JeuLk53jdtqC3DLfTFSrBtDTZyJKA== 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: ST2OpaI4qRd1H1+yuSHejwy8Dgxvl9SjPTiCKrbUpAYhbmbiDiJGbOdFjNepsuyBHw43zg1CEoKc6D9EgF1S6nuDjuHfCkiy/SY7XcgLrejouXTXR1TeYbMmNFLMY/zrnMXCaBmZbJ9csqQYJwn+jlUwm9YUfHNZaSod0kgKLnRmXb8Lu6lzR70UdOZS+MWPnHeZ5cQJsgPuJKjN4Or3EE/6p4g902OQIgM6P1sr8inojb0bXYstuEzgz9ehPPz3d1+fqtF0epzhqAvOE6hEg1BdV5Vs7px8XCk34SGSUipxz2KSbLkosJDfUntXhGt2qXcpHVG/HKpZLo7AfeMcIOy+RMevPCX2gVe80hokw+cYmOsla6XI8Kx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MzXnKAu+IvMpckU7JvEGEv5oyTw6tpkd/IUBVUCgs3AbJwFYhmSHqGdsn5CYDJM53X8HtXKBA+CiVGZzyU9/+HKgQqNWnAOVv4C9usbkg+yPkJcrhTllqhLA/zhcnhHqEha4GqHsaWgWElYSiSC0VKcg2rT9+JK3ll9EVPP2uUQUb01NTAef5KmoURWcAMw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d3894cf-9b2a-48c4-b570-08dcb4e75888 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:41:29.7619 (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: GN68DC7zjH/qFLnNA0Ad+XW/TxCfiI6Y8gXut+3jpu3ElKV9qc5xGSBC2pgYR5Kx7tZEjiK3XDRUHuoO/vAWo9/R//bpEQQF2a7t6E9hpShAQauj6rz8Wy6pBkF5Oed7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8678 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/es8311.c | 4 ++-- sound/soc/codecs/es8326.c | 4 ++-- sound/soc/codecs/es8328.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/es8311.c b/sound/soc/codecs/es8311.c index f557e33c26ad9..6a839bd5ea3b9 100644 --- a/sound/soc/codecs/es8311.c +++ b/sound/soc/codecs/es8311.c @@ -452,7 +452,7 @@ static int es8311_mute(struct snd_soc_dai *dai, int mute, int direction) struct snd_soc_component *component = dai->component; struct es8311_priv *es8311 = snd_soc_component_get_drvdata(component); - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { unsigned int mask = ES8311_DAC1_DAC_DSMMUTE | ES8311_DAC1_DAC_DEMMUTE; unsigned int val = mute ? mask : 0; @@ -508,7 +508,7 @@ static int es8311_hw_params(struct snd_pcm_substream *substream, } unsigned int width = (unsigned int)par_width; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { snd_soc_component_update_bits(component, ES8311_SDP_IN, ES8311_SDP_WL_MASK, wl << ES8311_SDP_WL_SHIFT); diff --git a/sound/soc/codecs/es8326.c b/sound/soc/codecs/es8326.c index 60877116c0ef6..fd3e89cc02862 100644 --- a/sound/soc/codecs/es8326.c +++ b/sound/soc/codecs/es8326.c @@ -605,7 +605,7 @@ static int es8326_mute(struct snd_soc_dai *dai, int mute, int direction) unsigned int offset_l, offset_r; if (mute) { - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { regmap_write(es8326->regmap, ES8326_HP_CAL, ES8326_HP_OFF); regmap_update_bits(es8326->regmap, ES8326_DAC_MUTE, ES8326_MUTE_MASK, ES8326_MUTE); @@ -627,7 +627,7 @@ static int es8326_mute(struct snd_soc_dai *dai, int mute, int direction) regmap_write(es8326->regmap, ES8326_HPR_OFFSET_INI, offset_r); es8326->calibrated = true; } - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { regmap_update_bits(es8326->regmap, ES8326_DAC_DSM, 0x01, 0x01); usleep_range(1000, 5000); regmap_update_bits(es8326->regmap, ES8326_DAC_DSM, 0x01, 0x00); diff --git a/sound/soc/codecs/es8328.c b/sound/soc/codecs/es8328.c index f3c97da798dc8..0c371da80c7e3 100644 --- a/sound/soc/codecs/es8328.c +++ b/sound/soc/codecs/es8328.c @@ -483,7 +483,7 @@ static int es8328_hw_params(struct snd_pcm_substream *substream, int wl; int ratio; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) reg = ES8328_DACCONTROL2; else reg = ES8328_ADCCONTROL5; @@ -535,7 +535,7 @@ static int es8328_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { snd_soc_component_update_bits(component, ES8328_DACCONTROL1, ES8328_DACCONTROL1_DACWL_MASK, wl << ES8328_DACCONTROL1_DACWL_SHIFT); From patchwork Mon Aug 5 00:41:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816953 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011049.outbound.protection.outlook.com [52.101.125.49]) (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 DA2C917BDC for ; Mon, 5 Aug 2024 00:42:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818524; cv=fail; b=Bwpct+poix72QTKl66z4fFSi1TBDU70VGdUkd7VW8VV4xJB6PLsSHQmMTxWQRzoZd2WqAFNssIye6mH+sNLv8WkGhNO6rziFVJWoYm9jaLC7u7EXd7LImILGFT6I1S/2f6qK2ha1KLk7lYEf7IYOuMRpOOt/hXJioh6Q6wF30pw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818524; c=relaxed/simple; bh=dtDxKYXzaihL07zyBf0CI5eVsPGd9MgBvDVOdQKRi/g=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=c0Sg4KFgyzbZz7eLgfZaCW+7ASMiB11WmErYHz1vXw0ZPDK8x09TWRmYzQTNa/r4PbGbZJwX5qc3bCTjVkvi9JgFskPYS2gPwJnbnVZ5/JdDc4KxXztQ4pChc4XJXf1V2MZZEiEfYQ3dDal4ljONNLncLKeY+wDj8U/IMNpE6Mo= 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=VhrSM1sC; arc=fail smtp.client-ip=52.101.125.49 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="VhrSM1sC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GtC07e+6QloRzbc+PxGIwigQirH7AdOg8D3Ht6bTnLltMuhtDPlSe+p21CJnHA0FXXVihbcB25sxR1c1yFQMQo/mSbgcXJVJMsk2fQp4G93zhOI8XzyFr5ThcVE/wlU+Q2G3UNgCujHuHDunJAyJxQp7Qy/zvWrIIH7Vs4C9qpIKIeyFmbcFKFeRpCtD1+a61iupQiyJBWmAzcnTmhY+hXxyWTzPLM8WvStwPMazvhXS5cSzR80UULxLafos4+Ag0x4u7hdvbKMmgoHAMN4af2R9dHEUKXaYXtWIHO5sVaq3VPv742yt1EVSZWZG9aleewfMMwjecnY6pXiVPG95DA== 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=aF+P81Oto2g4Ejdeqj2vWGlqxdj4i0+OPE7KNSz9NwE=; b=KOZ1dz1/C9B/7yEVGKiHJ2AxFhwXZ9lT8KxklaSisqvW/c2BeFJfHGHgCYvy1IOiEcMRQoyhrtAGEacthKGTgMCxUh8Zo52E33kwHRAvljLaCFouqJqF/QTsCQbsMPx3rh6PQdniKeD3valYNiQmYQCQCARy+TD4V4Qv6wUns9OP+TkquH+FhCKzUnAV64IkwVyxyStzflbBFeFTiybnM3bl/baMmWac0fVl3lqBPg/KAFmcy//dmdzfHTMHoVrxm5LxjCrblA/9KffdTMJUZ5xMiq8ghzbNUEF/CmxRTs4BHGcXc1GkK1hoip4EbyKkd2jVo491moOGJXN861Rm6A== 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=aF+P81Oto2g4Ejdeqj2vWGlqxdj4i0+OPE7KNSz9NwE=; b=VhrSM1sC1KZ6K+ACrOBQc1iBMCq7BeDon2jMDBsTEF1wMOREaK51IKcbbAIrCkd26eWZy6FISId1txOHCtcOiWLVUhKpW/q3Mxo6dXnNU+czPsuWF8VrS7TA7Ya1x1RWKP2HZ68pH0uZwyXfMH0t5FucyHyDYeCd84Kn2k6QMwY= 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 TYCPR01MB8678.jpnprd01.prod.outlook.com (2603:1096:400:15a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:42:00 +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:41:59 +0000 Message-ID: <87y15bx0kp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 079/113] ASoC: codecs: ak46xx: 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:41:58 +0000 X-ClientProxiedBy: TYCP286CA0340.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38e::20) 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_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a6d85b1-7728-4b09-cd8a-08dcb4e76a24 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: 7U3QtWjGcbKvs86ZzMh7LLOIxrQanDFpbv4AQER9smEHoW7R1lcf/zL2kXvAuAqgZHf+zF9GnwMv8EbXdhlkLGeYJModKlfJ7DiNKDEtzrt+8q+qzJZw6rWxRKr3tDi7HmmKuW+1oAAAkl8z6L1/Sr7MZCBXvju01cyyVuzvuxHwdtqgtVY12+qDz/PPpnlJaXRx1XzTgwP71gaqZZCSIJ2Fk6hzF0ve2tjJ4DtrMV/8RVK7yDFb60qpj/PtoagYsJmxX6lfTi+Ve0ffKLhPY+eIKNAfdE8mmQ2NJvrHeTfzE9B/1jHmsfCaa8a1jJCq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f8J/u0KAkWhG+dfI4tOq3FMw== 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: jLc7e0z1bLMhvWj1WkmDd1Z3VPCsoLXMsAXes0pMekLJasxVJwOpeaGdXmg4TUFsu1Z7g7QNJ2liifG06cxDDOAaZw0m/4yZki97Ib/ywFx+EHFZE4a2KviW0JF7oAFuYt39MIqDycn8hgiyEF4JcZcXFQk/JHGZE4I/dDf+ylecI4Pz/Taz1ffoc2hUEHrxC/nKLFSPUgRYXXLCo/GDU1AFWBRRZDpMGJCpeQt0M/rkilqiH7ZwfP9loukjV1x9cUwfIHIlOTIJ1jfK/BxhdNZZ1oDwpxZRFeovOIEIaWCUAb9sqQ2n74yFSUj47Se8RAKkbgKkolSntZD7ouWC+PgZ3lWV8T1ywXQmwtTMVlNlHQDP0GYALrHgm8kgfTokL1Wl/oqBn701Bm5ehid4GjY84lxPTftEVbX3JogGTHiwktPbaS3YKKtA43XH6JkTmEQXOPZlY+/O/f2XxVWNN9sbjMY5OrcvaIOgWyadCIxO1P/EiWH6fqSLMnJQ06CDzh0WH8l6y58YKvncBe7oc0Fp+NfLomA2bmI9uE+eOMEURs8+UeAae4Dgn6LPQVM9lTnJyQrF+0Ni3uMcapFVF7Yqqt4qKfLj761Gb5AcAF83HpE0kgr6BcFQUfyvmfPllcXes4PISCGl00l178Xjs6K7GbhLH0B+tgVUuM92crtdEu5SkSu/kryZLNjcdje1LiXQHOiuDMrYkFMfrF9lPA9waKZIk2STYBdIVWs0RbEHO7m3ti/4XZAdbGX6itUts/53qEgWfjv8wwVapbbst8OfJTWhiPtTtHF7Ia2yAJAGB8MLBqUNDCZvCVHut94jIETtkDnsGMwcTeoblNqLwmYB3vYG4/02kCbHxY0ZeF9g3igRv7k2OWL992AEvD33P8vzuI87bpRze0fcVjA3Olb7wsZY8A2AWpCZ2b1o0iR+9TSK3nnzIIxOteWCNoWilF6ywBzK/I2g9H119tCFVJgzWg3sIv6xemb60k4tzzuktS9QDbvwV8u67beWjkDEBfiTh5co10k2lmUjlqap1avwN9E9XVeGGeuwDsu6dh27nDN6k5ni47BcE2YrEc7rA7lJ2IYaj/hFxtPoCXs+4bTIxxPEC9ljWWCP08sgENn3mmiXD6JEDHZJ9epbpfv9fBoRqplAB4qZvmwM/cAGSddp3qu3ZpUhIoNYkKwju4KGo669eDx3JlyqgZoi9rEFdf64ZXP+n3yuGS2WAMqAUzAzviz3pzjbOY+fUTT5vPWrZG/GQBwo+LpZHWPkoytDEwFlxExOhc1LloQF0IETRIzJCYWm+Q2n3a83munnpC3lF+5oGAXBFZYDXM/ouGxd+volzfcBHUigZNfS3lsbkOaFwje4aJfxyFXeUEf/Yn4Ndki/0TNVfSRLd26qHIVR7Y1MsnRpU15No046sm0QLBze9Y5ZT9SvOgQ/UH7Pr5GYGqjAKJrJ6QHEZ2go4CQQTM8no8jjdlHB/LWOenBSuwMZPXCpsvqidbEAbWqYKv5YtiOKi1C9O4bDasFWRo+U2yiQhuq8vhHT8Lx/xuWDn7g4Ez4VJT3c+kGM29Zp3S0OOEWK647yrFhIOgR02Rw6YtFtCOJyGfy5NfbE3MCHmTKiuVY5ewJY3SyLx0/tj3k= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a6d85b1-7728-4b09-cd8a-08dcb4e76a24 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:41:59.8434 (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: uE4UZv8x0LlS1hAWpUwx95LEirohPD9OGfZyktUuX62Q7M08Z2vgyDFRpJJ2AVwHhIUushJ0E8DWziPobedJU/XG1f/IRov6BTEuHPeqNJnIDl+OliI2aM3heBtYnG5H X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8678 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/ak4613.c | 4 ++-- sound/soc/codecs/ak4619.c | 2 +- sound/soc/codecs/ak4641.c | 2 +- sound/soc/codecs/ak4642.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index de9e431855559..3d73c659545d1 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c @@ -434,7 +434,7 @@ static void ak4613_hw_constraints(struct ak4613_priv *priv, unsigned int mask; unsigned int mode; unsigned int fs; - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = snd_pcm_is_playback(substream); int sdti_num; int i; @@ -739,7 +739,7 @@ static int ak4613_dai_trigger(struct snd_pcm_substream *substream, int cmd, (cmd != SNDRV_PCM_TRIGGER_RESUME)) return 0; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return 0; priv->component = component; diff --git a/sound/soc/codecs/ak4619.c b/sound/soc/codecs/ak4619.c index 8f2442482f725..1d63e5c447e1b 100644 --- a/sound/soc/codecs/ak4619.c +++ b/sound/soc/codecs/ak4619.c @@ -538,7 +538,7 @@ static int ak4619_dai_hw_params(struct snd_pcm_substream *substream, unsigned int width; unsigned int rate; unsigned int fs; - bool is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_play = snd_pcm_is_playback(substream); u8 dai_ctrl = 0; u8 clk_mode = 0; diff --git a/sound/soc/codecs/ak4641.c b/sound/soc/codecs/ak4641.c index ec33e7d73c6c2..179d391083c57 100644 --- a/sound/soc/codecs/ak4641.c +++ b/sound/soc/codecs/ak4641.c @@ -344,7 +344,7 @@ static int ak4641_i2s_hw_params(struct snd_pcm_substream *substream, snd_soc_component_update_bits(component, AK4641_MODE2, (0x3 << 5), mode2); /* Update de-emphasis filter for the new rate */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ak4641->playback_fs = rate; ak4641_set_deemph(component); } diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index fe035d2fc9131..9cf3bc9387b13 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c @@ -277,7 +277,7 @@ static const struct reg_default ak4648_reg[] = { static int ak4642_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = snd_pcm_is_playback(substream); struct snd_soc_component *component = dai->component; if (is_play) { @@ -320,7 +320,7 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream, static void ak4642_dai_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = snd_pcm_is_playback(substream); struct snd_soc_component *component = dai->component; if (is_play) { From patchwork Mon Aug 5 00:42:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816952 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010022.outbound.protection.outlook.com [52.101.229.22]) (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 63C6517BDC for ; Mon, 5 Aug 2024 00:42:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.22 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818537; cv=fail; b=utYadRIrKfbDIBNqVIwRFevfGkflbJeSoPdTECtPrhYAYMHQxmk5lGFJ7g/yE/infAoWj+UYhenMyFCoR8e7rrEh7WFPcA4iKJftGGZw9whCYHcrsSHkNVEWyUX2CxGgcL45Dnooz83mQATCyqogz/Zn0PQTWjEMOYT9xbRWHQk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818537; c=relaxed/simple; bh=2uQp1+GdQqrIe3QMXC2uWJ8THuLzo5nsI6/6nCPq+fw=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=VRljG55+GZBGHltkicC4/teL8lE3kwZUjnyeNaVAAPzN9K2ExqS5qFsIklg8TJWvpIOuqJT/b5W3snp0diwH0pfz909rropLFL8QierbeWFvu4aT4ymnKdG5J4Um7yVHu0KRPHPA9P1oFqSR8awo706GTwr/4LaVKP1i0EsJSMw= 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=KuKtt610; arc=fail smtp.client-ip=52.101.229.22 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="KuKtt610" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j27ojQX+GugK6nc8fz/RmJLOt4NiME10eb0hMFkbLmCAsnM8KIGIJHYXrGdVXEfDi0Qm4rS3YsZqOIL8B31YeP/p7xcjP6CbleHB0unwsiptX8X8Gu/pMQG6RQ4lEZ8XxXW2/WW+t/CrMOVnqD6xMvLo9e2O2HcGwsaGf3260Wp42HJL9L4bs6jVMdaNgAdzy+Ruc8LcPMzv2rvp2eRmu0vZPJt7aZGs7I/hTU7Au92zamtaSWLdu2ZnITO5BljXscKgEHXoYGwAi39mCK0ha0HL90QeAyrADCkki5TRmlKhekRdN52yP8kB5pUKGBwbmYQXZr5vpZqxi4zVx7PdeQ== 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=jgIRNEw4aX5CNxUlXsYtrSamuo8np2AeOh3Y3wtT858=; b=tf1E8mYc2leg6HkM9M0ldENg+xghnZtQ5bA+lN8cXIua511deMGtFpYdplVSuK7kIhYUbJ01N56ZEu3JLTJBxmHZQV0hMqFZ1zXpXyzsYCBtS18371g/h0wKkf6M3UuL/sctTlEaJ/tWzqWO/LLa2NHBj2ckGbC8e/rR0TqR+7gNZYhu5Xr1WK/40AhEuljqNBlW/DAPNhL5sBzv65nz2uM8jRMj3OTAamR20ATUbppWfAOc4h8Pd9pj8erRu3LrqkYUztTgE8VR28ON9VYS0GgotB2gFGFSo83NX7WJgfdDzDWU8cUE/3MbwjsWmAra74KQfOjTTR7q23kQCT2rzA== 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=jgIRNEw4aX5CNxUlXsYtrSamuo8np2AeOh3Y3wtT858=; b=KuKtt610JuS7ADdrrK/nZ1e4AcUm5HumZmQd4uV3X1B9BpXdslcHcHZwGMnZibV09WCW7Efey4M68RcPNVlRyDNNdDLaVW/t6WWauzBfabHsFmMjZ5KUZTRbEbhMTDHtHiHqFvMgdTY0YraFtax8CVmeLRbuKv6d62jM6BYOGik= 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 TYCPR01MB8678.jpnprd01.prod.outlook.com (2603:1096:400:15a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:42:13 +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:12 +0000 Message-ID: <87v80fx0kc.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 081/113] ASoC: codecs: mt635x: 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:12 +0000 X-ClientProxiedBy: TYAPR01CA0135.jpnprd01.prod.outlook.com (2603:1096:404:2d::27) 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_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: e659891e-0d53-4ad6-d70e-08dcb4e77206 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: mrKGmK6Z5M+9UhVwLrLLYxhI9ysjdQMyL4wASiUN/jO6yOy9xJ0uJLX5O5qwzzD8e3055PtTkmG2p/1TBEPfoK3ZEtaWAnqT4EPmZrM1yNDLWosqb0Uzfh/1dL+DHavmdj/5qqIozruMKJ99yy2fZuxBEhTCs39P2dxBDnRtHPoqxrnZynA6WTtLV1AGyvpECRHmqGv5UqXLr1vLzz2qlMqg/vGzJJuHT4JDjTSek7ToSb1NcCfzmFglEKmX9utBCkEGClDQoeJHwjLwvDTQxDkL2rWQ7g6xaads4kAU+m2piYFeggk3WBnB632KrlqpLDZjUjlqo8/Phq2FME47Hb2P88b8cbS2k4Qu+F7SQhLeNBy6KTu3yBlMAtrdILO2Gu2rOvp8o8jrwxXki2EUAyY9nKxcVbZrcAXwBxGs9jzUOtlRUmP9cqOI/eG5rQif/bMXpyvh42avnexR4hwfSbxCIOk1DhltIUhsh4vegPKX1RExnjHQl5UR7t1sqId97gJLYk9PO8M5z/tITLaE5izQ0RkfIWtvbXSCn24H8crddssM2qFDGUqT/mDAwSj5e8r2bKU4L0m6vrmOvu4gMjALYhMMp8mV0GO303pwSJYpwAiTw4IdvqsUvisPBvWK531pccQxjxRTT6fUgFowZeEWEh9/yCvnHCcfONOM5CIYKHdys4SLjiyhtU5FWQPtnvLw3MKQb4+5QnXpVREauGKXfOtPyva25XREoyKFbeB1wZgiyNL7RH13Rki2kxE2SDIXzDJJEvA5gswIYXER3IJKqXIuAZC8L1CzJWKEMO+acF8KCqa1ESTU3QuT6XnsGtLEf8OhRLFEdLPG6YSsiRofzhl4LyZVI3ISUFLmel3xka6snE2Afx4gnfLo/b9CwZyauo6tKYsDVsNDwqz0gn7xwXwT2fReLv0rWKFpgtTxriVm6hCQZaHrIW4kSKrGtNYGCWd3FF1sspwnBFuj2Oc2+fMuL8wnHnzHAFkf2K2aDdZbGvnqu0kzmKDKg1xdG25R9IIp63EjLYyBVoJDD0LumDLeEbwFe0vQfOWUWtgjKM5feYBHo705sQkpjm+fGvQtnWqAH9DMptalLUh6PnmlEhONmdVuC6+8MwrJWM6r1OTd6gavybh+mKHrdzFfNe355o+Fvu8G5BKnIOke5eUqpZGdX6Es/l1RuKSWoIqMZZiPy85sioGidTw/kRZnu2xU89yMwjMe5VllWR/cYoSI+1nJGy/rix3TFtNXkTKjLuFKYyYFebJ+iWMniWXmFu9f/9z9Q+Z7euqUXKFijxB6ZWgqpeBVrASZXBz07IgeOhIsaATSUwUgSWTCrK6pm3vSkVGBdvgAuz8tn8H7vRAhj30tDbByPcNnYSMQ+XkZNTuetWD/UPKYStOHEVQU+aPnoMBAxhtvOW9FsGZCfg== 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: pH9Zdr0GV/YygHJsp5tLDjHQYxlM1m4kmEN1VZBiFdxKyw7q2ewNFJvzCuU4T71n9x2rquuK2lffY6Mc7nhLUjgYKEw99kN2QB05c3UlLsDfC7m4zl+uiuKKEcXeEqR7PSeAEVwr5yz5Fg9RM06ANNBkGN1J/WdAbT7H34yuCxKDcZm0Xt5AEzHDaRx3q0sqmu4XNlkMjJBR4ixOXoc2DXoHeJCQJiVYpiAI4mEXuBCd9+gRrjh/GFBNybEpbKxKMKpPmAOoW29OawpvevumDIQHhsjefHPl5dki8Iy6oT5MpsqUULTAA03r0kBpBbBgdfQvOgZimYdKOQMe6TBTiYIb/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YerNVZQbIV6xVP+l2AlPL02d+1tN5mVBkQb1QaDQLItvBwA/CxqMdhuh7qUTpisX/dyqpF/WA+M04gK1vZwHVbcxFpW+Jp7va0NkGZsduuoV0mKH4GJV29mjULQxdlXhEp8gO+7/FNUdTRKun1LEY2rKuTg5pC/+ZGR8gWVM1yUnEsgO1xiIDUMvm0D4GOYdyDVXn3Pr1XSSHCCHehy7HFZu2SZQBA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e659891e-0d53-4ad6-d70e-08dcb4e77206 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:12.6850 (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: 6kMj/9SiPDvDX+3CazfnB9v7KX7dVLZ1DHl6HA17gz+xB+4sJL44GAvAOKoa02cNYFAMKDhsDYyThv50qTHIavYcXlSo2pONWWUvbphWBE6tiHhqmKNiFUzaH8rEToY0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8678 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/mt6351.c | 4 ++-- sound/soc/codecs/mt6358.c | 4 ++-- sound/soc/codecs/mt6359.c | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/mt6351.c b/sound/soc/codecs/mt6351.c index 2a5e963fb2b57..7bc8a6fd88262 100644 --- a/sound/soc/codecs/mt6351.c +++ b/sound/soc/codecs/mt6351.c @@ -270,9 +270,9 @@ static int mt6351_codec_dai_hw_params(struct snd_pcm_substream *substream, dev_dbg(priv->dev, "%s(), substream->stream %d, rate %d\n", __func__, substream->stream, rate); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) priv->dl_rate = rate; - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) priv->ul_rate = rate; return 0; diff --git a/sound/soc/codecs/mt6358.c b/sound/soc/codecs/mt6358.c index 9247b90d1b99e..a0b34508f78f4 100644 --- a/sound/soc/codecs/mt6358.c +++ b/sound/soc/codecs/mt6358.c @@ -2363,9 +2363,9 @@ static int mt6358_codec_dai_hw_params(struct snd_pcm_substream *substream, rate, substream->number); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) priv->dl_rate = rate; - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) priv->ul_rate = rate; return 0; diff --git a/sound/soc/codecs/mt6359.c b/sound/soc/codecs/mt6359.c index 0b76a55664b03..8a302607316cc 100644 --- a/sound/soc/codecs/mt6359.c +++ b/sound/soc/codecs/mt6359.c @@ -2653,9 +2653,9 @@ static int mt6359_codec_dai_hw_params(struct snd_pcm_substream *substream, dev_dbg(priv->dev, "%s(), id %d, substream->stream %d, rate %d, number %d\n", __func__, id, substream->stream, rate, substream->number); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) priv->dl_rate[id] = rate; - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) priv->ul_rate[id] = rate; return 0; @@ -2668,9 +2668,9 @@ static int mt6359_codec_dai_startup(struct snd_pcm_substream *substream, struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt); dev_dbg(priv->dev, "%s stream %d\n", __func__, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) mt6359_set_playback_gpio(priv); - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) mt6359_set_capture_gpio(priv); return 0; @@ -2683,9 +2683,9 @@ static void mt6359_codec_dai_shutdown(struct snd_pcm_substream *substream, struct mt6359_priv *priv = snd_soc_component_get_drvdata(cmpnt); dev_dbg(priv->dev, "%s stream %d\n", __func__, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) mt6359_reset_playback_gpio(priv); - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) mt6359_reset_capture_gpio(priv); } From patchwork Mon Aug 5 00:42:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816951 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011046.outbound.protection.outlook.com [52.101.125.46]) (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 DF9541BDD0 for ; Mon, 5 Aug 2024 00:42:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818547; cv=fail; b=FsZldSXaHGNSi1NfLTYW4SfyK17Z/PoG/GadCAhU3qzceZu0MpY/vnVVk1Sd9baLbQ2z8Bd4qqu7fV+x3et4jRBECxjg7lG+3j7ZY/FeivvYr4n0Ca1it59h+TcVGwByFet1a8t5ZG3VJ3BEhkk2kGpIvNNWutb3xniotCWh7UQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818547; c=relaxed/simple; bh=57YLvOUeVn/94qkKtm9Aay/K9AVLIKWSIydTAcSsNrQ=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=QhsVM7rld1BRA1QyTw00qwf+J4L4pEUWQfrVq+Ca2COnqb0eov9h/9113HuKeI4jdg8f8wzNvwSKm1DgXnVhrAxJmDO/1W843mvFZ8nkX+y0y/e+H5RvZX6lz/BafKvFGtq6j5KwBJ0X1PL2tbswAInpPgDmgUlYF4BaVGNnyiY= 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=oaJUS4TR; arc=fail smtp.client-ip=52.101.125.46 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="oaJUS4TR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kGrK7nMgitZoo8UYRDwjK4YJedrT8orPl3eCZzILdlDkwMeoOZ/YiG65s1WGO+eY6uVvLfxhBkQI0EI08QmUOhE7G8tFOcpUMKk+FjH2pXvJpbovcE+JySya8PmY8YB2vYZaU5wguM7EfpL0+owtaqi9RHmDcJmEqv+nWlFt1gT3RqBJceCmt1sa5D638eum54vXnt+euJFCBQePcHmIJ4Cmvs3/2ewQ1XhA8nJifzDva2UPu8ZsMGvV+XPu6Ji1dFsirUr8mkclBXCymrZz6CvCwwdtXjd6YamXsVix0Pv/nYhUW5NlEvQRJ6hmBpp80QsRRk7n8Xh9sgtCmOKZkQ== 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=jOmM4pYTIeHbnHegiHAyyr0wbZG7gG+hMjxUXFsAYGQ=; b=Ld359aitHuSHxB1B+Rsgjc8kHH0rL0Or9SBPhF3K/Xl7pQQ/zd4sIuT/8ARr3tiJAATa40ZxIDXebhfifKPmuxifyb/Rrss4e5v9ENI6RGyEsbk2sRujq3N4U1C0Y0vqqGVWG2V04XmR+PANsOmII5Lh4tC9yPDiA6PfGc/kjPmMOhCjZbfdiMZ3NtZt83BgkAhohFwYyujVv2KlLxNKdTJAzw/OFYIc23M6aL7BZsfM0iNDUtgKirbnLmORZYCd6D0msN+qJEZ271qfY3e6C35p6iAaD9yYAPEroPgEpB5m7U8LpHXffa0Ee1JqvCGCccNmt7fWY25wUS8jGGuIiA== 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=jOmM4pYTIeHbnHegiHAyyr0wbZG7gG+hMjxUXFsAYGQ=; b=oaJUS4TR8Ho5J0ZGgG+aS01p6w9loynws+MRoYg8QMUyNC1/+mA+MSWiugod8KHFCpunOoHZGxhkazZFpNbIE9Hta0hkz9dUpcMm4ZvgNZGjhsYcLUCqyZRgQWIMYG7BWrWgb4mTLwt7GB0CDmF5A7coBcE76bu+FUja6f2pSfs= 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 TYCPR01MB8678.jpnprd01.prod.outlook.com (2603:1096:400:15a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:42:23 +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:23 +0000 Message-ID: <87sevjx0k0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 083/113] ASoC: codecs: rk3308: 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:23 +0000 X-ClientProxiedBy: TYCPR01CA0070.jpnprd01.prod.outlook.com (2603:1096:405:2::34) 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_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: c7c2b79d-7e4c-4503-fcb9-08dcb4e778b5 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: Bxol7tH0Okcx2CO4v/XR3WcgQKox8cgiak/f8gu9WExWhQvEEsir7uxQQSVoknaf5uvSzMeCUfJ32AbUG6ac9bDJ99e0SoqvA44EypjloZOrIQLvoyf4QS54VoFEp6dJHVRI4oYG7O193mMl9ssuRqhHIwCAl7VbZ5+igrAXfVgoXxZbi/cqOgenm8iQdy25kcgl61ynewAXpxwbL1U3U0dYJZE0edyfW6MnKl+U0WiIMoiwzyLbSDFtUjYt1IaGn7zRrPyK2+vrv8XsI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+mrKzoxkqDOfBTpfUTl4adh+IJfAsyIcmTSsFdUcSCIF/s/cu8XONDqUnII+km102FZrmCeGhiTGYHJwzg== 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: DQXuuBxsN5U+F4t6+sQqNr2Lh4lyR+TNSjcSy3gmDNHDQNm15yA5e+vwPXSuS3WC3sdrF/akyBK//byNWrzrSrR8jtlGAaMfoX46lBkMGg8R2FZiMA+j+5v0d1W2V0S/N1/eDwhRlQkDj+fZlzw7h08pVhFGBudOkNXDRjSVOlzp3Y28wywqamtAQnkB7+ho1LB0j1Iz3L+RWhCK4FpoO6sA05thpWp/aonoqxfh1rFmZnhiBZzIPHq695kB+i3nPyfmsKzez0s/z7T4FkFB1qm4/+HzQABE8iyIJ2MZsnAx29/XMGPLzAMVxf7tr0200gLEjTWDmzrXkaiUzCcX8em7a3dbOa71BbjdTNlpSGDDeCCiM9ImyKsiKrrqQmLHHJcy9QSnfsKr38QnFwK6CzwRaKqDRm4Uz19wNx5X0w8GWhcikAvKbIG2B7u+ezEdNJ94L9ujAX3OMsNIT4q1xhy8H6HcLkx8ISF8wKRg2d3h3O5AuIWBvA0RL8z9kDFu1m0Vc8DzSMAQPt6KVBtI5h41j7A67N+Bf5Zf6NmGcQB0IqRwM1jSebgLVFsxZ9JmkHTP9B3NvtEgScangCCXP9f+xlXvyp03uYk02BXB71NueqWBJPOkBXbrtMYb8Unv2IgvRu0TrZZ2fFZK30eq99RMHjrvWnka4TCyJuUHSLDEo1bFyJpIjb68BxQdfIcPFT9vnGBZNQxRid38VULK0QV9EzkF86WwAKE7V9agofRXXAwwdkH7G6gsJjoZiL2MMGUzU3kdHSvljlFhNusIxsPwVNc+EofyUbHIrMQm1ZIBy+zleDAjaVH0DbW8fhlehwOpRyoLpXSSCf/0Ubb/HcrXNJLf5MnomvJDrqCU3+mGq0qJk3XbAKDMW/m3GG4bHXVANygcAoM5lbJIirWe4sA8KAh2B6S1pwmqMd9Gzg5Wfmb9ktAzxLacypvLvbASDRkYsyQNbhrEY/1CxLmaseEl1Nm4G8n8xP3CRLsdYN+GKrs27LGRJ1gYlQVGn13TSGqVCBkRbt7X2IoP5lRHq7TGtp8lpw7c072N8HxdkHKcQNdhvwRwwUY3c99a/1akcqll+U5uuAAQ+LEixSZHABAJTvQUjTREIYdaxlm6KDQDRdK6VsjL960vjUOo/TwN2+lCSbiVdL3RbCdH1D2Xz46+pYEmO/gfFXUWVuP5GmR+o1v92GTOLZOVEEq+tm294XhtSi2a84R/uaLDKRJJqYXnxVmHnKNlexi5HxiLX5/6JhbOhLf+/d+M/QgJXLaKMop7cOKNXOlwuOtyHYrqp6oqSL5qK7lPNuyuBj9U+DxPyHorCO+EgINN1FOX5nxE9h2zg2TnEjQhxpF+4jvQbK4RG7MwezJYlsi7vziMT9iQKZLZEFkEU+h4f9hypWF0MehCWw9BNC83nItg0QqDArsnH0dIfD7XSeWFJLhBFY8NaZSJ6KBlTk1CvAtiawzAylC9X6Efr7XR4NKS3XTZyit2oJKyvymbdZoT7nUcwpST3O5XzBwJ9Qqv4UrCX+iuImK6A9X1uAAtkoY2OyGmlz+iOX4gLl6ajeIsYTAJSqYxNU6iP4wkaZ67x/KBHryIQHJbhpmWFLLsLkzQbV16DzyUDLUzGItGkT3qvt77WDw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7c2b79d-7e4c-4503-fcb9-08dcb4e778b5 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:23.7357 (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: 6pmMhV1pq4tPdeb87uL7oZagDPyHX1YV+tHxl4sv5vJ2aLDdJxu6OFX+bVSp1Uvo9FfMBwvgaY3dfQKDwqphzToe6CuWPl+L0t/LvYvh0IfhkzReYHBVNcMRphKfJE9w X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8678 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/rk3308_codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/rk3308_codec.c b/sound/soc/codecs/rk3308_codec.c index 8b51e87a17115..7a36cffc4f3be 100644 --- a/sound/soc/codecs/rk3308_codec.c +++ b/sound/soc/codecs/rk3308_codec.c @@ -674,7 +674,7 @@ static int rk3308_codec_hw_params(struct snd_pcm_substream *substream, struct snd_soc_component *component = dai->component; struct rk3308_codec_priv *rk3308 = snd_soc_component_get_drvdata(component); - return (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + return (snd_pcm_is_playback(substream)) ? rk3308_codec_dac_dig_config(rk3308, params) : rk3308_codec_adc_dig_config(rk3308, params); } From patchwork Mon Aug 5 00:42:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816950 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011045.outbound.protection.outlook.com [52.101.125.45]) (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 52B8D1D52D for ; Mon, 5 Aug 2024 00:42:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.45 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818557; cv=fail; b=W2iSSD5A0AQIdwnIZRCKqFjx170Pbj96SrM3vUO1ky9piSkQ5ZA/I53D1qomXBpZjQamATohBU/EL6/36wVL8K7/MCuk2dL/1o5cUUH6dNDoxglGMJSZGERZdY/tQgCrKt8hVDcQ7O/OLZYTrbJHMxnrcZdN7FMyohIrCLTPw2c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818557; c=relaxed/simple; bh=eUF616s6zXlMAKRt36vKj8LWNVNVLsDTreD1RGWU/LU=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=gfoRGFW+JLGEi686kcXnz5DKRrJDoMcRjlYmVvE9Uf9BPm1M3W9bKSet9g0LoyZOIIsstubGt4PGq/Ls4ZlPUFiFkcHLMc9Z5PwMsoMdVjUqkwCAZy5afXyU/FilUo2xKJAwPOcecB4h+IepTBIRXA4jG7fwjJDdTQAjFSkmyr0= 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=oP05d66g; arc=fail smtp.client-ip=52.101.125.45 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="oP05d66g" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=n4h/1pQzCGekQ/1fZk7IQFrk4czoVupRHOcpJr+/z8QzT/bUxAMCzLEt4M8rI6FRtDTpPLJ7lywdgztkabuHPZXGGcU+Ry4XjSFMPXMOaEe/daNezEWwl3aOJJ7IP3uaajqXHXOXeOfOjAv7L5oNNCgKZrwi0Hu7MFN/4Th/CmrHSg8C6JW4msQhPHN/nw59WDZepX77ItOqvkGyvYXeD5luV4VsSltIIGQyp/p43dm5aw1loSc90xP/nKn+Q1SFBo9Hf9XwySN9QjO/bdm4zfmfaLvc1DPzJcU7J+8cTRmiBs1PVWt9k7n6/NjvYRiz0/syXca4Sl8VYq1xdMFRIg== 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=SljpfhQ7BBWinue7aOjkv6qpnUwf50Sk/54Z6Keh9HU=; b=pIes9Y1UkXz4PgFeGp9JLstKPV6aLdrwStheGVuYkcDiGcf56fDV9G6faNIwh7q4XDHtZOfbKoWQ+TfyY/CehQkVe2jfLonNYiLS0cw4L+V1hnQWlp51lQuBcmERH3FJDkjBepTr5YhSFDYBSRXelBWXlgi7Lg8E0x09s/3P9CqTg5DvOqQTgHQRBwJjp7zjXYd7Brnui4vWCbI9Fq5hMf4fnQaf9q4sVG0VzF0/WIYby/c0Ty+FlqR9zO0rQ0/+yk1BeGgjjH9FLf2vDq2wR4N61KWXYWgvSbsWP+xn13/s2Tdu55hzMEBQIyFB4ODGj22AL6ZBBryqKOFG35sYdA== 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=SljpfhQ7BBWinue7aOjkv6qpnUwf50Sk/54Z6Keh9HU=; b=oP05d66gNA/rIHtfUqZW/N1xVoAp4lh0BSCCFmBFZ3oEgyySJy3sB2hMc/9ySwFLNmICVxDCCKz+4L160LXAHpqphXvYGFhkGyD/SuTNTPK2cas1tyx29ASreTzB817st0HSN6+fd8q8YeYnSL0kzcRqTOK/f9IEQ84r1PaFu4o= 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:33 +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:33 +0000 Message-ID: <87plqnx0jr.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 085/113] ASoC: codecs: mc13783: 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:33 +0000 X-ClientProxiedBy: TYCP301CA0035.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:380::11) 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: 78216c4e-0510-4230-4fb8-08dcb4e77e76 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: bTIstk3gSbTeBAy0lAhSA1x42Y7pSoA0Ak/bBZHNJq8QXN4HpTxeeG7u2i3RPDBr9MGCjgB0FeQJBAndDMOua9aXVyiankqz5uSNOKl1XcjZKrOwKxn8/AFiCoOiPpdTzhAxrtebgI8D+Rll35dx8JHZMmB7Cm5OFfQJQiT9vEM+dzwS3bRQfytln4nq6CcGB8tHJs4KHE4NVeJ70k1LxDi1pHmB/06Ik54+VnFMZG4xNDKEHnIwk6dWIab5IcNrFvlT2f7+BwqAVQ5jYcJPo8czk5NkftV+gOFeTObRDZCJnbBguprmzC5gERgzfn+wOY94EJ6BclpDixqbs6DUlqzE0VHa6JPPg4h1+WfJHR/5AACR/+uUiEzu+dIwHd090be7plo0pnWE8g68P3Ldw2rkOsWNrgILcAZf+PHCzJg46lhKkYI2pVr+/iYBFZnWI9BFCOibU/NCM5ltNiycR+XVQPWAX1QXG9ID+qAYG9226LnXBITvjWOAH6tFlEADMUvixaKoJ9WUBWQnReSjCvuMj+MzgL0tPsYjIG27LHpu02Kz4uNAncBnUHD+YSbxooh2L90JX6NU26ocVOApMpbBRHh6A0uiw4HYzT/HFW6/gXBRjBD4VyMi6XEkkRYI98CNLkXfTzT92S/j5LdabW6icoIqjSop3k0xQK0/kXGayMwrIy5+wFF471LCZ2gPK61x3M5Jad/LfHqBJbh2xAaqccWS0mKDf4ELfCTibl3jHWwoaSFFTDalN8hqu7PkVA/eEUxxa7Xegmf4TzmPqtjE0XlrtD1L9+DrlM8FAC9wBVr3Mk3OnJOQes2Kjzo1fJ8q7FyvOSkD9Xnh2ZH2NJG8SJPzhVgIuM4k1131NOv+2FenME1CTJgT8yOwL9lghDC9IdVSiLnabhQNWQr+WsLcooHD3ajYyfCNZ3q9+LasoCQhOwQHHMqwhPxLiQFrW2I1dQ7LE2QvH+6KeLORbi39h/iJ/jzERKs8m+PC7wty0EoWNuF2SjkEu6lMMfyjrNeWSi6lDHXcDrVbier54v9yWa6hgdQD0r1g0AopCoESc7KrwVN+KkTXyLeAqTWJ3A8FkLMa+OT80/CGgLPHD9HH4iUdcpJZy9RcMNCPtDfQtSkLNcT6VNegVlnAh42xSImtZ4KMf5jnzuOGPBBp5zqlYQIe/ZSv59+OkBxLWs0K1emHxWLcEvDmelYibTL6Dcmk56rzCds1fTgDcRYWxfC/1TxG+8LHDGvGinV8PTxyjPzWE2/7iK607nltqOVnCf/F9QOSX25Hh8oKz6jB4+aiu0icQwqbiIp4aebb9hRSYfyAZvzEDXjNMEtjBL+v3D6ltNX1LkG3u0Y95DNTmpsb1/vvRnljIjoaaHGr0vcanr7ZhGGRcMRN8KLcym4A+4iKzxZjWeyljxYdZi5OOQ== 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: EP5Vk0jFr7mPFuxk5z88m9Gn5s9cdhyUWxwa7wtNcS7V9u2EWRMTMBMkYV0Wk/Xolcs3DZLLA0IawlCsNwhHvP92GTHu/Nt2klrx1vbatdVUcLreZfHoXx26RSrbYyHQ0t6/B3omIDR4aH7quPEPBhyfRVXPsfJ2cZKh4IRizgwPuv+5qfLVaUH+qFYNbnWpeV//efdPefxxbkXReDkU3t2asv+uMJjPMlrTpCLT+KQnvtY3UP5jdsSy0z/kDeLS+zUghmcTeQgTsL6fLV9FmHr0A4pvdhNplSiTGxBIqebMZgOB64uLJjKxCjHGge7Uv7E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O3SjUtMcxPFQIo/t3nnEcImkaHRA6KgnOecLa4gBKntVs7V/Fsr9lJoxZwmJdAPhQHYEqGIy8xrxdeWHNpQV/fUmwH8M5ULzQbJeRRm7mUOCwbFOqtPHDmtllEsdKwXwdjl2eKbYoZqlSc4twKnEGRUeuR6nq0Cu35LIlgyUXI7RvPLj/SC6pLn6zzOXAVA8pCmzXzvBpgT6oOz2ULqj5meRQRZq5NVRdbaYrwRDe5xunn9RRylsCvDupAg2EODg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78216c4e-0510-4230-4fb8-08dcb4e77e76 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:33.3027 (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: v/zEmF/nCErEH02s8m+DBzws4D05z1S/Z09N+gF2tdF7sabRjqekae+n/25cDLWHcbEN8+c5p1ln8/YrqNBKeEx47ns/7Fvt0q2vSEpeWjOXtzu3XgRoPpneU8UXqdx5 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/mc13783.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c index 086ac97e83866..77f9215699dbd 100644 --- a/sound/soc/codecs/mc13783.c +++ b/sound/soc/codecs/mc13783.c @@ -138,7 +138,7 @@ static int mc13783_pcm_hw_params_sync(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return mc13783_pcm_hw_params_dac(substream, params, dai); else return mc13783_pcm_hw_params_codec(substream, params, dai); From patchwork Mon Aug 5 00:42:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816949 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010029.outbound.protection.outlook.com [52.101.229.29]) (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 847A41B974 for ; Mon, 5 Aug 2024 00:42:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.29 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818566; cv=fail; b=SiP1QkXTc4lhFjN8hOb4+62353kC9Fo6nwgRClJCdNw8osufVokE9CYYPz3kQG61qwI9uGMbaG2yD8U1onbiNiBbGOwVka6jtvyrlrVJpIsT1MsBYQyVS7FNVRtfXhecgTT/OhrcZxdaMCuaRhSJbaj6j6o0mWXSt9znoY5CW8A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818566; c=relaxed/simple; bh=+h2K+yqALq7vIcMq+uaGehr9QTfm0NFjE5FFaccqhro=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=TCbTiijqnG9EJo1sBzvOV66j1m02/xZM8fa3w9wns19RP+Qic2tIBAWhJKo35O/hFNdEAYHUfJGzaMAaYjGe9h1JmATO3dH9oZxNvJqRCXKo1o+/UzlO35QY3iJP1zl19JbP5YhcCrikiaBxXRjR1Z0ph33s+tJ8j60b7d+MSks= 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=Gd8HyXd2; arc=fail smtp.client-ip=52.101.229.29 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="Gd8HyXd2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w1dNOncWMNV+TbGn5rAo20b2msbrkb3lYtyIZwB1j7OQfhRA215jtwVF47YBcm3ljEbU1jsC+MjVfDz72O7zQLjWT9x95d2CVHThNld/gvD3t+X1bTcs6ILvllgppuGUuzAXDgYeLJeI7sWamFH7CNWJmnNpYRG64n6GIHC7W6lDZnRIypxM7ZWPhJ2619Cm38owqFu6UigeuPfMFQs+Lrxhc67aypFRHy7ZQ1WSi/lVsPRjb59Yo9uuUvAkaMRlcqNIrkLgb7wDH7xZyTNc/Txwi3q+A0zNFbUXqMu4+omgPSv8n+WIw0sD/3iLEPy5LmNaagVV4n7ZZPT6qKyonA== 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=PTQgYuupF9iQTgZtlY7vsEdTChxpJWfkUASiSmwE9Cs=; b=U//tlupapjmTZUCvGQEn661yaXY1x07SwMLZ6h1FZuZzAjJSumrh60a3qXPPXczG0RR3cYcA7N7TwXZ1Sd+jE1CTzjElU0k1zN7JovL8PqMYOyEMmACuFG3Wha4u8rnWDFUpSDLzE/cKG3fRdCvnYDE0QbR8afqe6WPfkR+F8JoIHcuJjJag95xU2BYbWVV+Zjo6ylUpxGz/eMVI8D7B7CcNK7Hzz4YyB19a7aFfu2Fv5vieWtO7Q1psM4YKqyGf3+q/MlqJkLZLYzL+/2DPTZVs818mOxcQeodO3Pqa6U480Q3umb/51UTR1S71bJUXtv8A+t14dHvvbiHiO3HcDA== 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=PTQgYuupF9iQTgZtlY7vsEdTChxpJWfkUASiSmwE9Cs=; b=Gd8HyXd23bjZhEL8rB8pBhHo1aTIR93po2D77HgBoEKF4AiZTm0KBk7WCpl3/8q8uTT3XiUU2sYAVZ9tkgZ4L/44JxIcNHQc8iUoTfKnwhpoEecvrEdsmheHeoMoAAvXcyf7hr56a1XQjtfIBexvX2c/UkI0ABoDuyMsDVI9KZw= 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:42 +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:42 +0000 Message-ID: <87mslrx0jh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 087/113] ASoC: codecs: peb2466: 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:42 +0000 X-ClientProxiedBy: TYCP301CA0032.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:380::15) 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: e94c4247-61a4-4e36-9a96-08dcb4e78401 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: auRix8L033pTLxgddWdo6u2EP+DygugeAlHgL7DStx9LqSQjg+BpIfeZFDPuMahIc/2v/+hHamSoW5JRN6ynCgSjXYMwMkDDB9leRQXbOLM+8vvdDGYsiZ9pvBgMnoXK5Lj9Xy9+MCFZQPdE+h+Sfqqr0UJseyEX4uscg/VgfJD3H8Ec7CHt3PrFIfGaAPJVXq6I1Kt7oiym3WAy0K4TgXuY6SDFi30lvHLZ0z002IZLg2An3viEpo9MAAQ0KJaciPP+vq/CqJGEzPfpe2fkwzl3Lu0MetxJ63NAsr4ljGUub0HzoZRwAeoqAXVNgvzgCbxQ2SZD2hN+A+rnZw6H/Z9tyev5fypkD49UxyGqVesOTNeD/yra7/MKF3RFMDO7ZUA3OQ2Kse/ya2XgbwYBUwZmUUoh+CLfLUmp/ITv1wGUTEqwuD5MshG2yywWIZaJB9ceX8pPUDqrRfd/b26Yj6hq6BTkGIAjeX0uSmzABCxtmfwKlIUy4TDd87Sf0gyMEqtiMOrFy+jfk3wtcO0Nd9DY1TNkG98lqyRmCaKoAW77triSJ+DIv1yPbPynUP4AsKPxyyTL3sjV/wc32S6CqGrVMaR2Fu7vnw6ZlTGVQkklfkkJlLk9dSn5a6EQAEYuroIDTz0OLwfeIAMUAuumoFrmudwT5fkrW9jvmYiEF7omPEq5pKRUMAoe9DKdsmMBe8C0CCgiJvS0XZVl16+x/1pI7IYK1/DdjO2TOweWkYcV5CECB3fbb0SvCoYXLdos36QuJNcL9B5O4ur1dk3k/dK6JpaHmCCirbbZ3Y8FKdEfQ0MX2w9R+LzCmUNyL87T+OdgEKAmAAhKQxI1JEi/7qqcFx6DIohHqnjlo9rfgAYWqzaWVJQd9dRXB/N8hzvauKsvLPNzFRU1GAGFMunvDoOIOm0NfADLHz245+rtHBMX9sPa1Q9QeMk64VWvSwhvy2mDTU8Bp21rKpx5zKt9UFWbGI6jU/JNGD64VW0tNrZO1t3wnSr2dAEzB1jUKaeqznBk0KkvD5A/qYyEzS1fSqyRoF30TtMu2hSmXnHAEVC+HCCTx5MFXtMQJ7wVrot+I0DyopZDSr8QsBiReDUsOXHetffNK+RRjBBf3b55UFTP2lWYR8FdTJefFWSkMR6g4N5hluINBrtvPpvM6EqFVrONxbZsRlPLd5qXVIyYbAoD8k5GA7L1I/621+VjUYSTw/6EzBo9yw5VehgYxVWmShihY5W/jFr3pnCeJFWtOMMF127GO56ov+KM3yDQoC0CoafT8Om9QG9PqPdTW6kBjYOJd8K5pT3q0y8eKO83wZ/hHelWXaETvKAKsjOKoClj86K+3AQ60Ba+lk6d2mshvilGJhsytZfIy3VnPAIUnHAhInzg+jrV1TMASD2S2Qdb/uOG4uLiJdiuq0ZbIz9Zyw== 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: sdjKV70YhnMhKrRjCVwd+SexJR4hJr/CUeIjquDkP1ovVeu412pSMRMMqb2AbQD7yMNccqo8mRKvmYuFfy6ZcQ2oKHMLO7Pk7L85+PECrpb1ovdtUC1lvnSjifNKuGyeqqnqS7rJIlLiQApemN7/U5NQf/MEgs33ov2ItqIHE18ouZhJEcU6t7irU/hGFcfMatWeDeZl2lbKl8bXCKsNHJ03EmuEC9CSnm8dM1Yv8BEQk6iVBeHYMV4SvzyhW39HEDoJBXcyGDwsyJqGsQVtwMCVAMDCK2kDzVq7QokdjIUnAucs3A9mjJfLaiD+QgIufVrddFF4rIqZin/V51flN6KPp8P/BnP7ygC19zpy4suaNvYrI7GxKyy5XfbSYHUiaoiE7E+xK/Wc7CUrphuqbUq+yt3ySvDpy6aVtBwX3W7RA4bQo2h2P07A7WgBLWsTs6IZNpF/cuuWGbPw/Obqusc4hBQnfMv2bprUO8zXn5whNHAmnKfwFy3H7h4wbNr02LSubMhSBgmPbiYfWh1lZelf9ZOq1Ow7tvxXUTODIeUq5MyGgtYPxmHnFMRMoL5/lqdyvAkKaCkLHdxtYL+mXC+Ycl2Ua1i/RngJWaBXlYcxSrWaGXz35Mbm4L6TQuy7bCNd3iGAzdaNmC0naEceWSU/erxn3Xug55y23syjNXbtlwiUN/GUfUjcJ1j8R3zEyTOrxes/UI5qj1vOtdaBVEzjiGHKNqI9dtAty+VEbXlDrdNuuRJj2tfmeOJCai22jIO1fuNVio0kEcLBz2iGXqKDwthxWK5qTWDeO4/vP7v99r7Hmb9dzyFfh4399Rut2Z209VBbG6WRarQ8mvlDFGIruZosPDwdSHXvux+UaUy/5K+Dkli3togfrFJHxaagVzT3sZqHEGcgkMpPr2kXbtxGX3jw44atvS+piKTSpIxPky/NgS5axEkBvdROWQzXrTu+4/Jcq2IGMFjrR4U70Mew9rlElS9LigjPGzKMiALESD3eC3+0F+7k33+9H0vokf1RrEThxeUjuonpTo3/uWT58nX/TIafRlmYv5LS2K+UfqauFmPhz8ua9QNfBsuF8wTqWCpRBWRIINpvv4VDNC3qJhdBb7kko4mkHwrUAzEEXaG6cA2vM791hD4fdYQrgkzilN4GAb0JPzmY+PJhhtPreXtF+p6Cl6RAmRCaAr2kcL1BqDTFskyr/ygTON6OrDv04SWMkF0a/7P2gJFj01/d19m6kBpDeSA+8KprryKO7RgX0Ch5PfErF2sMp4f3pnuVIT9kYZXx48pETUY47hAnzqpcVnnUCQISQFlDgoltjq+kiEOyC0T3Mky1b/ZdaIzPuNpGX7A4/xvsZKi04iPSlN6iNLHXyfKPPLIvzwnSgoYXxbL5K87M4qw/75PC0EEbjAdwOY/a1YikYD3DMzDSKfc4xXXC06PnPrTEoNg604+ZlVVbTkAcWfFvKJH2fqK7eCYPfjqdcCNUYDFIoNS8fm1IdjCf3VVktHdXep5ZQyKF7M3EuGEuCb8w4E1SMbcb/YzCAZhRjco1NOe05AI96+3U4CYrA294tk7amCotCVdkU1Mz3QOUhst8OHCgY1ENejQSQckkosJTkuWGDKoNRHGzXodisz6STS0tJvE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e94c4247-61a4-4e36-9a96-08dcb4e78401 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:42.6060 (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: V5lCCLMQP0vrhCqexZTrLx0Trdgasyw/HmnEfMy1t3Vr0fnWvYkQc5YaGbom+8euV2CMb5UALerY48I4afhhg+doTiNX4T/pXGb8hVrXDpmMVYMe5pZS2JpVsCxGde04 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/peb2466.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/peb2466.c b/sound/soc/codecs/peb2466.c index 76ee7e3f4d9b9..7c5c575300671 100644 --- a/sound/soc/codecs/peb2466.c +++ b/sound/soc/codecs/peb2466.c @@ -796,7 +796,7 @@ static int peb2466_dai_startup(struct snd_pcm_substream *substream, unsigned int max_ch; int ret; - max_ch = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + max_ch = snd_pcm_is_playback(substream) ? peb2466->max_chan_playback : peb2466->max_chan_capture; /* From patchwork Mon Aug 5 00:42:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816948 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011025.outbound.protection.outlook.com [52.101.125.25]) (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 830B01B974 for ; Mon, 5 Aug 2024 00:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.25 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818575; cv=fail; b=ldSvz22fvk/h6HUU6nBeR6sW7jzr64s6IJrEYzqQo3V25eEJyCe9yFfQPfG2M8ccbJIPXaD+Go/S8i+rvRlHYVHyOJKpUu0/52IaDwUtXhg940eIDgf/5pDJb0SZMnAYgEfqQByhIJd13UbfWvXCc4zJSbNfZCBrsCzDjivd3Kc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818575; c=relaxed/simple; bh=IllMxGKt2wecKuK0eFaf/dq9HIW3PhJOg8XNX4CM1gk=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=ggOXC1Eex78x9cJePr3Z8d/SqQABTiZcT4tBizbTfq5uWnEW01PXUwW8N/bKHZR7YkvEh5BgljH/FYyklPG2fTriykweCuyx5zA4VHxKhJwVeAUm+5OX3S3snnCaF48ooKB5htldGmNHYOFf2RucXu/s93vpU4IJA4Eav0xkAWI= 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=jgyeGJkJ; arc=fail smtp.client-ip=52.101.125.25 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="jgyeGJkJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UBeMiBbdB2XecbUmHtey2sejN7KOY64Sb9P7VyNRMabgluH3EpL/qiLvnVodQaWWQYzTx09SDbiLA13iavhhJJ3uPAcr1G/UXcd8dJdyd3Zdu3H8DoWgg5bXpj8QhPfdmnBtb9LeWcQwlEL8RLFvCBk+qwdVdbaCNChmi1vA7R2xn9Bx2/ES4/BjoNMnhCrrf19PZTKGZJonuArQfAT4x5rBBOmy4bM9lIj+JG0jrtdngSGViPKZsyO5s65PNjGNwpTpFbU/KYXATep77Fuexh5cvqRRdIFS2dz3HddxJBOBAj/lu1IQiPiSvs55Pu5uBjwJV/j44GLjFfZGf1BS3g== 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=yUKp0VYCS1HeM76ujOiPvnWWVX3BUceEP59zXs281/o=; b=KFSbBzrq5AQ0WYkIMu4LKxQFEY+rmHYzNSg13U7a2U0kASUIFiR43HgkayolrSTUUr00M3vDD53TYabdg4NpTLcUdPTipDbtdrUDRnMX2AvHw2sZJzm7/ffrKqwohF5mVXeIesv8zIMekOOHgoLyrBDbG6+1mJSSVnuV2/fgliYFTqkEVqzqukbJzWIkfI9yyrQI5ZYlwGhdkoJYO9hYD72GDppFVYWfYNm5vkzghFUKzSTfrKp+kFcMoQY+u3hFP2/YPnk7r03r2qU/r/Q/erZdpWfWUHy34pjyni+yLNM56riIXCdD/tX6S78T9CM/69CLOMzerVFl4lXKDVE0dA== 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=yUKp0VYCS1HeM76ujOiPvnWWVX3BUceEP59zXs281/o=; b=jgyeGJkJqm99f3WYFPDz/wcbi3HsApDco2DUd1vzk/S1+VZ8GLrqwQInIl+MscV+4qIy2i40boAsnNZMvzUwF2YV6VxN48+p2O48weGcJRVu+d+UMm+2UtuRG2Yiv8amouXZ4hMNDExL03sYZYjv+Yba84blqvVdY8CxeBv2aTw= 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:51 +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:51 +0000 Message-ID: <87jzgvx0j8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 089/113] ASoC: codecs: adav80x: 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:51 +0000 X-ClientProxiedBy: TYCP286CA0143.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::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: 5d5bb973-51e2-4e7b-a712-08dcb4e78950 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: UbV2nq6vq1TTlN829Ab1Jn5X/fhaxuOjAk8lZPOchESKfq8FCHmZIxU9o6seYYXB1ECL7m8WA3EDUFRr0xZaEvtZXyQ2TwTV2HmJmw3RPnCLOV4RvHE2OToZWudn0FJsT5LrgLOymN0tR5/mSSgqPxkvzVrc2aUgKxumlnacUYEpNt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f5Tw6yEEtME3Dvscx3G8tLu44Isw3FJO92GEti1O3gyfMuV1uPqflYTBy/4UOfAoEQ3IcqVl8SBD3nrvQqGUeOyx2Z2nXHZSY36SgAMA1tAC92tO8K8d+3ZHlyTl3tmGA1yXGvD1su4WKQpZbMVimP4tmuV1K7MxX01GN6rHhk4bTopOw== 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: +BGy+1e1BeyW23APk/Gz5aocjp+SXSI21QkCgGpt2Vn1ELP02YAnROO3Zkw48APj9FLcKRQhlKkHjUw1u1M2SD4zVnTcVKbgU2emN6ZY0GJEyOcE/oSlJhVDUmV4IVDwZANjqvCtjnJpJqoGHUDalhljKbP8MaO11Gtpl7dCNHrt+TUQ2yACH7bnzqCADjpZuSMFJvoqRiczl3n5jToRKjFZu29ecQf4xGYhwKKyNYuPCwp+go8fbx7rq//Hz3Tyd/z4is8oIyVi7VgMCC+idYl5xsFUef7jYrnF2qgR6gMzG4V0dnJC+Y0R7c7aVfHof1IFQ7uUha4EsYIvCEN9U56aD9+MMaHyGxcIbARe38UI/Gq6oKGKhi9ZARjemhJlroAbPY8UnNT5ORjJ288GvGws8QpUuYQ8+SHBUZ1fvXpm6ZWo8JPJopwZxSvhfz/v6heMQxxwci7YE93sf348zK7RbL2goxvWd6X2ZZlF3+mdeNzZOiIQZO504UlV6cRlxpuJCGwCdVVTZo7p20ZdgSsjokP7NHFiu0g7uDmpcxYMAOWgN1IiFCaCdjc0sYfg1Oh4K6wqf4NHb9baJysbTEyv6DHEcAbP7BasgJ2tzLdPj4VSpYvV5qLdPJBBZioj+cCypjdkWKe3YLWFp7ORYPqLS38Kr51oP5LRmIjDQWYCr9NGBEazBIBpVoT2RX1sR63m/oJoyozE9Tw/Mcu4PaNdCSXvCSMjF73DTRO+muxYH70WTq8dp9+9OxHLPFtarIRzx1AZwDAFak2kZhzeJHikKVMspilYktb/kXbXNdEcHDVBZ2QbosH0g0qCk7fFvvVudb8VuvH22HxIxb4onKHIdWJUubaq/QrYJ/f0nP+omPqh+SotJXLNi44T6vZbqFpjEsEPdSEugiWgjSJNAI6+5PtcAEeylzzN3PLaQUslB5QaAA1J+ybHiPf4006cDEhvibD5NLpIoZusreAYfNXS6VhwQ6Nw1zWbUr+Queno18pEVw1D2zq1+3uqcgy3sBc568dpiZ5noYJJB7BGWVzEBPi4iH1i/nMLoOoE4BMPhURNmbggut/UtZgEqscLs2uT0gnlRC9tBt1KxHfidofRoiX6H0SZlr2TpIQRvlM1CJZ4Vxe/rzH2S6g0vDLuVTkVQnNHxPTgoC+SjBFgxK1AeB1phTJF9lyLt3nEfzIp9CEJqRzj8UDEnehYuHMI3YkJPgLK8thqE5eMQzFsJDHmkIfXQSUbxUr7r5QeBp9QINfGGkKNvL3Kscij5AqepztRbtfF3xPKBVbSoiaAiLLYNauYOnK5gr9UsJkenew5KFyHfDzFAxULQ3o2hy5v6i/L+8U8oZ6Q73Ja+6ZCLIbnICfkGE8fIdYlF80xTHi9lVeQQ+rU9ayZlcWHLZvCwTKx+xESHe0+rbkQTVYSBRgVvgY4gQXoz+toc8mKt01WbY7cLoOMgwviiaS6hltHmIKGLh7U3JSirvw+BhIv5XytJ4R27acv9/Ox+GdC/K0XccedyH1qV/cNW2cgROnIGW4krWmD/2abB9W7jIvDc4E/ckxI2tbfLREjIZ23jwhQVJJkZh0Oxr1q6axN6SEbtGaDfNZE4ub8/ndJldgOuY7nBDJveEtpTwxMy6s6DL8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d5bb973-51e2-4e7b-a712-08dcb4e78950 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:51.5025 (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: U5nKE0LM6nCOUF+prvfFuHHsFTOOYGe2UFqoffuvB8maJYcZX1wTwgsmJCiKoMfB9J/E+KS4Fv2l6haendr7BeU2kE2ExpDRYckIMnI0SpUXQcgwKDBUn2tiEmHG6zX7 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/adav80x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/adav80x.c b/sound/soc/codecs/adav80x.c index c8c0fc9282116..21d20cb42d200 100644 --- a/sound/soc/codecs/adav80x.c +++ b/sound/soc/codecs/adav80x.c @@ -521,7 +521,7 @@ static int adav80x_hw_params(struct snd_pcm_substream *substream, if (rate * 256 != adav80x->sysclk) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { adav80x_set_playback_pcm_format(component, dai, params); adav80x_set_dac_clock(component, rate); } else { From patchwork Mon Aug 5 00:43:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816947 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011061.outbound.protection.outlook.com [52.101.125.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 36FE71E529 for ; Mon, 5 Aug 2024 00:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818583; cv=fail; b=P1EbWr3zTsVTsZ5kT+CGodUAS0Udx0fqhqPIrDiU1EnkSuy77L/KsVjameqDCYZp/4bCit+1hfAOvDLpdENRsVoADCwWLOqEThKbfjJYDd0x+VCXPnFuDJqOkPwd301DU+ULIXCr8BaGKs0pRDnNKTAFbUhIW/pHORjoJgfqcdE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818583; c=relaxed/simple; bh=XG+mauert9qR1cl6Lexl4P0vpEAtkno0k3vkaY97nWQ=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=PHyaVga9lmlyQu6VE7xpC7m9VYT+ezDgMl9DETtucTtXTq1VDFJng6fuK8dePXvjImrYSE1r5iZ5jOWiPbhkwTOPAYe2kqEyZ4f8RAp4EXatWNI3DSqvIgeW+02vJrRe1uNk8VX0B2/fxFQjfkkFsHe0+auvGHNHL7wLm5dQiz4= 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=mvpqpAKd; arc=fail smtp.client-ip=52.101.125.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="mvpqpAKd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TSEm+FwvQBc6FmSwliW9fHc2bG9Fl8RDNLwFbe8sdSuCIKXTD+sdrwuzQjcvPxB/BTU181leBCg88rFhwrhCkbdbXD3hOsDzZfe7Dv+vdlkEj+IpyL4tV3ray6z+jSNFuILcex5pGU+P7Id22j0TKCCylBwlIYDDiFblcKXLXAfXuJXow2eMYKG90X417D7vdbgfvBxA0/ljlvL9h5EIuI45Dlq+DIiDNvnBO+soX8/Tp9beAoJbHRxEqMA7q3uWLFCQbfLCbpUbZyhzW0qJz9tVGW00HtIu7NtW/Onoe4lZ4WAQzSvjOoo6gmX3lzfJATWOCoBG/nsZCQ4uqKYoLw== 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=bSWCqUqwVb+Pyr6/igVvjr8UZy1QKXLV5RPw07whWx0=; b=WtfJVvNUwdzvHpE9KIPUUoOLsKb+Tr7/9Y3q0Fjq21SZ42C0JcwZgXHaRT1nxU4CK25IvUsiGyqkoQk6JBSCsUqiHR1HfRnN2euOhDBV+8YbBnZN9Brc6uoAZoHHggRfLUvg+x51yDvY2NVIEtGRD8DJwXlv7A5qz1EjMBF+Tj3k2w8IFTWstQcCtHXQxilAdVcRYRM7TzV1It+/r5qaUcmgqPMqYr9i+QKFM9VfPO1Y5qqVcmDH99XbmJ+VBYSdjlmnmDTwAUuKjhYh9uoAWaxk6v/JRWgaXWvzpkPOUhhc7BbSrTwOurYZQjEsdFnSze5q0mED5tbhnKeKHrtXYQ== 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=bSWCqUqwVb+Pyr6/igVvjr8UZy1QKXLV5RPw07whWx0=; b=mvpqpAKdp0ypl+XDQ8Rx3HkO1gaWtWQKCAoPGlcOcJUhQVSkhRRFfgdXmrWY1YKUD49sfWNqV+4lJ//E2r54j1q6Ni58vMJpeGIiFLqKbOXapNxPi4IWbL+lbZH4TNY2BuIymJTWQ7SKIf/fK9/QELomKyhFdj3WrALwtkWDYBE= 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:43:00 +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:43:00 +0000 Message-ID: <87h6bzx0j0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 091/113] ASoC: codecs: uda1380: 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:43:00 +0000 X-ClientProxiedBy: TYCP301CA0056.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:384::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 28218baa-df38-43c4-14fb-08dcb4e78e7f 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: vC5XClmp60OCZaun0emTmCBs+QZBKieG6+gZKBaxg0vpcPyhBQTZxsO1R3ApASFqb24p42sodvwvLMNdEKKhWIAcwpVRcRO46qYhf7iJJii+mruTNyOVHMGxhsLiRO1K7MZUeL0CQbO1U6vjPr4oNiwmzaunKcLlCKEN8Ep5LR1Y0VgeR5OqMJdX5X0Q0GgOplQaZNLbEFMN70VDcVgyyBd1HQng4r8OyHZ+moEkQK9lpN3/VT00CUIzFNnykIlpsUe9qos5azhrz9vBbYoQVQl8Crnm+UqZ35m3XsLmgqzVrZct6UJPasww65xXFXxuHtpsjQ2EOYUZz5sRTnZIJQLZBo0g3o/wDMSfiiBsmfFqKSsmJrsqGR9hCeiZWN7mR+YOegimYmCn0TKzQ9OjsbvmClrCpkMDYL+Fl9BR9Hn2SUj88FffpOv8NueOYhSmB4QJR+sJRJj7yUUmpeZep6V9V33c0NOruCKsycNuqVz9VeMhSwSQ3SU5HEkCai6zcPDA1N4Vyk8g7O5vVKqVXvhW1h3p5JutZsi3a56SksZICn1vjaag8jefCB9H6yvlLuJkADqjjPgBryatA97bcBRWlS33uSAgZ+kwSR6DGPprKmGSvPThIOEC5odoSzEmf1gC8X+OJq6AYuLma6q7Otb+zy6FU0hlWWhTK6Dm6uNd/RdRi4AaspJr++sRrobqhhAvZWLvMJVOcc0GosJC6ImixNKVJmcBsCNw/DccUNsCvshieGAAJi8oqmpzr7kT3B7d3kHGCrI+a3BR+FzYVF5ALoNdfETovl2WflT5Sm77O0nvDAu0tLTIYBgwe0aE+Ww2Jnzyn+HaC9TzG6YNq2lIoc8/uuiVVUKRiVgWz33M4/uIjeF7185Sy1nqjWmXl2jSfJGeD5O9yZuRjcz9uSfz/GsAuXM6KAXIakW4mwrBVHOVU7Mf47XyuXcZBnHqmNxNCSgY4TuJS1/ZMKtAyml5WXKFt+smWRjrlY2eHnuRssEJvpfbcfcDphm/DjBNSZxEj/092OV3YL+E5xxkWXS4z5H0mm99LvS5xUPNUPrNyLn0V3rVBBnLIXaUd7M4ai+EZEqKQOlSBHNE2M6WDgGOphFQ7OLpAsxqzQUTQTyC7ZgIWlq+w6aC0KmMEc4E17xZl1QQHlp89qPCDJy3LI57zgmlZVsg3ggSpJ8WGwP4trN9ulshBJHn4oshMMPgOFhGtvE9g3uveeqbguQwz324KI9VpKsN84BmHq6qe/XqzE5fkrjsjHLfX6dx5zRtuUP/W8FqP1fNik4UHu6mkbKf3OVV4rLQJ0p63XEoF6I3j6hhK7LpkAUnyN4WEGbpZfMB5UpelYCF0nBRare/X2bmWgG9J5KpUGiah5iZ/6beFI7esamhCZvYt2Eawq1YfH0yV4Rq9cKnpX3gtJ1H8g== 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-MessageData-0: DXdHacWt+rNWIvlVDjdWBRA49/loYEul3F4luPDofnJN6a25RVNY2Sr4EGpAS6jC65wCyUXx3fkv9eWahl40EM11XQgV/sLPKohqaZfx77iEwfDIRQp6XbiCEPLcJnhj+53mXZ53B7iarYobkjqfUAz9J5MUSqCwZu5zdi/3yft2KK16Llucmrab4TVMm+TaUttPOtjGec696x4O7BaEUDZM6Mttxhf2ILDZg0BUNcPJ0rrXiWWXGR6IAGN3csQRff5AKShnw9wb/vfs40n2E7qifMsCunNt7uHVfNjI297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/uXpUrcNQHgGK4l+Hz4j9ICg4RCxYMskYl6amoudMcF+Jz3s58MrscGS7+KsSjYhqF8DyWi68yX6cOs2ZrfX1rFxM4HyRBGkGDMNoRaIvD1aR1tJMH+DCXoFe7K4JuP1vf+pmmIkH0QP2uFJigHMnXn9AxzqjUO5/d5U71DMceGu9YK6vz27uYV6Cgf1lHe3ADwBCFamUOsnL3ug1ACEYcGFmilJYRMqGVbvKD7v8YJ8FL5fXNVuLQDOcNnPY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28218baa-df38-43c4-14fb-08dcb4e78e7f 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:43:00.1886 (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: 15xLIL0tpBBKaAaYByR+7+sq0bQCLrwTxHyi90GdI2DbzTA4C3LwscXJ1DsXe/gMeyXcU+eCudlLtERjX19sHXFbnjVjNP2dt3Mqtd/51Q9IbWMaHrHE6PaxbEhIrjcE 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/uda1380.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index 4f8fdd574585b..7ef7b5fc927f2 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c @@ -556,7 +556,7 @@ static int uda1380_pcm_hw_params(struct snd_pcm_substream *substream, uda1380_write(component, UDA1380_PM, R02_PON_PLL | pm); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) clk |= R00_EN_DAC | R00_EN_INT; else clk |= R00_EN_ADC | R00_EN_DEC; @@ -577,7 +577,7 @@ static void uda1380_pcm_shutdown(struct snd_pcm_substream *substream, uda1380_write(component, UDA1380_PM, ~R02_PON_PLL & pm); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) clk &= ~(R00_EN_DAC | R00_EN_INT); else clk &= ~(R00_EN_ADC | R00_EN_DEC); From patchwork Mon Aug 5 00:43:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816946 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011043.outbound.protection.outlook.com [52.101.125.43]) (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 4265F1CD06 for ; Mon, 5 Aug 2024 00:43:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818594; cv=fail; b=k8zcqh28rTfajibVNKfPcskajwtqtgXCGmGJcSf9Cub+ni0fv2QUzUYhMBgc1gujT8U13XGbw2t4NnL+R7notamPJjgGPid6d3Jzzm4Xqa9cfF5I1KT434hTkzBMfYNgHCzCrw3sLJ8n1P9WG/jkai3wzaUpJQF7AYZTA7cqP1A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818594; c=relaxed/simple; bh=DyB72PZQquq6/TIyhC3bDsoGs4NsNv6sFQSLzRSylrM=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=friavfLwpITrzrqoqv64Lkt39eHuky20Ng7i4i+m9s68i5P4lGp/YN6xdpfn+EPgjotSQ6dStICE8pLvcWdHqQlmYaNFe2kpPkIJmAJelnjmdmbDPlpRfcBaZB8+5LGxlM2OSzjYsbbyNf3+K+60hblcQFc5MCLRKZ9C0zBUnyY= 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=fYzAvyHS; arc=fail smtp.client-ip=52.101.125.43 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="fYzAvyHS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EPR5h+gmHOVrF4vRlAiAF+E1jRhQLhsrURBxiGpLiKZNPAZJNyCqJ55xAnIUAI7pAlemd/LgVCybbX1EnBtsDJ+aywH00pgv5aJA1ff71TYkQ/jhWOIo0Gh87JGDDT+aUD92+JoftX7AOK39PSMrQAofNMj+K98eOpcAn+57hybuA2QMPKD4hl3bM2cfZG/hNmE6uBCuQ//uJAWc27UjHZ4O5pNXLg736BL6IBEgeKeMUpAKNzwKGhkQn3dEQ5e1YsSPckkGWJzbyIp+x8HGbsMlR7aKbLpkIg3pfYv/mLmLNOlJ2HvcK8qylYhaWDhmXO3EcGTqPmrFpYCYnkFUuQ== 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=63Ycz6sYFGLrY5mF+DGmuYvhiRv4Z3bOUMDnQFuy5b0=; b=kk6ZsgPP58Ulj20cV68a7z6S93sqkjimHFKjLRUMicAGx3uII9m9+zcpZNCppmvjD9Q/YNNwUJpnglSt5OQ3AAHAZA+cgHnbpdxLaKNf4PfsFIoJwEFrnUlgsgDrwgQkGiFus+Oh2aZs4WbZGhR22ZwyNJzGH9LJJ1s0oVBd1WC+rWRtlhE1UXjUEQ1DMDJWeoskSSeKFrtl2u+0XmmOOL44st59GSH2lvWsu6XHvf8/lRBgvjHMwEmCsKWws5Bav26yL5lyA001Vf1oOVCocgbIoy/7PeHgEZqAGeHkMB4TX5JNp+mNZDFHo2yNlT1tkr8++b1dhwzXCBflqQscjg== 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=63Ycz6sYFGLrY5mF+DGmuYvhiRv4Z3bOUMDnQFuy5b0=; b=fYzAvyHSvDutrEMLrmdTV4syXWHSukeT/GsT1ApWhUMAAcffg6FdcxfRdR3tIog+0HyGxzP8bgXwXnnda3MG3+4OKRDn9dc86pkUQpV7TBQEcNo8vNfDAb7t5JqFXEZBhqq7dgAV3ANpeiRGHNiIYu605OVKZX/qds6/UrglD24= 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:43:10 +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:43:10 +0000 Message-ID: <87ed73x0iq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 093/113] ASoC: codecs: zl38060: 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:43:09 +0000 X-ClientProxiedBy: TYAPR01CA0099.jpnprd01.prod.outlook.com (2603:1096:404:2a::15) 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: 7c84c0ef-5bbd-4bb4-0cc1-08dcb4e7945f 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: Fy5YXpWABAWuHA53xFqFvLd8WHkf1ke2EiSkc19ayS2SGbljMcP9M1e6RHyB9riacE8NMDlm9GY5vmtk/CT/n+OIhQBFemL6RZBMZsaAW3ujbtsOewBEJ46B/FLZG12OTrKUt4bF6/v74FP0D7y5ynZMwr+acoOU+RRjOaTZPvqUbezqOXTnyzK8gjRzRN8J+tZp0+YVQ5GYfQ5XiOo2Y8Jf8AEMyzH117x2DPTFeMzKCJYSYHlMtqVma0s1Loq/EWxJXiMnjiS3GAvYJvPmJTSCtfRXP7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MDD8eQtjsvA/xw9xafbgx4qdZIyWZ7FG9vfmixQCxOJ12ugwpmeQS0ZA== 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-MessageData-0: TU3I7yqGodbjXs3/xLjb7uZmIroaw8Adq0xwbTt4oV5tYRTWUA0pHp4sljTR88g3VszwZLCeoHjnULarh2kNeER8oGH/Wd7SF8xrvDwfX6JAxgvVl6JKvGQJjtTxMYTcaoS2q1x09H41iWai9EN9dYDuUoiVOXTG3yda31qDXvsq/MUgVDmfVnjXFeAwFgPALoB1H5YFBkMKijgqTguaEJmGpmNPPMZB2XSnbW1YuEaKTygGMK/X7NznJXWxbFp+d/WG2Swb8pkz0vidWTCVhWZE3/rBkwfdXSQqDqGnsNYq38/035BCYkJIiYWL8P/InEwsZg8+Py/DLvZXErcj0gTrnFsoo4yE22K2hikyE9bixEDdVFE/lyvzDXI1+qWqAp44r1O5kdMSXg+wqzwB0czMtLlo9+HuxSvi/kE24xbHNSvAYn8pLNtfpKUK5usjGDunWyGCaOx+nigBzc+UJzg2DyeJk0ExKcVWZ5RvFHHG79YiHC54kV4XOLxbM5VHZN7dSnU58lzAxJVR7qL3IU+2EJ7w2w04gs/dtzBeyJRPoWmVppdPofeICjr2YW3VVT/v5oUv+V2puuWg7MJqUy4w6soB6wpuH/eOnyJ+914Khqllzk2RfjowV9HVS0iM8y/+aGIf9ErjFVL1RQ9220/crqwDlBhXul62y+qizxYqUXYNhA8qT37hsTtmFV8JERZxLQ8SRZmblC4VHqppm2R3GWbCJmPGihcw5D4kiStjFEsn6U/cwFe3x7Ujh5b/DOBdOI1vqAERTI3Su4UZ3ofIw/1UGeNozh4gCk+/k6ZjOQh9jMjjKpDG5BqffJcS8lBOY5JLlLK7DncKYABQWZJUUZP72MPlXKPsedAMHJhHJq1cq43u+cxs0YqK35ME+EGDTwpbyV784/ezJXVAg9ZJCe0kFl1OU1Ipu5PVMwAOb+3YahaUDoqolTgyfZI6JeorSr6mqBi/pOSt1Qmtr2dVzOH/L4FSgKrHgpCLx7BP/ObasQISOccJa/gkj6xL1mIqzbW9WZ7EtKL27c7cnYekYmHVhqjvDVMlXahBHCrTUlLzAX9xbPheaFks3Z/6LFNQRk8DY2POHm7zgc1Fmw0e2Yxv/SDuVxhZrP3zmLnibmJ9S1V4GU/yCYF3b/h8pG768Oi0nXUzvVd1zEqJW5/SIHwQAQPUX8ZxRuydbCEj9HGWo8c/TzDyyPcFF4EoL593PX9HPBVVw/l9ydQROGNEbBKulXRNCOkhlqPfYkVglsptDf1GiM+M+cpgn+/FUSz53cDNGflrquFsXpTQdztju/Js4adTnTAHYNIs7F9VYMl4ljtZX/hJOavOQn9dk5LYEQXIWQycaGhoWpB6NYEW40Ryki1Ikc2m4pCAFynm2eWgCq6hEyK6nRZeSVECtUn2J9yLk2N0XOdXiBuyuINe4/qf2sO7/Olb8Uv1CvSaAAHcvotQFTYSzXWvOoEj6T+4b0673BosWMhr2gDD9gNj8TBF+TGWCYA0s8D9UyawOJM5nXwST0MzSwydLekGrMcigFJV5SKa5OT8zPOs48WttfpYY6AL7Od2FHWPcIZTZGx/gEuun7+WkjS6sWtjYA6FY/jEz6AHqGBa9Ie5pvEx85xI6/R2qOa+hFE+kfQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c84c0ef-5bbd-4bb4-0cc1-08dcb4e7945f 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:43:10.0569 (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: HSLoJnrSJ9UbM7W0H7UxprQOfo4rk9wALpSDq+OJ6WnbJKbf31sVJEBoYn/WPkg6nx5y3ylQAc1/nEqK8DUL95zqIQb3PgpZT3DejU0Fne0fd/TDNS0scL1UaCsM8z0/ 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/zl38060.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/zl38060.c b/sound/soc/codecs/zl38060.c index 28c92d90299e9..8650c9ca0cefd 100644 --- a/sound/soc/codecs/zl38060.c +++ b/sound/soc/codecs/zl38060.c @@ -271,7 +271,7 @@ static int zl38_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct zl38_codec_priv *priv = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); unsigned int fsrate; int err; @@ -317,7 +317,7 @@ static int zl38_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct zl38_codec_priv *priv = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); priv->is_stream_in_use[tx] = false; From patchwork Mon Aug 5 00:43:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816945 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011041.outbound.protection.outlook.com [52.101.125.41]) (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 F41BE1D540 for ; Mon, 5 Aug 2024 00:43:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818603; cv=fail; b=GolkTqvl71v//iBCGMMuqzjOqnDM180ayV4ROUmD0dR1KkcwAlt15+H/ie+ssY/lR2yXRScZHed+AEZceCJWQQWpp/c5HexSZF+7lOe9YXJGKs48+EqupSjpgJEYjLu6eSc+gjgmRL/XD+ZfyLXBcai26BxGyMZJDC4oR4W8WGk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818603; c=relaxed/simple; bh=u6tIJFDkXh1OP5nlFWrzz6DqfeS5FEcmwonep8FKSfE=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=AZS9h5YljJ+8nte7016qnRE1uxswWHMpSR6QhLNFMpy9tv6Ga5YICG4cPHxl4EaTacARd0D1Bxh0qP1WAcNL2Gbt2zW9Cmc+9T5ZX6buc0P9pdCCZFcsYZrAyO3y2uOyKdpzweSP5yxr3DuWiprhumL1mBSsnu0Rl9qn74lLQjU= 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=RJ2imFv1; arc=fail smtp.client-ip=52.101.125.41 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="RJ2imFv1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dz5MS0j7rdYatYNwjr8Z1C8iEmC7ktYkWOzaOsIwcQ1NKVUhnx/crZkDtz9/5sdYIoa1BMr23dXVbkjhKPPyIoKo7m4PVItcR1XhmcHs4SSB3o/SutdYJMLSZd/ES5yVJqVeSctDXl0a+pTG1p9VJOw0bjLvl+Ya4zJCzzP6E8WAPi+We7xLbRG1upzUtD6bw7tPSzllDJfzMHXBpwJrRWPYTTP3Id82oj0xEtUgmzsQ63/Ota3NKbei+MC64PX0Sb55M7m+hXYxkRdpaHX8rPrGhr7vtVCRFYQK7tsiVc/S5BeuU1ReF1Mpg7qkeWDW+IsaKO0E+qac2QWcKOhOqQ== 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=8dr4G+0sYwrd0WHD2Il3ADwYOpp02ml/lfpQOzekkaU=; b=udXeyr0eHrD6jZy2xtVMM9Csn69ew62I5tzNXNdKAFJmB/QpoU+7nXezXkVZS0ixHmdnPn8KSv6ZKeF8we2x+5XaY5JZWvwVnpIHG+qUS96rrXPD56ZJZcS9x6367N/XuuvZbmWtJV5nSuZ0y2Bl0Pj90LXOSCQhf46h5fwVdeAxETgY3PcsIVZESAEYPqvKX8b5XwSUxWVeLZCVIWN5rPOgaVxAuLCOMSc5T/FBD1XJyt4qOXKmpBHqzrSVCZfuuHsaaCnHn9ZIOTM8KRkiIDV/9pnLeLQiJulHsfb3sZx8+Z3N36ayqzA+FgByZLL8iWRybA3a9NaA/K2cAS0ylg== 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=8dr4G+0sYwrd0WHD2Il3ADwYOpp02ml/lfpQOzekkaU=; b=RJ2imFv18sSKOTfmvEQcFeuhp+Ut0192rbEE06qt/fUeLzWqLjWxRYRfle+23fEyeAdlFr+rPHNOrep/uRGSkzadepbhZiJHjvuFeiP6FqjGeF4eBXg9o/zheZ6+SC2d42boo+2l8JUM9b4p9u4lWcnhxB4og0Y8xt11EbzvHrw= 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:43:20 +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:43:20 +0000 Message-ID: <87bk27x0ig.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 095/113] ASoC: codecs: hdac_hda: 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:43:19 +0000 X-ClientProxiedBy: TYCP286CA0192.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:382::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fb16494-a9ad-4362-a830-08dcb4e79a54 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: 7FbEV7a0vP+CI8HI6S7qSdjs7harDfaP6v0AoEcbBLssEKuh/IZQLIP/W+oA9K9YaKj6vMI3qc7zOqMYs5ghhVHrmAI8opjYMVb1ij6rWhJj03tXAhXSxy8Ouec0uobSgp8JLPeJAQmdvQFxoHwMcMb1g0Wlf121aQeCLQwaJejZgSj8Tn4B9F9NTTJ0PqA12PydH9lPOV3/QYmZt5fZPIO7Xzg8oW6FWmve85H3RTKxWm6nSXjAgQGzV+IBLcWhgKZlNuSIyPcerN3jKyDphsqv9tAz1kDSITYxaLP4wZ/EZxC6aw0QkgrjldRo3Vn/RQFsWN1y9/2bVag6YgeqRH4dUr8t6zwy6qRuPAjsx8oPNplLPRy9jgYRGbS8Op6QhXgVNRH3AjTTjq0xUwimLQvTT/4qGhJC5msKy6rCbkthH4oh6iIDt6UWdQKs0eOtZ/5u5dhVs0d4xCy8Fxw1jSKdmbgF0/UbdMfYrUNPtnxps2CKmBMK/utZI1hOa2a1AReGinWkUS5cAHYyi1I9PoOAejznSCY61RPh7rmsKhO45Abq0v90NAZOlPw31SmOQyyKCbq89ykqPuE7CA2X3j+THIWFDIvInRlRoMXo1jqKoNjwGCPNzfNSO7Y/fpne+yJDjbPZhPmze2Wj2gF5IvpuarLTNXNZb5FcsmeKO+ixb/X84JlStQPPIoM4ELWijF+Ffo6Ge/356Vn6Nr1VVC2FFkt5JaoZ2+UOfJBDOPgJL0Xjn0vQhClaEhIdzYObb3rQgZy7ovBMo3F7/N40UWWDR3PR6kENDlvw1RQsai77mtl/FSxH/YaqrDu3A+lzqCCvjcNU36M5Tn1NgKuX6DPmg1sWjK6rNtbK0ypWbU1jj8phiE4TkT6WlWRNxggRZtcrsGVSzaty0o3ocRt1pGVfzhtWLGM4fGX3l75V/8GQnXGTO2asMvaTr5r+Xd9Tih1CbrY9RLu3vrs2TZLkOs1vK1/m2EzkrENa/y02FVpKj/TnDSOKn/qvLE0btGkBQWIFZWA7ZVQNnRhlel1gsUOpaAhvwt9vio9LEEhLuRz/ILuEj5IoDN2gl5md7H5q/EC576Luonip3jaybP/4Mm0iQ7uFKFPVSJW6PKcolUEocEL2s+xI6vyxO8WtIzjJl6xtzQTmywIW8UXy9Ug8HgUHsQRMLjRAOwpiavUVPoacRPmOq3T3rh9StPuL63nbZlfxSNU1kgzVyH6RJufC5xApwnRPGAn1buY9lM0Z6Rc8pomuXP8GcZK4NK0JUXsxyCeONJeaQ64WiFyJZnzJGL5zZtUxm27Zza/uCgCqH45Atog8lmU7b5348bteeCeWFn667grMYv94mVyHiBWuD2mvoPmjqPKi98jHUzrsw3IM79LEktDNRZXpAAO4ifF6dDoBxdlPa5wGPgQPJygAeg== 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-MessageData-0: 9e2QWo/jkArR27pmUzTni7ZgzDkjdeWccLisBV8e7gxSuADEt0iXg1buQVMYqIc+s7q8fFroo6/Rkl/1O/jK5GXS+vfrNbHNYxTuUrj427rGDuAQQo1zoik40/7LU50seNSgO7Bq+FgRtSqFSaGqg1zWKHk83Ay/j8KYB4mHwBOJ9zGHtoeYAh9ZPH5wJxwTdvxuoXBSsN2OduEde6A+LhR4zUPO3hSaRde8XcJUc2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R7mjk5qKyyCM8y2uUoy2xb4Ynw0XhlxCTtYGBuB1L8AN+RwYI7QVHPwMlrjNz2cdVJIwQ4QRZfdrUaQrpAtyZJYOCJgxLz6P64VgyJ7cOp1dlAJdYqX8xFcZRB4ho+DmTggo82pVsEmIa7pGqtISNUyOM5/7elJY4NZSRdy3hkHFTTsO85Id8x1H5Scx3+MFoc8o+LSk63o4dUPerABt1LUXL2HLzZlPU0L8RED2ypxBuC6sM0VaQGFhHhPKvgcNuVsn/SsxaCVJfm/Prf/zg3HcACu5kjF8/C3UUNGhwZpF7X0TGT+T6Kdpx5D9htzc1D/pa7xlBwCYgNBgk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0fb16494-a9ad-4362-a830-08dcb4e79a54 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:43:20.0214 (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: CeO3AnC7Jl/Z0XEHtg+30lijfdALLLAlvo4aYg4jn+bY+v6F2BFMcLZOOD7vE+eselYRlV07bWRF+QZQ/Cuus67jla6QX4OW4qSn5FKMwSBgzd3zb9azu0TILobKkJ7k 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/hdac_hda.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c index 29c88de5508b8..d5b72afd82709 100644 --- a/sound/soc/codecs/hdac_hda.c +++ b/sound/soc/codecs/hdac_hda.c @@ -220,7 +220,7 @@ static int hdac_hda_dai_hw_params(struct snd_pcm_substream *substream, unsigned int maxbps; unsigned int bits; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) maxbps = dai->driver->playback.sig_bits; else maxbps = dai->driver->capture.sig_bits; From patchwork Mon Aug 5 00:43:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816944 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011013.outbound.protection.outlook.com [52.101.125.13]) (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 1497B1E50B for ; Mon, 5 Aug 2024 00:43:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818612; cv=fail; b=Cs3hF4tXc0uvfs/ICuOv6kvmxj5RkUIqPf57Cci/ml6RVbLtZQCv+jg4mxB/owfwuHeZvigCkh9vMyHdCuaV/cKfrAvmOd51lyBu3NGlXS9sit8H4cnzw/JTggel/3UlnXLRHvlgT0Tdg29FOxjzxFQsjnTLDESOwTMnrQwDVfk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818612; c=relaxed/simple; bh=l8qHpHZZADoUcEytZNYmt5/+OFa7kk2ZOXL8PNdJ0GI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=EXf+uo3yjNz/TeuXSOib4A7R6lcye3Drgq68GdRS7Gkyqa1W/J2r1QeuzmKCGmQ1g4mZvyf8+jB7Wsnbg3QhwsRPdFH1JtZTxdGlggL3T5unjsNoTgWLv3aZLkDCtv9Hmv3Elwp1ZyyDX8YdYkRQ/3T4C3vLc8zJcc09eyJr6UM= 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=i4BWZmXY; arc=fail smtp.client-ip=52.101.125.13 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="i4BWZmXY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qYBBXeIru/S0V17yB1vo86p6Fdo6Tx/z6b80c9HM2hPGiu5VyBB6i+6qOdb+wWq3ar4roUeEQPXzf9nJphsyXGUxKZ4weg6Q7p0qWxhEXhY3Hb3ZNE0sGvZc+z4Hm6pR21aLTexr5HlE6PmLM70zRYjIb3kVaZ23gr0J5aGVWZ8aRcAIcPm4AdUXwxzeuuVaZupLDB7UAQJOl4OeG09lXxpkkp4+I2vCnbJ8j3sip871cvKRgL19zRSzOoUZ2oDuVis9UP9XTV/ozM41yP+JZ6qCxgV+td+GmuJUaNuEPZR0wuxo7DqLtshLVVj81PoP8UmoJlSZF99ZTl4eQMCfbw== 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=fEz+SzyudQyb/ome52xcHQ5XTuQ/qDYNh1fuuU5uy9Y=; b=K2eRwfo23nzK5gv7X0PWRroWXaftU6jMyAulzUxiwwjJ9R7aRZKbN98jkGNiMIEEtYjSXy6IMGafa3/VGkVyZqm+JqlLJ7pBxMEzh095I7oVFN7Vv/5aB/4yG5o/tgEWwqcZ6VGYQbTe98MouONBiHnWGF0K/TCAyJKW/YFdyyyR01V0GFrpvKtuo2xUOzprLRUAsUrpk5MsNGC7X/ZQdtcA4RxGADLGusSAhXb0P1ijtFSdxKbrmSw8MmpS56d3oimJgAcYzKrDvHPWJ+wpHUA5xfvqQifKCcCcFSYr4lzynW5I1oQgVeTQMOK3wGR7+N8K1P7w0KDz2AIis/V36g== 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=fEz+SzyudQyb/ome52xcHQ5XTuQ/qDYNh1fuuU5uy9Y=; b=i4BWZmXYRTdf2mm4Fi+7KIP4zEg7VGDCmLyL9bXAPr04FiHT0/Pz8GlWEw0bifHA4dAg+7vbb+w3IailSC1z5LAeMeyKSdlegv6SGuPzSf9fPCYkd4a31f4LIc9uRv9pXT527ykLtcUpLEh+yIQk2OKd3JQIy5tJKgMc0o5EzBs= 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:43:28 +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:43:28 +0000 Message-ID: <878qxbx0i7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 097/113] ASoC: codecs: sgtl5000: 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:43:28 +0000 X-ClientProxiedBy: TYCPR01CA0076.jpnprd01.prod.outlook.com (2603:1096:405:3::16) 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: b1c1088e-b222-406c-a11e-08dcb4e79f90 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: eMSWDqtIUsgzTg+bGVSuRffUO7gtyMErzZkDh+3qRntcpt335cvbZlEw1s1vvPPGFBOAoWM86TcfPUJHmY9MKQ2EdidbjShYHu2TI15+6mXGDtMobl1hTlinnHjRbDEi9pjPw6Mjzo6ntSfdv0y1gqHejGUOda2ivFX9S8zk1C4fsPq9+0PE9cpYCUTjyHHjWINkKZ4tDhEpaRfjM4Q1SRzIwshIGgDkTflZFK4UcJAayJ4+U6zAjBsx74vkEgtc7hkI3Z3Ds0Dc9+70TY0YfDzbLxALDaMkWGNkUGy0yUHemXAcLoCy6v4VJH7qooJip9WB5+50XLzo/MHqz3gb94XdSwmuUDrAcj5hI40bSerNsn+dZs2G0PGMYJDz6RxG56Nxj9sWvRO+Q9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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-MessageData-0: rFdOQLpTTyoEDaAoeCgTS28VDp7AtwMIzym0RFq7YNz4Xyc/IdgpnwYLAQAIqQXvezqQvTsuxNWntaiwWAUXlb+P8jWLciabGCf97PXslEULds1FMaFcVgiCqISNaaNhGczUGsgq62E/Jia93NFV2fcdzgcQ8MrIblr8cUxwQiyn2IPG1N6j/CYDUhwd73TVuiQ45YU7kvF6G3d7VUI6JUgJUtZUqyv4nHjdiypP+K2BA4dnInIUfBvMRS5Y1tTWIonA7tFnMHu3NGlVLUPRwT6d9E2EmGhSHw2QUfLSE31MMLCwijfTIfkN+sH4xZTIYeLxJLFkiPhBS1P6Y89QKwb4/Osdg/k0mD5MFpRvS3kDosxG+u+hA6kiEOx2s90hDHKz+uupl+l23q4oCcWN8G11xHq7xr+7vFwou8OWiqok0KKyIgwtdT0VuJpGWCSNv4fnOjMyfLU92KdVZn5rOAjdpMdeUZVHFcUbFaBee+z346iUa/N+8OcDjOTpauqRkH/jbiazbGC2mD74o6Lqe/n49F3llA7CfQr0xX91l8JSg9iPylx4TZfj6+llRN0JYuTV9mfwmR+ca/HfVyHJTrWgTTV3AnyBF5GvWIF3viAEmZTQopfULig4QUUjNW21dtFlwPRmTGBGnPFAwM6PJHWU4Si279lKbjQoqufMG0fGleJom/2WN/x32YzFPP1cbLatHjlZEpfQNC64EMUPS+k7huI0LhCdcrVMuURh8qY//aygxUStccFx6XZY4/ly25UsZABtT4Hdm3n+qwcmysVYsviQ1P8/5qB/F1M5VKCfMuZwXPV/nSKebji8c7n64NIbxwvweUinZyXwqgLnIjOGTikFD7Ac338GXEBYjhDX7RDDZnL4F8am2SoegnH5Ve6+paBqjRXLXVjVHyeYY6NLneCwVOkWAI/h0m5yKxG0NwSvbsfibZOGXDc1chjjSOh3neewZFwG8zw1wUTqoaM1g+/HMSY79zSgV3gwmlleWQoUkfPUfjcxMRlSeOWboLTn6ZsdpKaUUcnjibb9mE4EafczDcQEbZtDA7xEnbgJmSqr1jfaJVHaO+eYh2RoAy4ConArLNRH07ti7lkEALNiab/XBoGSZTqn+Vu/aff6x6qdp8Jg9NmyJ+e0WYcN0d1h/hcFeiU99+9g+4nsgFjZTcCqccvBk00q1P8MqVlnBOQVEI06CUsk0rVzz+4EIIr0dW0dEgd/roFvm+YNdPA3RUdHguZo7Zwlec1LRiPow95nvk5aWWDjWJF3WXQEd8n56F3Z4DDDXZzxiXD6t5rSAu/6d5k0RyP7VrErCqLCPKImr4esbs6uQCPRenUVEBuDCHAeztfeg57EWLV6DV4wnwrwuSCIEuuaxZolFWVI5FG7GKEEm5XC1bAT0DlhkbYcWKOer98dFs/cTvyibBxaON4eehJeN4RY8TCb09mI5B2FIaDxUTOR6FO9DD7MHyUKUEBdfgB2/WKXYzcgWaZuf2N7ABUtr7cJSnMxsBuv5sqnw6V5BLG92JgPhgOW/P1d4FnoNKL+NYui2ga5yKj/xbryj2ZcugeVLitj5X9GpAb8AaaltYIpVOCoVLWN0ys6R+IDkc4zis45BbNdWmNjrzir8TBVVUtyPCoGDjg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b1c1088e-b222-406c-a11e-08dcb4e79f90 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:43:28.8021 (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: EKBzPTNC9id/BozzIVg0B1hFfhhdXCe5Caps0smO9s6MSStboukG4HffXl7oE7mSRaFzJjwhuxEnEqGYD2tpw0WOkMR5Pzxew+e2UIxrt0pZLJ8nQPHHaAsf6dtzO22a 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/sgtl5000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 7aa89e34657ea..5b2544e05db7e 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -1061,7 +1061,7 @@ static int sgtl5000_pcm_hw_params(struct snd_pcm_substream *substream, return -EFAULT; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) stereo = SGTL5000_DAC_STEREO; else stereo = SGTL5000_ADC_STEREO; From patchwork Mon Aug 5 00:43: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: 816943 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010046.outbound.protection.outlook.com [52.101.229.46]) (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 92D5427713 for ; Mon, 5 Aug 2024 00:43:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818621; cv=fail; b=WvHv1UBKrsBGOFqOYnDBKBUtausCpejDFMYcc2lJ0TeBsxqOm1uyvxxbi0MhXsKTjgYO92OIfCpS8rwnknRaOdGS/Ip+5doZ00+zH1qknvZVV9fii5QYIuMhEWdNd9Ex2Mc15NkHmY27uTGAFqcR8Gz2M1KswWPgTs/RnA9cSmc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818621; c=relaxed/simple; bh=IAAkCZBiUABiIEXUPF7iK9BHMJwykoctt+2fR2WwyUQ=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=RFBjqNlk9nQnDIpYDRPXEIUeEeKOGfYwEprDx9XuWDGcf44UKz9HLul9ThalzbeeErAh2bD+fAIFNXu5vBpzo5XjAxzu6w73PAgSmAzrauBeubNVioGHyU55tjqC8q48xJAoP/PJo64hSdY0GnKC62H3Yyad+bK6gAZbcNv3t3w= 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=bm9RZKEV; arc=fail smtp.client-ip=52.101.229.46 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="bm9RZKEV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ItAcNHZsMiqaSIrfa6sTrM/nNBRpp8rpp5NFqZfHUi/2fAIKLAKL7Hrlqd6Ynt6xyTUZLeEjk2laJMV4ayJf2zeBPWbA0UHlCkEJClYAdO4ieDUlAeD2PMAHf2RHH/5wxisJrQ0oKBtKMI4FZQM/VOK10/SccF3IqXRntBOOp8qqhEIpfz1eVw/UKbxD+hYig91thuNoFjgeXawppT6IC2l3lAXr6Z3sh6gWn/BwjmBXbXEfouYIA8iyBKnpTFWNZ4GAJRGYKFE0dtK1bSirsR+t5aUL2QtUVGpJbveNQrkwWDrbPGdYTeFg9BdISqUJ1IKdMIlZBD0WwNKHiK06UQ== 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=q9Xz8dvJfDOGLupTE/Izp1DBMjzRV3/t+URqSmcxMv0=; b=ZR6TM0ULdk64+Ndd8dnJbJj/BRLD6ytrWPkSHisuwejswc7T0QXZ2gftTSvqk1lvwBU1eF69njsJoBUHlg9em/1PWh47D3S/k1Hrl0AINUpGaxo3IxEIsXY3Za+FZnTl616u4oxmdTjLQo6TGAaPFoxjZA0G0jvn1kgH+YntdW6lTw6K/bagnprcJFCOOfBHNIhRN/riVC0KA+6okTaNPebUYF2315mFQGJ7oFZqFeJlZxu/kCpKJu240zVn9leFZGfxxh6Z2sMHfh3JprB8GZuvvXN6Y5nQioJR42+gVU/Oo3LPIipNTQqwWPc+lsazIHrcvlw98ytJMou5+HcsQg== 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=q9Xz8dvJfDOGLupTE/Izp1DBMjzRV3/t+URqSmcxMv0=; b=bm9RZKEV5lkZnUqH5oe+KQGJcgAYrXkJVhQwyL4nhkogcbGMWJ9fHGyIKvhaR2dicAIwHLZw2q2nI1fKZBjfkXDBsm0Z5dykjHD9Fd1LLN3K4uc/GuvL+ixRE0fmOv72M0VH9XwIkbup+6GDt7g+eo1S895aaVRwK1PtvNpu1kM= 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:43: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:43:37 +0000 Message-ID: <875xsfx0hy.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 099/113] ASoC: codecs: tscs4xxx: 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:43:37 +0000 X-ClientProxiedBy: TYCPR01CA0009.jpnprd01.prod.outlook.com (2603:1096:405::21) 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: dc095ef8-ef7a-4604-3390-08dcb4e7a4b7 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: mF+MLGSBBSK7Igdpoy01UuNLpH8ymy6wM7t6SWT0xEcmW+St9k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wuVmhc9ZJ2j0I0qr2utzah/VO+LkOIQEmUuxCivt00qLOrCMTiANwnHkA6UTnrVY2vPy4u67XEGLmBUqFLh3js6XPP9e7vdKdW/AgmoUui2QIDYkpEtux/UfjvxVBOUk+6BoWcN39fH8/nsXOsa4kFLazOhzWrM26miKleiMH//3P6oNfWAtYwMxaNKCKpp/XppkhavkIvhp/C55f6Za5U6JlIzyZbs385+VrwaFjzSmh+2IunXqy3LMxbyx4kZUsk2neZWNWqcKAasHRe8cwAc0JXFtRXm+FtOWWcgukdJKsqmJZ+VyA== 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-MessageData-0: VjHFYuACfs41B4IU1c93Z7mWi260YfE4lffxRGD9k0EQHEYIOT26/TNiT543865wYZi6t5YMrxWiMUAYdAPrHXuJHEkrcRzt0Yf9aZnnTE7G+UK2aWMWGULPkqRzmXtKSl6sIRy5V3ZnQ6XsmDhw0otlDLbLlOajmrWmVgTI6GpBde+QglclnO9RymAZ79EqIudVxCpfvXotWe+GzAubmZoNgk9vCPJjOHj07Uyks713+crExOmXg3NIGbyF+bFuERrzvmZCXnEH00BnAqCLPds5n1cYEDzomqsQ1bWMyZhYZAY0pJyE5sjqhjHzUL/F9bti4siIih5NQaNoF+fsd5xjd4xeebKWSCvEx9jG7NlKqJFwcyuaEmJRTBarCwoKuUkZhLShdjJJyTyof3ac13I7rhVEk8FOorOPzZipnVPadfFSY4hZojfl8Kp78/qiu8+iTT7RBs2U6p3+tt3b8xy/niCrhyb07zf7BZaM0LA2N4EMeZbo8hUTXeWlcUsVs2GEdoLy6kQaYc7oL3L/fSbzL7bMaVMSKyZFXr01NWRY4pC8z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rg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc095ef8-ef7a-4604-3390-08dcb4e7a4b7 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:43:37.4601 (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: TQTOmqDDr+IKq2gFAovHLHBZoKCQqC/pe4iQS4ep4xsK8HwHoitYouWWAFHso+BqjlAoD5FXBvG7FV5dshFvZZBZ4rX1MB6MpZuFCb1A2iHFxQIfS3s8Gjko1NINl1v3 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/tscs42xx.c | 4 ++-- sound/soc/codecs/tscs454.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/tscs42xx.c b/sound/soc/codecs/tscs42xx.c index f8a3d1b40990c..dd87a37b97854 100644 --- a/sound/soc/codecs/tscs42xx.c +++ b/sound/soc/codecs/tscs42xx.c @@ -1178,12 +1178,12 @@ static int tscs42xx_mute_stream(struct snd_soc_dai *dai, int mute, int stream) int ret; if (mute) - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) ret = dac_mute(component); else ret = adc_mute(component); else - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) ret = dac_unmute(component); else ret = adc_unmute(component); diff --git a/sound/soc/codecs/tscs454.c b/sound/soc/codecs/tscs454.c index 850e5de9271ed..b8ee1281db489 100644 --- a/sound/soc/codecs/tscs454.c +++ b/sound/soc/codecs/tscs454.c @@ -3221,7 +3221,7 @@ static int tscs454_hw_params(struct snd_pcm_substream *substream, } set_aif_status_active(&tscs454->aifs_status, aif->id, - substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + snd_pcm_is_playback(substream)); dev_dbg(component->dev, "Set aif %d active. Streams status is 0x%x\n", aif->id, tscs454->aifs_status.streams); @@ -3241,7 +3241,7 @@ static int tscs454_hw_free(struct snd_pcm_substream *substream, struct aif *aif = &tscs454->aifs[dai->id]; return aif_free(component, aif, - substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + snd_pcm_is_playback(substream)); } static int tscs454_prepare(struct snd_pcm_substream *substream, From patchwork Mon Aug 5 00:43:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816942 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011042.outbound.protection.outlook.com [52.101.125.42]) (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 632232A1CA for ; Mon, 5 Aug 2024 00:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818629; cv=fail; b=j2vdd+HHJXQvVcLZjtnMn+J4IFnHAMaiqxVqtHe48YUy/j6cmfepyJl/Kyc2sP0CT3iXz33CrXNEpAKrp383c6po+qp9Jtug7TR5xGdBgkLjF3egozW3PNDtw8T0ysORjwKjoeEAuCHJdD66b+xuP2Ky3n37ZjUBNszevQfAIy4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818629; c=relaxed/simple; bh=szmgBSGhQlEcjcU8SHLUDJKNSG2P+er0n19kqPKz26o=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=LKXW1x+SNyoNB8Qw3oIyUFq6es1jyjb2Sj4Ci8e/2fjqJpSVSETncUmmz3OhXeMXbrnpDBNwy52mRqWZWf9gHdz5NM+I1jDGsYr447Wjt8f+biB/1KIZ8MejnHZIGA2gKlK+kNTM79rNJiKy386naDqu2eNDf1IZPD54wIntH8Y= 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=eaIqNgUE; arc=fail smtp.client-ip=52.101.125.42 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="eaIqNgUE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AgjC4YQSkMeGl75YbmnIcS6jB2YhedaOBqaIRbvuK6e8/WST7zJ8L9WybR7Gwrnjk8b7GMqfkNuqjveF+DxZPX3AAenvdcUzKB3E4qUAAur6Xw70XatI4Je60pxaLo31VdUuQgRGKhH+Gilm7qm1Rc2mrLpNXrIWmJiJPhHjJSXFYHH6bpO3z2a5+3/f29EDIa0sFbn6MndtQaWguHr3zYZ1VgvHCFD8m/Fv0MOHbnG9Op31rRrh2e00qxmil6naki5Xfw1ij0QmLmUfnPvR7YzyTlj+pizc/cYrRYGDo8e34ZqRh7M+C3jmBUOq5LaMaAqH1faq7yjXA5cNcEIcxg== 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=16ZyGdmC8HrLXkROBXOl1XvVpGIkYLK28NuS3/QmPtE=; b=bTpTKqWUbapcbZ/N1ULcUhyuOyVIvtX28UDolH4nkjcQX3b+9aPxypYHGosXCOqZqLrIOZfAS9WvkNumYrCuPMSOt9ds9cmcOrDP4+zLG1UrxmxtiftCihf9RsPcYpDpFR+iJ5D76MGmN7N29CaUN9UeUcRFamre/lXamyS9dWlwVouXGH9ggPNkQ9FU4vFKSCU/gjL5xO4dNz2fJhXj3T/SuZOcn9SH4MbhRHvdnkD12UtQWEofDrtPpl0+QXT+DxR3soiLPJjQodsUJlZwy1I1o1CJG2z1fetIhhRfnWxH5Jh/XBOellR8WME/1lyMWuWvYf9sCVdiAcRglXDekA== 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=16ZyGdmC8HrLXkROBXOl1XvVpGIkYLK28NuS3/QmPtE=; b=eaIqNgUEn8mX7Y0DGvhbmcYs98lsrOxH9QOIQ7gq/a7h6YNhFLiUTYtSJwowsPx1tzOHNijrdrHxJ+1g3aXTImr8S8TPe3aodnnLp/OcqEVw2ZsssRRTSJJGPOQHkN0mnrFU5wDGTPRIymqgjoGUah90LzFat9Q1gRtS2EzcQ+c= 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:43:45 +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:43:45 +0000 Message-ID: <8734njx0hq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 101/113] ASoC: codecs: sdw-mockup: 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:43:45 +0000 X-ClientProxiedBy: TYCP286CA0280.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::8) 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: dbcb9102-10ed-4a1e-ccff-08dcb4e7a99b 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: 9OI3tQg+xr9G+xEACbo3yKUrRSHpXpF4J/lf+pm5Wu9cCvXRHtpXX0+N+rJheGIJGmq9W5mvfU2Z82SJFtHfZLjSc/Jp6BGDZ2gY+sjidg1rdIw3e8ckep7ZTzJEVkmmgPL0cQXOC9W0DFKx26SVgTnuy84wVY+TCerhs9vartR4H4rVrkCigGypV/9dOepfm2bL+MB+XtJe2X6bAeYd4XB62tOxVFjgsm86m4vD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LgJxgVYIYyEaQVntskRiF0Tc8wq0caZ3oy4NVhsVjRkDtQE/lt40b7js3davrABn4OF6tjfqmIlH486Y2xC99ObwtkuFEuqad9p/tUxWyD4Uuw== 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-MessageData-0: N4rz3ndQODyFl302cvPNLPaJ965YU0Mn+I69bzI+jesa0Ul9zaIVLq3Sks0Iu+r5ghmGSeKsUaSH3FNfqQS4I3Ct+3NqZA6+VG3k1NUr7D7UQNZNNb6JDBBqkB4ZG3YAvBqAd+50Lzqj4lE7K+w++AwfnMZQ46d+CpWCs1qYvhkyGknqLxnUaBS1mbHeS8VLbIs9LLs8lPjGCERWMcz4OLx0ZL4hLUOG2xh5o1wVM5sU82JvXZPYWM8PpkxDwegDLUPdQCQbx1dRr0BS87EycmGQax/Wr8rFoeJUr8Fyj49kQzWo1pCeDV+w8x1fyUEvZHQLDDisOlYgxjzX6lY5cD+Ei+4mvg7K33EyaUT8FM+fCpB64II1A+8Hu3WrkBg8FmgnD3YK/3qDVmdnXGogXlaGipfWBwm3JKJyTZETvAUmV/kRYPrs40w1kOMeMjMpzmH+/WgEWtnpFrXbtCAbsS1S7KmG5W7PlTOI2hCu72Pt5dCNXzBbdGOMPYA5abtAxw1Vz9SNSn/03NeE9w3lTdxLfTuu7DbvKmXpqAuKVF2qC0rfD0Qgn3CT1wC0HWdif8UdiCPBYuqoPNy9SdMHpKofGiiY0Am5UmZbf4yrKYCndXlOlBe4jInb5KMQNSOSRqXYvEAD9PPPqtmrwokM6mubb1P+LN5bh90+Xae4S6+miopbGW3pnITuuzCaiim9u1wP92ERCktAanQ5cFlM8a7Z7SrLVMzCSokiyFMli/EISOy8D2ZiamRi74hnBLjtgFsAiM4ELv/7RyeWcwEk0cIvqIWdlPMxuN++ciII0/79WAKQ+uEPIglO+xV2ySZ5f5wNzbDpsPpHqNFD5f9COEjerIwr2nelS9FlctM55PWVCPt732C29cal/tR3CWel6x7IxFAhuhWg6sP0EiqlotKgpZsMppVJ26AEVTfhUp8/eloTh4twGSEo0GGk7aZQyG2QYqZTw5/IzPeseeS+rtYYo/HNsvrQISj+WDtA2Y4tgMedUm/c9bPhXWZBMcfTVMnoSt1vrHjmuAOjkDZ+cIVPKizjiyt0KAxc5LhT8Mu26JIEd9DiTLNHwu3J2m8AEbHEmXtX9I9hTj3j7vvqS3scCA4schtThawvT2aTlh4pU54pC7HiRlHn9cpl3exKSVAaIedOBYqcDTFvGHwga2npdwG4d+yIUSrE+6fD5pHKGCZwO7BofxdMDZrtJ1NvVYNtsSTK43VcI99145u08Hi1l16lTB3yxfqA+7Y0QuEVCfdE0ie/1nqbmOb2oehiE5C/7rIVAbXtm6pDDea3e3pJj3ghfcaxQvX3BQNitVbsWQ3RTSv7AU1fdgZ/WBFQPAAmmXHJbK7BjTImi9kJH12sWlh72AkZuHtJqB3gO0cxXDXlacsAEIXwL04l7U0pUBuaMy8EnItY7dRTb7DvE0EmAVQRwJ4sqZF/ZYYjVSP4E8BXVwKe37zvcL3RvL1zDyQSeSCfOQfztFRcn2tD4G5p8KwcYBNaubg2nupJqbW4z+Y+rVmnEPJch7G0SLuEy+/q3W7jRwBQjNvMbsocqgDV8cWVPerbHNCCG1fVK8hhrd2nb7qsQIQhq73vbKZjIx+yE8iLaz/oZhE1e2ILMnzT5n0uJ73Y1KfKSCNw6SQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbcb9102-10ed-4a1e-ccff-08dcb4e7a99b 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:43:45.6420 (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: zUSafytZ1q8/nmZU6jykESVtfzgaDMe5zooqpmKabQ892+7vWNAyJxH0/bkz39Hn2p1YjHLlRxvvbUQl972Q1v66OWQNotRmfZmaxQTbM0ZPdlhx0urG7cmFA2yXZRYf 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/sdw-mockup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/sdw-mockup.c b/sound/soc/codecs/sdw-mockup.c index 574c08b14f0c2..24fabd392d00b 100644 --- a/sound/soc/codecs/sdw-mockup.c +++ b/sound/soc/codecs/sdw-mockup.c @@ -72,7 +72,7 @@ static int sdw_mockup_pcm_hw_params(struct snd_pcm_substream *substream, /* SoundWire specific configuration */ snd_sdw_params_to_config(substream, params, &stream_config, &port_config); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) port_config.num = 1; else port_config.num = 8; From patchwork Mon Aug 5 00:43:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816941 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010071.outbound.protection.outlook.com [52.101.229.71]) (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 229A426AD0 for ; Mon, 5 Aug 2024 00:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818637; cv=fail; b=EUNeVOaq1qOFY+pJHNFLfCU9GlzlHhxQEutI1TGSlIdLUjw05zVFlKf4lszuCGIF45BIuGRSnfTYg21BjIjbJ/UMUttj84Hdk7HMsFK8Fh7JO7KQVYFcp4upINmK41huJnZnfvAWQJa7fUR4kh4gO8Ez376kHU4Z6/7A0uQ7XDk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818637; c=relaxed/simple; bh=jbhjJU1eRGO4pfqdQLBUv0YqlknRWt6ZqZVmtR6J4Xs=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=BW0pp02iPMjhJahXaQExKSijw0Pq0R2+8paNI8Lk367K/OCUIu7s4prGYlawvz6kbuXQ+d1Rc6A1J/zyhxuFvMySLcO/egvTHYy9P/HQyW+A0hTe+NJ8Iv0LKtMfw7H+WnvdOLPzpQox8oU43/fab2qAA3dYqqfU53MK4yYm+u8= 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=SPJpHkMC; arc=fail smtp.client-ip=52.101.229.71 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="SPJpHkMC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rO6ITWmM3bYAHylSA1zzgJc+OSxwx16KFB14Gb+j5462jCvxe3RjHlEu/g9eBnf09ZcJHSx4PdxsYfwpAj+/5qbZ3QOBOK9Lqxv9Em+mCndl6O4TjvpbYeYEUQYeWanlJ4by1X/6ncKKXiID48r/wcZM30ucfQdg7W5yKTuvME6++61p9jbs680ptPdEaLHFv7okeQu/Dxzi+J4w+SJvQ/Etr3VRj58OnXDierJtM5MAh/YBF0zW/+hp+/ndgQzmAIdlIVTgoeLYSA3pqRTSEroKb0S0mFLjUvGpFo/ZxhFci77YjMD/XQMYpjqWODoc9tD8ohJOsE+P8L3L08v0sw== 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=dBVcoA8iEZ4VqkO5VhCHEbhrj4iIS9rDvcRTadehGv0=; b=E7j5RILFRA3YZyHVeO1pdy/MsKOg9ZRKmjFEzlzZWnpXDZ76vso4bSzZe2Qr1QSf1/bV20bAmlmBxd3XtxilBmuWZLc2UWV8dwVkn4jZB5P04MpI+SYLrdtwt2X7AmEOtV1LDVj0zZo3dHGTx5F+drFrJ8ZuZKFucuOcw1Jbo3LtBoyRN5wiQUK+kkhA46b/PQdncjnciivfkPRS020QXNK7Gd/ZSwrrbG4d+sKjvMk5eu5J/M8CvHD0Rc39zzH+sVBg6mYcAfYNvRPqWoi4pyCwbcf8LUrScr8NpCxpuz2cNg6KBBX0Up26oHeXmRiMhmvIhC9CwtDCIeLpXLy1bg== 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=dBVcoA8iEZ4VqkO5VhCHEbhrj4iIS9rDvcRTadehGv0=; b=SPJpHkMCBcRHqllUYX/TB2F5EB2YGwJwnVRdcgioyKZlPpsIWuIa0gDu4/Iv8XGIrqDWTgxK+mtypxlbeNxuzHTmB92rURPvJom9mCmOIJKhWyaKuqc7o1CqabxCEDVr+fFzYS/Tm12QlZNIOEDx+LZhIb/MtaCBf7DzLfL4kBQ= 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:43:54 +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:43:53 +0000 Message-ID: <87zfprvlx2.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 103/113] ASoC: codecs: tlv320aic23: 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:43:53 +0000 X-ClientProxiedBy: TYCP286CA0272.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 642952bc-619a-4e79-9f32-08dcb4e7ae85 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: lOhQtCvHnPb7MI6LfguOO/S6N4biFBUqz17SYpKXHHyDC7pPxoi1ok8fMWIAHJM/L5PbZx1pjt7bseVaNPQmAx3FlUBnS3D6RoOAno7UosNU+TYetzu4h8kPWtWTVAUen/BHsU+ziKYWGToatChsBdjs7xAAG48Myu3xksX1XST2dYQqzX4DCBXz8mZxXtTzWs5fQjNyo1yPhjevK39VxV3hGyU6TdcRiPhRxRGA8ra2eri9nmfm3uTO03JNzW9qICLGmIL58+UMWShqTCnJ2TjpJaPy831DdTMyxuosiCP2M4d817OWkIWDX38EAomyYgfd66ll2KH42RRKSR1a3LZHgN+AEJ6o5WN1y5abwKNrQfpkIwNKEA4Hw2v+88kQzASVpwCv6AEckihdMJC1OJphm22TSU1hoq7H339j9Jc1uNAOkJ/6TBTc6rmmdX8QAt1CIQHV9OGHEhohYSFiz57/h2g4aQJyi2yS/tcE+NbFtRlaFPeA+IHTprERJwxxz1qUayCrrbCYLCJBh736OmBc6ToeCMG1W2ToLKEeYkJJMmMkTE2LXWN+NiP16SmS7AwArLfqA6YmtKGaCCS3bwQLw7wwFcANj1b7jW7K9p3f40inGljKhZCpittaYptv5GKXGC2KQgRWSqPD9uNdXDENUIuWUjpKcO7ALzvk2YuheYQPgiEx5HbPrK0eQ9duDejTSVm/mDkA8AsNKptktVNlXEZRseh/D39ajDYmgFKX/Qvh5TDGDhiDrpfrAiZweTCqXI8yr6iV0mu/XB7hQhOqHEBF5HPGcrUAtWtJ96Td+/owpatKYZrdFkS0/WAV4LrcAJj3uUVq0bGHg+WVQ2ozk19IVoBridigW/Fiizvel6UoNIx10kcmT1k5vVDkFF9WKZTl+vrUiQdXoboqUYkm9Lzj0NUDENXvHCo7d37i09ABzrqqiJxoT0FRQo7YWID6REvF8YWUXyyt+ODev1E88ffgGDApYwwaapbIGPV9LLYf+bXKVw4SNc3YkfzFdP73RbA1VCsJua6hOPgAiFLltVaAt7UD/+bpVNYb+YsaoXLUnJNp0sFfHOafjenXWO/7fbgionOv0wzxZMbu7GTOfDbMtdZ7uLbD8ryd+1KYDOZKVjjZ3ry0twyetb7hrIYbAUG4jgRLQXIRUk9k+vwKv8QAdgTOhw1lb8NOmjmMraSr1PWCQVPYP7mhXatjoL0X2q9RMSAX5yv9QZEI3SFKAKTaKQPkjBi2+SItd4fT2xH2akJSVH67DZQVV9K7Bw3vqspNkAR3mZ0qlE9KxLdI6fPnGrMBYKBjbKNZcvAIoJgJSEDvw5uFDf8a3PxO0RskGht0NMlKYDqVf8FhSTB8/F0sBeK5QbdJGxGpU5XvBg2aH2DwEXdpG86MpnfiV0ikocnQnuECV1nXqxH2KA== 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-MessageData-0: ZJv6Rd4WYc1fdNnTDsGQBdybb7PZ4agrvK6M0zhvn17ULKi/CjsWNPc+YEnTkIJsfSFSjbOT29yTzXScOZMmYrzovk1TyRFSc9RGu0gJnqFXyrqYvaNWeWq5N4DVLhgfBkE1UdGNnIrq+aEcdu0L274P5FVUtp62ZupJmQ565f6x6Fd/AxJZI19fhMe4JXm/gh1qLUKvCqM4hNfQfI8TrJH+i8yRInwFiHTQSoJlI3QcJTgnl6lC7sNMtKRL3gjmtRcIkP8kr5y6Zrnj10gX35XukmF0+XvRiqoK49O8o7NOCZkHHf8eP5K3YPTpFfAwDclpTKwNPnJ6qNd2Lh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F5DNmRGEHGhV//mPHpuVmC0o5YfYdRJqX3NLaBS2qepediPIFBulVJYYh1O9H8muwb4JgIaJ+f2tr9Zb9MLDR+YO7tYNcsQbjGEx51tfes21FIQJ1zz0/mobyahgGpeSU6z/ol0NGfrtI+EPelne0XqfCIk7krAkHvmVze0JLnWZXym7naZnggj+txlRvWBhMYDnwe2D2KX9HLDeWSWBgje5afcBx7s= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 642952bc-619a-4e79-9f32-08dcb4e7ae85 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:43:53.9023 (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: ETM3EVmeYgllWNwJdzPnHIpYw+sgQFkbbvX2xbxX2DsM4/X1CoFnVnGDQrGgIuTePa8P5c+rB4vUmHX5j/Mc/0zxlNwPDpJg/Ae1STj0ISw8x3HJc0UZFhhhWDsj14+9 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/tlv320aic23.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c index c47aa4d4162dd..06dab9d9b7576 100644 --- a/sound/soc/codecs/tlv320aic23.c +++ b/sound/soc/codecs/tlv320aic23.c @@ -342,7 +342,7 @@ static int tlv320aic23_hw_params(struct snd_pcm_substream *substream, u32 sample_rate_dac = aic23->requested_dac; u32 sample_rate = params_rate(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { aic23->requested_dac = sample_rate_dac = sample_rate; if (!sample_rate_adc) sample_rate_adc = sample_rate; @@ -398,7 +398,7 @@ static void tlv320aic23_shutdown(struct snd_pcm_substream *substream, udelay(50); snd_soc_component_write(component, TLV320AIC23_ACTIVE, 0x0); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) aic23->requested_dac = 0; else aic23->requested_adc = 0; From patchwork Mon Aug 5 00:44:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816940 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011041.outbound.protection.outlook.com [52.101.125.41]) (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 B683828366 for ; Mon, 5 Aug 2024 00:44:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818646; cv=fail; b=jT7czd7QsN+Tc7Q6av3wGmzM4iLosJt+fyxy6c7giDZR4dCqnnawWHT0gMy+lOcsi/OD/Rs3AXi8k8YZUrwf3iTg0xhcetOW+N5hXLXPIF0gtnapkI7QvmD8wHP2etmNVk+GHxsUm3QtaRvsK5F4Q7Zic8iVjctplX7d4AmKhLY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818646; c=relaxed/simple; bh=TzHmMZ3IA1n1Ch0cAApz+Sl/07KzkSD4n6VDabTGiV8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=IiV+Rk4+ywbCCvq7iddblEEFBVTbOBKkn635C8zV6/buApA1qBHqTW69MP4Ppu3XXi2mt8SaLEsa2wPZTtUlqiL+eRdE8Der5hHhaUZShrP9vlJR4vp2pqMhBpn3A8aUmGVzGDUV1HWNGf+IRdbrciX2NZJlw7GvT+o4+kX80c8= 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=OhdZaoqK; arc=fail smtp.client-ip=52.101.125.41 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="OhdZaoqK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OeXY18M0QKkuINOjqSkjcm7pWJTDtU7kcTDVURMkQ0iRddB9I5zhCHYEYDKpHGU9lGa57g2riQtsbwlAiJQzx/qtZraA+WQP36uHjbSmGXMcY66MLMbSseaKsCJA0Ftkev5tKFdLXDS/lDfLiD6AZQz8fD9vYnyiKlWw02K06zpCivpGruaR+q2Kdt4QR7HUKqmuscX9yyjSegd3JGcyeb4lC47O7bKfAPTZzvYSkKKtFLreK7Ro3hwCZ2/ZiFxemV6LXpwg/PoUYNc65R0ScBOCRJDc6XKQeA1zm/I/1udEcbvEaziX7671YKwDH1hf5K21MFcd/+cctyfA78kLaQ== 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=8iN3ylHoFXnBLmyC3YRrE+pMKjnmUEzsk6JQYYFL50Q=; b=lVdZNQA70nE0SXACpOkIP3X1/Wa+9aWMFtHs3KORRkQhBUcl6Wi+E6NTCSOVN4LDpxYp7zhda1Ky0Y06XdoTNrI6om2RcAHSjoQMuBlBbgSuIGnX8rbG7+FwR/cbTt17lB4upxLwxYfPg9VNZ32KtE/scbWO3cVmgzGSH3vaTwDDyUngI4VhampFFN6XF4AlFcwHpGayjK2ZCrwknH+BggltBAO29vx0nZ8vKOMDkAtisa/HWaoKyDc5nydtVgt10mAktOWTcNi4A4zzL0m9hfb7PeJ9x1iP7UMX6mj9QvZMbxNm1hetZHqfgCD+4bZb2Hhhq18tTRR1GscqYBq6lw== 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=8iN3ylHoFXnBLmyC3YRrE+pMKjnmUEzsk6JQYYFL50Q=; b=OhdZaoqK8MRV5NmGuu5FVBQLajW+P3TtQwQ3EGSbdbtk1ZyBDLpAHSemYSuoRGxOdwiYuIdksPzgPUJMsOr4LrwJeIS8vC+afyGFpZF1CBArHCRO+Rd8LEwbErzHfNBU1Q7+0LnU4sACOtEaqkPkUBnb/jZEaAZewECSlLgr5aM= 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 TYWPR01MB11466.jpnprd01.prod.outlook.com (2603:1096:400:400::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:44:02 +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:44:02 +0000 Message-ID: <87wmkvvlwu.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 105/113] ASoC: samsung: 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:44:02 +0000 X-ClientProxiedBy: TYCPR01CA0119.jpnprd01.prod.outlook.com (2603:1096:405:4::35) 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_|TYWPR01MB11466:EE_ X-MS-Office365-Filtering-Correlation-Id: 690add45-484f-4193-bed4-08dcb4e7b37c 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: LMkL1R0VyDyZKRZSMLA+MLPOsxbQa1ah1KmxVTf78SgyWPrJBVyqxCypxa5SlifxSZ0Q5uOYQ52czvDlZgHbtLGlYJFQE54DP6rBgmOWvLh2Li/rx8ilYc1x3opmvUDqUqAmmsODDVwM9TT40ET26g8QMsTEC8SmWoUeiSbYf9MZmZxgG6tjs7xv4ogI58G9AVX5hZuBiiMZzjrihyfMwripMYLTtKoHgaHmU6Oav7+tYiBKDK2BmmS7BSBjBrehMOX2cn0UFiD3dvZsvkF44W5Zg+hGyGn2BEd5Z3Wb5IMaV6TY3gEBBe92WvZe3H1nHvdE73PxVlBhMzD3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X3wdN4dAJIRg== 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: aITRVHU7McpBIATjuNQFTbupEF2/BbOgRYOl60JqYLhCVYqLwCjQTrzOoMk5WNE+Eg5Iol+mC9tciZFUQcJCGp1dfSVqH+Kkp0MAHCNtmbdbNoYH147iydYveLe7rJe24KPOzN2bg3bV53+6NR+v873o+2Ym/iM7Zb2sH9qGmg3jL4XWQbuKwYVbkArJfM+n+64sAVeQp0VzQgRhlln5qG6niRxuWgVn15iGNdtJ1OlDKMDm9Jz0RF8cDw0Ooe+2ZvrVA5+cEzAiwmsVjjkifsBsD+CFdjoUoB7cy6BF1vdzueiJOlcjm0OwVfneZZrmh3J9CfoExY/Q1GqoGGB2US5XwfJGa6dNuohSuh4gzqdbY6Jc3cJRf8M0R6OhWQJ3+nf/IUudlauTUHNeqNt8/GnlxyD3Rv/BppyFUmJ1db+BtXYm7S2WdyUToZMzz3xFXkHmpcRbxRgelJjZJY8ry12IPr6ZcrJ9anlu9kkyOmq57qpsA1Uwv/7/Q0VVCV0PlEBSrqi1taZijOwqFMKiEL5SisAlcYfrTibDMMFB6cTnoPI+d4Bf5NYK7p1+Ut/vr0hGMT+cw9QMmNqowJtFdqKSHWtUbFMkpcJ3HZP2r7TazEBZcGCl6UIfFsQ0U1gkNZIvO0k+GQcX4+798o2CelgRA7U4ApnnvMviPRpNN8tRC0cr9RLF7P2M377n45PLWDjsGbJSQZFJUUZWRtTCbMIZMrRAWMlPW4A7nIVc2Ibvkp1Eit0OVmZmDjHS2M7bSI4BOEc42BxjDkbiUnQZ05sD2aOyxZrEkWW9UcHHkXRevmGCL2qGIJMX/gP0Lv0rdHtvHfnl5UoKlOSdJpDSIN/69Xcj+WBv1sCon7pcOmTJHLcxZWv90+wCxzVRlD8XJ+u4fLfFk2lh1rKOXrai3lBjfo6ChZQeTDG69NTHViq+e4Ha896VYiSeDaCaMhDCeJ5ayOkTqgZGnF+yU7YXv/NHTKpAfXkgCEJ97m88Cygpo6VoAK2YK3k3OuNLBESewT+6oizSwXhSr03uckVt3NpPvzQ2UbjoKXG/BZmLKjijmT5pMo+ZnuwKbqnovu7vhmKbBla8Eq85LUrG7DPoefJc1uZOGPg/InKuIBOKmFi3ZSbJHsbCqNzBEzmS+fYMztSd9JMNdydKJMzhKVyc8u9CCthcespuM/Ollm/QfHLMoVb3iGfJkTj3COg1qnuW+ngHfVzsE4A/6YCAW8eVi/5clt5R+p17qejEfuiiIx1dTACYsBdQK4N75r3yWFtGrFKX9gk7KHT6ieKTLXp8K3JP1nq2XSJlJJglZCUV89V+R0dLwOgAOeVwavh9o6q2bIm75Yuj9IDnx4nz7YDdaq+Vo437ngE1Haw9dGpo/iLryG/Ucegu+eNk/M3SrUtVlA9Ws4eVj8+BQLtPw+HtIpy6AQMlCTdBDLzZplnn8/YiypwVYnXwIS6WrYaZRuTIDZo75zM9IEYliQ5BVqjcQNwKhAqDjHd/DAbcpgBOWScxuFOjwP+lg+8HZ4DdjSs2yZps9TAASN2SMZsE1sRZKbXcFFrmSuRU4YGQUez3SjaBX5GvYde88D54RLc2XoDDGyU3V9/QSzYqONHjC9XvyPhoQAkVne3wvRGa1zWX7B8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 690add45-484f-4193-bed4-08dcb4e7b37c 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:44:02.2292 (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: H429NEUNM6phEZOKrZtS0zNHhkxNur4Oiz9JnKyoTDMXkSZSRvaUoFIcWBVCyr8VzGnXQhcEODMHgt9UP2tGQSNz7xHir9t6CFQR57++Hj+TSG3eG5FwEE1hYEZlpktM X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11466 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/samsung/i2s.c | 8 ++++---- sound/soc/samsung/pcm.c | 4 ++-- sound/soc/samsung/spdif.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 1bcabb114e29f..fdf494a49dd92 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c @@ -744,13 +744,13 @@ static int i2s_hw_params(struct snd_pcm_substream *substream, val |= MOD_DC1_EN; break; case 2: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s->dma_playback.addr_width = 4; else i2s->dma_capture.addr_width = 4; break; case 1: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s->dma_playback.addr_width = 2; else i2s->dma_capture.addr_width = 2; @@ -936,7 +936,7 @@ static int i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct samsung_i2s_priv *priv = snd_soc_dai_get_drvdata(dai); - int capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int capture = snd_pcm_is_capture(substream); struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct i2s_dai *i2s = to_info(snd_soc_rtd_to_cpu(rtd, 0)); unsigned long flags; @@ -1026,7 +1026,7 @@ i2s_delay(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) WARN_ON(!pm_runtime_active(dai->dev)); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) delay = FIC_RXCOUNT(reg); else if (is_secondary(i2s)) delay = FICS_TXCOUNT(readl(priv->addr + I2SFICS)); diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c index 573b2dee7f07c..a9bcc2adb4403 100644 --- a/sound/soc/samsung/pcm.c +++ b/sound/soc/samsung/pcm.c @@ -228,7 +228,7 @@ static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: spin_lock_irqsave(&pcm->lock, flags); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) s3c_pcm_snd_rxctrl(pcm, 1); else s3c_pcm_snd_txctrl(pcm, 1); @@ -241,7 +241,7 @@ static int s3c_pcm_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_PAUSE_PUSH: spin_lock_irqsave(&pcm->lock, flags); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) s3c_pcm_snd_rxctrl(pcm, 0); else s3c_pcm_snd_txctrl(pcm, 0); diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c index f44e3180e8d3d..d5eaeacefd230 100644 --- a/sound/soc/samsung/spdif.c +++ b/sound/soc/samsung/spdif.c @@ -187,7 +187,7 @@ static int spdif_hw_params(struct snd_pcm_substream *substream, dev_dbg(spdif->dev, "Entered %s\n", __func__); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = spdif->dma_playback; else { dev_err(spdif->dev, "Capture is not supported\n"); From patchwork Mon Aug 5 00:44:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816939 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010005.outbound.protection.outlook.com [52.101.229.5]) (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 C040324B4A for ; Mon, 5 Aug 2024 00:44:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.5 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818654; cv=fail; b=VENC3SStYozubgIiAkuHPLgkWUr6xwGN1q66r4r+yeWgSoljr7vi1Ud151IoXBJcwTGdWWzsNasDL23UPDglzUFDnWENjpOXPP2RDsEwlVB7PkvZuSPm5yS//pEbUoyojkK1FmDSV1WGdWgUVsCWAm9o6LMT5tcA0vPSZSMkYT0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818654; c=relaxed/simple; bh=/DlWqjr5z9q+7TthAfYDJ+lha3qJsfLXVrhdmKvPpt8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=OjicolmvsgSVadLJcdAdI+RUiruDltURkRj+qwqunr4FzgwiXiYDVKRjWt30p9yQFUX3dr8UjzqW2Byj1NUZUYRJzPD7T92ifsb/BPgA4U7yurIjDuflHzuIDzwOobmnHxyhwRCLSw4LbVwQtWQgHceNATcS9PFnWRki+5rSRjE= 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=Padg/FO0; arc=fail smtp.client-ip=52.101.229.5 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="Padg/FO0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TYxzyR5maUAOwO/ow7MZdTiyZkaDTWxg/2gKpjBcWRxUw0eFouecEGHr7FCKQzUweY23HoKar8PJB2MJvP6ECvpVV/nMM+SZaIHHg7mlqELCTd8rbPjuLf0ytfEmLFPwSjTl157mACW6MD79yANhs5M65Mc+lvNoSdyV3oIgf7nJFLPqbOk0vJ+b56yzxsVl5bKxfEabLU5DeOwLUCkhQ0OzgTckgDfPCfsKaigAU76mzpVPHWFXGQ4kM7yF2zTEqm3LYd8B1YdVruCK2Jfn4kJstnV5ZTgf6rYQRACeTvsmXgbC9ssUZHdyjE9N/b1EFmZwafnnZu8m71QZ2L3K5g== 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=FhVfyZpb8wHC2V2WI4MfseUPvvZ3YvKFHHGr3kzKLOw=; b=Aclj82QS7gP1j6w9KJiQK4lnqnamrhsfYeh9EiXnBBURsKRKNlvddts4m2X5urpH0gFbuU3vYpQ3eckqiYuSyQ0yvAFKqe9CtHXODOQSxPcbLmcwdtVTKv3n6Qc4TeQm84o/RYDn4Eq6Hy7ci7Dsvdnj61l4uRqXrT9zZiX9bYUK9CEAwdQ1XbTD2jZkFYzEUf0jhZiYtkoLPMetbrHwwQ7sN7tE3qm7DRKAefaMjx165Ry4Mnkd5vwKAptpQyZSsGTq5JCSWkfgaJonwDs0K+EPr4Fh0zG4SOZYrgPztGdLpB7IOqtWeq2nKndqyemwwIMy+J1AQXBElkF/RQRNlg== 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=FhVfyZpb8wHC2V2WI4MfseUPvvZ3YvKFHHGr3kzKLOw=; b=Padg/FO0Qme7C42zaGRoWasTOUMB3NrvawhFc0w7XTVLdtlVke0VgvYrCZlEQ9BRyJ597/ftkOQvvCao996vLJ6nljg7nIw0MnQVSd8Hn0f5Zlb6s1smfx8XoCQ8krX55lARkBCHIz4+W7ywrY1uVs9AoIjuOYF9G+IFaqdvQfI= 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 TYCPR01MB7846.jpnprd01.prod.outlook.com (2603:1096:400:183::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:44:10 +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:44:10 +0000 Message-ID: <87ttfzvlwm.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 107/113] ASoC: loongson: 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:44:10 +0000 X-ClientProxiedBy: TYCPR01CA0057.jpnprd01.prod.outlook.com (2603:1096:405:2::21) 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_|TYCPR01MB7846:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ca85b8f-1936-49ef-5292-08dcb4e7b86c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: B6esRGKDqJ36bf239Eq3Uomcr+mSpSVqAaGWpcfYcmogbn6LrWzS9xDtz9zDNSIFcqvQA2bxBgSljH68vBLVNPCXFw6/DGwnndkSqNy+APDq3Wpt7pVng/s9kBKAZdSbPgIYycTempLzegmCyqREol5td3jztVVbMttzi5GYsax5ahFdcIeCEVbXe1PO3v/pFLTeEFhVvyteOXm3HDSiA2CTBJxhgCyj0QGaI2AFxUpkHQqbNSmq6F9fk7nYuQKYiDm/emvsGfICjV0drKzONToP6MyFMLje1X8THeY61TyMS6cVDJ5gtbZa2UxMv4+j3XYcpPH2943BplB6s7A+axjg9H9aojt+mDkLN0NxEAzeqWjUNelOZoo67W2StjHDbs/Z/wNDcpuMl/0ajwhi/IXXtt26Ejxry4rpxBsZ+2D3RvOI0Txa+lR3v4VEPT3gyLXLeCTiVnEdaz9uvzRTwwvatH4RI+QxGzGS+jn82Fm9lQz8JpuZ/M6zEoSpSIE0SMpGIi1QzhLNkAdzFnd5MUAmDrbixMTC47kVR6qAlmp51ewGppDGchRfkk05hkbatW7/AV8f1Rb4rcEtd2BXd6l4MLyQiQO3B/7PT7+7neRtg+BpJbUyHvXi7TWIK8IlyTqOq5kQIB21nJ2abt/9rZ//33xuwdaIQdenRiWLv2uadk/JXvMCfb515jYKuc1jsrZ8HCxiKt71KYGs/xLvQ8KlaqCVNjtN8+OIyAwchwOmCOXykR/vjUv2IRd2EtXAklVYbIqOHaM2SakXyTGsqTzrUCVwrcs6zZ8nX8mYw7cYAAOZNUVtOlJ1MXTw+MCL3u3LuFmKhDHj+U3WeXv7rln1N7V9Fs4L4B1HNK+8N3HF6+iCvWFfWgtjPd75wWhFT9NyhtchGxK9WkhYEVoPI9uuiTE01gnIoI5xV9vXb84hmRY79HIla0ZFXJ4sTbIpTy0hweTad0wIFLBD0xDP7ZX3taFwXxxnyFJzY821jYgLRsOzh6NPe55vmasRtHG7G4Pl0NbE9vY0U0kH2uFq6Pt8JHLaaBQet8IVFtRGvJJBOk8yZnNBmMVNBDZ5Fmmu/YUgG5TE50qWaiHBQ0EzCXSrCmA0LvnV9hq8s2H6ALWxv7RFBzO1r/bF33OwgvFwg2AHsOydOa+g7pY/tApyv70iudXZsdERfmRGH0s6baZqrCjnq2lqkpn7HoesuP6NVhdPso2dhdH/9/dnalxWl6LiqZCRRkhmJopptr0kO0zxmhIZZ+jtOFR0Dw9r9ZSHG6fruAg+JC7rAv1X/QDEKFjscss8s4Kd26aLHXrShtABmsc/3KFF+kVAMKMR88ra5dYOCNGoEqdshXBq9unYhqYimw9UzvlaHxCiROqjp20ay2gr0V0Ue+NKwp3b1Ug9iJFm0vpL83uLt3jRNNUpDg== 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)(376014)(52116014)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5JqJ7mn8OxjHz6eeB9dtQlVk9Yl3EBe5cfp9sKn78u9CrrWzcfL+DuUlPx1xW/uN4JvCggJIPBwQd3k1SywYCSqTpGfHmmAviNg1uS49Pkom0Cj4ZtC9ld24UdJmK648f5/3qE/2Pt0BcVstYHKiW+t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pm31MegjXe7TVstrfgb9wfdxOYL27erq0Eo6JUCyINzpyyTXJZb97vx5OL9MPMpAWv/UbPGbzkpfafwSPp42nveQuRLy+DXy7EupScFr8GltmSx0RCUfzrfk+AsurF9N3GbGwG+QSL6sz3HY2QIXtneSDvDTYgPv5IvSjMYwCo8SmMD0GhMPkKXIxH6feC1n49dQ9tlSdfOskE5rYPSGaX6hjkNfHnEXXwjFCVpr2/H3DsDqreIyAlNF5MJbiWBci/xltD/Ikq6SeU8O59JO7VjpQV4gSOob1o+kysaXw2Eb6eScCgEqZRcjWW6vNIqyiKnuEjYtmQq8lzxoUl7Wvp23dgNctG3zCpChmosz+DKNHSgYkrHKuyh9hhbUMwv05IfnbcvfRjYLLGlk9V/5raTer0knjqdcDWeY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ca85b8f-1936-49ef-5292-08dcb4e7b86c 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:44:10.4992 (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: 0Zq7vcpyRnYOF+bfQf9VR2x3sWUbyrqYGFWM3GaIfpd0oEF/RP0MHRg/LjzDJCckwWuoQW0o8x9mUyLcYF4TKOOb2IjkTSlYzz56/pGm1yjzCkv5OZZjD3skdV42VYFp X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB7846 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/loongson/loongson_dma.c | 2 +- sound/soc/loongson/loongson_i2s.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/loongson/loongson_dma.c b/sound/soc/loongson/loongson_dma.c index 4fcc2868160bb..3a7018cae33e4 100644 --- a/sound/soc/loongson/loongson_dma.c +++ b/sound/soc/loongson/loongson_dma.c @@ -176,7 +176,7 @@ static int loongson_pcm_hw_params(struct snd_soc_component *component, desc->daddr = prtd->dma_data->dev_addr; desc->cmd = BIT(0); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) desc->cmd |= BIT(12); desc->length = period_len >> 2; diff --git a/sound/soc/loongson/loongson_i2s.c b/sound/soc/loongson/loongson_i2s.c index d45228a3a558b..6b3a4d57a4b46 100644 --- a/sound/soc/loongson/loongson_i2s.c +++ b/sound/soc/loongson/loongson_i2s.c @@ -31,7 +31,7 @@ static int loongson_i2s_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)) regmap_update_bits(i2s->regmap, LS_I2S_CTRL, I2S_CTRL_TX_EN | I2S_CTRL_TX_DMA_EN, I2S_CTRL_TX_EN | I2S_CTRL_TX_DMA_EN); @@ -43,7 +43,7 @@ static int loongson_i2s_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)) regmap_update_bits(i2s->regmap, LS_I2S_CTRL, I2S_CTRL_TX_EN | I2S_CTRL_TX_DMA_EN, 0); else @@ -95,7 +95,7 @@ static int loongson_i2s_hw_params(struct snd_pcm_substream *substream, regmap_read(i2s->regmap, LS_I2S_CFG, &val); val |= (bits << 24); val |= (bclk_ratio << 8); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) val |= (bits << 16); else val |= bits; From patchwork Mon Aug 5 00:44:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816938 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010049.outbound.protection.outlook.com [52.101.229.49]) (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 0A9442BAF3 for ; Mon, 5 Aug 2024 00:44:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.49 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818663; cv=fail; b=g7rre9FiQmqeCzKUWvIlNxWIv0tGqBZiVTJt/JBmZmlFPXP31Ahj32Qv6YGwHms6ds3BMan2IgPlTg8ifB5zWsbaR5qMjfg7WiYR6uuuS35QQ0yadLBOUQIAzUZuAvKjaYlZAAgnuk8WCGJ2Og+XXY9Snp0M18ODVCJJMOOO8sw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818663; c=relaxed/simple; bh=HDLM2abrOtJiDSbTqFAxp7eLsOFWIRPf9jli6rlyiCY=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=qSmH2FOqO9mTKfhRtL5v+EAoWM2JUuyVBHnBP+DAHsT6CJWGBbxFCdQvQ8SyjtVe5VVTsn9uAknjrNG7kJSoNH4AtjULMMQujLlPwqOIEZTrEVuHTxu+Q9nUSXaEaHpKomK7cZ2QZF3vVoD1o7f8Dk+lc6cdRItnB8xEVnz1MA4= 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=OPjfKY8Q; arc=fail smtp.client-ip=52.101.229.49 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="OPjfKY8Q" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VrlGxtJk9XPIY6hZsdxYHFr+ltRnm/Wh5yK8rHCkQ4Su44ENeotWApHv3JlqfICoMWelSFbZE+rVuZoX5s1vuQFn1bwO99SNx0XlXvc9+Rf4LsAkQ9Vy+q8p9WkfYZKSZ6DYTeN87FUCM0TXWn3kZ6ZGYQVBs4mGtG0E2F3/OC9CQD/AIde3UZeUekbFJqs352zzg/c2P2H3u/HegVFN2wMHOOxHBk0pgDhKk7yzGycKFJiutq8a51zYhHMKkiGZ1XFlAEkU4Jt6wgJvhOMVlBjPyjWFdRoeifnvMJR30SbKMD+qNiD1gFlfz64XBzGuCzS2Cr76U1pHjkfhXvLSnw== 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=X2p1el4yLQRR8pMhWBfBlMJO/bZeEGO4s5MS9OnFS0Q=; b=n+dUFpCdSPFBTveX+Fmz38oZ6Tf5DEcI8MPWueW2J4aauC8uWjeH3tTACbXPbjSaeTrXkicQNSpWggyNSKr6Csa1ZwQpIatayBr1e7YXQOk542LWM10H7YEXeSFGf0Vo9a/3JyDVjfrdktbtyoHKdE7d33wxKhIcYBshUAqa2XCOaTOysDhkpBPQ3cZw296Cg1k+/jS8igoYrn7hrz4O4hW5tKW+lbnSsxrBvgdqmRS+9rFHHrkMNhgPs3558bMXrUvKU3pJLWMdIFODRPVUlDz78nS5ZhEtDjh+RSN68KRcg3mH3hxtkqXOHKSAJsm26W70RZoTml+zHm1I56FxfA== 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=X2p1el4yLQRR8pMhWBfBlMJO/bZeEGO4s5MS9OnFS0Q=; b=OPjfKY8QtAWjPkr8tTtbKK5xAkGF7sQnAYbwmCav/tofwfVIhNQboTiyV3nFjxZqeDe0q7qBDTcOFZkaWldAwtgNCpxf/a/meozbeaP1XrlDW+i3h5EKmtjSR7fY8PfeKnd9cbzMwFbVJlyj04lXaMSVNg2cISqUR3lV4aS+l+U= 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 TYWPR01MB11466.jpnprd01.prod.outlook.com (2603:1096:400:400::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:44:18 +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:44:18 +0000 Message-ID: <87r0b3vlwd.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 109/113] ASoC: rockchip: 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:44:18 +0000 X-ClientProxiedBy: TYAPR01CA0150.jpnprd01.prod.outlook.com (2603:1096:404:7e::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_|TYWPR01MB11466:EE_ X-MS-Office365-Filtering-Correlation-Id: 59f5d9f4-de79-4878-bb08-08dcb4e7bd64 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: /ZD1uuWgPRAEL2QfGcKEoSk7lZvagaiDwarJWcpbufp+qlnxSjPUOFVLgyFamMqvwovaS84JgDX/vuj93IiblyNsYEC8HZKexHDW6g8lv79oDh/I8s8D3nox1DrPy4WRpVGM+lZknqrZB1TF28VmwCzvfp7EkcBgWaS6qsEGSDIDBV83E9HL8DJlkB7Bi3d7eiBtYcta4f3TeR6ZxJRfOxFdZUb5qwiqyKjm90RtQVFowxCRE8rOccioAF9RHCkk55hGSrCKCJZR1MGMprF0kuypWrVP+zsGVGBb3uRe7IFIcIJlAxuPSQGCv8IBR6SQGdB2dldgkBOK3CbfWlPb8SqwMd+FPkFdT3mgFniXntISYsygOyyLHDmYClSCff7VeD2js0MqevKWBb0O0JrsjiI7ymJpwQwiO+fq7EOrGM9TqnYjIlNNggPI+eGqLNzshqbK6wb/bGaYBaclFjEZ9mCvAKYW+WjNhO5dbf1zYyZ+7ZtWXaDdlGxSmX55MB2uxrxZXqphw4fs5V2raIpi3rk7gLH/CGhnS1E9KWTl06uwTyx5DpCjm3eyTE3RY2t21RrNZcBnswgFFCrYcJ2dbjRzIO3nrC2LhW3FLMlXWuCRGbtStZQ4AHTEVTFpqp6lUdWra5ts/XS1byuKOx7aWfJo4cv+VIMmPeskjwhvQhTMpGN8heSsXm2SfIUiQp868JeGSI5Q5oVsBgb5k2vPEsDLPnzNLT357PtosrrhGObZTTzKvzseVj6E7bWXwamY9tKz2RTPOFTnFPB/Han3p0Cv5sA8HTSWkZLi1STlDCLVpFxGxOqPUwwLn32jil1wy/MBDsH92KC2WOVIa129sZ6tWnm5OBO4mXvec3UjkXMG6F/rkKYl9X/GZERaupJf6xoxw29OCqT2CMGEstYWI0+aJ+1cuDzMMxmobdR5oJsYK0J5cxPzRueSG3qqfHJTxDpmMx2+ahDR7ZP7GGlbONMIiGCyIH2dSVoCKI+ukLIO1shYbqyTwcKefcEVHjVZ/irjTBQowCJX1NhLnGpyCx2V6zZo6GXVpXiiEPqcXWdn+1D0TphpqE8ds43ad8txGS2NvgMkX+P+/h+IuDYYvNpyGiSVGr9SiY/OUWXsrsOyYEfEpDFCMCycl2XSI9arIgD1soZdhTvW4cXg+4kOBHZ707irb4iwi13UKh6kz/MpnlZw5aqVuayswLLKT3Lf7tDV8w2V3msc2Ja1/t/sk03tVyuNIwAVROExecCJ6cMK9ykfFZ7gRfTfuDFm4RmLJdFlKqvi73ANIlVhaqkPyIcqJOvve2uo0fTHRwoqAyUBFrbbtKyb5BWmfbkjDPv7tvo1Vs4nUYAuoaZXTSHUpeS50z6BIbc5KB+kvdHQxWtp0GwJrhH7GWHacei5XPEpIVADyRHVhu7/cUdK9fMkew== 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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OMovZwgVTvL9l/mYgusUjWLctzC90wAxgx85yUoJbsEhL5iXyv+bJYLzFX7ZW+zBj1FbrpBiwS0saOHf1oeQEAjQ0YqeBwYRzCPwZEmF40MTrmc4ucZAZp/Q2JAVVotat+yTMPAz/Z8aw9+nEnO1Fabw7rmRNj681K1d5UCD15z3hZACwmoWsDsJB884K0L0C7j+rmys55pc/oZwD6Be+r7VfUTKUEkwdAZLqXGcfgtnLRp77etmp6qgnFBAcpQsDlzKPBPLdW8r6N//IETuqSLX/qKEceRmfCAzBtbJO4DFidKSV6iaDHrYu744NZbXnTPR6xmsL4mAQ7kDGtgVPLy/LFxuFfdG+dXzl+pxwlGl1nMU2oQvCKIG7uchdGWH0CL6ULWlmY/P9Gc61x4nBtRW1En4P59sgc5Fv8fWIJBGw2NW0kKPz5UenCfsZILucIpOxdBkEkbvtfMOUjtF/dZnrSfW59A3zZ8VF5VB2EIye4YAisvNm8rwocoB/Ij75In0Xi3cTgQhC6olbqYGKW78R1DNPoJM23fQCb0pUGqWQLGiv+D+CDeL48kZ4bZchHBVEHH0kJogn+xXlJ1c+rwM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59f5d9f4-de79-4878-bb08-08dcb4e7bd64 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:44:18.8469 (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: 0WZBrTwNpJcBr4u2M5wRBbfG6ZtiJqABkfKmFu0+6IA1lsImNqlCbcXRkZmbmQK3IzTxytRuuNNuC6XeoH+1xRkA7ARJTHyYAL7G6LsccIl9DGPbvzHqaNkdGApIYjbQ X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11466 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/rockchip/rockchip_i2s.c | 6 +++--- sound/soc/rockchip/rockchip_i2s_tdm.c | 20 ++++++++++---------- sound/soc/rockchip/rockchip_pdm.c | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index b378f870b3ad2..09e4806071839 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c @@ -413,7 +413,7 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) regmap_update_bits(i2s->regmap, I2S_RXCR, I2S_RXCR_VDW_MASK | I2S_RXCR_CSR_MASK, val); @@ -471,7 +471,7 @@ static int rockchip_i2s_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) ret = rockchip_snd_rxctrl(i2s, 1); else ret = rockchip_snd_txctrl(i2s, 1); @@ -482,7 +482,7 @@ static int rockchip_i2s_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { if (!i2s->tx_start) i2s_pinctrl_select_bclk_off(i2s); ret = rockchip_snd_rxctrl(i2s, 0); diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c index ee517d7b5b7bb..25d1a516962f6 100644 --- a/sound/soc/rockchip/rockchip_i2s_tdm.c +++ b/sound/soc/rockchip/rockchip_i2s_tdm.c @@ -287,7 +287,7 @@ static void rockchip_snd_txrxctrl(struct snd_pcm_substream *substream, spin_lock_irqsave(&i2s_tdm->lock, flags); if (on) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) rockchip_enable_tde(i2s_tdm->regmap); else rockchip_enable_rde(i2s_tdm->regmap); @@ -301,7 +301,7 @@ static void rockchip_snd_txrxctrl(struct snd_pcm_substream *substream, I2S_XFER_RXS_START); } } else { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) rockchip_disable_tde(i2s_tdm->regmap); else rockchip_disable_rde(i2s_tdm->regmap); @@ -488,7 +488,7 @@ static void rockchip_i2s_tdm_xfer_pause(struct snd_pcm_substream *substream, int stream; stream = SNDRV_PCM_STREAM_LAST - substream->stream; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) rockchip_disable_tde(i2s_tdm->regmap); else rockchip_disable_rde(i2s_tdm->regmap); @@ -502,7 +502,7 @@ static void rockchip_i2s_tdm_xfer_resume(struct snd_pcm_substream *substream, int stream; stream = SNDRV_PCM_STREAM_LAST - substream->stream; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) rockchip_enable_tde(i2s_tdm->regmap); else rockchip_enable_rde(i2s_tdm->regmap); @@ -557,7 +557,7 @@ static int rockchip_i2s_io_multiplex(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { struct snd_pcm_str *playback_str = &substream->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK]; @@ -629,7 +629,7 @@ static int rockchip_i2s_trcm_mode(struct snd_pcm_substream *substream, I2S_CKR_TSD_MASK | I2S_CKR_RSD_MASK, I2S_CKR_TSD(div_lrck) | I2S_CKR_RSD(div_lrck)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_update_bits(i2s_tdm->regmap, I2S_TXCR, I2S_TXCR_VDW_MASK | I2S_TXCR_CSR_MASK, fmt); @@ -661,7 +661,7 @@ static int rockchip_i2s_tdm_hw_params(struct snd_pcm_substream *substream, mclk = i2s_tdm->mclk_tx; } else if (i2s_tdm->clk_trcm == TRCM_RX) { mclk = i2s_tdm->mclk_rx; - } else if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + } else if (snd_pcm_is_playback(substream)) { mclk = i2s_tdm->mclk_tx; } else { mclk = i2s_tdm->mclk_rx; @@ -719,7 +719,7 @@ static int rockchip_i2s_tdm_hw_params(struct snd_pcm_substream *substream, if (i2s_tdm->clk_trcm) { rockchip_i2s_trcm_mode(substream, dai, div_bclk, div_lrck, val); - } else if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + } else if (snd_pcm_is_playback(substream)) { regmap_update_bits(i2s_tdm->regmap, I2S_CLKDIV, I2S_CLKDIV_TXM_MASK, I2S_CLKDIV_TXM(div_bclk)); @@ -755,7 +755,7 @@ static int rockchip_i2s_tdm_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: if (i2s_tdm->clk_trcm) rockchip_snd_txrxctrl(substream, dai, 1); - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) rockchip_snd_rxctrl(i2s_tdm, 1); else rockchip_snd_txctrl(i2s_tdm, 1); @@ -765,7 +765,7 @@ static int rockchip_i2s_tdm_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_PAUSE_PUSH: if (i2s_tdm->clk_trcm) rockchip_snd_txrxctrl(substream, dai, 0); - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) rockchip_snd_rxctrl(i2s_tdm, 0); else rockchip_snd_txctrl(i2s_tdm, 0); diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index d16a4a67a6a2c..2e97a9e842a89 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -204,7 +204,7 @@ static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream, bool change; int ret; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return 0; samplerate = params_rate(params); @@ -351,13 +351,13 @@ static int rockchip_pdm_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_CAPTURE) + if (snd_pcm_is_capture(substream)) rockchip_pdm_rxctrl(pdm, 1); break; case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) rockchip_pdm_rxctrl(pdm, 0); break; default: From patchwork Mon Aug 5 00:44: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: 816937 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010024.outbound.protection.outlook.com [52.101.228.24]) (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 BFD7828DB3 for ; Mon, 5 Aug 2024 00:44:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.24 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818670; cv=fail; b=ehkqf6W2/POIiaW+ZW/fFSwqp58fDbkmzJFdDdfGOnllDDgxtX7NZRBK9jjq4Ycw7U2mZ2HehpiyynxdskzZWAUqe3iOZiaD6FYz8TKdI3BWyNCYe5YKzDnrRAyBtqVkNsR5/07bKokykQ7YWd6cgaN03nYLdDBJkDwJRjq6Ze0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818670; c=relaxed/simple; bh=/Q3+p1MAlB1CX/9UtsEqtOHACoe94C/iSuWQLhu5yCQ=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=ImWDwUNBLbZWvBZKAOxiv969tRU5YTqvjsmp71cMaVWKZWgTWXXE2LBe/CxSfJPreExNkIXYJ9faVugyxo5sabw5/owqYQNcdHr9bjYCuXsNySYKSZZYEcsq0Xsq1FP/CQ43h56HiCdzS7Oi2+yzfzTxa0hWGwSZJhaQe901wtA= 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=JpUHD15i; arc=fail smtp.client-ip=52.101.228.24 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="JpUHD15i" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Rvoj0FsrZoIRZjBhE1HfI2yc7G7uSTk9FJa7A4ftosgBBYoh2c5McI4AHiD+vDjlwfvkdLUIKSWOoZ8ZweftMQ1e+5fwnaT7jQzXkENa03rPaN8ZjEXvdMvgTNkVPJanVjccKzMOIhl9aj62ltEcz5jVQmRCsixhL1Tr+rXsUAEWtnhJPa9TGtK2zW8zDomQnePhIZLnBiXCkrgNmnIWrcggL6Xr/XoPTGNq32Eb/jF8juFxKWtqv7jASvUxrXo6YtjpdZI5YtWnJD9cbLb6w2cb0rmtvRtoEgAE8kvZa83BOg1V3U6eC13Fk4d4wQreGzU/sQOaQxzFVWPtjKjn5w== 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=120h7DuuGjXwnmmAsP8B3fWs19boYVzhA+ExgnVjOH8=; b=r8Ow7ge9itid7gnEasF7tJHK1JwHLAzEPgwH7MgMZV+J7zcNt4afu44Lt7zXb8milKLGFx5SX2BdmJ97ChUFBCiRUqnop93uUfoGXz2ZW1HaggpQ+Xmke7IGOpciMJLhj4Rv4vZzSQRCt7e3Gz+95Sl1rqkH0yw9bcXYCmJDiFA1eaWmEronMYkVRg8wa79fMAxWcnVPSTU7pEk0QUuJDLGx5nCEm6ZcWDFhGsMTucyz+/ilGmLXSxNLlTCfcL8ZlPWmNQNBR72BwoR0k5xIedzii1UcTTTJSOwRQvfVTem4U3mbdDEJQVDmfiGqVlrL0us3LmQ5IIHyOD9kGXB9PA== 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=120h7DuuGjXwnmmAsP8B3fWs19boYVzhA+ExgnVjOH8=; b=JpUHD15ibwhRIy0CjNDcuU6FYroIfYtx2jpoqjLSOItz2ipmRTvWsJjC6hSiHgspeSwTR26PDR5wzSjXStPgZlaEBKjjCTq0YbMoBFLpzBHMn0zdhDTFrfpjd+7zAqwmZtMsLKw5LVIGq9jy50BOiCB0X071KqKE2tdDcYtdPk8= 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 TYWPR01MB11466.jpnprd01.prod.outlook.com (2603:1096:400:400::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:44:26 +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:44:26 +0000 Message-ID: <87o767vlw5.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 111/113] ASoC: uniphier: 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:44:26 +0000 X-ClientProxiedBy: TYAPR01CA0112.jpnprd01.prod.outlook.com (2603:1096:404:2a::28) 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_|TYWPR01MB11466:EE_ X-MS-Office365-Filtering-Correlation-Id: 49eb04db-11a1-4787-bd2d-08dcb4e7c22f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BC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z3sxTLAKmY1PBg+drwBI5/QXGBqsIXHNdDXff9Rqb1gDlB50Ofyld6/0cHzg9yzNuqAtlpe63c/c+sdvfj5LSfdTFGj4uu3nDdUHn9Je+KFU30lu/5a1e/PN+NsCgmqVJ3NhPp7Ajt8ocDXbcpNrJXQwkQM7LePp42WyuBKW9q1xdpLbJiix7/vocjM7ULdflf8rBxIaY2sI+NtqgGb1y102Er8phR4fTvvLSNMdypNpECA6Mir0FQA29xQsm+LgS9L0CPD3IARvjayBpJOaNEWuFOH97wcsNT0xPnuO6qvE5Z3pNYKONi7Eoubb49I+6uv+fqUINKz0XZZb1SnttxXdln2mH7sC4Rk7dx3g3y+zxUp3bw/666byUPOSwlxpPFTSQeiVrJ9IGlFGrMYLrmAywg== 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: GV3q764bWwjxEiBSGyMMD6rVLBpJi6Wa+kily9bfjLc37VdVpvTcSI2SFK0kDfNc0OFo3BlHkF2DDpX0KqaGvGpqSAa7vO3qHcA26Ei52k+3HXv7/hnCKLKd1bmHvGHmGztXWSWmi6L+frIPb753HJYVUT8I83OtqlzGT2Jqw6M3N0iEFcQxnTa9W7Xz2NizaOjAmmmUho5ds65N5zJaKc1lunmmLlSEt3oOnYstf0p4my4qk9hXwppZUzd6HToqr8e/2qVxlUlFh0/TlkrJyOfh5uK7u6vliLrg5EcRO+rd/jpFaiNy2r37YefJkvXPk0pccHPYW5VpZUw0y9PpJY6MRjX+39nEsip+TsGTOPaPqPCMjRbDK3ztDVjuhC6SqiNRPbANSAdwLPpW6uWlcdr/jVd6LibQlnzCCbzXCqadz9OIxwKI/Gl28DMhstk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BndtC4hZ2Wbc8Qt/ZGSGHTyGYqDwSBvzqGG6/Sim7UIJ5We+x8yxyQPCJiS/ThJpD33c2D2+YZXyfTO4cms5uPUfrAXSYrQIV4hqsoHbXgN6tvHtRZxK4i1Kxgh0N3ML0GQqE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49eb04db-11a1-4787-bd2d-08dcb4e7c22f 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:44:26.8832 (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: bRcLXZyZfrwfoNOIFjCrmI90wj58YdShmMK3+S7Us/+f4cxyjlNWzG05yCllzpyAzFjXl3Jkmm6j/27TWTQe39JoXt3HZZwnhSspavUFRLfRuKk9BTuTLduKOzjlzL46 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11466 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/uniphier/aio-cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/uniphier/aio-cpu.c b/sound/soc/uniphier/aio-cpu.c index 470f129166a4c..8207e8fed2a80 100644 --- a/sound/soc/uniphier/aio-cpu.c +++ b/sound/soc/uniphier/aio-cpu.c @@ -64,12 +64,12 @@ static struct uniphier_aio_sub *find_volume(struct uniphier_aio_chip *chip, static bool match_spec(const struct uniphier_aio_spec *spec, const char *name, int dir) { - if (dir == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(dir) && spec->swm.dir != PORT_DIR_OUTPUT) { return false; } - if (dir == SNDRV_PCM_STREAM_CAPTURE && + if (snd_pcm_is_capture(dir) && spec->swm.dir != PORT_DIR_INPUT) { return false; } From patchwork Mon Aug 5 00:44: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: 816936 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011041.outbound.protection.outlook.com [52.101.125.41]) (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 F0B0A38F91 for ; Mon, 5 Aug 2024 00:44:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818679; cv=fail; b=ZKk42N5PVAVRYv/S4pLbTtUtpcewFXNqaC2H0H7FBPaYdarA1jhRBh7gmL+QyJE3kKbcPkudPovfpaKTSN2Cen8o8gktkfZcloKvaeeRbxFuGK/ml8Cn44ZW1YPtYPSQXyZWKKQx4C2bgEp/sfaoHaRHJ53ZyhSyYLvQUvKa/J8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818679; c=relaxed/simple; bh=a9ztpP3vFeEIvYnFOeBXW+2SNbCTx95QARjsD7c+wCI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=nUK/KqYi9B0WydzronIWU3VeiCEayhxN0KMPYbJ7CbzFzxHMFUW0LdI1x6HZzDJhyoHtj2tsbTxpi1Ziad8cDjPVUYZudU8eREKZhWYdNU++zQ3yKYWxaIlrqOsf7gYZ9Lv9QxrlSYQi6R9ism46c2U6j4MOGC6YxhWBIrz4tZk= 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=WNUXUQdK; arc=fail smtp.client-ip=52.101.125.41 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="WNUXUQdK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KvvYe/+rGiGiXPtvNE2Jqod7DpJN/U3klqp0agWacW8aHoSETrU8BtLxB/a0MrG4/K7Ceb4HINkb2caTBj7G8eaYy39Y3FIaspLYgRGYUk3lPGytTSosO8ws92GAzvxHI/4pxGD5FF6RF9aOKmZQr08hbNK/TkxZyzsYBaTH4T9+3auf/EcROKLM51m58BYoXHj3459gPoeF/ehMowejNWAf/qJT54FPKyqyhYkwIgwebPUc4xrb+yV0hwPIaB4BLe7rv6aEYjJVx8oequb+7u/pnxT/AiWvwKzRhHTufKBFN5B04D7ygW2XVxal6AimuFI2W+0cjfTQ04NTsZ4q5w== 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=blaxdQ8XtGclL2ZIJhWZL0YNMNXebqSKX/sRc8bPS3c=; b=SRXAfbC4iY/0TA5Ccr8KKLMMXHqFPZdsjOC/ySC2GTsq0NZIabl/bbxEP/1RTujfMUWvtgPEtY+KGS3k2tRqTprlT2mZvC7exXLrreFOSE1jCnhgvkOT2E6u/BO7wekuiYVQxfn2ehFezD9aQoCGGUnZ6ZFfVE3LCoFeb/+LpzXaLRDqx4GbKGAbKfMflpSsZM6/ISZNEHrt9Vn0Dz2n8M1l5yIGo1r6jevWeoTq7IbxM2WdcUpZravn2rLMS6THuFeKbrhmXmX9GVgItys53gk8ZGLQPLFWvOkuzQtqEB38O2wn8u9BlVttTT/tjiJiyJMeN4hKvK/fbKZI3oed7w== 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=blaxdQ8XtGclL2ZIJhWZL0YNMNXebqSKX/sRc8bPS3c=; b=WNUXUQdK6dOt5/C+IuKW/HKhYseKSKmEzXAeK/I0IahFQQlK30dksrPIwSSVQsp/5wKyNDGvHBSVi1m3eImM8wQ3DfIZq+KpGEgnF56s1MkJ9dCUfjUN0AEW2kXqEvzqtBDk2pSMYC8T5rYFH/l9YHtaodr2x1E/UJol2qHwatQ= 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 TYWPR01MB11466.jpnprd01.prod.outlook.com (2603:1096:400:400::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.26; Mon, 5 Aug 2024 00:44: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:44:35 +0000 Message-ID: <87le1bvlvw.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 113/113] ASoC: sdw_utils: 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:44:35 +0000 X-ClientProxiedBy: TYCP286CA0238.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c7::11) 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_|TYWPR01MB11466:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a55f330-2b66-41d5-611f-08dcb4e7c754 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: U3x9d0jTpJUctPGxIropl3Q/ItfqzKfW1cu6spnPOehI5FOHWpsclGQ72FZX1phUPA4e+nrIImctngL3vg+3dOpxxg7Gvdrh2bSGw5ftMyW8PWZnxIavKiNJaJHBUxqybgZb1fTZo1zYhCaDaXEN7ZoyDplkSM1essA3fuqVdOQmCWGJ0NtMv0fwVL7dWaC2K/WdJfWtFDKFGkajLr5vvnyNiYKSBTOPZHlh07OIL6oV3IoEFoOIGoGI+mz5NlHIgB7EYK6v8+VaxmhRAvHvNSaWWjVCYfdcTsHNO1Pm28BikyVumObW79V55rLaeAmiRfsciVplAc2BsmVhw6Es8u0niwdQqo9vh2vsWMn6ecJmiDrzvygl/OifB8fQCAGn3VNexmJ0S0xyEZRYyx0dQFbHoAg8Pr9XAskhV+fs1Jhmx68HQZceuHbfnliVd0+ROGtEWaQqlnMnuPxqZjxB1Y+4YknaOIRV5faU8j+amxTnNU1fLKnSINwes9qG6jZBP2CajWPUy7Gha2hx966FbI48Q2TyAcn3AvPEyJowl9IMyqLxgAYluiLsKGcv9RxMyFy73IyKMvFtyJTtN3HseFNm+GlcNnId4aGleo2Dm6z9Oj27Ccav72SBBuSvOnVCyuJKhul4ZZ2xIsa7qCfMVmE67uIjudBIisZmRythzYIaz7K0Txk9O0+oOgjEFokZHjLIQgRu6m8Cm0y2jcYpTCMEFps5zAwAz69l2B+q774WB8Hyi89x1IgAJgyPMf0HcgQ5ucbaTXbsacIURbr3kRLPkM8CaEKCwPavql8q+1+jr9/Q6y8CqsbA3OPPHhnZqcz8lQsUzRcFF9f4YE2QWwlKs4hpaKkZW855BI0wYrkv5qYqHXtmNq1bLZiYWZQZgWG+BKOoZ0t9cDHgizBNOdJrDiEQHxIyL+Jr0JrO7I/vKeRYcDfIftYvsgfJHPQptm8gUfiQoQ+6K9uWrZGI1w/MJ0MzK+egc4wWOlOGVgKuf3oK5unl7sIMZPCAb7fdKa6P3KfVK+8yybcdibX9U5UkyVq94X7Im3e4vhqMfyhJP3eXNlFdaKHqDSkgg3SxfFJC113xGBm5QFmq0lW3G1wIh04NlftuJZ5wMvL8U2LqxkLmBUJLQvH8ZoWpDum4DwUg6k2x2jWxGxx1qdU2KbBIEtWnVpjww71bOL01BETfO1YcIzXbNiQfqFuQvjvyXNdg3ueEqukSTiugHBzcVqXOfYbQ5+rAv0RpgKXRnFOUXf1Bjm57iyDeQ9JZYhDOry5IuYGUkdKCzpBMcxWvG1a5FSvEyvFiaAa3RBFJKGfT0Jc6SqmKAswQG+on/C+gfl6pJNh4kSkBA9i1GsnrtWXDTfL96T4wSwXj02aqpUbvqkhViVH5lNGQPmQ7ZO/O1+ePbAdqu3QE2aE6aejHtw== 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-M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J2r+Sbd7vbr+uicXtJSvuFMb+P8gCZEf3oWkxW88TNqN9UfT+lubEyoYypzuLuabVf3tSFNvywzDLwBAby2vs13k6BU9NxpRNdMWjXbIuJ5wvGn0/gk7QehGGSDAVsJ/lWram9WE6zkrXijdU6d01+4gkdWDt/t5fevZNIKRCemtVSmRu2oebwH/6AdQvsITsR8itJOjCUBvrMfZXdqTkW6sjrVVZXE354ibrXTaiD+2bZ9gOHOsTUZIRkz9icZRbTrQas0A+X/D6K0nOM2O7LEbrgcfgdRGYCnsiQm1nCgh60/gCbxMzhyge/eR1rYEjv7iLVFPF/FeRP9kixtu7q4k1CsFvm6VoztcFkeBk6Q7V9ProdAswn9rXmuNPD6t4Y4Bbp3OC0lXJyX3UtVtUQ22a05v8xIMNNkqTG0hDiGaMtTvhl4oXYLBX7bTMYXw/hap+S/s7zuWO+ANZQowZ3CiBX3yaoNE0AiqOpzLmMHCITnh/DX3wryj1wRxPWdLQJGgQJyAZyZkvYILWbzmbE3OkwZdQFl9J7hxC/yQipcAziWvJ7iOi/a4p5boQ90dP7+BMQiM7F45w+HXceGJVLF0A4ohVZ3pBPRPux3euECqonGCnA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a55f330-2b66-41d5-611f-08dcb4e7c754 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:44:35.5582 (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: AnHYKSM6WIXV5velbyFKWSCQcB0flOciGVAVdp9dz5cg7lpxYyvpliapCckOCb0h8AFOI7XmEVDgKC/13QGr5ghUJynrlSmCzPr1qHmRCnvtZz/ewcwXAjO9aE59VnV3 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB11466 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/sdw_utils/soc_sdw_maxim.c | 2 +- sound/soc/sdw_utils/soc_sdw_utils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sdw_utils/soc_sdw_maxim.c b/sound/soc/sdw_utils/soc_sdw_maxim.c index cdcd8df37e1d3..714dadd75eedd 100644 --- a/sound/soc/sdw_utils/soc_sdw_maxim.c +++ b/sound/soc/sdw_utils/soc_sdw_maxim.c @@ -54,7 +54,7 @@ static int asoc_sdw_mx8373_enable_spk_pin(struct snd_pcm_substream *substream, b int j; /* set spk pin by playback only */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return 0; cpu_dai = snd_soc_rtd_to_cpu(rtd, 0); diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c index 6183629d1754c..2b8f058450b25 100644 --- a/sound/soc/sdw_utils/soc_sdw_utils.c +++ b/sound/soc/sdw_utils/soc_sdw_utils.c @@ -750,7 +750,7 @@ int asoc_sdw_hw_params(struct snd_pcm_substream *substream, return 0; /* Identical data will be sent to all codecs in playback */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ch_mask = GENMASK(ch - 1, 0); step = 0; } else {