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: 13752819 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/4G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wKKm5cGe/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: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: 13752820 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011057.outbound.protection.outlook.com [52.101.125.57]) (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 8A3CD1C36 for ; Mon, 5 Aug 2024 00:34:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818053; cv=fail; b=MiT5r0EKHPgc7zHqbC2eAG7kM2ByD/6W9ZtQ+m2sldK0PqQNftgo3ELyTAOpmh2KA45pnlQCTyur+wDWSb+2FP8LBH8JdXxj0FmRVzZzz9/xaWo9DEUlOIcjnWm9dF7vduRaquqQbAFh8X6AFQ5l7MfZ8+P57wlMbx/QHfom8Es= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818053; c=relaxed/simple; bh=Wu2Hgbm+NG5sa19ycahQbJwlVy9dLO3eNLS0+2qPqpc=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=n3aWHcnBqxVrfQUg1k3yY6oitQeiaSjsbSkWEo4eOMzfSKxXsmucZCE4Ibhe6hwhrsK1G3Ysm1tq0e8xnIv58U/DMIAGjlyZyouBJAAR2CVgdrEzlJ1P2b7l5zBQIdzsZYkTDzUPcNWQX6taQCJW+qIgx84l6ykNbOtG9rJBKFc= 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=i9FRwNEP; arc=fail smtp.client-ip=52.101.125.57 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="i9FRwNEP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qqaAbDJf7acbhuSY1+9Dml4Mo0xoQvof6x7X9Tl8wkzKT03j4antPFORXFHEivJEX36/HBDruJes5qO6SWW+fk++1CPx+ZfxvU1rR+y2UaT6y6n/JUw3X65LjgyGM0Uh8vha6N/ny2evNVOp5Fc/RTx923V0bo/B2fS1NnCdfdevDF3LcDLuFtaI9Yxu5TK8pUKGdCouF3bHaWNMxiS04BlANQ0qxm2fHdTW8JV1Ks+gGLEewbJtCu8nfLHTDCQgpbh+JhFxjx9t2R2a/yCOk5L6+W/RXJD8rZN0ULtMZ2N3E3ZEbY+WtHFSO/0FmAQCerSCp/GL49tuAMhiN7kCQg== 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=2BlIdZU9HhCJ42PTLUQESOSSES0dzK4sxPfy7FuBfwE=; b=QqB49tZ8PB8GbMCH4bF7yQQW74hA/XdVzpRee4TAnxyV8/hxyo9gdgrzT11fbouKfLXvCyiBB3MSCUknTRhH3CGzHPx6Co1vpUdI+OXMhQpT9ZBwT6WNQ/9K9aKOeAlbMLym0lOajKEQvenMtLJh1eyn1amJfpRExICuh3qOUD0/8UXrbu8vprvihETgJl97OVcNlRa1Lj4N/IN+N/2T+FKL7dJDLkx8Vcl586YJxxtjPPHiJTFPcAnnXt2comHv+OkX8RAKx3Pn1Fcxr9vMTurpd7m+onCyZfXm4Wp7k2Fht/PDmwtCJ2kydzjQzHXlKWg0Byl8OPj2+xIb6SCKPg== 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=2BlIdZU9HhCJ42PTLUQESOSSES0dzK4sxPfy7FuBfwE=; b=i9FRwNEPBlGKFI4LBrAPPQpbnt8Y16lL4gFsgA/duPY0ToaaRg+V2EFHAFX0a83QnptObhcscY14ilxPpXaCp85fjNPJj2d9pRQyJlpXY6e0q+4nEcsvHf9fhitlw+qEinJa3JyrKqs70sfWqVQK5Q48Ky4PVBFNZCtKYrT5sX4= 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:09 +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:09 +0000 Message-ID: <871q333j0f.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 002/113] slimbus: 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:09 +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_|TYRPR01MB12335:EE_ X-MS-Office365-Filtering-Correlation-Id: 70572247-d2fc-43ec-717d-08dcb4e65216 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: Upb9dvTSqwP1t5ytEcEom8x8LOE1x2A7LvaZ5Htq08HkG46IK05tVecs3+sr5px2jowxkNxAgEYUYu0Jgb+vrydL968Mfut0HoS5TQHFHQKlILkUdoWut5ppFDYvzCnMaZ3aSoWBshygp470rPYKEz73lq7GQjTm4P/zPfqvVrBT372LqzwLt5G0z9jLMR9ahqpoDtzUsCncXKVfLU//2NzEonY2/dgQK8q7UIix/Nreo9lSIVpmb3uU20z4w+XR+tTO0Mu6KN8xsfv2Sk6+3ulIso7BI9ySQyNIz9Tq/hJpi3VV37Ca5J/FTtMeF9eSxGIX7HGLsnItkW0EQCiHFjfX3IkbTIGtWwfl1UXU2S8VvoVQpZMi8x06QfBF8XYHssBXjdvT9J/BCHG2jcuuN8t8iBdc28LYd83xb2fEowL/dI1Rx+dyjgqxZgbY8nyj7fyX/CUi9zTklfmuNJulcvwfNyhUp5Esg9C1wDDXDiS38TtBRjnAcpWCtIdqg+JPqH5X2Qi9me8NS7saH5z1+kH882N9Bey9H0JTj1gnDxYjDLAl82ftbILBH9rH4a8xZHCzGyFBKu3wGUn0tooUXBQpQCaRISz1s8oDLiIk+kh+1gL7CfQv+mi09mRJ8rvJzkzK3n1GgcVAH8OKzgRRwW8Zi0uGytIynWi6xpy+dW3gasdboZ9smoBtf7hC2+7i0L7I2aHhLMAHdc065BUbfef3pDJ0AVizaAJmrVuTZO6MDH+KpW+Da0AIo4ZrQJqx8KxBw3EUuPTc4mCVapRJMMPJc0J1U5eCUDGKZksJ97bjbBWqe0Oh5C8SAbsT1yO09xR9ZKmy0WJGJ06YkFwnhJKgEcAer/ZV/quTexR6QSizK2oFPsH+4gF3xXxLkLXIi8z06rgSRaUTvTuZO3mITXEaeKn6b0nZwZ1I1ecfagUqeIw/+ahGVt/61lX8qYZ2oGwWE8szY1Gypo1Dc5+jGSNJbWvIcrD6xjfAMzLRhS1zZ7UZC9mUVYJKzrtoFefOfbAOvgdW1undpF7yhwtj627PLfKCEsmE09qmouk3YKh/lknqwjHQJ5WnFplL1EGfbMPGEa19i+O8xsAO4o5XUQXx0yI4WZuNWUJI6KO7x1/cYboVUeVzvJ4XodFAFuRmKsbhSmBdvlz49heFPBm5opovthuNgrSnXdkQ5dJUwYISqgI/VK6GTstjBNvQUomeJOXa4k1Kwq01cBv3TclZ9zuH5kTjfdBDx26g+mX9S4ykSeXd+WPcEsy3SZrcie2zcy9hKdd1x2IT+xVb90s3GmK2jFIl+WGyT29rB5LP0ZCqso/CRKYjObu+JGSi+fJYZF0LRKI9s5U2J9O9DEWPhAXkiVxkUN8akVDseq0p5l4ID2mPUgsW1/qPn80Uoh8p3hViZ9NPiLbLPf877hlFog== 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: 04A445JSX8/8svF9Mnu4WfW4djrcWmTHQJCE++CKuLb/jh2zI8k0Zufis4xjyC8+JfbkMSVDZPrnRQSsaPW2BWSne+aSuqAVg/Ijlz23cr1O4NN+b1Mukkyuvj6kLtwrXA+K8/iye/jO3+5lSOEx5jLFKCIsZOUZoY3/nicrnDhG+5OPtH5S9lt1dldRzJg5xjFIUxwh2WLrEVApa+N0yCOc4ljx0lVI8bcx5B706oxNLMOIpJsEiyqAFUwOq+8b6O98eMYcvDxEnF9FtDbx0SsrrqQU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3jIG0Hz4fYEAKgugeQt+hVAyLMbpfQvLjnOAtuxBJ0OZtXb2b7nijI157WpaZXP8KuFBQzt8z1IIN0V1WE/0QdDN6Ka6HAM8mfoA1jID1qBcHB0S7j92ZcRAMAqTXcKnaqcy2FFMuYqtUhf0XLh3SG3cRwIqlN84QkDTQ0fbdlb8qbcM9mjnVY/8PF2MY/oDECchmKXyeSHJUe8ZCc/+rZ5wP0w2sfszQVMo4bBmz2wwxi7UroUPhPG/lyIY1ouzI65QPXqmxQrngzg1Q= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70572247-d2fc-43ec-717d-08dcb4e65216 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:09.3813 (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: UjHHLWpfp2ZOg+0lp3hbU/2Ru/CQw9Rt4BrquEs0LdqC1bQm2QAUH+8LN3x7FxlrnhYPQzFDQ89MW6OZ+ElvFMHRVR6wA1qg/9zlmEKxdnDRIsTGD7outVRGNYIm+kMR X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRPR01MB12335 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- drivers/slimbus/stream.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/slimbus/stream.c b/drivers/slimbus/stream.c index 863ab3075d7eb..e65a6bda2f5ba 100644 --- a/drivers/slimbus/stream.c +++ b/drivers/slimbus/stream.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "slimbus.h" @@ -235,7 +236,7 @@ int slim_stream_prepare(struct slim_stream_runtime *rt, * data rate not exactly multiple of super frame, * use PUSH/PULL protocol */ - if (cfg->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(cfg->direction)) rt->prot = SLIM_PROTO_PUSH; else rt->prot = SLIM_PROTO_PULL; @@ -256,7 +257,7 @@ int slim_stream_prepare(struct slim_stream_runtime *rt, port->ch.aux_fmt = SLIM_CH_AUX_FMT_NOT_APPLICABLE; port->ch.state = SLIM_CH_STATE_ALLOCATED; - if (cfg->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(cfg->direction)) port->direction = SLIM_PORT_SINK; else port->direction = SLIM_PORT_SOURCE; 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: 13752821 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/hw5nJ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1m/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+awR4/Or5VAQY7siFMG2bsKAxvDo5JW1xELK9IIztmauL/fBgRBOQtlhc6B6QIjEii2hm49Cy6FAcoI1heBikxhCI+biwRFd8p6WYwW+Ii1mIYaGm9PoBUr6edcYHVHnIQViev3ZW7EfbDeOR+tB10NBpymP+7KRrXO+ngb7RXvW54ql8XoQor5JrUDwYwe0ygo6yebMUupSY5WMBDMKfPaeWK+APFmzgttIoYmhuXdclVVARyLncyuGs6U6A7FwxeqBqRVoGipPNPMeUOvBf88Yz+mB+igOJUEAAYcxG8UugSCfPZ21Qi6uDiX658KF44Io6cxVaA7ppUHOXSy1F6pfPa28HMZcdfwFqKi1WKLv0DqTkVel0lJQOsBNgDBeNdlPbUVqEq8XK7VUhGqagcJqEF73yZi/p3eRAs3w1zIVkiMN5+t6YsGxvdRxUa56u/I99FIrMt2zoMhXLdmS34wvC3rLTO+JpcD1b9oPtnhFb7veA5l8KRlrqt/lDXTnd4VDblchfRAU/2rXikjDYphOU22suyTptBHh2djCFDgcFpUauu25e+LREUXA0oV75gJUanP4E+Rda8+o9cwnfoTNtsb97TIGR18kYFSGnJ2MJ9V3L8wix8tjwZMCe0SIb074Q7MlMKK4AnF8+RkmAosQcy5zCR0+yhfkGQDDlWsZ7vWXlfBNK1p3qKP888QsL+jVuGobMuWmwBkBhHYo9pOH56377amyywF1HxwgsC+sLYCUA1ir0O8uWpXIp1I0/9imZmHeeFzA2qu7rm6pqXYQqlrR3aPnlMq6hNeu07ohjy6jWi3LXjuDa9oQ2cFXqDX7XFJuxIN1C51ysueo7A0f454smORPkBLaFCXaavVulg60tx+d2KDGC5Bb5g/z4tQbg1al4raGLdTOCD52s0Gx38iWJkwyMY3OecosuaknUefEPC6MFhrUHtefnm2cfUeZd3/LXDUsMR4QpsFT0SngXww8k6wgPQ85dN437t3xN2rsaLb8N3KEz7w57z6GdWCsR5EsFJ8v9jQiLEfNQo/KdCkXW5I/bJ9dBHv7az+UtZPubSxyjUPvAy1BVm2Mq2xrOxTAaEGzMoqrrmo/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:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752822 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010027.outbound.protection.outlook.com [52.101.229.27]) (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 5FDA21FC4 for ; Mon, 5 Aug 2024 00:34:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.27 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818068; cv=fail; b=r4DX7JxorJLsh2BmhN/G4DU7TLwr8kzfiXtkMWLcbYEleUlRDHqWoSNznh21nftH9z3Toz1snJleYvpul/haimJ8pfaaWJ0CbwIBtpZ4lsXgThv9Fhmw56JOFjMnfY1vboFnzy+itQJOCX3tgbFk73R6eJmJ4BDQgwzm2DY/tXE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818068; c=relaxed/simple; bh=wZUcCKfRypx2pFpsANvr7jOGkCTb6aV7BTj81uwNjbw=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=g+XbrqKv5uqlk7vguortxrfKdHJWAuJlmbLv0E6+zX5u4A3uQVyER+CbbO8IMocLjJNq0lxO8SNRXOWZ+Z+idTYshmEnv+zGUGtUqFU22SgvsanVtPZRsc4hVC9vfYm8By5/M3ahw6ojvos/RH6IDaEz2hn681/Z/99VdnKoJQE= 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=EcA48BcI; arc=fail smtp.client-ip=52.101.229.27 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="EcA48BcI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MOTRdvzhPiTwrJlSgfkZ5JCoWDVX0wZVQ564iaga1qUEGiKAfjrAcnOUr065SCo1ai476S8Cg9zRhAMLhDyJPTZHKj3noGqc7L4WzRv+zpnV+7MHxk8AEYBPSIE/BnL7oWlnDlzdNAdYcaoSRuAOVOsYSr4xgcDNwRgmkLRI3511GCuacHjt1wnufwjug7gScaTQZ9UZj3lUzh9DkI15g3aN47uiyxyTC/3vG3YYMdf8t2Ul1kOT9+jQwWzwGGEqqPc+91EpU1P4gPJSLL/oN9IC3RVLO1+km+P1EB4jlT1gveYbGA218ePjHxi+dsi0UHWaf+uoEkf0kM8CuqbASw== 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=XjR2gsSnHpxklssZ9xh1RDlJx2HWTqEa2D3t3xpLY/k=; b=Rc8r8j66cgx+CIqm/ZZfG+fX9fBYlmaOPJodUuEL0aNYLNWc4Rhr9Wb47HGTpW+4E0DIHbMkz54fOUDlx+owAsRIrMf0NLVKTBj+Nnksva9725Uwwp7xRtq+nZWNUSv1hX9OmYqLwx4NV+64tmJ4g+0YD6Xmk8CLdFoShEwfFZ/rmOB7sXasjfyvWp6I/lhsOC5hfr8H7TLqPgb319kw0ppBoGlPZH5uNfM5h8hGQYUf+JGah+fzTrhcovJt+UexqkNy1L1w7xt6mRBgQSLftPqswFYuTsJhddetffdrF44PPc6OI2lFwmnv4BdeP9VW384M2DvNN9iYWb+E2Y1rmw== 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=XjR2gsSnHpxklssZ9xh1RDlJx2HWTqEa2D3t3xpLY/k=; b=EcA48BcIGa5emS1rMLNMVmTWQZKeUJSHBdokew9A0ejtUI4JpeH1DcWVuzYtmA8hbY68/u+YsHxIIdvkQr6IjAE1kV5Uv3Kag1ED6oIj/OZHpRwqpkEVFl3rCbDtaMOE7fbn9/urot76JukbI9dCYfVU3WBn/pWQD2IjwF752/k= 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: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:34:24 +0000 Message-ID: <87y15b24fk.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 004/113] soundwire: amd: 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:24 +0000 X-ClientProxiedBy: TYAPR01CA0043.jpnprd01.prod.outlook.com (2603:1096:404:28::31) 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: 49cb9d27-cd2d-4fae-1218-08dcb4e65b06 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: JNjxnDD8Ctx32wOVru5nYtpmV/o3YTG2MQ7ttOdU8lH1szeemyGiFltrXa+QfE+qdRu3E/A15bytDXJFBxNB0QD0iGTu8ca24r+F3wv83Oaia1vz4s98u1k2RHB+OBJODbSPSI3oknrgSNHeQGMZB4VBd84LkyoVuVYNT2mIEnvh1Obzsx4jthXnBIK2MAJZhBJ3JKgUFZl3jr/86HikbTVNWjHhGSgRe/oOwymD4N+9KeCdG68wooOg1PLL0OA3b/ZXygWhVB0f6hPwb5myyXhvjuP78/JmEkl6rVjf6GAxWaC2QNF6rvY4mZtJHsM5CaAzPynlWqlMR6UuM/GfsO+Su197/Hpb4SIfl/hEALa8l2cV82+AFQhqpCU0sX7Tt9olxOqLZfgFK+lXmadzcSa5MjUuGWzrZuj0OPPwCcXuip+2zYGCuMIHtk8Peln/MDRHVujz/fZyqVE70IiKxNwdJOHM0FNsCBl02p7VtbnRGxHVU0qBzgQF5bR6Q6l0METMki80lKQ6b0IMlC+ZRg6SOcaVKi9mqpJHwqfVN1rpA4sM167S3JjYn6xLVdvQ7NujEHl+zObKmTAaaHdm0QW1rjY/a1R2IIp90ZqH212Gm7VRqm7f68jgvVgZRH4Zz6RK8LvtBZ+6boNGN/ONhr7+rcuC9guDd7b8BCKCGPEPkhEDeUKOrIugg66n5WTKkN2z9nK/HP2abuxG1/bRLGt4PMFFR4SscKfg7Z3k/Xdp37uBUKKMRt67ETWy7TNMp7RdMaFeDKSRzlkefkBk1eYS4mclsaICRROPtcztyTQS5HsCrG2If6rZFqvD+kqpYoKYdaCXarCwFIPPHMwGvnqLpwWwJPWxu9E/YwGmZPyJJJ6fme5q35SYmvLC5j4VAtkTROHLzTAvP/3UeiXyOqn8uly0odcfFGd+6Jz/2f1euwFosv1XpcFtLGUH0W3rZULEo2qsgrRLzZMo4sotb3mhEC+25B119cVgbiCtiryHChHNL1iZoaPkbYQYBLWvrHL1Y3A6WjOI4+yci/ZS+xfZWQcWHkdReRLOKcN6ITefYs648Rc578SINZLJDFBdHYE4V2ZZgvYMoOgfeYow5zw+CCvVr3ZlVXmoHT+yFxJ5TYl31SLdqlGkC8sn0/EfVlnDHjkCkIymf+mYPRMiAIa4dhqLeSaJI8H0zSiI4QpeOirbIohu2WzXqidjXglMhA5qRe3+avALxMJl/GfNsoY6ttybzRgkz9vaESrzY0Rla0jqmJU3FqzB0cOkcfpYt/VYsuWeeyFXCfwHf+EeJWWayvgkWRqih8J7vL1H0C3RJ3Wg8Pj1KdRuN0ChMQ1OKlzFDzD4nBpYF7Z9Ek/o02AT8surKnsUMTmBYzIXKJm1OcKmxWUmrT57mS5x6riCFLj0l0tJW5wgw/M+aCu73A== 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: OvrR3/BQNX/ar8WDroXKzxEABcDNrOaHiglcimY+EhTJawMR0gnOEvlc/m1LKOguI5xXQJORHEGy9oeMvhEwXa7buXU3mpiZyhuJvPKVkxRRUZ9xrq8QEHnujkqnRuE9/P8RqzkC1vxikOO1ibb6dg3Ena/VHtIVEdyjDztVPVNTeOn0R0aZISe+LFwrkcXq1CBAY2u5qdsPo0pdKLGnS4CDcTKRvtjBf6CG437sBPrsxSEXKv+VXk8O82DpvVn63xgo29kVFy4Dc3dJTkMXWmP5nWQcnzS3ol6fy7bTXtKxtyBW74p4Tl/BBdwcKKCLdzhZtHrMdT0YUS9cl+ZFnBAa6tV3xvqIaW3LbdWhmeP3syBmhn2Q452feXomSj3dAqP2daT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IcXSObO+HZG75hyWhQjNfdxZlfHdl/bdtT7gJ30xUr74utfMea8E1GpTurzxaQKQSK7yQsx7WUmMrl+zviKV30ZGn7JDSdkA39BtMJWSUokQ5aLo5yo8Ef3iA/86cSp6QAs4zrCGd25AoRY1q0Q/olYj1BM1upUkOBB1ozqC83ybOLvtA0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49cb9d27-cd2d-4fae-1218-08dcb4e65b06 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:24.3353 (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: X4ZeXkfULjs2ZQQPs5RPafG9u42rDQEAwE2Z6s8wY7v5raHBceFr9//7Ea65DdGjdrNe1cuES1/lePH+mRinEvG9PdAK5TIJbj5iTwFrC2t8mBCAHMyM43LBrDQKVarU X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYRPR01MB12335 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- drivers/soundwire/amd_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/amd_manager.c b/drivers/soundwire/amd_manager.c index 0d01849c35861..6f9e075b49979 100644 --- a/drivers/soundwire/amd_manager.c +++ b/drivers/soundwire/amd_manager.c @@ -612,7 +612,7 @@ static int amd_sdw_hw_params(struct snd_pcm_substream *substream, return -EIO; ch = params_channels(params); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = SDW_DATA_DIR_RX; else dir = SDW_DATA_DIR_TX; 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: 13752823 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-Exchange-AntiSpam-MessageData-0: YMDlsI/58iY1v7XtCQq7QhqTlL/2uI/7lTO0uoqQh0uKYTs/BUamJL3HBiF7eHw6tgfESf0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gXOqjWSYxhI2OILHhF+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:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752824 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011071.outbound.protection.outlook.com [52.101.125.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 CF5283FC7 for ; Mon, 5 Aug 2024 00:34:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.71 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818085; cv=fail; b=sdmD4MtDmfltdXMVhlBZmWCum0oE/fT/6lTy/FdP3JRueqaC9hQuB5djHRITBcqQ83QXkE6jTaz+OgxegfaeEGA10GTKpGUj7JsXNwMn1Jv8PVYpIUzP72VTomGuRwHImhakGQDdqSINOONEqqGwc04NDubyAI6d24y2WQDwLSo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818085; c=relaxed/simple; bh=WeFjavISzMSFH/srSndOZpGAOt4ap9JGSkD0M1q5alA=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=t0jbLmpUiYimHaTghFIVaHXhs1co4yaWY7qY2sSZV6APYWE++AGxlOPQ04KD0u4sGr/2B7JYIFTnlmovOnz8SvxY1iT+R8ITBGBc72jlQFTfBrRgIjZtvjiFpCLWk65TczRCqt402Yjg/X5nFKKBdHJvvI8WpDawEiA9SgZFbhA= 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=K3tzODYG; arc=fail smtp.client-ip=52.101.125.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="K3tzODYG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cP/8041kwRR0t5zWnHrlcTgyvXKV8JqBYMPeG/2+J9lwUCC+vl3Kar0p8cOg3YXQ+SQsmSqPV8JHbhn8B+8DULOXYv1L54JVQr788JF6XNfEuIFUPEjlhsUy4wwieB5nlCkrMTlq+TR7V1PiYzYMYjNV/Llf0BSLNHH4vk+y3n92vEzjGBXSCjof0of+ExGHpjS1cPSbuTeJgkNsOwFjIS23WCGK7jTg+3/9zvlPPGq+kp1jAaorV0mkWloV8PAE7h6tMXOUeR1Xa3eeFPltCFrP5z8xT/R/vmPloGJ86C/evDwfLhhk6ApE3VCe8jNoGerVTzMKifoBlGrTvRYhJg== 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=jA9TzAfqUrRxp8P6/tcc0m8ON2s+ManXGlpk2hx2ncs=; b=qyWFX6XTvlRFBmxY/Es85HO/km913Dr0eMKW1SU8qWOVIR0JFbggpbbRE+IpFp4OMxIAFDywsWpiK6cT4fT4uQRcQJBAkxa2Smipw//95h+cAvn/LuzpYJjR9bhbDhHzQbjqQe3AVlANwvLP+pistfCBmPzsaDVIMfuwcBUHlCE/ufe5BL/WAdy1u2eypdNBDJuW+zNpoTnlPk9MzOFowtQSi2iF2HPD+p1DDtPwy0m+MwzpcHiblNxKiepGkSQBDMCIXNoYZkFdftdgqelyhCt9xYWKmGXujn0fj4fMDCkYzxZYYIDr1mtCVP+HP00tAdi7TVU8MFxhezb0BDJfeA== 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=jA9TzAfqUrRxp8P6/tcc0m8ON2s+ManXGlpk2hx2ncs=; b=K3tzODYGL3l3TKPH3A1qyZxepiu9IxcTUBt2ORuCg9Fw9HZhe19fZMBHIxhgYrBYyW/ozzHoelX+z/BdzbA9Ka6Q0TgFcSaqRFonqkK5NU9xAvA98SJb9rx/0MvwcNbKoEnO/hyui0vOew8kpjYZLyLr7jSRrEVOmdIebxJ+CFs= 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: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:34:41 +0000 Message-ID: <87v80f24f3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 006/113] soundwire: 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:34:40 +0000 X-ClientProxiedBy: TYCP286CA0078.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:2b3::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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 18bb4f58-52d1-4826-f27e-08dcb4e6651b 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: g2LLp72OHdvK+YWLb5CFCzJ8WEkjX6yhfGeT3VLyro/pT0QRCHAWOjUcOb1ttp/I9tGNxtV2XxfeMhrmPCloE4PlJShJpiiF9T8Xaon8XJTJr4SRo4Xpa3sAc7Dwbgy8nl8iDorarbGjN/jOB2o47jmvbYy3TXWJAMBuLoqf3H6LkZk8rB3wajRPYGxB2cyKdmTUiabtp8jJkb4hvaAfIi+GZeW5UAGjIbFU/yfZ24mkqYINtOjMPkJmxWTwsvmT/I03EqAF9oc9F8/ghkyiw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Qu/BU71+08j8FfLYTkgZMYVBIp01qVM3SK4yGUQo56mCNi3PmhPsfLpcLowRvz2OBwOZ+tZsEObwCaDVvEkEYIfgw4Q== 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: fvMWKfIPCtx1yJ+McZY2gSNVE2IUXnuwcRnKJ5RxvRgUoFERzb3GwfDyaUx3x5UTZ1BbE698T1B2+O1hOjO1ua++LMsNSxUM0RcgNBdE/WNlSKS7uLIDvZYvxKBmUhK0gDibZGlAYnfzbJVqCyXaPiItXfB10yDAfUDigM8hfst254tDfg7zoJCpCBuxv0qZ1yDQdyog4jV3qbYpbgac9VpCY/wTGjf/BeLVyKqjDbxEZ486eVnitOJesmOUoln/voC3/4CuqmODCfFp11zl17u2xAUaRokEpgU+1SgA/2mMdItkClgb3W9zh3uLysQH9wA+r8fKuctePSEM5e+8vqMqLAUB0FvBMuHKweUG+6RUrmxD0kdhaUFVs5aWdy8kWHJt8Dul1VVDJ4zqZbGBs+fug7UkZ+y3upeeRdD1AREBoeX71EpGHRBb+fe6VHgu/Iq/1e2vn1TR66RqfYQR1W3NxwN0kcuQ90KIiPvDkSvMks4bO9562Xv2V7tWSZyQfXSazuYTu0LGT3Po9tO3SabPVzWO91Plpl+8Vq4JlNUnKPtZke2OifRaIvJ0TLaq/lUEQkntpDDI4zX2lZAwdg7/MeYRY5wFRr42ge0+oKDH7wiPCr1G9Dlho28B/YlrM8HCTvi7FMhp+67yZuRJd5Pcy9v1A9TxGLGYP+6koZLdB11XIzbo9OCtqUP7nzq/G8IQkr4w2osbtvvVOukXKvlZXOhdqDORUQd9t+jW3KQBCR/ckv84yGLjPUt4FBdlruiHQozPrrehLSLWQ7tQd/4cHIBr7p9devPPghfcx4cTUs8ztsLDIonV+iLvPwbH9kzytGVSQwGmjxSc9tNREezhWZfuXdV1CEW8Bf/oA0WRXaNmEQB+8Vy1LrGyTpowaCwI1/SYSt6J1LXML3TFEioIqggyk3qbaEiEUV5r449lyCNNOPcLWwzxlFBjUrFk06g4MZq6BN0BGoXA+ArpLIgYWNFO0e4SmH6wh6MwPbWQstuoLosW02DRtRUsUuj7I7n97OuMjROdtlOBcaSqBJyBIhYPwGjJK2JQQjVJaWJmXE39PFMMKwPFTWcFgQtnRgNkeFTvxYDcdLGWdRZTp1H6e3QUcw2I/xaX5bQLSOeR7Y1DWuAXF4vDH4ygRkF8Vx0hnJRHqh+eHEDfrzm2+C8G3ZOeEE4+6ZEsMwI+Vr4R0XV2S7Db3/mA3NOVp6XPF39UonDzeS5s7AzMnjbWWbUi53Zo6ayuioi0GpP2Z9pGf+ya1Nvunkx4yKIBNHT7a1JtgDX0VOVxBNXokZ4iVqhD/FHol3ivNIy3UL0h1zofZR9icGCdSzHWbjNwgyccjXMNGeqht2WxKPzMxStt1e5J5yjRXVAP2dwngy51Ve8quF/TYmlRg0UNxf8WFhtnoxrJx++aNIRfJTI3RorGje6a2xBEyskFpPSL4Bz3ZIgeH+274fuNQtj5oDBoqwUERsSCR+7fJ0vTqd0SMCa5fUX1TSntAXr6uVjSR48KL4kGoC3plExleUmZgk6PHdTSdDUtUCtUebRDC8SdxWeNPZCyzlpjCDxKC9ZrnH9r/Rc8dd+DFBoGIYS1V1IiaoTkxUGleYuQc2NjrOZRFU8WR1fOsQj1wsuSRncWGrkjOg4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18bb4f58-52d1-4826-f27e-08dcb4e6651b 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:41.2478 (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: mtUgCcyc/kSIZRhpz9h1Y41Z3o8/nH5Ant3AhlqKCtIonbRRrcRHXRbIhyH44ZSItum/qN3YNY4mllreKlzBfWnSqLo0uiBEHNYlGgft8/EMGGvfzAcuh9mLw8fW6uPP 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/intel.c | 4 ++-- drivers/soundwire/intel_ace2x.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c index 421da0f86fad6..17bad341f2336 100644 --- a/drivers/soundwire/intel.c +++ b/drivers/soundwire/intel.c @@ -734,7 +734,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, return -EIO; ch = params_channels(params); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = SDW_DATA_DIR_RX; else dir = SDW_DATA_DIR_TX; @@ -819,7 +819,7 @@ static int intel_prepare(struct snd_pcm_substream *substream, /* configure stream */ ch = params_channels(hw_params); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = SDW_DATA_DIR_RX; else dir = SDW_DATA_DIR_TX; diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2x.c index 781fe0aefa68f..b1cc9041ff917 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -319,7 +319,7 @@ static int intel_hw_params(struct snd_pcm_substream *substream, return -EIO; ch = params_channels(params); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = SDW_DATA_DIR_RX; else dir = SDW_DATA_DIR_TX; @@ -407,7 +407,7 @@ static int intel_prepare(struct snd_pcm_substream *substream, /* configure stream */ ch = params_channels(hw_params); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = SDW_DATA_DIR_RX; else dir = SDW_DATA_DIR_TX; 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: 13752825 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+FPbCWaVcdFxrkjgEpflzdJ9kMqt7uwOLlxCyWlU/dM4remVFP+JFtzMwIHokQn9GIAbynM/qcNCDreQvEZNG6wphTbMycdrAFkOK/hCQywP6ddyk54bqmsgDRTsWx78qinC4JHN6W1lGEyJcwhhDA8ok41gANh7V4MOxpdpDWbPtizV2ZkXrFr2EwZ/99SdRG8dRoP63PI7RQ0cz5KZMK8kC/miNNfD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:;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+JvzeR14s/harnxuUi7Vs4WzKVNPRUIY4FTbfNVDLdfBS9F3aIqWPIUT1zU/fLe9P1Z9VAkQ/12jdaqSc30S/HXCnKNTiZ6rK8+hcNMIv0gascs1JeDbJH0yE0OXOPETUHpTK0KZE7hqKR9k1Ko54NqIJKu158QL0FfoQR4rm4EImXzvyVbsSsIFjCZqXRRbcyf8wgYvcq9+Jb2b/Vt3OoH3JEqWDFk6S2OKj6kZJupyeCpm+63ZrX/qm+k1GOb+3QnZDoy2ePGQI8sMh+kDiM0Uf8Cess8xHDmiKvwUuWtEFKjEsu6Lu7meaX4zyLA0hOo7ZP2qjvgRWbLjgFt+WEzXcAmY2pBzEE20NsEmZbfJl9BmB2EFSvIrcfOt7aDd6jFjB9KZd2ORn68oyMQNSpYt9JEVt9A31rj9DvXIR7Lw3f9uHn7OPw9ohVNltPqq5ZGJ7lQ8Xcu9ZvAx3+0X+UkOF04Wb3Yfm85vSidc1bhAimwXhQwvZoArtR7rCp6Q1lFHwgqXZjO3NbR2dJpUsmeTHQ4uDGmsTPpQ7HvHeINGR539DZRBOHkYVZssKCDKzydakORIAhddKd//SdnftXT7TpX5VQwqzU+Xh+8rfiIp3Kybv4F0Z0CMrMNVwRc50Imvv5sRr9bwx2tFpe/ltCqA+SwAWUIWNiOlyIi9hYV44043xg3+5avOZnLNjTk64s/v3pWe2cuq11E3YAe4L8zv2Evi0vHwmmjDBTWVFCKfmb/ZRs25tblV817B4l8Kh4YmXADNKicP8jHDBZmsNaKXON/6ddxsiE9XhuTx5Blqs5ywWn8Jo5Af1p0CesvA/dHQ6eZiXqe4VmsqfsOSdjF20cvZqQpYMbtP9itT4wXwhufTX7eKz7t29JEp8jErDr75mlnjFfc+yodDboO7QgpBpOLMar34y6KbWw4c/wXxGZhJ28PInZshDPV2c= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77db58ed-f799-43d4-6768-08dcb4e66b5e 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: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: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: 13752826 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011031.outbound.protection.outlook.com [52.101.125.31]) (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 0C44F3FC7 for ; Mon, 5 Aug 2024 00:35:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.31 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818105; cv=fail; b=l14ijdj7BQtnp0y0MSajtZiCGtHk+qm5bOt9p880Py1MVkGFOXLx2x1tIePTvTyvh3bjQy8PZl9J19GFqFt0tYf4Ph5HSKhlo+ezB9/CIJpPelB1HMYGoZ/alygaEPXqyPwNC7/28FANu0SuEmr0REBzRf4xgGUac+xrlaSor1o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818105; c=relaxed/simple; bh=0cRBQYa7X70wjyvei3chAN4k7fTkbsPa8BYLzdNmFzk=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=c4hQpWA3X7vLrrCs+ooKPxTh70CDWroDIuN7udS6Ipyhzgxvu9ytkztfykv5hyze4IrMKWYjlkRnajG+wJhmKRdouYKkZPAnc3cxyp4QoC4MLE8lNFxwIBCPmyO4ickcU6hWnBckc9LQPvff4ZxlLwTyw+6FF99Jx7rxoQPhaCM= 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=cFJVjafl; arc=fail smtp.client-ip=52.101.125.31 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="cFJVjafl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=USQcUpxb56KN1x5mzSFogulePun0zPrfg/XaV00e8ivhrHCg5RaYHF6Q7OQu1wrJu/S59qj2y2mCIRcRTSiGfJSNE+WgI4Xme5nXR2bljYzkoXbpAMUDmceKbNioum4wPYkts9tv47tIBxDihYjlr1vsi5NeDDBEZqk/C1K06lOc8CIjiqzrFKmvVxJcQu0bquKzEa0HqP4fPTgbZ/jxrYzNu1ggCzrekqb5A/JUZNCA4a8a2kVAa30P1VU7nzOQFs7k2/2MEJv2SdAQnONFgN+v2DoYpL/p2SYZNXFOhwxJnbtfRi9r2593XSOB8MhxicpTUYTan/7v529q9yDAsw== 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=1ces1U53ktVFxLwc0yyu5L4AAL0qNgQj/TlhKtcqksE=; b=BW19Q5y2cC4zFSjJA6P1hf4U9pqKvT++WZe+NxcEu/FXFB54K57VOLVzsTLhq88SLhKcbRzrLBymhNyDNbi9J2h1FGB0J+HMB8YqK2Jwkx7RGmsTlM4pQaZV8vfjmyrOOj0N88XemXefSnA8U+kDH6dpw4MnWkYsHSJDCAND8AK1sDswN9ol4qc704ENSypvgmfjqkJ/PdxGL+xhBXUUTRq23ZxF4juYjEQn+VnnFwd7tNYZXnfgZgfpB/LllCkIjsqWxYINJdHIpkEu+eecKMcjGaLh1SuxPnx+xDjVWFjEIKJuer0TzfxYQnrmMP9bJ849K28BGWj07pVUM52tPQ== 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=1ces1U53ktVFxLwc0yyu5L4AAL0qNgQj/TlhKtcqksE=; b=cFJVjaflIyv3nJfpRiPJ3mBXbysPd+kmEBO8sKuEzqwPsB+5GnAqkZkikdTUN9mxJwp4pUxRRDE735+ygoHtIe9PP1avDWDK+Xfjc1csdZi2sOwBoiYeKK0XpGyBtWGgVG+TiEn7WdMsDmXYwzmIt1Nf2t99iMymCs7MSEg1/4I= 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: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:35:00 +0000 Message-ID: <87sevj24en.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 008/113] usb: gadget: use for_each_pcm_streams() 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:00 +0000 X-ClientProxiedBy: TYAPR01CA0222.jpnprd01.prod.outlook.com (2603:1096:404:11e::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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: 91f5396c-188b-431e-b376-08dcb4e6706a 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: scsHlm2gPFeLcTsY6KhChba8aw0qg9y+j+afEktsyJq1lM7IZ4Ef9jTDfX/KZ7e5OvE8XQwJP3xk+09G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dsRjfzW2R3JSNRp62OIQkzpMMGK+YJtnYQOujjTU/ccqY3KGxL0qYZQhbz+rom+mpV9vkuAQEKDK/GY01vndC3tlsNT8ZS2PD8oRRXK07tMyCziKcnI/eq4HWUDMPkFzuRVSBVom1FfNX6wbHNMOVGnHb2/b7YCxcmNBOHIDjrv+UBynfXGq9ktAanNXmI4b1iSgGIncGwfpBG7dPfr1zLYwhn6b0FjAeBNd5pYjnVMVpBtRpM2LgX1VzpDnrALzw== 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: cDhDGU+mcuqbgW+XUkTysuV8pkOfRi/tcisuEjd2PuO8HtiHOWAc8q7ahuA2ocbATrE32JtW2rxuEgzjALE64ssctPfGnTtsbwfscnywvcySPyVITHTHst9R1PNbNbsII+nvAbgbSS3kkL0i7rnPow4EImbzVsRngEv6c6K4RNNAkw6ZCI5R2UDTU5cIA1WvcYuFEMLZCEgiyuDWPikhkT7dWiUmWMj6gbPgEjWOm6X/VOdnIu0D+FsII0wu75zzvGZH0AlxAzb5W6Js1MnJc3pP7Se8v/7MAOgqKpFmsrTYgylGT3v47MaE+OW2pb8dB2jw7vXTkc1z+nagiqYWGRT+xJ/Wcf3fFqrqnlZgqJhB8BnM2pHEcLe1js0SdlqluljYbaZ1A9vSdirfR4HT49NKXxR3lG6CpWeQ81WUJFApC/CbbY0pHgtIoGXhpdjKX2u68L+hb2/c2P+tRJJeKNTXTse84+8yBA6vKJlqiI3Ao3GLTzWf0URkNaDP2QiS+D4eK1YzimOxNDF65CucL09mN6F5xP9udAZW0mQpDiURV1g7piGi13V5jO6OlSBPbctX+dCua8WQGI+Dimmaj4frw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ange-CrossTenant-Network-Message-Id: 91f5396c-188b-431e-b376-08dcb4e6706a 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:00.2135 (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: JXICSwgs38YGQP4AevBDgBz5GTykvSpU4LDYfOFacVkAGevAwn/LX86kj0W6Cjo/LaIMX29fwd6Hnxi7IUBY8/lzZO5ToqNHeEnTTDP3zO3qFxdp9peRbZobMTgRo0TS X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 We have for_each_pcm_streams() macro, let's use it. Signed-off-by: Kuninori Morimoto --- drivers/usb/gadget/function/u_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/function/u_audio.c b/drivers/usb/gadget/function/u_audio.c index 89af0feb75120..40093fa1093d3 100644 --- a/drivers/usb/gadget/function/u_audio.c +++ b/drivers/usb/gadget/function/u_audio.c @@ -1290,7 +1290,7 @@ int g_audio_setup(struct g_audio *g_audio, const char *pcm_name, goto snd_fail; } - for (i = 0; i <= SNDRV_PCM_STREAM_LAST; i++) { + for_each_pcm_streams(i) { struct uac_rtd_params *prm; struct uac_fu_params *fu; char ctrl_name[24]; 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: 13752827 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/aUqPHXcgb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64W2d9sixNT1ppc7nVxVnzm2zXg8bmQ3biYknsV5j4dnb7yVpvKCRrzoxVgQpkpLUI8kECUo5jm5njUuCVDrANBBthZKcaMKCyHdvMPt2h2F4hq0wGr57WNpGFRF9SSvo934LzCVzAFGtnM3W6DeZwGlJ9uDNcnljnABojdZo0UsP6Qfs6CsbSXi/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: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: 13752828 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011002.outbound.protection.outlook.com [52.101.125.2]) (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 BA3886138 for ; Mon, 5 Aug 2024 00:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.2 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818117; cv=fail; b=L9OmybXBxwWARn2CXfS9H+d4DOPGap2OTpmG/iQgpVQwkiUG4gb7utC6m+Q9BhjQXLfdInXwbumYVMcIBoE9+aWjivIWKBQLeyhaEYlSn0RindJpo71azNoky6P2e8iEFKKOAQXRJxBzdWx6QFAYH6PHHDgCA9at8RODJ3Dk074= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818117; c=relaxed/simple; bh=N7WYGc4xp4YzmzjWHqh7NC9smpp+INH73rQ4aqDnD68=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=UwZOVEICdspVXIRRzlyQqeJ5X5ROJlHPh+rlT1XQYF0brswz5NDellIliLB3/Uj2nIs3KVTOZrBxp9FG1iETvmmhProqUk34uMh9jA7fQ8JgH+MtegH45IcNk/yCPWjbX5ykX1wqaIztd5MSYpcRh1p4ARgv2+88LXalQ1Fztkk= 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=ZHos9fAi; arc=fail smtp.client-ip=52.101.125.2 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="ZHos9fAi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GS8M1gzOaiL8Jd0ySeHuL9dB6DzCizqtCPn6viPppBQU9t2uXIZWTZfrJgJSw1E6wgZsXixsS1V32uzA2qhUO2PMCh8si00Vm99Fo2+M0ygGLd2FMhNo/4oMvkzXlDRbpuIP++cYXZI2IkmqZr4MxLRdfPVZnsCvzvLgyTpobS+Gr19LPxXXPYid61RGOu0+6ctWS6cxzzDUoTghWNvnj32b9soGd/YsI4c8vWgWFVsGyyi/HGkXCRfXKpOvIss00a+785z1M+67+SfBr6LjWedBE+W1L+wWI8Y7b3OxWdgvLm7jCqEFsQOCUuG2URt+RqF6cxMuFyl3sVy76mSNxg== 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=TIeh9UFk5aLeWLWckP6h+PobhxPgKOygL3SUWnoHDcE=; b=u5Zskscy8pGwk7w+Oe21rHz7TQz1Hj2BGVbUHQ+/bsSAiKy3okVZdwcvWOXC5TjV/c2riRbp1RWRPuPWNV/7OF8JHE037HMhfttGRNjotsyPceQdloBePwHKbTPPH63+z8SAbW2SEfBZHqlJ8tThlChyR/mJ0VE/8zcFVs6g/q56tN9RpCnECnHEHuMIwhqYSijpcaMaI9Ie3n+bciyoFEsNpHl4R6cSwJ3RYMmhYbS9wInVPUsE67IVVEAztM/UfSeqEmzeIZkchhmUgp6Tz9aRfnXggArXgQBaTCLs7o8Dr/snhOoxWLcomH/y+XuXrf8ae55Zx5UPSHYFob7Kqw== 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=TIeh9UFk5aLeWLWckP6h+PobhxPgKOygL3SUWnoHDcE=; b=ZHos9fAi5UEVfVKLvkRcHghaSctP/IJ2TdpR9SArGhCYzhw3ZVpHMG4vHdAEGQU2AGq4KZhFahGU7ZwsVjCj587jWxng0APd2mLyKwokrqkluK70IpXu4TsjOmxQNgysE7kAgewjWHh+AdjzY8cZ14e/7zqfwJQ97aG0Evz/hM0= 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: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:35:13 +0000 Message-ID: <87plqn24e7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 010/113] ALSA: isa: 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:12 +0000 X-ClientProxiedBy: TYCP286CA0271.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: d8a39f26-c2dc-47b0-d536-08dcb4e67830 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: N23fPjWVHSLQ5iShx9qT6HO2wmZ193LYBu/ZmBm+SAMkvkw8AnqKLgxBtwCyxaPlMP/hqnOIzZMs9wF5WOY/NPs26aEMIQ8Xxbw61DmyNdNFf8J4v9B0YuH6iJvonjWu2znfWlzmSvUbscgXf6oJ1YEGzUJAAovSsQefsKQHrscjnGlBDL42//aBQKXMJ8fGce9nAn0V4Z43CNTgIPVZpDq12bE4LLLIsd5IXPeMED/00+Mqq90a2vRmg3co+0dxBiXRACQFz36kV+vEAwQQ/7wA4G5tONy2w6AK8p1HO5dKmqe76tWymPpA4Wg4786+7ahUCdY9/FACklkKoKFruSyMkv4jm7ol5Ba5mp1vDQKryE2+er3FGLwIWnEpKL8hZA1CZ1LWctwOd957EdA92OFHXGshX0AGKZMNRg28sieMd5Lb6qxEsu4PoMWcI/aJklFv+APQ0t8tSGFS8ChqX7gf9HPOWi5pc8Xw7FKMxBOAQ6HgYEoaDiRkCeYhxnjj/9RuCvofogkUUwfzSWvVvGWMYoa9d5+FThy6mdXxnRMEK9I9/GkYi7YZ7wNChseh8Ib7f1ezM2KW5n47LkT7bl8PAWUruT+crWbdnhfaa3Pcta+nRvKpPA6nnJvshNsnfXFOfBY3n0LZkiivjCLT22nHr3dsldsMd+7645miU/dq05zuWdF9JGL5B62XJuw6hT2Qilm6+yKK83E5eAGpXRILJ6hu3p5iIPXowt+QBI928k8fw1K9fkQKy0aXFhOUhzWDRxgnZ+3mG5k6dVW38W1hW5IH8Hc/qmthHCjxsaaLQdozZHRfEGQYOi5L1h3xPtXl0+FOm1g7BVdgXlvs7bGe9ECtnr+tdXQ9w3lSZV39Zs55Vtqjvq4W4ICUPF0XKfY9Fduwlf/7rY8bkcuSoLirtjlkiBXdC7X6sXGNyEUaNV4SXesTgpfsvkK1MzsrjHf71AkFYNQk+jn1HXFiZJxm1N4Pz268UiBlzWVZijLCpgbTUl4XaOhYYU4Ep6B05BSpBxi2+ahrIaIOKydgg22UHdcaFzb2jgpA8iFYPSFITyQAEL1Usp76g+Bg8uZtQhMit4DUB5C5HQ3HiddyRydSXbMJLpiIbT4ZbSTkBs73LmQAEU7agACc9lLRDlLztZA8SXIdDzgxp/mnCeIxafMyBrbd3URSUMyjXIvu/T2NptUHyhh04Y1uXTNZLtw1Z4RLVc0Nh187Iy3iKhcb/3IBA07JERoBFzi1Cv4hdzIRYJnLTNIIpw7f9K8Si3RLynRrfMveUO2n7uTaFRrxYk1gMaTrAj07e9jyT+nwFius4NkygG30Ym2FBKa2yLYUnfYayKbn6gORw78QSjHlZXAl+E01XqCyEFLXhO3cEOHNLKcl3js4HWZsHNqNkT8ecrjWY1phi7+2jqLyIpoRBg== 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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cHBfG2dxrIDbl46ekLyCXLkZRKHFq/Frdr3RQgIvgrilIz7/chP6fTMgWUreWt74dTrSfJUmY10IVZuYW9nvWZMyWAH2J3kPFgUZdFjZ+DYFwjjlIHLqKEX6CO7n4rhYUGoP31Tc49zzeQ2u1ZOmxHiqEVnYkdtonGDBpDBB8yREdZnNE54KogesadQhJ08Q+V1zDWHt6WSMZ1C4DCO2lYJYwbyHuh3YOUtOiDbrNL37Z5lPRANPZPn7CQU4I5WJ8FjAt2/lMoxR9GJW9QQv5JUM5qYLe9q81uYIA/lDHODtmfaHFXKHYVjRu38ncWo5kwlwH85+ut/XtYAUONCjAoeHQKaaSTc/RLZnFox0rBJ6WL7m9wiy54LuWIPs5+IEw+LC6f70alqkbFsbuTdVBV+7v/FMOyeS2OZuSJgvJ0hZyOYyu/iwfvw4g5F+znqLytqZCJC5kNmpFXsrOUZOSvGsWB1BbUiXMFu9K1AFL1Z+tQKwz3Q9RDHoNE70anYy4wMcazg9Pf/J224X4BSoGHVS/kGmok3ZtbtIt5wUi0x1ypYG4+qWWMPBJr61DNbE3RbWr76udQEB3AMQJKjZ1Wq1GYm4JoiNayYUK1LWsCoKMSXKfDg3wr+L1wXY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8a39f26-c2dc-47b0-d536-08dcb4e67830 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:13.2577 (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: mlzbs2BYRChT15zTLZ+ivaPfDNn4bLnZtTEpyiUwHNKNw+XM0ttvzyG9HpjLZgM28Wlna/ooaMGfewSRX11vyzZ7hRcQUERJv7A/G76VPTYCay5Z3GYb3rUmYLIo0PTk X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/isa/sb/sb16_main.c | 4 ++-- sound/isa/sb/sb8_main.c | 6 +++--- sound/isa/wss/wss_lib.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c index a9b87e159b2d1..7145dcb4417a5 100644 --- a/sound/isa/sb/sb16_main.c +++ b/sound/isa/sb/sb16_main.c @@ -216,7 +216,7 @@ static void snd_sb16_setup_rate(struct snd_sb *chip, unsigned long flags; spin_lock_irqsave(&chip->reg_lock, flags); - if (chip->mode & (channel == SNDRV_PCM_STREAM_PLAYBACK ? SB_MODE_PLAYBACK_16 : SB_MODE_CAPTURE_16)) + if (chip->mode & (snd_pcm_is_playback(channel) ? SB_MODE_PLAYBACK_16 : SB_MODE_CAPTURE_16)) snd_sb_ack_16bit(chip); else snd_sb_ack_8bit(chip); @@ -860,7 +860,7 @@ int snd_sb16dsp_pcm(struct snd_sb *chip, int device) const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction) { - return direction == SNDRV_PCM_STREAM_PLAYBACK ? + return snd_pcm_is_playback(direction) ? &snd_sb16_playback_ops : &snd_sb16_capture_ops; } diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c index 2ed176a5a5743..dbb08e9e0f367 100644 --- a/sound/isa/sb/sb8_main.c +++ b/sound/isa/sb/sb8_main.c @@ -473,7 +473,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream) } chip->open |= SB_OPEN_PCM; spin_unlock_irqrestore(&chip->open_lock, flags); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { chip->playback_substream = substream; runtime->hw = snd_sb8_playback; } else { @@ -501,7 +501,7 @@ static int snd_sb8_open(struct snd_pcm_substream *substream) SNDRV_PCM_HW_PARAM_RATE, -1); break; case SB_HW_201: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { runtime->hw.rate_max = 44100; } else { runtime->hw.rate_max = 15000; @@ -532,7 +532,7 @@ static int snd_sb8_close(struct snd_pcm_substream *substream) chip->capture_substream = NULL; spin_lock_irqsave(&chip->open_lock, flags); chip->open &= ~SB_OPEN_PCM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) chip->mode &= ~SB_MODE_PLAYBACK; else chip->mode &= ~SB_MODE_CAPTURE; diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 026061b55ee94..d3f1a80c3a574 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c @@ -2196,7 +2196,7 @@ EXPORT_SYMBOL(snd_wss_mixer); const struct snd_pcm_ops *snd_wss_get_pcm_ops(int direction) { - return direction == SNDRV_PCM_STREAM_PLAYBACK ? + return snd_pcm_is_playback(direction) ? &snd_wss_playback_ops : &snd_wss_capture_ops; } EXPORT_SYMBOL(snd_wss_get_pcm_ops); 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: 13752829 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: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qr3PqNQIvJmEkVGaWk+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: 5LFQl6s4Gh99UsR8ZfikY5tfztW6g4gN5TtP3tkX/ZAJliFMTjRa1P90TdcDZH7RGHfI0OK36jki+SbANvbX841kOn6xdXOErsGbUJfakTn7SqyFAMhNJNBV4jOI3Sbe3UJiiLorEPI/Rwkg3UfHvPRatg4HY1ABgRV3lILbsXDBDutXNxKz2k3hAnJwzWEfZCqShfs/HQR7XYuOSjULNC0d9G1QOxXSXzsU6iElQH1ohKmdkrBJq7p576TC+s3XAyY3zNJuSDfOcejgFNzKEr9E/HQhkylaTr58nymi4A0x4P6FwhOGkmmS2oaZPpldhvVKo06/4D+4R876+HuqU5BgPBB8XrztE2yStIeWvLE9t38l5LUNk+OVujSVjLef0/GxDjPeJRQqTeTQQIVn+wDp0V9Ifac+rfHmQxvcb9gsUEa0/d2ny5TiiD7QvEYPVeQ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cbmzeq034t1aMMOx0oKI+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:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752830 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010050.outbound.protection.outlook.com [52.101.228.50]) (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 3E6401C36 for ; Mon, 5 Aug 2024 00:35:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818132; cv=fail; b=G9Hlq0ze6tfutaO+lanhlIs2yuWdd5kHrsUAJAkuleDijWobwSCows7GNGTBCv36Eg5rLNl4OWpp9lPi4SXVrg4n1OCpL5qmRj4oT7sd+R6Oi2LU6BYfjT7SruXIKLBkaWwd7TeEw+YwoDH+/oKYCzdsdH/gl8DHbHqfBM4cjVw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818132; c=relaxed/simple; bh=wAfWU8RkK6TrMQ7T6BAsuBLFYiMxEi1X8L0d9gUJ9AU=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=VTayKAIPTEyPMvJ7AataDow9dq2asBidl3B7fM8woqJjwONmlUbbnRuFtBCuf2H1M6WSeEcGesF2lNGfIxrpWmxfgcIWKaFrezQJZpfb0Da/dAZb1MK4Wpnmp9GuBwQR2PAJePBKBIFQmQcW+TNy3xdhjPBdE6Nq2pxDLs6DEIY= 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=ePxbwkDu; arc=fail smtp.client-ip=52.101.228.50 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="ePxbwkDu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yc7w+ix64ogXoQosvpBpcA3b6e1jvXtv7bEjWLU/sKVMCnxujaT9hFKlDs+WhBSp54mNc3oZfT470ZUa99bmYHburQ6jJNxfrCzoz4aP7gEfvoieR1PPUd+ikdHMtwQkqPfcy5xP0RaqJcwAaQA8CNUWeD5ZQlOHPzv7yaqsFTkzgcdyT0rSjCHWwT5oKBki4gjtmQ2TdKy002qtdBK/XaD0R+vpFjnWSSLtOV+7F3ve9DaouVqdJ+q+XeEsP75z+x/opblMTJ89NyghYQJMHv0k2SR+1lUGG2P+eJrnV91vmTWWml5GAtPC6JuCk35hysBlQqtvl50mbqFVhzWHvQ== 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=aHtKcixYAPzw/V1vmXMcbeb42Ti40TDFqqHPKnKUnXQ=; b=vgpCk4kYtG1x4Ws4OZBoMEV3rTGFYGhnbpn26qv/uV5s3H0yvbmBuxbBXyw01wtG68GkAJxkFIGKuJ0eM37+JxW8jdVXVa4PSJ5EN4f3rAAg/sbGpyDqPJphFHKNmX3XeJvh+4p7FHBOZBw2Pc8EUMSU5rm6we3NsvQXNP2h6NkPP1tnT6qGFcwAFVkQMRZBWQ27OMdh8IKR3iVakxj8NydygwPsLyHGx0qc8nvoXaZ5N5CyzALNbnrVqBcKReK6VN22jdalX32jhPXkN3dCgHrr+dGsXLq4IXr8v/PsNYqA13eC2x0+rKX2Yka2+mGGFr/kOfXZz/OvAr1jbDnCbQ== 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=aHtKcixYAPzw/V1vmXMcbeb42Ti40TDFqqHPKnKUnXQ=; b=ePxbwkDuYKFisR9VcDfodHMUtHiAw8DSDbhqQX4zPtFVlYAgCjnsTNLeSY0+O0uMBxajPhlifoscZpaihQH5kccgopnCRU/PyQnCRXrPT8FErQfifUGhnEj1YPI774lutvwm7VF4MEULuzwx17r9d3VPHA2cKzZarnCTLzfajFs= 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: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:35:27 +0000 Message-ID: <87mslr24dt.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 012/113] ALSA: xen: 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:27 +0000 X-ClientProxiedBy: TYAPR01CA0214.jpnprd01.prod.outlook.com (2603:1096:404:29::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_|OS3PR01MB7994:EE_ X-MS-Office365-Filtering-Correlation-Id: ca25e829-ef2c-4c42-cb58-08dcb4e680c7 X-MS-Exchange-SenderADChe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VtHsU7gOiKHgqG1/SW9FVAKBNnMpOqbA57n1S6Z7LjlpZVeKBx6FlCgSwefwykzqRqES/6P+QFX4mYxj/IR0jPdwUFLFY78h9vtewiuMgXqOOn78goigxOiZ726KGUbBH7RgV8Cw86SJPYbnWqbASQ5UVYl4naI4CDLcuGZQ0E71JEfrBXQ1qCPJ18pAHjYAsR4/Xl8OaF0Izi4rEPs3cXTNFHZCgGcBQ/C/29G/Lj5c/kLp60E1Bu1WJq9mhZ++lqUVOiVLjoVPhOqm+LJh4uPgYpqOU5TGmqmzCPptyKRw3DJR++lo7mtMpSsr+6sbbKMhGtrXDDiLkWy19dLo89qtjfj4KCsVUOBdc+0293Wb9N8HlMYqFlkmIvCv8Op8DME/+7z2qRspZwYAJ26gR/6VTn7XaaxgBY6f1fk9/sp7vNiwOJEuRcAVFlko96jw29EWWCuoqBhhS7KD4g== 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: Wx7hg79TRQzycSDUkjO6VwYPsZQEAHc6819eOezJNObh6bs1gbD5qiuL69fz2+lUCTKeIocRWGPFf90I9WSlCXpGuB21F/0hAnWCn4juyBTRs+tU3Rpwmr1rF4vzZrLYbBfrOagTO0Lgc2bzbFewLrOBm4kt7Mvzwj0zLz9jE4tCovNuRA5XJBdcg7Jh9Yyo5BnAgD8E1TlWjJQJC748QxVFqXDQRjvP+QCGsauTK0R9+h8eek/ibx46zHFDr7jelOwnBPrVSbnHukQJm3owOYQJakvk7CtmdR9oxZmoQ3JXf11g1ZybZP78OlPumHKVoZVkqLJ6k/QnOTqTCTIQHMsjTb1o7i+2RjGj1Z9kn7GyagcvOCIcCKft4EQ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2PEzKr3HewDigleF9dnJSqkSriAa2274X/6iVBi0knSvo2ixdYvGeIIexlzHIJWssxfuKP6pIB2EyR6ychzHzCEg4/PNoqHN1d1iDkNvrJKS2NRkPueHMAWGUB75uI0UUWKsjvSlwO8Cd7m5WUxSt2P6ZSB+Y5sORBWoPIe1sV5Fdbt2+ns/tF0oqa1mg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca25e829-ef2c-4c42-cb58-08dcb4e680c7 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:27.6473 (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: 2cqhvLeBNiDwIVQkfjdN6sQ4BfXmUUra2G0pWhBO7vXxnlfc+zW/w91YHKL/STLUKxO0hImkRDh9Nz4wP1fZmOKPDkSs17kx8YOhcALeYtdZ2p27DH2MlGDBhtco/Gf+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB7994 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/xen/xen_snd_front_alsa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/xen/xen_snd_front_alsa.c b/sound/xen/xen_snd_front_alsa.c index b229eb6f70571..0f4f849bd20b3 100644 --- a/sound/xen/xen_snd_front_alsa.c +++ b/sound/xen/xen_snd_front_alsa.c @@ -240,7 +240,7 @@ stream_get(struct snd_pcm_substream *substream) snd_pcm_substream_chip(substream); struct xen_snd_front_pcm_stream_info *stream; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) stream = &pcm_instance->streams_pb[substream->number]; else stream = &pcm_instance->streams_cap[substream->number]; 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: 13752831 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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rtc3v5QAORxIkYqyAsEJwCImv+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:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752832 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 4C09F746E for ; Mon, 5 Aug 2024 00:35:41 +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=1722818143; cv=fail; b=birVLt9NbKH0GacjgU16QbwNilaOKBaDzJzUxXLEPfoi0pzkgnOaGBJ+EHJG6y1CkrMvj6dAkc9UzdX5ScKhbI9lyrt/sp7K2pBBaRw+hv+2I2y/q/veP+klqqw3FGiR46+P5dTVuYiyspgHeWfxBz8rJ+R6LAG6nhwNGz4UqKI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818143; c=relaxed/simple; bh=E62+TX6G4XfDRmg37BFmjd1R2msZXwoXLs7ZjLQXKEs=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=OC33t1R6Hwbb4UoZ9ZKGMnM3TuJ6jw7AHnuy9F5TeiXxr1iL26afOe4fmwJkqaHp+NBRXv5W/HTZ8CReNJOgzx4mM5ZW/6ilYa6SocaABACdg3gUmVpjbBaR7ekSoyGPVZIRyaIlZx3YNZNQQNc5KbAVmzz+h+e1wvkwHD4S4Yw= 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=FzOjOaEI; 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="FzOjOaEI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w8UUIV2DETiUQqytPYVB8h1+t7fNQCo9ai51eZjfIl1ggmrkv9ilIwqBifcAi2aunnFA11ZyfG5TNrFF73UaJLK/HpYjpaKuJtDAcadYZ/MjCSFiIiCujrJR4XQ1ca4/WUqT1vP5PFGFGpbyTXFsxLGeithaIrwyamxzzOyEkh66kKKlBhn5aH+ErniyxgkZtYvz/OuZqVOgeQja6qnYNnNQKcJT9gD8eV8YQxzUQ7BQLLnGt8Z9YrIoQLq4wvZliNnkot7NB3EMPX0dMGZt/G47LlAHggvKFaIfgCI9hiRlJCr59eB27yP02nTMC/apIPeHw6wRixSLdwfRUR1L4g== 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=X6E7hugC9TJp4HKlVqIg//X4XKAVcOkqxHfcKFYvU4I=; b=IyuQNujUcAJZGjzS8KZzdHiv8NSOAkNixgCxUhf2iee5pOSdVPK/rx+vs7ea9XDZXJQxK47tqisDqp4+NY3yaejv0o4OMDhhnId8UEry1KCuyBfUrzn5B8q9cAwKkZGcIZ1dA6zDj8tSi707u86ncSnHV33pC5H7PsokJ69ZpsUXRAYxttBK51AKaqkmX6og5LzxAVoDlANkgyXxpXPEn9IlM9TDNclju1mfTbfcxqYElthHOb5QyxfRx3IxIKnDYV6gevcjrM+DD6C0E32urT+hb18D2iUtIg1S/1A2vdBKXL64o3rx06lcQb1O4ZFCy8T60jz5j2GjIhUxn//a6A== 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=X6E7hugC9TJp4HKlVqIg//X4XKAVcOkqxHfcKFYvU4I=; b=FzOjOaEIq2b0Ec7HcB/UoixT8IB7izO5CD4BppuE3IbRdhNT6ELGV5AQg2yWYot3/wCaHusCou3LLWjpCTqFq6S4MA2pJWMogBVYaIg72dihABpH8Q4HCOdnVraAleFFIojwOVECkSCjjNdKpUqtIzm+0VzFLKXihRDAW0fgvKg= 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:39 +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:39 +0000 Message-ID: <87jzgv24dh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 014/113] ALSA: pci: 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:35:38 +0000 X-ClientProxiedBy: TYCP286CA0013.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:26c::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: bdc2056f-5988-4ff5-0c41-08dcb4e68798 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: 9KrPppJpNjuJ/dXzrNTLygcewmfoIvcl2n8M9tqhAULi6iy/gzd6lFxs7PEWsCUbOjR5GaMx/zrwOHLJwGloxQOcxGS4ywHiD9VxproT8eYoxlDPRFJzJMtNl6ORBumpRQ3FxvOpjaL4HMDbr7yu/SLMbMyvF2i8Y6AcOs0PIzDoqsgKRbCOckXJAP9519WrtQZe2+Jbm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c3vkyFbpbrtAcdum5kitWors0T6v82YbwoYsSfDAV4jyOp44NHoF7T8IJzaaNuWo4D9q58mDVoZWPubc+8ZiqarWoxhoDwAQSldcnrsvZQI3MRsBwlVGOxkwxUsKHjomciim7PN5A2VX0LOhbSA== 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: vzZYyO9E/7F4tt3jBSt+0EHgdvlTDJp10wqveSAcKYG8x2FZGssVdk0emIttW1S5sg5clIQu+2Io/Dfsf+pa3Meec9iZkuWZkoBSTVUWmkI18A7kapoBPkqkVbdKAlElbOumSSFc7yNEdyeMhZCl7v/TBPUNp+Mp+14oEmw1Yo/1w6Sy7E7P++sBeAXmQRnEH6LTleXrpFF4FQMoyXnZB/jpMqIxQhl3AE182h5KLdo0dyunR93bnzsEZ6moBwvhv7j2pexx+paqOon370XgUvYr+PCjuITDR2JyLTbJbziBJCX0R+1MIsBfsBPrjSj56GJrEHoiJ7aouZOMhj97P8Sc6RwFSoSGKmcZv2m9vug+YsV3Pzu3ysuqBvKn/Tv+1KpCk4E0rI4pCI99HHL8wCA+yndJ0qAeVWaV84G8SPyhkuJzOgtdaKb31K06EbuC5094Y2Zk53CWa6aandKh4wJ1IhdFoulrA2VJKWyydF8m8A4DMQqN22a6AW6cBHULTlPsqWt834+9mVRbk7dkwEWFsc7Ew0+Qh7xfwDCnGU8g6KO5W3JqYi8rYZOBBDPHlcvEcYYhqNYqWLGFXl8xx2nZ7MKltywCjxZBlccKp0bSfwmbYbSj9Wq5BEVReh5A9ufwlKRaezTMu5bxyZmMkchmn4/6M3ZgxuY+aMvOmHfp/SDV1ashBK9aioAJIyJVBJZ4fiFwR78e/xCyIsV/YJve1R4MPkYa8Ib3jaq/hCw5LPcFwvVjLuoMcslzqDLb1jcoPlItIcPzNpCapyT2mJsqVGDZV4KajeClCNej8SNtmuvSnfqcaFaAV4U5URVa0Le6SGiJix8vNbDCGYBhd7waEwMnpUxDul8TGYwiwMQH7WzfOhUgdQq2DOXHVMTb0ZLRK9KZxqnZmhNKJ2w8SSZruhcbkz3n6+mvgq5awDmoZV1AGjLFf7jT5cNnUnROqxNMrVZACYjx+4ep33DBwPNyj3OwfP2CgHgAQa1psgwIFMH/LbtZ1ozV0FkgbxFj8Wt9l5/MGK4Isn8ZGc0VqAfLr/Eq1wDLO8xwDnzItx1gIYmyGP9K5bk3vQ2XAzJy/nRl0cHVO2U80gHhaU7P/8BWLVhlA3+HxpIh/6GDlsiJzBPygkGLwDOWdUrFqGKmpxnHER+5yN7tAyKQ+z1xYds3YPj1Ix6S+1VhhB3lnUHasqOy5TDBQEcpW7ijfgJVI9hxWFKR7UGUypHefMobhrH3llUtrez1sLrpylMhKUFY42AmBqDhKDQEq1J+G1Dv19ipLfgYWsSP8ubXVy3JXDrgYcPbgXAWgKEAycK0ERRlRe0q/R9ciQyCb/oG4x8T92KH2AAJ9ojO986eGlVkbTygkGPDxm729R0hsXWOrjtejCYxEC6Q+hQgeyZ11HTIbyxGjKpPo0C0mr0VnGl2EaWH+ZzRTE+83h9IXewhIiN7taAzbMLkgBwoXmcoS+6Pn2bWQBKLT5FltyyVt2DxVpgCw8YICCag01Rtniy5WCfVRVN7fQ53Ij+wVhFtz/3lu3njONAn5/0hG2kE4E2/RZc/oNOSXVUJXY9buiSo3fywroieC3hsIEUng/Sq6OijZfdR6dm6DpIvnlFHARc7vivnbARrp3XKq8Lr075/478= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdc2056f-5988-4ff5-0c41-08dcb4e68798 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:39.0810 (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: /grWJbpRfTIk0CF0pdgtcwXSFFvbC5wJZT/jrmmuh6mx4zSIc7CjpOpbKNe6/uvS8Qx8TUDz6PIqDfvYCOsZks/0tn4opIs0aa8fMphJWT3Arz5MDXSNzrCYOpJl6Vj2 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/hda/hda_controller.c | 6 +++--- sound/pci/hda/hda_intel.c | 6 +++--- sound/pci/hda/patch_si3054.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 5d86e5a9c814a..9efa43afd0c16 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c @@ -75,7 +75,7 @@ static u64 azx_adjust_codec_delay(struct snd_pcm_substream *substream, codec_nsecs = div_u64(codec_frames * 1000000000LL, substream->runtime->rate); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return nsec + codec_nsecs; return (nsec > codec_nsecs) ? nsec - codec_nsecs : 0; @@ -385,7 +385,7 @@ static int azx_get_sync_time(ktime_t *device, runtime = substream->runtime; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) direction = 1; else direction = 0; @@ -659,7 +659,7 @@ static int azx_pcm_open(struct snd_pcm_substream *substream) /* disable LINK_ATIME timestamps for capture streams until we figure out how to handle digital inputs */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_WALL_CLOCK; /* legacy */ runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_LINK_ATIME; } diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b79020adce63b..c9552b71c0e9d 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -583,7 +583,7 @@ static int azx_get_delay_from_lpib(struct azx *chip, struct azx_dev *azx_dev, unsigned int lpib_pos = azx_get_pos_lpib(chip, azx_dev); int delay; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) delay = pos - lpib_pos; else delay = lpib_pos - pos; @@ -800,7 +800,7 @@ static unsigned int azx_via_get_position(struct azx *chip, unsigned int fifo_size; link_pos = snd_hdac_stream_get_pos_lpib(azx_stream(azx_dev)); - if (azx_dev->core.substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(azx_dev->core.substream)) { /* Playback, no problem using link position */ return link_pos; } @@ -869,7 +869,7 @@ static unsigned int azx_get_pos_fifo(struct azx *chip, struct azx_dev *azx_dev) } /* correct the DMA position for capture stream */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { if (pos < delay) pos += azx_dev->core.bufsize; pos -= delay; diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c index 763eae80a148e..9f13732a89064 100644 --- a/sound/pci/hda/patch_si3054.c +++ b/sound/pci/hda/patch_si3054.c @@ -142,8 +142,8 @@ static int si3054_pcm_prepare(struct hda_pcm_stream *hinfo, SET_REG(codec, SI3054_LINE_RATE, substream->runtime->rate); val = GET_REG(codec, SI3054_LINE_LEVEL); - val &= 0xff << (8 * (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)); - val |= ((stream_tag & 0xf) << 4) << (8 * (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); + val &= 0xff << (8 * (!snd_pcm_is_playback(substream))); + val |= ((stream_tag & 0xf) << 4) << (8 * (snd_pcm_is_playback(substream))); SET_REG(codec, SI3054_LINE_LEVEL, val); snd_hda_codec_setup_stream(codec, hinfo->nid, 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: 13752833 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+FtP0U5ZXACBfZpWo5fmw5jOMf3Wla/7XfHDSlBCH4qI2sJrKnJ6IT0NSetB4QmlgrJG3jfr1/q9HfHy4bbx4aw+MUuknf1jsgNwobraQKtCzxz/ulM5Y9Q5gRGKutxPzwsVJKb38hcVuVvapb0jBIQWO5I6TUEJDdvqZ3gl/iMtjbNftTQx/Iz6m2Y9Ykfrik3cXRoJV3656WftBdN9eP4R9plpD/gFn8i0JhNdNKo2oOqe22sjW5nB4OGeYO7/XBFkM5sUUTOZzZMB8BLaDKekv8Tm+ct8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800799024)(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: 13752834 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010053.outbound.protection.outlook.com [52.101.228.53]) (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 2593C538A for ; Mon, 5 Aug 2024 00:35:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818155; cv=fail; b=UOzc6/F0zGrhAt0ZSlZc0bixdhutIuSZVQMIIoVH9yt0CiFlx+eFOnV16hZkgY3/ciiTm7N+BjZPTDXUhXZtdZbdQqq0aFf8DPui+xwNmNytM7j7xMYgalSFOefAVLQNPtJZkKX2qkVqm0KIJ/GfhXfesp4tNVaFouHSmnIzJw8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818155; c=relaxed/simple; bh=efROVIxXFFDrkgrp4i7G7cCHG1tkzYRmOhl8NYg1BuM=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=Ols/sLTz9Yen7ziIOnAfISlUz9I7XVKn2qGdBqwYIwh2ee4qqnp8qnnHMiTpslLct547r8nHgBbG/SrKCrojEo0f+rUPqvyJzC34ydMDAiGgqFEJDq1yN1lXTpFrN1wDIVs5rU3YaDryarRZndWgJfB6df3/fZ6F1h39JRXyC8Y= 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=pp5HFWXs; arc=fail smtp.client-ip=52.101.228.53 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="pp5HFWXs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i8CxDSFxHiAJuetvtGJgYh1Ds6XhHGUE849zVjcKiPs+AC+mwM3j58greumKiSJ7BaFbuRJuJIl5ELfAtRpD1QQKJIQEI5KUYsuRPZ1CDHb681EifX4u43N2Cp0pmMFeIlZ8JAwbBDffxPhSysaOUZfqCeX3lnL38PqCoIn6c/pPAHPhvzFv8BNIBYY2JCGe45l43eYJNL23ZmeXxRPV4AJtsTRnoXfzKT0EyEsKJAtkEfHRaZqMrYVE551fk+l2VnHfi7uUcmL9L8iyPxS94gWBzHUx3GeVNP/WcBWYwV8YCYj3A+Sia4yR60juxGySJgmA3oWEw1WxNvQ8fxPwVQ== 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=GFL9gpwDt2LsE0MEC39up1Sdk6A+Ag6xb1TieCWb9KE=; b=BSxTHbYHWnzDCKZNXg6c36T+Iby+Va2NJfacGfSf0t1lDkBw+LZMnL0rARmR4G9V94R1Vwd6bYwUGKG4/vWSwJyKJz+Z5zjaJXo+rxqaFcQ1lVH9PyZIQs6gugDWuYvR6nmUAIyDEtFx5A+PcmoKIl0HcikXnB1gSjNf23hCMBsq/y1MbUFxpBnrjuQ4/6bH54dGHSfKLexl8ohNTt8NyWswZpYu72ms3bg0rgURAmBgWjD66aiAbFj3ffcfRw3vCBd9oH60pbQQYdIMRvH2Fb2IRrt99ViFw3sDX2bCJb3gIjcN4CyOD2Q21Oi84fESF0CRkq/W9wpuYY4qM4lUlw== 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=GFL9gpwDt2LsE0MEC39up1Sdk6A+Ag6xb1TieCWb9KE=; b=pp5HFWXsVzfGbZ+HtQOT2ZyR+CvqMsGoqINU41jTjTA1zZtF3g/LtLxy0+ONsusyA14COEVLHMSYkCuvAKjA1t9+qzzX4nUcglxNHwjM0zNNN5rwzJwHqwaeRnOoSI8CsbHC/rgThoHt3Wl2nQTxbilEUByATtDwQWwSAsbmIVU= 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: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:35:51 +0000 Message-ID: <87h6bz24d4.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 016/113] ALSA: pci: nm256: 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:51 +0000 X-ClientProxiedBy: TYCP301CA0028.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:381::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: ca727641-1632-45d2-e596-08dcb4e68f1b 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: uGt/LUn7LXlCiMvgnPKfNoKUm5mTbeUFaJ9N38Y9AMUknZ0XkRCXnybIBooxglHrwuOE1KKNDliOIls/UY2atwtRdOWEzLYfmP/jByVFxpHekVzhCSuwsXIQqcQH9CCj2HmC2AvQj6l46TowRmoL6x5c2MwaFNFnXguaUlQmGOxEFcEs6JJ6WXB7PeUEpctVqyAT7baeUDIUpwlGbK6feCZKobmoXfXvrGVp/eV1BKnE5Kc99URRuLu9nk+L1evYjOBXRn9BMXwiMFpLYdMdXvceHI9RrgpOPwS9XiVZ+695zDbpgmuvweOvq6Xm2RWIC3s1Xtx/oPrmRJoQqVterzotg4WpGuq1wbzBH3N7LbRzgpRKsu5LypYEPUxaZG4aXCEc7qKgr3NRabY6GF4O5HFZz+QZaSNW9xqq/4eT2TBOpgAmjJlNbcz9yPFS4II9y68ZyaVE0keJGrlPN8WoUu0F1NLJYXS0eRsl/GEK3HPWo3jaoaNTHrG0WDCgZ2D2ee6efDlMCT3Nwofc0KkNih3aKjvsnnXd+0mrJgCqtoFS9scyKFsRXkGKlz5njGBK0oNp3wbVHmh8LNy1glc8ioTOXpevcc4Y8JCIm1VPd1vyMZHGc9ZdvYH3yreslC7s/WpL3m3jhcpBC/qwRDjgKyfD6rXgf26J8Yffkm975R7xR2Oz4V7E5U309sDt1glKWcKMpX/yUiPpFbcT3bjFsd6J0/03nXx6OnUKE37QAdAQtIY7jM4UaKebfzgkaCPkMW6dVZKjZUa0gDHJi7xwioInmsEQnxH1fyaVoT6/OxMzhIJjQMg+EFjVKVjdFMqd9M/ELoL785YedNNGvtB770fNGfuSMg2VisvnvugWZ+LOTLPKyBrx/vYncEiOvrz9p3rTpOkoo4DiYahTBxGHy4wTrKsuVJFSUME5vTHkto7A0Ulr57TVOCtObHAK/0fn3atpGe5wIYOvu8VKypsPTETYjt+rBlDeEKRV4998awZrCgF1hNigegKzUbE9Vmuo9MwW8EA5MHhkX15qe1WNkVmWrn5EvDfcGh2GQ0msG+9+E6U16cT3STekn6cWJ13alEABY/Ss4ZUtaW0OOaB3Gx4wqSpe+h8bbQg6fZIJw6Z7EwHyuWiUbUvIrEdrDOgWDCKbGh7SmP1ELZ+75/sEiftrtxaEeoHt/Dd8hrQIJYW6FZBfEfVGl8LBGKhuc1uNEsdZkay0P/bQirFj7W7NwOpORyv5SRgB5YvTR68UUJxCaZJm81tDLVy6+n53g85ULyrx6HUks+ThMmm62WuGx/qyHL92SmbDi3ZT3J0wMkxYOgQ3LCnG/Z2POETu2VUge82kTIokdA2FuiMmIahKsMz8R9UgKuZ6pKCKpcIWXjKDEl4cm5Ck4p4z8PxfqrTioj17lF3zPGDKYmYPb3LQlg== 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: XLCf+g5+lAhFAlhACkqEtQgMFrqKT+cLv9OIIi+P7YtVah5Xs7VUOe7uVso0K4eD3K8w4vRnNQ3Gw4FwPySk4xmYHWXBx2+m1dmzash/3SeWNCCiAcraOvkNI128kiwa6OrnOh/JyoFAelnkuQlZGYJ2O8aBm01B9sfBX/o0BAQSwM6JsyOZciW4buG2dSmbFWat1bg8+thrgajbxJluj0YgDJhLBQpWZVjs0VBRMUH7XNgXiOQkqBTEq4ATc1E356d/AHmgimLF0SjqAV5/rfKrVCJPdXeKLOJIQoZmVcKPE9uoQzpUocHUjm3YTf277URfNGsZBwHb7HmA5wdssASPwvG9gC1z+/K1mhA+T32S/QsvFU5/DeTOA5AWD+1pkX0QybO0Vya/oEHQxHcoYWYae0g+oRDs9kzuXBu2fzW7bBB4P8GUI1dD0CFYiKuPxFMqow+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w4Dezg4w2wSfR73XklOaVAvdtSnMAFUCpQpvPgDkaaOadd6a5+pREwqWI70JCWBwRP1X0gnNfHdBLxZ6OpAK/GTwrHGWPkgL9qNaz1XBq4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ca727641-1632-45d2-e596-08dcb4e68f1b 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:51.7232 (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: 8kID6u46NKW1TqnQS7qPU+CI9FNjmVTdSmVvnau5w36PW6IKN64MeDMKp/Oxz6V0i0oHahwoHJrG/jwL98K7nKUsBIdwNK0pbv4hLYnUxGMlOwangNCd1ac5nPZRP9UD 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/nm256/nm256.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c index 11ba7d4eac2a4..4ad3734796ed6 100644 --- a/sound/pci/nm256/nm256.c +++ b/sound/pci/nm256/nm256.c @@ -332,7 +332,7 @@ snd_nm256_load_one_coefficient(struct nm256 *chip, int stream, u32 port, int whi snd_nm256_write_buffer(chip, coefficients + offset, coeff_buf, size); snd_nm256_writel(chip, port, coeff_buf); /* ??? Record seems to behave differently than playback. */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) size--; snd_nm256_writel(chip, port + 4, coeff_buf + size); } @@ -341,11 +341,11 @@ static void snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number) { /* The enable register for the specified engine. */ - u32 poffset = (stream == SNDRV_PCM_STREAM_CAPTURE ? + u32 poffset = (snd_pcm_is_capture(stream) ? NM_RECORD_ENABLE_REG : NM_PLAYBACK_ENABLE_REG); u32 addr = NM_COEFF_START_OFFSET; - addr += (stream == SNDRV_PCM_STREAM_CAPTURE ? + addr += (snd_pcm_is_capture(stream) ? NM_RECORD_REG_OFFSET : NM_PLAYBACK_REG_OFFSET); if (snd_nm256_readb(chip, poffset) & 1) { @@ -356,7 +356,7 @@ snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number) /* The recording engine uses coefficient values 8-15. */ number &= 7; - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) number += 8; if (! chip->use_cache) { @@ -372,7 +372,7 @@ snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number) u32 offset = snd_nm256_get_start_offset(number); u32 end_offset = offset + coefficient_sizes[number]; snd_nm256_writel(chip, addr, base + offset); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) end_offset--; snd_nm256_writel(chip, addr + 4, base + end_offset); } From patchwork Mon Aug 5 00:35:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752835 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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R5l6rtotWZzSwcOceKEoqDvbmoR26k8b2mFi0uN/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/0cpLU3AD296W7beWec32xRKiHHYRsm/U/7D/CX+jX/4j0t79uqp66f82glVu6OWzaeQP41IhADEyRhT5jgR6EKj1vwuM6KjnQ7AWRWs/xK+pEMsniDCN/Va3yzvZFRakkFUIOEnqyg0npvvIsJGE9xxfblFu1UkDzE6EJgA0BobpiuOLbhL7hMLyInDHLHLUDU6ec1wpJ+wa/nJaC5lazzPeqeCi9U/Z/5O8PyXI+vDg/wnKi2r/36pR9Tc/Gqge915ZTyWd9Ma6SfH1Ayss9BdhN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8UIWqRZSJTtpby8Ac4fv84Zd3ps88SdZkGgHm3a9rltHvxGYt08Zbkz52CdtSZaxAZEeVyDNBDHGU6/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: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: 13752836 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011006.outbound.protection.outlook.com [52.101.125.6]) (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 607B15695 for ; Mon, 5 Aug 2024 00:36:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.6 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818166; cv=fail; b=M04rpNKnoRwKveQGJAIFXMtMCwO2YHoRTUXrDmSyZo59KLy/gDC5NlbW/H46HebZzK2wz3vl7y8yYNT4Vbhdi5EqBIZcJjw5vVVBuniYXi54RaV2C7tBpEu87uPQ3R5eQ27Zl3EG24djpPH0zfWoXtl/ftL5Oladv7kY3XHfOU4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818166; c=relaxed/simple; bh=gsde/cJHAmwbbp22NkWXiU3qOdpEOOZulO9Kz5BIpxI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=CPMm5NvO3zXIoc5h7PKrkwvLtBasztHBtgBp+hSLF9l9UndyCx2f2t67K2LXcy/HpVnaNdQhZDeKitkR5dM3nDh1GqSyXOXlBQX3q6E+hfE+ShwEAijHgjscRQNSq0+hN+8jaAb+NLgn0Rj5zJkOKWX+pvrl+fqiOLac7x9V0Zo= 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=GsoVauOt; arc=fail smtp.client-ip=52.101.125.6 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="GsoVauOt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dZAIFsd2fqVfMp1dhruRW78cutgGPSAnkh8MhXGaIxc3XfbR6yNmbtKeBmCx3QkmsZFAxJPvBsq8hBAtWeUliqUXpomW96JvaZSco7zHtZ6XBHvpI6va7BHneJipDzFur3kh2nxcaKZuI3gcVhkwkuefAOxmqEQ6bx0xW2oH0uWCm0YY5GgPNeqSI/+gvfM7WjoXtpDRDXabRlHMyC8f0SJsIe5d6NVe530eBs5sU2eVX5F1VnUWQ4J+f/XAEcrPoGNEv+T/leigGS/8+HJNXf3awYyYkqnbyB/70c02J7hsgYHEgYyLNembR80ZKf/F+8X4PrZ8MiB0n8xobZumPw== 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=0GmQw3MIk+q98y/3wEF9FGiNcya3N5KLX9JV2Js2j0o=; b=tMnlJH57bLnWnzuwaDvhjoE3WNPnIK1cQK+g18T83EunNpzBWSOrjDwjlnCmcTIn16uQvkGoTmzuqfVjfYNbnUt5sWgibDFlhFe9dBFTJPbdMc467APrEhxOCpleOKYIWf1bb1O+J8qDWxIJAxQhyIVV4n/lqHccHCo7ogOCrhIVj2/ZoHlfZkQbpENkGiui5+FcpWQFjdTNky7iWaiRev0Xl+Xgr49QzEJehJEm4lunOqKEeMgPdzBQcTF/81ycyqOC1GdbY0GH3Qi1paFG9zsdPqiVjNJwUWe5zjzeBSRpX5M1zUf1jYLSW/BLeMIH7LPuQdNj2eRxDPgs1wontw== 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=0GmQw3MIk+q98y/3wEF9FGiNcya3N5KLX9JV2Js2j0o=; b=GsoVauOtpTMNpxtvNEhf2MNDti6LbC9WPFxY2HnYcsONrUrTyRVbwhOv/4nXhEQnEDxCTOxeUINhiUCej/htyTeTYkTSBudekEIGgrR04NIgKuqffMoxteQv2xwntDujWVvLagFI/TZ2s131r7iAxnSNhSjwUwc7pmSrHjfDts0= 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: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:36:01 +0000 Message-ID: <87ed7324cv.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 018/113] ALSA: pci: asihpi: 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:00 +0000 X-ClientProxiedBy: TYCP286CA0163.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:383::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: b92e6272-e5e5-4cea-c4a5-08dcb4e694b8 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: S+UStLMKpbz4S4yUmg0kB2BIl28ch6UHBTYEvIji0KR3ShjKus+JXIuzwbGO39Aiqmt0djBXUllqnH5duLNb0kJBTj9+r6Ldia8Nwh4TLewoM6yGWX7TIjXxq3KoAq7r7gZjTXzBUTtx+NuE5Sz1/KQBLWB9Rl2Qc7ZCJu0YXahnEnsdwNaUDWg+454Pq5mxfDGSD9QbSqM5tibIy2YnZWgoHG27CIaR/cnNUzCGRGH4PVp+GsGFQwXzgUBesj7jjgkIZn3XpTWuwuT5ctgVwZgavj+S0mA9nn/r+qB2dZLcVFrQBKOaTaWyPyFGjMfozlQlFGzTo+vrgTk/aYkU01Nn7SJCaXM1ccTVWPIBFMW/53MgVj2sa2sLvEKZVzez6Der4QEc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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: +qHVx1K5SsWGLSKIul6u//CsLTtdaC+I4Kjv62Gn8lksGYy80nHZ1LxTLBQRnXBLl1A4kwxCf4dJLTEEhFW/le30Qo+hOJxlEKsLaPo69NYGH0wB1hyvBKn6+B0BwYt9lEd9O81pEZDApqFiap2+3XQor++FiTmJ0vGcfdFgFWS8+0G4x/G6cJ8/s36X8fYRutcKhFw1NxVcVBOPZ3+O0FU25CYgvTPahyvxfuPjgPnounhzKsENoZXU/KcPqaYtvpELbHa+ZbCjRAjL2MGty1SEu3CsFybV2Pw/e/PnROhp0zYx171P3njbMCOkyBmioUMLXUY4sD0H5TPZQAITv3r+hEuL7jwTO+5Us6VXBkIg0ks58d0qw3rybeGuSclEWkDVLtQkazs7Ei8KnsRLIfTZXhIwk0U1QDbU/NDAbnNIOLNFzPSTmM8TPFxWB+TN5cxLABzkYBA7zrscD/2lc3mFbBZYtDdauikoNZFsnNvL4bjnApACBCjkVsuCvmglrkYhCI21Vr0gPRBqgfw+AKwOBbmioOvXJOSEmxAI+4wWjD5jhvqDirEupFRR256ycK728EKYK1ElNTsqQ9CAqitC1q7U8ALgfQ4Ybe7h03K/pEFSvw0W2+Uf8qY5JV/l7lBGn7iAtchyXuBZmBABs7O1+swJkCzcn+/z1Ifu7fRK2pOgdwZWLIaOGhTQmdvwQFrUfJ5vNVGFtHQFRnqQ+dktuoESo9UDMZecAMhuIQMQKHwJKzORftRq9iv9AWaZFXiS2QX59/84QVk4FqQjeEg7SIEUJgx54QcSAhh/SuikHmngq7EndSkFBH/D5+eJVcK3zoz1Ez4tWRvEVF3jAO3c1oFKDBQn1a74RBfE29PiqWoctGOaahEYB9GUs73OeyFxhH5Kmpn6SKsydpL/5ii5snVmEubUpsbRDHMgbxH9/J539UHLepvC7jruGFqKFhBSCc8oXr4cQYTBMHDmb4B//XWINL3UtbURykYft32+Wjyap1y//4t2iV6m9E6FxklmChRmHZWv/ZEPJoM4XfswypF5bATomjFcNvtFIy/jbxPAL6qyJRfQEplPSut3NEQG7VTfXQcIJHdVm1pB7HGqknC+I28R1RUJ0M9WnHSiZHmxOdyvWyHHW5G2B3fCXS3hSCAimq5EQf9+OOO0WeQx8xwgEeYmNJopRufi/AR7/XOpG/3NGfO7LCV0Yk9w0YDmAYCJq9kCiSTRXBya95gIzGq+VgMldqXW15yUIDPhlYj8zqidkpwoKbEQGkLHBSuqT2UsbCIxGE4H8C7z3veyEmQ4v9i63MvKmn7kvBIBIRfE7bQWx/0bFCegMmw4++n2ZGKwSGElHXBip1IvLAGftA6Jsaf15LH3hz0VVq6J3ihJIBi6hklJV53pa8LIDAKuJbs+taGqChzNHX+csvpC2x6p8OEzmZgA8nAMKvsR7SHDn09yYllWSzSP5e6kCsWT6JSoApwg6gGyEdYbsDOas9ro+vGUtjzna98/2DCWOotciQppsfyzwSiNL1i0lKmHzJOpWAgOKx3g7uwAeLiKXi5qPTkuvdsjYBPxTQPDPjxJQsIEF5iYdYGr+72rx1WYDWuqvBlcUhYwAXqoPL/h1VwFQOb61zeXqwwiz0k= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b92e6272-e5e5-4cea-c4a5-08dcb4e694b8 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:01.1178 (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: nDAUeRtlev17UMgtxxfVHssCsgjpG9eYqf+NE1keHSPb2sJJKvC0LVTmI4dVdR85zFJUtMwtN0Mv+IapjwONYFfTTl5nVLrOvyPHb11EyNT7+1FortolwxzcfAzQoqy6 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/asihpi/asihpi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index 001786e2aba13..69eb696012933 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -447,7 +447,7 @@ static int snd_card_asihpi_pcm_hw_params(struct snd_pcm_substream *substream, params_channels(params), format, params_rate(params), 0, 0)); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { if (hpi_instream_reset(dpcm->h_stream) != 0) return -EINVAL; @@ -582,7 +582,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, continue; ds->drained_count = 0; - if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(s)) { /* How do I know how much valid data is present * in buffer? Must be at least one period! * Guessing 2 periods, but if @@ -615,7 +615,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, } /* start the master stream */ card->pcm_start(substream); - if ((substream->stream == SNDRV_PCM_STREAM_CAPTURE) || + if (snd_pcm_is_capture(substream) || !card->can_dma) hpi_handle_error(hpi_stream_start(dpcm->h_stream)); break; @@ -643,7 +643,7 @@ static int snd_card_asihpi_trigger(struct snd_pcm_substream *substream, /* _prepare and _hwparams reset the stream */ hpi_handle_error(hpi_stream_stop(dpcm->h_stream)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) hpi_handle_error( hpi_outstream_reset(dpcm->h_stream)); @@ -755,7 +755,7 @@ static void snd_card_asihpi_timer_function(struct timer_list *t) if (!card->can_dma) on_card_bytes = bytes_avail; - if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(s)) { pcm_buf_dma_ofs = ds->pcm_buf_host_rw_ofs - bytes_avail; if (state == HPI_STATE_STOPPED) { if (bytes_avail == 0) { @@ -837,7 +837,7 @@ static void snd_card_asihpi_timer_function(struct timer_list *t) if (xfercount && /* Limit use of on card fifo for playback */ ((on_card_bytes <= ds->period_bytes) || - (s->stream == SNDRV_PCM_STREAM_CAPTURE))) + (snd_pcm_is_capture(s)))) { @@ -853,7 +853,7 @@ static void snd_card_asihpi_timer_function(struct timer_list *t) xfer2 = xfercount - xfer1; } - if (s->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(s)) { snd_printddd("write1, P=%d, xfer=%d, buf_ofs=%d\n", s->number, xfer1, buf_ofs); hpi_handle_error( 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: 13752837 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+xYsFb7ZTsr7qdaKg2ZgPg5vM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I/kslWjDX8wXXDRT/tm0HS61DI9iI4v3UeAaL6DV0PcC6KzoYy1PhbSspPsxmIap9WwIlPJM3rECc00V/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+m3sX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WfyqQzt+8vsB/gAxqZPjA2hVmSynsHP6QXUkfDkMeXNexqnKp507epxEOUu99lYiyv2fO4O56lgwYw= 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:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752838 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 564139457 for ; Mon, 5 Aug 2024 00:36:12 +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=1722818174; cv=fail; b=oZq5SVKa+z2dXx/wBudlvxgEW5GcXFGPFeaRaRtOt13nYzOwl2+PbG9ne9PJtxoBTbwvfAEdQBJsTYmi4MRHVz3G+S9bQW0r7aZuOeHfJHI0Ej7Ii8/G7fMjQa4jTyj5L1orkJLSGxdRWM2fzx3/Mg2pWHe45JZ74SwO3BVqaTk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818174; c=relaxed/simple; bh=xq3Mt1ql7U3H/lyejOGb1DigCzDhBnHeHhj85z4TaBU=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=b/hHRFLAzf0qAqVlw5vSnRHxgSmPTvh2lv9B1zuZEbWuGZACi+E3qIpWzuxIKFsenxXNKe1wI7ETSWTK2lwuiDvk+h9GAnjIunxGARI/jVtiIBVXTLkMK14vDAAoNoufKTqg30L4CH1xohFlU3GbUxd0Z2cg6BYV9bOPGdZpBJw= 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=PqQ/0U3+; 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="PqQ/0U3+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VYpprfN+rIKTjDlYXrSrDuywPiuWbSYXkQL54MMgUqFReSaFm1ZoheMxPW50EdZUBTv+jjfiFyawJekxU/jpJrBQwd1Eiv4Z7deZFQVFXz+KbBJdKdQjbc5PbL9f2AJf5wM7xBD80zhr2+H1uBAIOtpZWDfJBRw9NKxdnhwXVFXOeVYFoNNpdtcrQHKnQVBPxm3fEOcLBtk0eBOvIV2GS2BdV06feBuD/VjtihhoqYVaf4LykstWdDr90Y7mQzIyk4Xcx+qjkHcCRbRSottxAhlpl4BXFLCR4DVWQ8Fq6STt5Ij+a5P2pQBgRlhJPHSevqhN4JPzTANnm54xTcRTTA== 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=0AOimuGkJt0hPMSSBzijB5opL4Pqz0vwxV4X1XmvH1Q=; b=NIzoOlhZyv1IsNpVmSw41lop8189qssM0AQelcgbug6zqrQyjoJtrPtvWqpzbVr7B6Fty4Ck4S+xZ+JgepKrpoV2lfFTGl/ylUhYmLVo1ybrjkQ6LBqPcVjEI2jAeeEPY2BKfzC0FQ+ZH+2/FErNAu8wAophwhzITJlGvgZGj9VcOZYCwX/FYulVv/LiF1n/2glS7xFnDCbwY4N/ui0SLKhZmKBwKoN7wKQofBKOOMZGxzFfY8m/Dk3sgDTrg/gLbLO60CELHIVbTOFN6MLDlv2HSYeQvs/maPlFBzGb8q+NPOAZelPTncjS2Hwv1HshHIIltSffwnxhcv14PspaQQ== 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=0AOimuGkJt0hPMSSBzijB5opL4Pqz0vwxV4X1XmvH1Q=; b=PqQ/0U3+L60U72BqfrrNx4rt6Mv80IrfJp3Ie5Vp7hjheUPlW+lIX79VwuMZjlco5h9G1zFjOglXrfiILecP8QuG1O1GjoCCKx7FE7Efn4QVo5SO+tlKFfWFYHiRctJPam9p6I8EcAUKlH5IqW3u7jZhXn/Y9bUa7t2sCitYJHo= 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: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:36:11 +0000 Message-ID: <87bk2724cl.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 020/113] ALSA: pci: ca0106: 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:11 +0000 X-ClientProxiedBy: TYAPR03CA0015.apcprd03.prod.outlook.com (2603:1096:404:14::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: de770122-7b5b-4f0d-6382-08dcb4e69ab8 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: 4sW7sLs1dGzaRPXCfGmkZFB9JhWUzt6RSBhASTJ65Y2KPB8GHH7rHzvIiR+krSnquMuvkpBHv4gY6OtI0mJsSEKu1EZ5hKF2JYlo/VHw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MT9s6/gkbaYSMHyhOLPRMj3jGLlOZ2nfGIQY056x6C6uz5zL/cmuPwEz3gMPuo/g6v9tNKsxEkibMwQg1M4EhVeNRIK2kivByXieKQiXEs3Pd5rkHEMIwEWfAo+sbhiOUQy1FXwUcHjAxDgC+G9k5IGIOfKH3r7u3pDxxxrQU2p56GlQ+lxAu7mMntDt1RB2y3c846f2EEmSgLdCRLrN274NtxHHlyXzwerT8U9tjB7vnRpVRkeLVczgQ== 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: ncMliJjqpGT8lo3A745W0lzn683ABIyzlWP1sxCSf5z5DJZUzgjNeeDostQ1RgHZnWh1qam/QTlgmXhyKU4ha71l6FUa0gFluxTecNitp6IhK5yjZIYYt9IgtkuadO3vKRRmuyOz29quCLdMUY17YuRmiBBdH8Q8G+RYQ1pekCICkpZ/2u1+9b5zAWO81Ett46YyqB53ltdmqhYbSD4gnQ3Da3c8PATY4xyC+EGcHnzHWU+hwJ+bC+IXvACxWn4fQKt6pc3Oq4ctouvxFCFtEvFfaq80dJsgUlmFPVaayt0OcVd+ozOTDb7Tz/PuSAzpRNC3FXa5em0t7jaB5q5rY2YGReH25280DigbIFWHOqoWsx192PskrBsWP62PHXitLiKzsC4l0SQR2zvo+oOlwLJUznntgomUy/KWZ+2xVpQcsA2OuVMCn/68sj2XktiEJeXKN9Sh1jkK4ktn6lJxgL2CLT09muiNdxaRFxRyEyQkhyUNczOABPJxH81+Ll3rqnv6qjCqy3KgRApolPIwiL4g08pKAOZol9flnNbEmyQOV4YlDySsfWaZBBKAZfal+1GBA8LFtz53poMfxmDRCK5rwEc30YTz0Cs2CKAwXYjpUlpAo+xTl6qSk/X4aah5MsghrEwd4Ek4c+IQAdOIWDpLR/A1y2OC2nnSNCJn2QTuRurAsNpKD3Bc7yS373rhlXarAptZksvR9z81j6+MpcrKmWbExIqKrC6i0j/kdDYsChKw6kzKncA60epsC2c5WKVxCGdwE0kvvSilFLpaF2RXBKvNq1IASCtTfSb9lAw1PSBsEhoIWZSc1Pc/8rQj5bG50vkwMgT39AdTfVP1RBl04rtP/Y4JK7eeR8BQ5DOLFeu/IxyJLM+gv1D9Q8e9tuqyxetdJ/mWJdU6pOhHA5MIJjK1vEWw0DlOaCC1SJKv5ZaSmdq4EHGeDw3Ud+V3yKQ0/o/I/21jR5aX6wqZSjS4mzksw2AZLpIrcyke0HB0TucVGbWNgVUxtk18O/fMPNzZuWvp83M+PdMURhDsV0I2jk+rD7HZEWhlxSC1O17Gc0ClodTVpActLINplYJq3k1NGA21wEgJL7WLvZ+sC4RuhJGeKluRcGrSGOIYKJqj3CRisJewlm/S2wEeWx1w1FSao5U6qXsNli+ryxNnNn54WNt62m/OSMkY6Te8XXwnvcbdcmvBX4/9im3dG9Y1YKZi1stnBHys9uteJohk+NHNqWL2E7zZbroTdUBGJHljXIzQaTU1gQE640REmVOM7sZTWYU7k6bQ919AVzjT8kD+KN0A8XeH433SueoFMbDCgDhDpISVDkKaWLpvjruq8Aw16U3z2vX8mGGnTCN7ccutGmxHtqeUpUrwezHv62V6bCbIHNqoQ8fMRybCCdaYROq631PgNramS301E1yZGfNBZYepzShnQdbYlf8/DKbbshD0onx/TyubJARk8Cl2zniTAtTP2qiXzIhmmiGRg2nk/Vpc/wxnXbOiTueNZLrgQmtJL+G9afldNhlMSsUcVYPgr74a6iyPD/QiLb8uN7nJ6h+0/PD0U3vW/Jta3hrr8tO7X9z4poQ8rOFOOFzottRiadMKPs0dwAy8BwxkAwduB3dsmNl/aBpsahqWcgU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: de770122-7b5b-4f0d-6382-08dcb4e69ab8 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:11.1767 (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: 8b8ZlzmOupPdYYwkvGgyZdkD89kTZ0rBkUrz8qFzuD2Jl8vRyyX2SzTRSH7hxr64oFpaOFl8Tx8W5nBY54zgCPEDim/40rSAaSTalLP7INDDCtGHDlVC2P5JcbroQG9y 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/ca0106/ca0106_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index cf1bac7a435f1..abee20e6dab39 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c @@ -943,7 +943,7 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream, } snd_pcm_group_for_each_entry(s, substream) { if (snd_pcm_substream_chip(s) != emu || - s->stream != SNDRV_PCM_STREAM_PLAYBACK) + !snd_pcm_is_playback(s)) continue; runtime = s->runtime; epcm = runtime->private_data; 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: 13752839 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+AU1goakZSWiqhM7okfnouc3d6vtKIK5lqBDuqUp9isW6NPYPRbBUfD9lebch7WoeBlJxbEm0FKyeqonQNuDYfkfDdvSZH2sfToPIkjzhMUXx2LDFxMJm/4XeV9Zx1ltvrRawTwLHHOquigQDcyQtV4wPS2+JteRVzQ88p1b0Kl3b0OBE3Cqoob8A8fnK8fKPmxm3ColDPpGuJ/mbNoaUWJHQRqm0jLK+oblvIjrGxWsoX6HeTrQ3AhV1oSb6ITjZxg4yDOzUk8smgQCpNWl8rj25WjRXDq/NwVTFcwUogunbHWyvGRYMoq78YwnUNcNRB/GEgeOm4HGk8SfbIP59h0CoNihQjH3oEpZRuMh0MvsC+Oy+F28HvGnv3NgsWv4nRI7N57fKRRAxstX9TqHH2pkidVk0eS8M+/N5nlJLeqorp67dX2pdVk0WchUFjiM9UhicbuWojVUoA4hYapdpiZ8WpCr3xFNosq0tUVE2WRr05CbqcZzj4EipG+DaDBSKJ19BHLbIH6FV7Ma+/Efj3Y2cTQMhQ51stQ3GShRsIyrRl771NICu3w+hR887LDn/ahJ1otTVoUHbiFzRECWJEPsf7S88W4ohtVzjRtICBsFU3+eKeslDuEw2vLa8hg8eUWjAxspIhhMs87EUUOL/riezuxFSwW9y+4EbxDHU9iHpKCMgcaRARTQPGvuSTaPZnLs++CUTsSFOecYl4GI+VoHuA7mnR905BoKqlYxI6/Az8Kb6zZOenwS/wT+/9X5UoXLWDUmRfKbhtgP+JIW66/jv2/ohAwqv3rgOhEqGsD1cqJJ9Sy+9f+edXoBHhFFN5yh8eVS0NAF4rL4Sb0BB2GecAMo0h/mvhpxlkaeP2gyJRKyldTkfOk07lDYdyCkYkQiVUwB7HxlUU5saEsOTOrq9NTppRcVCM+HSNf7YVlybdqCFNf6x/Tij+hn6KyWs6s+ib7bsxEwphylPh1fHDA1qXXEYSPwfVknR7Y/ion/whV9eQFNYipCZtbQ4QPb5rphFkdqK3A2d6p/HPN/PlsoVL2LZECgztFjSAi8d476Y/RxT6s/BP0ClQYm8wLxhxkZwF0Ej0SSCTjHcoMIubWnyW6bFcJbJjSwK8U4yXmabTeFu6/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+gIC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dGP9NPGAoujnDpy8QedyzDoMnDJhjAJzidI89vxCdmRDfHNPgthk6giH+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:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752840 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011024.outbound.protection.outlook.com [52.101.125.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 0BFA94A0C for ; Mon, 5 Aug 2024 00:36:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.24 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818185; cv=fail; b=fY/6izWnlho05n+eoTiDc1wzjqxSuosPfQ2iirRw1eHMYtSO2FPtIXJUIfowjxWDRo3OsnjeEBvPOMxQqWQqFCtySPugOdwNcc0yylW5AX048QarUq+9zdG/W+oPwkv+QRbepUhZnpo1fskZYt8jZlDNnrtJaJDdqnZ+TcrvbsE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818185; c=relaxed/simple; bh=Zf0N4JmGAnOLoh1BoriMrjrvUgifTzRyh2cB/qWe8uM=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=HcF3zofApJSJU0je5lClhLENy0WTGBCo2+LdpiJuUcIYx5FNlsbs1DwvkvnlLpaBrEJtEHNFNUdKsD+UKRn06vHBQ0SjExLxCvUlwaSIVf/fh+aViZEmijUIVz3lCxia9GbOIWjy2CNKVve08GAoRg4cMOj7OAC1D7Rwmf8BARA= 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=iB+GHvTk; arc=fail smtp.client-ip=52.101.125.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="iB+GHvTk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lr+arYGdTWoxGijZ+xnPwu8yrarCka95CeXtqbCVdeoiyN+9Bm9+vPKTWPr+beCXTABW3h4k/K7gUTDIch01o0wjYnUBrNRyt7o7KDnAL+m6rAlHIPCtKqq/xjc/OGsGBYN8R+jJIG/7Pig6KStDWbB5t7OAxsrE5h0VbELzNO7conCEhbL7qYrFAQ85d9n+j74/SChmO3OJQSOjFo+AzdpMGEC2QBUHilKIbswaNA1ElRdqFXaZ5WJ45ZA4VPWvC3SkA1FpquBEWjRwb3yZR4ckbpzTUo//xLf6XPdne2qL8jUs55OiBCvq9gzfNpbAUAbY3EepEdX5+c3d3CsDvg== 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=o9sSF6Gr9RkUcV5wPZ5OOdlEGW1/a6F1orDus/TdiZI=; b=WKQEn6M+PQIQ7Eqlgg35YCgYKae25auw/sAlZzfvg2jajv0qJUBH8wphQnf7gga1YqGBUMr6aa/fbOTl50X9mbXtXWFUr1YwflVpVoaW2UQNkDtAJdWgrNa3FvR4XVjEJbBkFMdxkFgPIBRa1CGhm4aX6SaRMqdZusZaKlOdrjXt3AYHqJtoY2Z4pElqbZkl++twnFzDICS1En2E7md4/Ri9efYUvobu1R8JGf2LrLWgbSDgIHrRrBQCO/f7FYAE4gNW+vSYVIDOW2R5Cj+53NcsmNcp7VC4xyBVbTaiQUbWljYE0feXf86xYKmboM7T5VixxHMKXGvcRUywSCo8zw== 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=o9sSF6Gr9RkUcV5wPZ5OOdlEGW1/a6F1orDus/TdiZI=; b=iB+GHvTkYiwPpRxyfBluj7K7SaM1oZ3wyMXTJlUtmGJVsDVYArXwkC7/0tx+pcWT/cMJFYwHerEG7wZfGbZIFN9hlTPDSYn02/mtNfY0ds2BM/FYXxjZobXcKi7iLkEMMijhfLlmmlOPS1xP9jUJ6zKm/lTHF+WulpahDj40O40= 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:21 +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:21 +0000 Message-ID: <878qxb24ca.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 022/113] ALSA: pci: emu10k1: 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:21 +0000 X-ClientProxiedBy: TYCP301CA0015.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::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: 5d434ece-4546-4605-d4d3-08dcb4e6a0e7 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: Q1VHNuFOPkXWu0LVLwrdS/7E8fHnPmKte+ykPUsGzAOwqkQ0xLuOA0ndQNv3R2nRzn0NYzn7FGxarbtljLaXXtNBeN3pwmKj4FZIk0kNXvDZ1cpLIJDc//YSs1M5mcbOs9fQ/B6qefsegucHZOynUFaajUTbotrKArOhoduo4ib+ObxGDusatF1AdqtuJIbmoHnR87TyxvIWnyjg7NSJqm1fVcetEevZ/iMkadx35Vz+4sGsc2K4AjWi7vlakDU8wCGbSmCFmm3ad4qzcFezHsAny33Zp3X5aoiRDpQfUtiIcA1sq3oHmSNZdUO6P075UYeuD93bbyM4MnQqpuWC7behjJkCbBLX+SRbJkzyWsmmVSpLx8jhwUjYDzyeqOWY6BpXvl+L7d9h7QRuv7hASnWMWubwLJWWlEHlRPFRNNUxVbWl9x+MZ8tsvu/c5Z0Qd7dT/9HP8A21Gpl5zDljePUsi+62mltRQ3u+pZlAa/Sc25li798Yf9epJ4AlNYLbtXBuNhdCWWv6pLaMUO7kBOeWCLk+df4N9Y+bTo0joMGrRjytJbIpTs7CHZWApD8rDqBKTEpQJOtULlVgCg4n5FbdOV4wetHM4pC7qcFu8k4PfM5N92+XRxWq/6Bez69O7Zb9Q4JE5y50iY0lOVYowCoNNXhiRtqgcw5/CNWKS6pjlbnZW7bRiDuKnP5Xy6IInyQDHko1ZdoYgvqM/bAMEpPhwXgtHSyLw1sJ78ylI+5sJQxtK3KMcaCzEMFr0FFJ5WmDnfo7MVr9Z4dusca44cLqDH4/T/GsVbcvilfb7GaE3ofFA4XX6yypc/OCqD5Hvs8dLgTFGrGFQyhgaDS9DC2FRXntohTnxzgtQcKceasTFoVZs7kY8LODoaWV3Vosobn4I9EarCn6KcOLCtUd0Xed082F8R/qhf1kbhjrYb6nTC0haDrnHpx+8kyxLsIn3memRceBrxVpW6Tr9OtZbOZZwgWAZNdUQMRCXVMXsyVSlF6ll2cgwWrTovQ/z6qr5LAhMFil4RrPiXeYpqye5hY4s+BVRbEGTlKSov6b6wZgJI23LhNSyATlguhA7TY3l1JzwhhuOIxNmLrUktuE/qsmG1xgpacDaPydJqay3lgz/+x1K1SnOdkW9CtYZEJTiATAOOHvRxAesG2tGWzQLqfTuVDvPY8A+ymt0TDuqa4UoCxYV/AC3cLRqBppuzZQFEZPs7CERiNLRKgvK+vvvPb01mXB2uvNs6iopfQpCdM5Pd56tudwF5sP1F7ouoFRTXxOTBChmSEkbxjLOtlLt73opEUubv59wW9+vQ5n5KA7Q9y0HyEWTx/UJ7bvg3nZVdOPGDSjm0rLcUp3NGF6uIB+4NAr7xxDimJBTteLPAJMNDFt44I5BusIuu0pz016KhtFiMafltLzJK/JUhZcUw== 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: shcu+zRHWLUHebNvLxtHvClt9Ksep0ib56WO9tUQ7DoHmOegX6YeCSk/IZ71+NnbydJnhwUP0hHQ3e4TDfs3OufUF1cinKu8aeRsnHgKbgeXYv/UmvtYL6E4XCBbgkp7hJU7XUQB6248RZKYRDR66kwJoCsxxGCCwwzxYLoCyHr6oUYd/rQfL3Juce2VF0EXost+Qr0VOVbvkp+pzdICf4DN0rnYw5TpmPuzbMqujg1F4WCrGOUC46CXnXfQLO0YCp9ALVd/uzNUSeeo1muiugjQXd34nP7MJYTASD8egp31ULt1bkIFagMgmKC32E7iCqnNb3e7GY0ZXCtpHwgGxoSIOEbkeWSHs5ecCxUVbrS/1OqyZHTYwZAzofYfa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J06Tp0SwthpyOHHtv6/k2f5iontIIw5wjr3RrFDr4rHSERbNOeEjXBsoH5bsqw+v7K1eNZC1Xa5/cHSpiIWyNduL9k5jEt8fb++oG1+2hCDKriL4rAuI+Feg5/r211VT4ioOiO7/Ww6jZXe7nlpmiWqpb/2LkgG2gFzEtUMHmoLQrLhlYJ8qBQ7+vE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d434ece-4546-4605-d4d3-08dcb4e6a0e7 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:21.5866 (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: V3oO+4PQmBOBUcgCT+mUQIoy0hZQFfH9MP+qOveooHXR9WpKdSrzEFEpxfZyjmcEe8zEXoyZe54w3dkKxfMgAZH6zHhD0JtSK0h9tvrpogpapJtP5zfmgm0brlAD619O 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/emu10k1/p16v.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c index a9a75891f1da4..b174b392b6aee 100644 --- a/sound/pci/emu10k1/p16v.c +++ b/sound/pci/emu10k1/p16v.c @@ -422,7 +422,7 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream, } snd_pcm_group_for_each_entry(s, substream) { if (snd_pcm_substream_chip(s) != emu || - s->stream != SNDRV_PCM_STREAM_PLAYBACK) + !snd_pcm_is_playback(s)) continue; runtime = s->runtime; channel = substream->pcm->device-emu->p16v_device_offset; 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: 13752841 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/0D4uAHN3jCErhdP1JRj1rxWKqEHrBPDfI8sYhsvXol5ZuXM1fDs0IvArWd8W0h08gJbGidoW9mBqz8HCoeSk6mxVDx+783PN54/4+hGey1zvRHGYYNQIrRN/YuoWYoM2IgDkbXTXPfhUHerC4hBcu/kzvO9u4hdU3dQnA3TfHr+W2DJZafWjAJ8F3gHgihZlV44ebI5nIvGPuxw2WqScEwG43Y1hr83M1bez9SkJRs4FE1Z92SxUz0PaijLZjYWnpi8r8fsOHTIlgNthmStxrnc3tegIMOBxyroLkYDohBD6XpoHCKdCZDUt/tfhwEzwalQqMvwtJe7BgTWV2IaAaciQRwGgZoH6i6M218cBXnmRKUBlFhgzqYQHsvmqqdcoNoh2RtYlhZpGlBD6huoPQrF/Zj9JLH3oO99IMQOIu9HCuvnsfmIjhdM+lsyafNwxnaNyWoTWOkiGfNSGGprhhkoztHbJIFLXiRpsS8LLv0rChi28bN8kYfu2pkJUtmkvD8KEg8M0l7vebMheDvMsgNl651gBQ+vyGu60BhpSW3c5FQwedORcTYy24j6avn09XsW5duKn0TpDIvbC8oBCyk7iWYij9mO+3SO+6/Tfj3WoQ8Va/PafQUR7aF0azXDnFlrDiYbzzPidxJCyfDougPI1XyuLLUTYmyHM/KH8ym3qrHMhzsWkq/vuuf3kUpVgE61JK1frf34mOlKhOiMDq4h/DjWtWUMQY6io26W3rvZuR79vUvlzQPRKFjeT/BOlVL3AJjXq0Lmu40PZ87tYe5wAkw1ZS81f7Kbg4LDnyj3hzGgD6CS703TB6P4k1DOPHe6bk4LAoEFmtGQ8+nZqm1gHEVQ+f6VcX+6irGBiimgBeF2Fm1XrZ6Kxza0BxWxHchN2O9bn5wr5MmNxINUFyD3DTDXtC8cZCPTOy/tAE4VtR/UV+m3PUN1wixyJ9F28rSNBm+GRRFHN5C5n+HMCIlMwJN3AGjLwv1SrQjRI52vCuBbUZjBhCReKOrX4+fzvKtkntQ0if3y0cPak2cOXDYwwkde3XGWmSxptOIRcdQVk0kxCF8SaKfO/P1Sbc3Yr1EHRxX4DUDt5wA== 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: 6lQpQ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ng/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:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752842 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011052.outbound.protection.outlook.com [52.101.125.52]) (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 BF4576138 for ; Mon, 5 Aug 2024 00:36:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818202; cv=fail; b=UowfN7z6n6vIAHy2ciQNBR2IuxL9gISKynmtQOsIH90AkFd2ddf5UA33fSkZ8pBaiYIkx/SsE2VsrXjJ9CiS0Mn2Y+y20rvtJW+iRb5SuNur8i9g5+Vp/v1GHdB/rsbIiX++qgCY/awmDhepFGuaiaVJO/WXInfk5EovQcTnAuo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818202; c=relaxed/simple; bh=twAO4m0NbFNEN3VdvY7CaSFGxPH3+uRvtg4VOT3L6wA=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=PBP9gRQrI00KJBnfuJKMlqUjakddKajOwMUYPLB2DQ1YXdWJyu3XbAQ6rnGYOdOpIm4FUkIj/Kr+Fa+Hhtc9oAKBUsxjlu2AsPyunzwxNfYB3J6Mxts/XZh47r/sBFBnTmt/y125OayDhdl5gH7BYVf58YFXbk2p3bPNhRxgTF0= 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=gUysYGQb; arc=fail smtp.client-ip=52.101.125.52 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="gUysYGQb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vGAhIIlsU9JHDKFNsey3DtnGKE1Ba/to4VW2BIn6bKUPOfBwKJCUXI6zzSoDZEvo4X6R81MZKHE1dTzmmf/DBVGCNLgbE9SFKOMYhJVKLs3e7GyjqhlZbRD/rTvNHcX/AmL/Fcy7gMp1qYOvtpvlzIQqrL9tq4VKxC3H0OddmaUFZI8GOApQT+Lg45ZttAuydiHDupRD9zdc5wmMUhX2Q1P2+VNhWQqSMxpBLxf1biCvxP7DJ/ufK0gq4D6ccsk1QNBVWp8shtHLRfL2HNvK92gn1WSOljvzMZhDB60dplI4hVTkCaY9ykZLJiZnTvRvZUIUIuLdbomn35/y4kfUQQ== 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=NM/kwySv9IWD+l5L1gOqEK4w0rf2dXzrAk6ErGxenss=; b=A27cGevcGNEQ47QPArGWkzeIrWyEYrl/ODv4cisUnT66whUNBmKNi4Lf1fMPDBOGWzmtl/TrqXx3ZefIHuJFBOg/ZKIymZKmanbXWOh4xAyBG/uJnmBAJ3s5/ASLP9lXdEqupgt49bnLE/KQvxpYkaKlPokUyESdQ+Sr5pvvBayj2SNBE5EToef9kQkVdA4zSDif2fkbO3dgRl7gZPO7gXONS1jxjwTgjcbHMy9V/7V+c4eTTqdhGw9XEiGIy6UpTOOoe57w/dU6IQEOjF8JoV4PMxuUpymd5XItcblvsgzbkq6wmXffg5JHLS45QCwf6l/eHo1JWgDre1tv4a1lWw== 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=NM/kwySv9IWD+l5L1gOqEK4w0rf2dXzrAk6ErGxenss=; b=gUysYGQb5TNiY3T1NwhouAS2E+YfX1PZSsnKrnF6HoVDbdPmnJgOsx5SqORY3YHW+cYGa8TW6iHSJnJxNUOiQFsXl8QoBury3XTLoPIlnkYf+GYmeupajjHwSO8uCKSjnM+6XYHajwVD1J/mE05tHpOb0c13kR3bWFwdVRsDd6Y= 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:38 +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:38 +0000 Message-ID: <875xsf24bt.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 024/113] ALSA: pci: rme9652: 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:38 +0000 X-ClientProxiedBy: TYCP286CA0324.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3b7::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: d7de162f-5c52-4444-b957-08dcb4e6ab05 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: fB7v60MMDM9AY30QLR1dpOJZ4RzPMUFcVnIixQZS81WJFO2LBCmzv6IdbUeAlDMaSsTm5LRHI4zt2Lg8OqWGzzcwbM0xWWmBs+Vqe4oEha2CBf8AODT9w5JOQXiQnV+QJSuZnGxa3pgddyul70rWmYg//lbd4E4XB60krMyGInjuUxWl+kljpTnOyQbYR4bQ98mYaNEvUJNwPUofzX71bqiHvN6K/Mfd/EyHc2vH/WSmzmxFMqrTB4adtc+jRhl09LV4rLeWHO4hnPg3KNz9ofNacCzVITU/NCkd+hEhGqKxLnZKup1EOjYF2roMv0SRfLl5h9gxXve+PIQIdUjoXMwnB0UVRpJKK4htQHb/mX08tuSBPDbdIQSMXoOSOHCSTVPfidWj7kXqEs51S9siCMi9Na6Ky9CCAdhv4V2P2urs48JIZ3FHcSq+p5NNwSRieYA1rd/L6bwBXWg436Jy0doErJQQBi17TfEk5nma+rKwdpSWLxQf/hQug+r/kckdtWNLAuPyQQYB6Zs1igbqdREIaRlebcTfTwK+IRz0V3/W9GXS+m8UkBY6WM8Tiaj5VCZWtRo+kA5ktF8JTokcT0zVLJHunFxtJ4A+OnLwJElD+YBL/VPfYrpPUvIz7zLKQcMr7uw5CYIn1m1zf/yfjIjFUGjgKCcaExuCyvoYG2GC5YsntDQWTC//jUc6CU+yLUOiUSovPW5TSFZlkUalYl8PsyR6AF/Mt5nFlnMDY6iO1MeI0RyJAwHLUKhv23T3b5gCwl/f9ZqKV45BxTQncymQWishaHij6l7+yY6Bp4shE3cVR83WDqn2PQbfiI9v3jkCFAvj6pYoRRhgCk2Bgvgq+JKmVcnCyMmx5VTwud9mHU4rwKcsXLblrHzFe0R3VniSrEcAcDAOHIBkXAW4VAvk7PYITInl0w56lmbQpSSsoVNfZ8Y8NDfAgPZQgBR17smDAkoKHxJU6VqzYN9qATnNFub04DXYURYyZWFfH+fsKRK45Ge/cahu5NYEP9DfhkqWJwsXrRODFAEyr/v9dWQSJ+Tcr3gaxmHEElV4ZoLDfx7mzYJ263kJKoPuojmkfjqOMjONZvvYjnTrfBqlR/WiF1WGlv+tP7bs2ekwqj3vjAS1CfqAuJ6e3JSLVVWtRzBWvwSpWNUPUXc2R1nUyT2u8rn9um3qcuRD+d3QC+srO8uYy3ZuB/qj8aC9LWu0utWX1S0zeJMj3QGQG9Mtm/+4SwB6JoHvxpnUA8AJpBtmt0He67jCGI9ywZJhyYT8c0fRwLEvsmXg+ePwF1RCx9fA9kNL3ZHe416TS0W1H01BN0W1lG4C0Nzzw/O/xvCZLgzqI9nlPtc/l8dCfudvR8SYZxWK70KvR9GtAnle494gMiCUTPWxwXykdnwGry2D/XBmphxUP/LwrjYk9iYT6w== 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: xr6+v7nrlStwAU0j6p/ty3RjVxpYa638o9/+ohOgG5Uus+cMP366wS9cT7xrI5hlrglXN5nvmY5TOh7OzcyJrLEo7J+mqqcHX7M+T/JpknnarIguf3RimkO3Nj+HNsBvO6yCyw0Ft03fV5Xp8w39V5K1upkFKpQkqOMjy4Bnwl1CA682Mml40vHif07b7W5EO0O7SLS60NwXz3ShzNqEmYBcHQSoJX4SETeHeITmla4rviYRQRzAu9o7VFl3wLy0IuGow1ig6hAWqHMgyFZRnhwGOWKQR14A7dqThmMC/PM2gy31N4FxA0T1wVHak9YiTmfEHI8+d2m5j3kwNLasQtegL7Dh642laiDx8vOCJlL9scxulAU1GVN1zWcxLhtzt1gcoz/fqmeX/K1JMjvtSwdagwmhL+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NvxDMwRnf28LrymfXUx92xAAAumwDsnk6xAPeOm9VVV01uhSysXctthFiML4PGl10SL48uxtI3X60fhiJEI9cXxT/ZwIhbmqYySelgFttbRYHSPBlqnrnW9+w8W844oqgs0Z3zwJM9FZXwBY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d7de162f-5c52-4444-b957-08dcb4e6ab05 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:38.5611 (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: FmXsIkgBYqT28wLJMWlmrM1kjMSmLePKyPOhva9sYDb/DCyrhYqrsSYMbqiGO7VdCyvW6NN0atajRnE5MhAAZdJm47OPdbzUHM0AKCY8FNLUsEjg0j621Z7A0JrPheW6 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/rme9652/hdsp.c | 14 +++++++------- sound/pci/rme9652/hdspm.c | 23 +++++++++++------------ sound/pci/rme9652/rme9652.c | 14 +++++++------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index e7d1b43471a29..b99f32d24f7df 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -3953,7 +3953,7 @@ static signed char *hdsp_channel_buffer_location(struct hdsp *hdsp, if (mapped_channel < 0) return NULL; - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) return hdsp->capture_buffer + (mapped_channel * HDSP_CHANNEL_BUFFER_BYTES); else return hdsp->playback_buffer + (mapped_channel * HDSP_CHANNEL_BUFFER_BYTES); @@ -4014,7 +4014,7 @@ static int snd_hdsp_reset(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct hdsp *hdsp = snd_pcm_substream_chip(substream); struct snd_pcm_substream *other; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = hdsp->capture_substream; else other = hdsp->playback_substream; @@ -4051,7 +4051,7 @@ static int snd_hdsp_hw_params(struct snd_pcm_substream *substream, spin_lock_irq(&hdsp->lock); - if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream->pstr->stream)) { hdsp->control_register &= ~(HDSP_SPDIFProfessional | HDSP_SPDIFNonAudio | HDSP_SPDIFEmphasis); hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register |= hdsp->creg_spdif_stream); this_pid = hdsp->playback_pid; @@ -4172,7 +4172,7 @@ static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd) spin_unlock(&hdsp->lock); return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = hdsp->capture_substream; else other = hdsp->playback_substream; @@ -4191,15 +4191,15 @@ static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd) } if (cmd == SNDRV_PCM_TRIGGER_START) { if (!(running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) && - substream->stream == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(substream)) hdsp_silence_playback(hdsp); } else { if (running && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(substream)) hdsp_silence_playback(hdsp); } } else { - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) hdsp_silence_playback(hdsp); } _ok: diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 56d335f0e1960..a85e09535636a 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -5465,7 +5465,7 @@ static int snd_hdspm_reset(struct snd_pcm_substream *substream) struct hdspm *hdspm = snd_pcm_substream_chip(substream); struct snd_pcm_substream *other; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = hdspm->capture_substream; else other = hdspm->playback_substream; @@ -5499,7 +5499,7 @@ static int snd_hdspm_hw_params(struct snd_pcm_substream *substream, spin_lock_irq(&hdspm->lock); - if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream->pstr->stream)) { this_pid = hdspm->playback_pid; other_pid = hdspm->capture_pid; } else { @@ -5570,7 +5570,7 @@ static int snd_hdspm_hw_params(struct snd_pcm_substream *substream, return err; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { for (i = 0; i < params_channels(params); ++i) { int c = hdspm->channel_map_out[i]; @@ -5656,7 +5656,7 @@ static int snd_hdspm_hw_free(struct snd_pcm_substream *substream) int i; struct hdspm *hdspm = snd_pcm_substream_chip(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* Just disable all channels. The saving when disabling a */ /* smaller set is not worth the trouble. */ for (i = 0; i < HDSPM_MAX_CHANNELS; ++i) @@ -5682,7 +5682,7 @@ static int snd_hdspm_channel_info(struct snd_pcm_substream *substream, struct hdspm *hdspm = snd_pcm_substream_chip(substream); unsigned int channel = info->channel; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (snd_BUG_ON(channel >= hdspm->max_channels_out)) { dev_info(hdspm->card->dev, "snd_hdspm_channel_info: output channel out of range (%d)\n", @@ -5765,7 +5765,7 @@ static int snd_hdspm_trigger(struct snd_pcm_substream *substream, int cmd) spin_unlock(&hdspm->lock); return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = hdspm->capture_substream; else other = hdspm->playback_substream; @@ -5784,16 +5784,15 @@ static int snd_hdspm_trigger(struct snd_pcm_substream *substream, int cmd) } if (cmd == SNDRV_PCM_TRIGGER_START) { if (!(running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) - && substream->stream == - SNDRV_PCM_STREAM_CAPTURE) + && snd_pcm_is_capture(substream)) hdspm_silence_playback(hdspm); } else { if (running && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(substream)) hdspm_silence_playback(hdspm); } } else { - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) hdspm_silence_playback(hdspm); } _ok: @@ -6046,7 +6045,7 @@ static int snd_hdspm_open(struct snd_pcm_substream *substream) { struct hdspm *hdspm = snd_pcm_substream_chip(substream); struct snd_pcm_runtime *runtime = substream->runtime; - bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool playback = snd_pcm_is_playback(substream); spin_lock_irq(&hdspm->lock); snd_pcm_set_sync(substream); @@ -6121,7 +6120,7 @@ static int snd_hdspm_open(struct snd_pcm_substream *substream) static int snd_hdspm_release(struct snd_pcm_substream *substream) { struct hdspm *hdspm = snd_pcm_substream_chip(substream); - bool playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool playback = snd_pcm_is_playback(substream); spin_lock_irq(&hdspm->lock); diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c index d066c70ae1600..84e18197f26f7 100644 --- a/sound/pci/rme9652/rme9652.c +++ b/sound/pci/rme9652/rme9652.c @@ -1833,7 +1833,7 @@ static signed char *rme9652_channel_buffer_location(struct snd_rme9652 *rme9652, if (mapped_channel < 0) return NULL; - if (stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(stream)) { return rme9652->capture_buffer + (mapped_channel * RME9652_CHANNEL_BUFFER_BYTES); } else { @@ -1903,7 +1903,7 @@ static int snd_rme9652_reset(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct snd_rme9652 *rme9652 = snd_pcm_substream_chip(substream); struct snd_pcm_substream *other; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = rme9652->capture_substream; else other = rme9652->playback_substream; @@ -1934,7 +1934,7 @@ static int snd_rme9652_hw_params(struct snd_pcm_substream *substream, spin_lock_irq(&rme9652->lock); - if (substream->pstr->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream->pstr->stream)) { rme9652->control_register &= ~(RME9652_PRO | RME9652_Dolby | RME9652_EMP); rme9652_write(rme9652, RME9652_control_register, rme9652->control_register |= rme9652->creg_spdif_stream); this_pid = rme9652->playback_pid; @@ -2056,7 +2056,7 @@ static int snd_rme9652_trigger(struct snd_pcm_substream *substream, spin_unlock(&rme9652->lock); return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) other = rme9652->capture_substream; else other = rme9652->playback_substream; @@ -2075,15 +2075,15 @@ static int snd_rme9652_trigger(struct snd_pcm_substream *substream, } if (cmd == SNDRV_PCM_TRIGGER_START) { if (!(running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) && - substream->stream == SNDRV_PCM_STREAM_CAPTURE) + snd_pcm_is_capture(substream)) rme9652_silence_playback(rme9652); } else { if (running && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(substream)) rme9652_silence_playback(rme9652); } } else { - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) rme9652_silence_playback(rme9652); } _ok: 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: 13752843 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/uc5GHhsGLwhp84ulsRjxYYGpVq1dte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ZlvJvLAPNUFIeOi211jxluUQWV4SKbAaD0hqNciyRPfFFTDmyrdebdmEuzbJUJEIGuaXbfpxEZjxZOgAD95qH6nyVrIHg1hYOWIYcDpQFMkLSQdE+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:36:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752844 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011030.outbound.protection.outlook.com [52.101.125.30]) (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 96B9A4A0C for ; Mon, 5 Aug 2024 00:36:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.30 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818221; cv=fail; b=LkYqln0woXGdV8/W5vArfqSOM+YQ02YyR7UhxavmVrTYsfxae7hjlAdTwKHJ5tqqorw3ZlXhLa7q33wKFU9PE8Iu+tXTASq6Zn6K2re+7i/Za6+Hys4raJ7WqZkjPSUFheehYTEwCyrVGCZ4rF5suvZaEXdMaxs3jyz8O5/zy/8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818221; c=relaxed/simple; bh=w51gyK8BRji5NWp78Yy/p3fxZBUPFXZIUKoW9IkJOhY=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=iDk/n+5g+2D4LEJ7WVtTbbUjabacSjXQHmuHal7y+cWR8z4djIu/A5o1TcHr++yxLtQRisnh27pifexcAvyBugx00Cy+44JwC/pIGF9YvgGXBM3ZcqjwpWxRbhEL6SqApzkfLQtxnm+sVZVTQaGQLZJm5KNm2oFKYSxxSHftm0c= 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=AOvPu1lH; arc=fail smtp.client-ip=52.101.125.30 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="AOvPu1lH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tCREf8kbhVwCgPAK9LZW13RAqfPqbpSt1V+qFokOW4zobSGTgGfzgH7dh8hzLCpyRFjemsHDvxrXNaOojRTIWejZxpmtOexNkd5k5r98m0IVClRY5MJUUth36U0auFtyJauF+Bzfpv2AIf2p7v5n04l1wfJJLbfyEpBrrVir8+BoQPPwUp5U9cZXbJkHiHG/M1IO2T3qOFJ4C9pR0jPx55r6bHfzraz4AF2oy8mAyLcGQmZjeR3I/Re6ss50bkdfEj/01S1W+gJM2u9T+XSA6mSCeSpuZLXrckAelzoZFB3MfGqb3oFGCtkn+ZSBLuec2eblG//tVI8oAnLi5kj3yQ== 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=o6E14dl9bU1XSn2qQdzNIJIGFp605SdCrlh0Wr0lhog=; b=Xo4dPkwkecduGQi/R/E9uqXKwW4mgk0Eyp3HJ5iNsVRdjhoXPm9NZ+cbNqwT56U+gLf7YOufVKPRpOAqn9B/CgByDs8tEi3DQUHf8asfKDqVTaWZP+3xlg9V5aonWgFMcUjK2aWkQFDRBpWZyhEVKMhaoXeg56019H0etCse0rqtd08Fl9cqFMTk1epTxyBodGQtIDvHd2VZih8EEMpGrg/YDVM8FSijRIXGy/4SZZWtsLxaIMoKkWs8JjUGcOaB/vSV9VU1cR+g7Y02UmaZPbnn/wQep9w9p4xMLcMtc3veZ9sZZdWTOlfiNMgY+dYHEdFEzPHrl9R7d4uupfWfUw== 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=o6E14dl9bU1XSn2qQdzNIJIGFp605SdCrlh0Wr0lhog=; b=AOvPu1lHvi65U/38lyWQLhJU+lTNm+BgmkzaYbD/vZOe3iOUbI/8qaZC+15dqyfYRtTD+Io5qOaFZUARF40I8OWUZ9MsHonlHcOH84mL3t0BFGXMemNsnVVTv8WGVoXYDs/f11+PDejosJigXucmOLrrq2jFyJumHnfiNZeG3uQ= 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:36: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:36:56 +0000 Message-ID: <8734nj24bc.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 026/113] ALSA: pci: lx6464es: 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:56 +0000 X-ClientProxiedBy: TY2PR0101CA0017.apcprd01.prod.exchangelabs.com (2603:1096:404:92::29) 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: b929793c-0c93-4216-920b-08dcb4e6b5a5 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: tMkKsSb6tHvwFOA+K0EGtFjmOKIhFydnHl9/O/XehUC+NiieJA+A6Vd9ECfBsmyFwXkcUN4jzJ0xoJKLFCVstktw85XZs0ZjxzLKWCLi7vm7wHk9XcMvxMFdQeCeR/QuSKf7x8rrxoOhgHQoTRQ6Q6wHknwHWKBjV1DV23ebjE5shfheKjdjm0S6CcIwjI6NEDx8Qx5YXuZfl2mZTBLQ0bPsqj1gmF4XnsWxvEAATHwCTWHsURcQUTRVBlHg73O1MMJCFWiqIasUr771eK8CXQMBRcdV3uXGy714u90ybKjIct6DS9TnZrU12+8iu4GrD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zAKFoXEl2SFhYviG/dglekG+u6I/qV54GB9vw1Q7TZcew== 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: KOIu/zavegrQ2uJiisuLVd+Ck6mLDqS6HuormBD7XgDs7MSuJ03HEun9V2hPQZcfQDK7/E1WdiGRjlhuELkeP+vp8OIDbcycaH5l2HSOKe26qTqODaoSMA2oOvym0NhsdDZGf/oHybzvoNIlM4ZzrGISsbazl6mtz2iRryYAZPxWVtlY4rUXTymx+YUZii7pPmzhNaaDdx9fv08GlgtZppytuFZ/owJ2T6ktZyAXioTqOOYRoEAZYXZ7wS7Z+vmresLvyheckKOa1KVePX/pv3ZFOHbSQBhgH6fDJzU7LkMo/qahBhYHQSAG27cvQRCmDtz6sXWQAYvdnLuApP67sF0WK8dIHE1ysR3gqYOc3Eq6kXSURtZ5ZfmDzxOLr6tj0jfPZ/Wh7q85bGLPf24FUJsegxRc3e9nab5n3VV8iNHZY6GW92On2oDWcv/CXfY7Dc8pLZvQbuD99RN8C8H2XDfQdVIkT+iO7R5XD+z/1tbEeryx7OlmAXcoDoS86Os/PDfyHqKE/JC0sX06HbYHiHMEzjqqp6oU2/HxOUGPszax7zu4sd4tj2zRVE173lHy7SoTYXciRWqvQ1le0APGrxSs5c4TWbN4dmar6GAl0/7X84Gp0MJuT/bcs9+uoxF1wjFMJwoj3k5ykz0TkCG83QMRfFHRDhYQxWD7+NJDxK9DyQG6FqkwurwZSVTq3Cs7fMh/cuzIt3p9iWs2oI9kbS5M52+O1pt43tCiStH+PLBQSH0uL1YWBlhANv78yD7KcQMfj/0qHGgB6lYD5YdqfWvxND3xrW84/amk+YD9t8iRqiwpW/Q5nwVNGnaciPbPUD3NeFbRAuwRvSVW5zTUMFbNEg324JMOt+sdwjK+ZUiC5NvKDBiseSwbgyLW20sSbcXiAjIJCpB4WqabuumMUvuIfUm6hCU4cNr1DFw0ftQLPb+3rpzdSEtki5O/VHkG3Nv55aqssomKFrRCRttTRtc/xPKrcvnmoRWK8CphcVUbHlmGjjKihyKYgKm79hsbzD3D3zihktHPiVTZ9Rz0dSDMC0FUgH2jUSvGAMSERdvpaV4yQ+ZnxBq8zjuFNZwMZ+56S21/7m6vHto8nYxUzUl5Ruic/6WDKrD/KdKDdTCSNo+KGY5IxYhuXygpI6Zk11W01cO8dzE4SSZ9y3lFwSnhFlb+hXRSwYe8QtSEWgm8rZFYNWskXwjN7AvckBtkK2Hi/Ji6Xcvsivd07Majnxz4MlndTTcwiCS1NDci0B7bQgyP81TpxmNt2IF5Ovpxo4BLRqciHIfmW5ycs1WjNTwx1WIT6XlVquH1JD46EhcIS2djGLpWW6q/XQp+SIg4L+eZsAa2dtDRZzjfPFpedeBwtjGqIIzKHigCQtzTFi2PWClwpzbHntWrmt07847nUYdSbwBV0hvBi1HKY1DLL12zX15wh6Y3M/UxkgGQO8PrqcHTOesJLlj3lNpqQoXxHcN1O9rCdwNPpvbJ/mutsg6Z8XFhAGkYgoJX7zklL62pV1Xq0iVAYm4RHso+A0ciUgRoP64Z8WvDREbSdLIrh3/PMjUbmN4J0EFPpDyAA86H79GYP9e1N4oV4duzOni4pHpBgK/52FthyKwpZJLtOMfmnwdBQl02NrKwB5ohhHM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b929793c-0c93-4216-920b-08dcb4e6b5a5 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:56.4726 (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: LfEOWjBmavKJVb2p6KpSAVfGvtmaH82E5ZVaFg9rEQ8Z/OcNkG4svjJtY3GY6JC3VoBH1ViiUA0mVDkFkKU0TWQPuDI+AyK4UCRvmvpKyaGoGPFWC8Nr+Lzg4f7ICwyf 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/lx6464es/lx6464es.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c index bd9b6148dd6fb..721b4ea3103ac 100644 --- a/sound/pci/lx6464es/lx6464es.c +++ b/sound/pci/lx6464es/lx6464es.c @@ -98,7 +98,7 @@ static int lx_hardware_open(struct lx6464es *chip, int err = 0; struct snd_pcm_runtime *runtime = substream->runtime; int channels = runtime->channels; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); snd_pcm_uframes_t period_size = runtime->period_size; @@ -124,7 +124,7 @@ static int lx_hardware_start(struct lx6464es *chip, { int err = 0; struct snd_pcm_runtime *runtime = substream->runtime; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "setting stream format\n"); err = lx_stream_set_format(chip, runtime, 0, is_capture); @@ -155,7 +155,7 @@ static int lx_hardware_stop(struct lx6464es *chip, struct snd_pcm_substream *substream) { int err = 0; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "pausing pipe\n"); err = lx_pipe_pause(chip, 0, is_capture); @@ -186,7 +186,7 @@ static int lx_hardware_close(struct lx6464es *chip, struct snd_pcm_substream *substream) { int err = 0; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "releasing pipe\n"); err = lx_pipe_release(chip, 0, is_capture); @@ -268,7 +268,7 @@ static snd_pcm_uframes_t lx_pcm_stream_pointer(struct snd_pcm_substream { struct lx6464es *chip = snd_pcm_substream_chip(substream); snd_pcm_uframes_t pos; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); struct lx_stream *lx_stream = is_capture ? &chip->capture_stream : &chip->playback_stream; @@ -287,7 +287,7 @@ static int lx_pcm_prepare(struct snd_pcm_substream *substream) { struct lx6464es *chip = snd_pcm_substream_chip(substream); int err = 0; - const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + const int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "->lx_pcm_prepare\n"); @@ -370,7 +370,7 @@ static int lx_pcm_hw_free(struct snd_pcm_substream *substream) { struct lx6464es *chip = snd_pcm_substream_chip(substream); int err = 0; - int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + int is_capture = snd_pcm_is_capture(substream); dev_dbg(chip->card->dev, "->lx_pcm_hw_free\n"); mutex_lock(&chip->setup_mutex); @@ -515,7 +515,7 @@ static int lx_pcm_trigger_dispatch(struct lx6464es *chip, static int lx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) { struct lx6464es *chip = snd_pcm_substream_chip(substream); - const int is_capture = (substream->stream == SNDRV_PCM_STREAM_CAPTURE); + const int is_capture = snd_pcm_is_capture(substream); struct lx_stream *stream = is_capture ? &chip->capture_stream : &chip->playback_stream; 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: 13752845 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/XfAADSRNAb+N7dk8+zA1xW3sS6JiqzopWVFuTmGK1eCodzTxPugt/klUHLXbgXuDuPtpjjM1Ya1/3oIToesXDLfbvLopqbd9/fKyK0Ir/oX1kH3d6G7tbFlei17lAR6slFJdHF0pqOZlod17lKI49IOi720g82ek9kaEfTb8azf7IvQzKOTTzCcYaMGxer+ML4TOcfUhHrxJ4yJocUmBuAS6rzsNeGrssLo0Gs0VTFiNAxzDNehjtSNHypEYMp55lQW5AOSAHOxUpJfioIwmKB0xZBPBGIzBW+1bt+b3slufB2fJp917B+pDgPBhj08vQnW94ar/BRG3jPF4mheUonK11fv6C6S2qcWiLoWvX09aDrt8RHRTcVnRL4AHw0G2Kk5xk33F4UmYQL4TfnXKwq+WFaHC/us9KMm+ca8wEDsoMjf95tV7wPmCajSdEO07Ois+KncplSc+T1zSZhHUPedD/0iyOh/k+xr6QgOX1Yg/foVbcxYy60vCenwFBAFsDC487GFNgk2F4Nu0RKdupfVuU3y6nSB/6M2C1FqCwsjg94czYlz5+8kNE/398yDVHj/UT8H8qIr0sGNfdSjiOSFLqWBTrzVYZRLHEDPEe1uyNK3FvmxRjeGb0ErW/Lox8VLntQENHIOKXBBSYW4sIRsk2tlmkhaTTCyQgM5LIsWESUAPBxKJNsRbCcXyuttGdY0ARsGQG6lh9gobwiI9u7SQ9qtjWx5XhNxWlLsjNARJVYO8kk3azmTmqwam8RY35CTgjFP8wawPk0AI9u3S0noRwvHWASytflSqv+lwLrOhGnMOFdbOpMujfKp6jn5lHNwsosCc02LkWcBwNveNaL26v3Bu8iW3HgXv4DOo/vE8+mxO/Od7qISLN69fRZBggWAhIiN8GThsyovAlLU5LPEfoO/rpOJsFXU8dnIF5Sk5CV1UuMLU1q4kusVjLTCo6/Pbd8vKg7YvZX8KQlx2IvQe8XIEMTL0jlnmkHptE7Gr9So0RPDyoWxQwyGIfc4yhP5FJsCta0Zr53sCKfugbB4FKro9UXq9pmC9z+iRV3D05gR8QERFkGReownW/h+Q== 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: 7kGw2WNobXcRY57KUbfRe2cWskazxEqm/5KQ/GVfn15xTKLYa/PxbG2NL+GqHcWbFfniSGDhDRMYCZlRvl7RSmniGj4hz8tlhwC2BKbBnsx8zAukmv82ozkgISgLix2/czkRkCl+AHPRbWqxMnviuUlLB+AkZbcsk1j+Ryuq9SyOiF84GmwXIXtwqqcNmO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7zM/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: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: 13752846 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011024.outbound.protection.outlook.com [52.101.125.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 027B2BA46 for ; Mon, 5 Aug 2024 00:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.24 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818231; cv=fail; b=VRKR6VUOSOWzgdAAnx9y3QwfTXpk7YDrsEj7+SSvHJDiwN6aWZ1X3otYlveB2GdtCL9KVTofxktth25/Tt/TW+o4FlBBHYfH/QCe0F8Mh5LnhpRJ9xa2VIFfGpARjsI/imYVaNlcTlxJqr9OXk2j1HPYxJCc0JBySAXoIbr+QgU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818231; c=relaxed/simple; bh=BYeiGQPqg8A1Pf2Fd1CwSq/SeOOJX2AcQtG/jlKbp/U=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=j48nugXKzJZHrvIMOBVtrXpyDIHpqclBpNC3zL/BC896SqGvkGWJuioz7/5k3osUcVR1UA0FNdDbErHoXSLQ5G9HkHHqG/3S20Ugv04C/z75EJpA445LzbC+zso/ylSZojng65ao4rGnGibAqAttBMSjhZJoTMYfTVhecQHy9Gg= 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=hn8l9NhV; arc=fail smtp.client-ip=52.101.125.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="hn8l9NhV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=O0AWWJWUBzQmJhWr1tG8QvOuKSvJnoBGFWRofZR9ipplSr+uSkj+2vUFXyK22l/nDpOCXPi5et460O9/bMmMzqjL8TSZ9cv+fAjS2zBV73frCoV9VkScPZyXAQNLLEPzPwlwH8yFBYm5F+6JgKJfhxJhhmjaPwNsUPCJjdpRm1qSQDpy2+YUqNQ80lNYKf0rmWnBkTQMw7aFPWyRzZKlJgiRqIyyizMaMB0RBeJxgI9sQj5EJKK4VCqolkMOC44cXH7hK/cGk1M0aXljo7yL5vdDNEf03qytyQTUGLsuIbeEOmQHZP9E7l/Wshy5l3xuGZLVF7yv+srUwtIU5nMWNw== 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=7H9u624bX6d2+JJGw1QV70upFuFqYwjbDQqa5wQRO8w=; b=SiipmnsytoR3JOsznP+ZdKIj9S/XskEhpME6CV9v84ETSh9ujQ2dBJ8j45FEGvfyk4dI44ZAUehg7vlxQHVVpm6kMs2CEybY3uDQ9zuuaQBKBjnt3++nrOLqhM6rUV2MyJ74X5E9KVxlnlqWZmBip/3RF3VWml7dRqhXc734SLZNLpjCWhGje59aDBmeeibJvdTo6Q5zeYqkkO75N4KlKceKL/5Jywf0qSPi8x0B+vt0+lAs7wVq9VpOTO/lttBjlXUCYvAgHtrBN7y9fdCJpfTK4/zgX3W2zu92bpYeJjkbscNnFEHsNxAZ5MSNKPRD1fgIJtZMdLYJGvhBCjIVuA== 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=7H9u624bX6d2+JJGw1QV70upFuFqYwjbDQqa5wQRO8w=; b=hn8l9NhV9sKRdHwZ8iX3g0/PSPVDoFds3Y0pygPqF+Jy9S7+XZrtXeJzqSWcRxuyQfA33CklbM2qHoDQW/w+wHBmok7vP3yIYNajnWDMjynPKoqWOlTAPSWqMPMa+6+nKl+kLTbZbppDTA4dJZl8pSatrGXNq77hBUrGpVY1wQM= 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:07 +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:07 +0000 Message-ID: <87zfprztxp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 028/113] ALSA: ppc: 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:06 +0000 X-ClientProxiedBy: TYCPR01CA0195.jpnprd01.prod.outlook.com (2603:1096:400:2b0::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: f18d231b-9bd6-4fef-b701-08dcb4e6bbe6 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: X15R4aJnytKjPP8Ht+VuKXdV0Utj6m0nnQs1pMvMZ36hYyukFO1fAVJliEzGKjYm5dehZODemd649VrtCtR6TJ3k2hpvVrqYmH9NxFq6jh5/n7tyJ/FiF4aIGsq2TAdD0UBN2yp0hvKP2KqXmV84KkrxL3ZmCGOj2AZJseNGz5BHcymWvwVUG1YWDKBZbTwcllouzkCclVg6TprrktsJpMo2H28i27v7AQLU0Y/Ve2oGUif5Qv319cxnkzNyCqGT1egoM4KPmtzb7pmHOiSvqW1gCRoc5hyfJKlMNOV12sNuBuTVChEAxfpPbOQbzwKjiRbwfRYTmprx31sCZZ1R4vJGpoP2Yy1vU1PA80ngaDCBtQwWWw3h/XWEDphPOEAUOItMOb9wsYmeg4dENb0hsuMQsaakl4d5zn+WDEifyotP59/jGK6YdTCaAAf6JYpyRsPE89HCsuW/Al6i+WIl2TboK3tWrYU4AmpB3hNodRGeQzVNi1zfojeNklZfTPzE3EiPgGKkQMTyY2AyybmsTlVI/yhZUD1uFQ4vuusdbK9each0QD0d1fD/ox2RSMBPslZrXjCbCIxIrQQviv19bjOuN2UpbpKWf7X3RQZ+RyDIgsfLpLODEo8+Yg8xOu0YyywEtGNS08gHKnHEil2vZYEz9a18F1JadHxA3O9Rko8ZmEhp9v6OV9mgOutqYFBJVUlKatTFqOIHI54tVfqAoryfWAqLbAaoqYVL7nhECunfpTu3tNoqV6dHv2MJ0ecPOpLxc25m2AE8nj7D9+TMfVHP9LatKVXN55SD2/3HJbMQ7Re9eDRAyekUrmTkleEsXudfTmupFGmKXRAMXrbS1cjLgCRtI7wQFnskUzU2TU9Bc4DAt2lnKeP5afEk8vufIgfhxxde3EHFmp4cgTdAmy04VpF9hrY3w6BUmcj3lDYc154HXOF7u/uQghlwC2HocIailMF/vUUWEyXHyTHcdGNLM6yGFJmu4u98PuB4FZyXxLSjIg/4mZhnIllWnltTh8wYL/PmrZEILwXTL5fvTPswVWR7dtKuYC1ciETvrkb0WFOheYW94caEBWdUsZ5dmPg8qfub8XrLd3CqPEzi2TawNeJ1jG9rH/14GQbTq3f1soSqJSP9yPxMl3tGRaiQtYhtP8aHwuIR6tJ7D9Y1DnQsboQecScVN9RZaLg8hZ5AzNe2J606yn9OM9dJrCbf202VWN+vC2BfFE2ckmX4p6K1qaRN7LYwLuhw0eQRlCOO0YAcBDfon1sC2VhYXarv1m+5g1gXcbZPdkIGGd+NBjY/C9+73W2JTrA23y08LGB60+IvN21z/eOycZrw90u6ulRH62CMPIjgY0xTYQchBhplv0nJkin6hc2/qvQcDavurymZj/TOowvkmbCB04Fk11q/v+AuAAmEcP12z1lQ6A== 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: beHv4ea38EoxN6qkbYhMGJPr4hpckJaVV07pR3h8PmelwaHNiNbojFWIiSE7miKv6JTTr7rrhExqSiDI/855qBZLXD2EkZOLzsN3Kd7OBb/eb7rZ81tDTlya3GyBdJoBLACXIE/YbVpQF1DLTi6ob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DOeOLoC9ZZ9U9SKiHi63JwEUcruc25CeBYkIUT1Fm5NVxu4klO37wbcZ03Ionv6wHUyvct9/QNaL8auvZEy+1EbpUnxK14fgACeSNLQy4gTXouYohFPGaUbrhNRer/F3dQUFan9sT/vFH2iyui1seznmn8GsTKEHfHYoTyPY3elGF8lyZPWx444V/z4cd1vUBmN4MqEGn8ihJbn9DftzMz/CwjWZt4IJKlks+JNbk97767ARBs7onH2kWiryGCL8ffNyC6S70jnDscFUBPcIkQ7i5HnslnwYGD3qyc9Vv7yOudrYodu9xdqIqjAcvrNzaWT6g/XRqPHzG3zbmFajOTww7LHvDcVsmxbhAjtRpupgKHeiH7ehbE2PFvwBzO1EmPvGDBeTNl2DzLIHfe3ZBd2tepfo8LZ7Lx50= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: f18d231b-9bd6-4fef-b701-08dcb4e6bbe6 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:07.5328 (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: dzeARkYb4JWgWnyxqE98ie97TErHCCtdOg0F4XXm84SLJXSufc33gGv8m+Mhv0TzlZ5NH0QRdwYvyIMiDUogDDJaju6h7njoI0TAPgwdmUxRHvdmDqt+ex+SjV6mWALA X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/ppc/pmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c index 84058bbf9d127..168c1e2535faf 100644 --- a/sound/ppc/pmac.c +++ b/sound/ppc/pmac.c @@ -103,7 +103,7 @@ unsigned int snd_pmac_rate_index(struct snd_pmac *chip, struct pmac_stream *rec, */ static inline int another_stream(int stream) { - return (stream == SNDRV_PCM_STREAM_PLAYBACK) ? + return snd_pcm_is_playback(stream) ? SNDRV_PCM_STREAM_CAPTURE : SNDRV_PCM_STREAM_PLAYBACK; } @@ -251,7 +251,7 @@ static int snd_pmac_pcm_trigger(struct snd_pmac *chip, struct pmac_stream *rec, case SNDRV_PCM_TRIGGER_RESUME: if (rec->running) return -EBUSY; - command = (subs->stream == SNDRV_PCM_STREAM_PLAYBACK ? + command = (snd_pcm_is_playback(subs) ? OUTPUT_MORE : INPUT_MORE) + INTR_ALWAYS; spin_lock(&chip->reg_lock); snd_pmac_beep_stop(chip); 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: 13752847 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/TafvHD3izh3J6gYuHe0lENPMqyQGuvvIrFl8oX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9UEOvyyi0t9SIjNjNJLSDS3qJgLSSvcinL+CUP9xvCT2z13Jy8yG75S0Po6TSmsibjEZPB3Zt9lJnNFch440yc+P63YSos9D5aposB5dcxp0CC1q81vuxWXZVE6F/r1EP125HrL3Fe1tG+PYZOe75J2E6OFbHTzm+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: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: 13752848 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010017.outbound.protection.outlook.com [52.101.228.17]) (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 C92A6746E for ; Mon, 5 Aug 2024 00:37:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.17 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818248; cv=fail; b=ew0dBWCJElAwZKczTTVoE5CTa2+4VhmuTAHGk/5WCS+PkySCQLUyUOK0etrzIxKKfudv3sgp5ZeaKuZde1QcL59LRoAAaqfspzI3lRaZjPk6h3yB1geiXMe19gymz/LeospTiqfQ1WoiWdYiMoQIGpeD3xkf2bwjU+7rycVIYIs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818248; c=relaxed/simple; bh=nu9nZCnytCGQ3zFB+ND7OAfvLYFH/QXRJco+DbjfDc4=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=n63L+StuvVJ8juBrNHRvjKBodNr7DTaAD/TOM3gvMperzHS+tAIhKjh5RynQGJA1L4ypYtqowyr83nBMt8kd3Ka9F/UHQ10xuaj7NZgApE4N8lYihHcVQpc3bNuRaR2qjOkUuZz6+/mSNE5xWg/BhrqiMAQBnS0K53Mu6zBbnIc= 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=gmeQJAee; arc=fail smtp.client-ip=52.101.228.17 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="gmeQJAee" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vSNjL3Me8cJKnlzQ2VFN6ASsrcE3XzS9hUis2BkuoCpRyw5aG67uAdlBwWCZQ9CO+bg+Frmy5bJxRjYJi04I4lg3XL6JMob0/ZF/XhTnM9NXGg9B1rRmmjZxa3RBhNtjSCvcCbYQJurBwPOe8UULN9nB0+R3IpsPWe4btosllxzEWde+6vwae78yxPPgGwPnJZoDQU9y/nYFR/WMj1d+z0HtjWwR6U7FPZOHQwMxPU9MOJ4yVEh/FS1WAZj+kE5D0KmRz4VDlKWzSRis2I4tk7KZLKyiBPxzgql6wkLdwfi7Vx5jsdPYJnsMhu9a9WeCuIM5b00h7QttHe//Bj/OPQ== 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=0LiorM7f5Ed/k2NXaSx6d0E558k24LxH7cojmjiBMkE=; b=Au/JXKOtka1TcpJNP2OZ4R3sfwOGdXBPtyuzRD6CPqUCholwfXimxEde+Bw+mL2qOxwEmCdIbiDNg+W13GsMgZNQK/gWEfeqs8khtoH2N1hfMwpQ+BdzkDhN1w3mH7F9vh03ZlluC7YrKVoJNGfYuX6K86cgNJrekFJMlKa+FCFPYEVob0ISAYGbwyWwgIFHzOsuQ/kR1qLBrqohm/13cVaCYq+PQLAXwO6F3PTrZAx8B/t0Opgkh9eiREDhN+gc4QVjQUoeW2LB25JsQ2oON06hjJyVHsFU7YgJrYTeNrh8Tom3bnRprSGip83K0uqYaD8oQ0It/oOmm1svrl8goQ== 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=0LiorM7f5Ed/k2NXaSx6d0E558k24LxH7cojmjiBMkE=; b=gmeQJAeeovyjI/PTiCKUyGkjRfurmK7Bo8WGpn+AqrwZ4dfdFRh1ugLdaAvZTwrTDG3eCqX9e1Ae986mz1Fgw3QHQwRadvV5MShCyNbMPP15rcslwD0hzyWo4ySU9K1d4UUQ8RZ0t/u/DvSK7XdmSy4p0Uc06XOu4kBfgJSF1xE= 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: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:37:23 +0000 Message-ID: <87wmkvztx8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 030/113] ALSA: core: 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:23 +0000 X-ClientProxiedBy: TYCP286CA0137.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::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: cc53b765-5c6d-447d-9066-08dcb4e6c5ef 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: aCiTYSEnTbojOJVUBzXDPUXRc0tQJVDwGWPc9HyBRXCJiqZGsD5mHtRlgqraYpSBOpS0SCzQXQZ3DmEn4vkIUEpMvH2+o6jJvO5uKLARUdV3xcvgBHDmIUz8Wsw9vpTLi9IoasPbV209NhUERgPAlVUAgkyksw3+34kSP1r3g6M8Q1khjzNWBIhB56VfQ54mY7O8c/UYHlvJJqM2nJfim0XDcJUzPZJE8XKLIWfkC7uFytS2iCDaK5nT6B3ekPnQ+J1MMi+SxIR0Cct0gFNooQMNLdbexghTNLJU5QFb1CYn0RoAVbmMBLY5Es/aNJPze7v0ZK5Qbf+r8CW6kqad++pFSiHDJf++pU0UI89vOqmFqWd3zYaUg8ziN2BZewxWyw/DOGdKmyQaq7Pwc9SaYGvr0v4e8jDz8FiP5HP75ocMfyIyeea9kB9u7V08bdjcDXDxATHiMmxGaDtWROErSdUV19wAYRaKd6Qhy905Z77ui5mVnmcKLbP2H5lzOxTYpmVEe5G0GWX5HdYVYxveziltDFFjc5/risnuUYC1eG84zmsuOI0OsJquklKTmrjJzTAOH2GXmKAuqf7fsyj/hkYMPjFy87Q6bLAPEK6kf0/MlepJkCk819ouUYgG5BlNyLMxZ8nu2Bfxl3h3meA/wV/0/nGWSrsAIN4ax21nB70dosisepsnaxyGz2mq1JQ4GcHh7rCdVIkHcLt0qYI5mKLqCDvtDjDNhbkHV20Q3boUX/oqXNLQoSXBlMDkhs7S3mgcKAMh5x5c/5M2Ou8WrKq+h8brQ3Uy01CWgyjfAG6e4x0MPaG96OQi+oUkqcVtZ9q0NyIyWdJQvcVHU7Br0fpO6dhi4Tr0C5egeqLHClH2satpd6hUmeTLkYhP7cbPlgKRQpGrtT4qy1ldtxu0Ee/4/6A2jXy7DxIN/UUG09uTETY4taYTrERX8gzDjGsv5OXVjLmvCyCOrc5/tgeRPcZqF8jvpEJ8tCmWEFb6CEZYS4m7D4TGQOfg4WuPtZp5eCgTGt9a2d6/Aw4SOWRoUPcO61eX3bGNck4QRh0E4il5rMbi6f5QRfaZRp/aMsRgUdBf1yJ99vZJeSqTGXwldAlC6WxcwCho6QY2qan9oRNaQZLbTLpJxs1Hl8ZebzdVRXFip3Qga1IKK0XJEs9HWgIHctz2pw7CNk3lzjdXOjnj35XINnrV1ID1utjQr9YMlvTQOy4vpKKd2wI7CfyudKpBzV+/AX8K+1kHyK0lobzyfBpTYWx48ybmlZV+9wmNqCr0SXQ2jwJ8uA7nmXF2N/BRFGzrbXRu2v+hu4YE3xjgqRD7D05j1bMZN8DHV3D5zTUgDqPsV2AUcEGXqttBPMLQ/CsywpdpVRP3N7cckwevtiI2ZpErJNkZpkxEdQ5BUg5oo5hZ4eVTld1g0E8dIQ== 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: 78ipTg3jJ3KSBMZMeWrPPhJUSFrmJeh5aWP31XrS03tW/77LWg2OwokmDQ4bPSz44fgGibFq967K4p+593g1EKvHMEj8h4+CxGUHS9YVwRTz6ynOVN1ahJD9xE4yAdjEGtvELGNLumGax01iIsqi/74+d0mP4hKj+EE8jRTHTFbCTugbOAQykcxt9DTkg4B3EoZAf/dkkRbctM84ujxbMetG0CCzpQYt9i4f+vdbM0aL0BJIBtwks9j+qpjpPUIfNtJ7Vk2ilq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7utuokbJqhasI5Oo++TonfhhPyfncSYp6dWehtbZHgBuDsmDNaRvFv7pUy7KB8O0sEEcn9hin/PjPCZm+iw9VygdnfvANmRnXKHMy6JAhCIYaUiNiLix/qpeTjnqTPsmaO8OVbBTaiPqySzJTK4R85VCrfGHbTL7iCo6MstLW8PjbhYHivQWmNGpRYHtvtl68h5MvTdYXC5cukBflSpS1HuFPg0JiYbnDvye3E9d4+VOruX3aErwZz4NIxZy7y/D+3kUXQ0TFxoXD9eTg4s0kdPcwobgcDRyKm68J9E= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc53b765-5c6d-447d-9066-08dcb4e6c5ef 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:23.7358 (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: bKlUJCE/6o+t1xA2Bmt2r8eA7rUhEiqNdCjhStLwHtP+F/DWt67AyS1i5uKm8wKZ2fCp4F7ho0OQ8JldYINXTL/0zDLPtCl6s9uYDXA/5qAu46BuQmBJwhblMev6qphR X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/core/pcm.c | 8 ++++---- sound/core/pcm_compat.c | 4 ++-- sound/core/pcm_dmaengine.c | 6 +++--- sound/core/pcm_lib.c | 14 +++++++------- sound/core/pcm_local.h | 4 ++-- sound/core/pcm_memory.c | 2 +- sound/core/pcm_native.c | 30 +++++++++++++++--------------- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/sound/core/pcm.c b/sound/core/pcm.c index dc37f3508dc7a..fdbfb13e4d18f 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c @@ -497,7 +497,7 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr) char name[16]; sprintf(name, "pcm%i%c", pcm->device, - pstr->stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c'); + snd_pcm_is_playback(pstr->stream) ? 'p' : 'c'); entry = snd_info_create_card_entry(pcm->card, name, pcm->card->proc_root); if (!entry) @@ -642,7 +642,7 @@ int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) if (err < 0) return err; dev_set_name(pstr->dev, "pcmC%iD%i%c", pcm->card->number, pcm->device, - stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c'); + snd_pcm_is_playback(stream) ? 'p' : 'c'); pstr->dev->groups = pcm_dev_attr_groups; pstr->dev->type = &pcm_dev_type; dev_set_drvdata(pstr->dev, pstr); @@ -884,8 +884,8 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, if (snd_BUG_ON(!pcm || !rsubstream)) return -ENXIO; - if (snd_BUG_ON(stream != SNDRV_PCM_STREAM_PLAYBACK && - stream != SNDRV_PCM_STREAM_CAPTURE)) + if (snd_BUG_ON(!snd_pcm_is_playback(stream) && + !snd_pcm_is_capture(stream))) return -EINVAL; *rsubstream = NULL; pstr = &pcm->streams[stream]; diff --git a/sound/core/pcm_compat.c b/sound/core/pcm_compat.c index a42ec7f5a1daf..47fbbbdb5a8c7 100644 --- a/sound/core/pcm_compat.c +++ b/sound/core/pcm_compat.c @@ -300,7 +300,7 @@ static int snd_pcm_ioctl_xferi_compat(struct snd_pcm_substream *substream, get_user(frames, &data32->frames)) return -EFAULT; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) err = snd_pcm_lib_write(substream, compat_ptr(buf), frames); else err = snd_pcm_lib_read(substream, compat_ptr(buf), frames); @@ -359,7 +359,7 @@ static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream, bufs[i] = compat_ptr(ptr); bufptr++; } - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) err = snd_pcm_lib_writev(substream, bufs, frames); else err = snd_pcm_lib_readv(substream, bufs, frames); diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c index b134a51b3fd58..30db37652038f 100644 --- a/sound/core/pcm_dmaengine.c +++ b/sound/core/pcm_dmaengine.c @@ -72,7 +72,7 @@ int snd_hwparams_to_dma_slave_config(const struct snd_pcm_substream *substream, else buswidth = DMA_SLAVE_BUSWIDTH_8_BYTES; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { slave_config->direction = DMA_MEM_TO_DEV; slave_config->dst_addr_width = buswidth; } else { @@ -108,7 +108,7 @@ void snd_dmaengine_pcm_set_config_from_dai_data( const struct snd_dmaengine_dai_dma_data *dma_data, struct dma_slave_config *slave_config) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { slave_config->dst_addr = dma_data->addr; slave_config->dst_maxburst = dma_data->maxburst; if (dma_data->flags & SND_DMAENGINE_PCM_DAI_FLAG_PACK) @@ -444,7 +444,7 @@ int snd_dmaengine_pcm_refine_runtime_hwparams( if (dma_caps.residue_granularity <= DMA_RESIDUE_GRANULARITY_SEGMENT) hw->info |= SNDRV_PCM_INFO_BATCH; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) addr_widths = dma_caps.dst_addr_widths; else addr_widths = dma_caps.src_addr_widths; diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 6e7905749c4a3..34f45deaf493b 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -253,7 +253,7 @@ static void update_audio_tstamp(struct snd_pcm_substream *substream, audio_frames = runtime->hw_ptr_wrap + runtime->status->hw_ptr; if (runtime->audio_tstamp_config.report_delay) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) audio_frames -= runtime->delay; else audio_frames += runtime->delay; @@ -464,7 +464,7 @@ static int snd_pcm_update_hw_ptr0(struct snd_pcm_substream *substream, return 0; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && runtime->silence_size > 0) snd_pcm_playback_silence(substream, new_hw_ptr); @@ -1947,7 +1947,7 @@ static int wait_for_avail(struct snd_pcm_substream *substream, snd_pcm_uframes_t *availp) { struct snd_pcm_runtime *runtime = substream->runtime; - int is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_playback = snd_pcm_is_playback(substream); wait_queue_entry_t wait; int err = 0; snd_pcm_uframes_t avail = 0; @@ -2069,7 +2069,7 @@ static int fill_silence(struct snd_pcm_substream *substream, int channel, { struct snd_pcm_runtime *runtime = substream->runtime; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return 0; if (substream->ops->fill_silence) return substream->ops->fill_silence(substream, channel, @@ -2100,7 +2100,7 @@ static int do_transfer(struct snd_pcm_substream *substream, int c, struct iov_iter iter; int err, type; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) type = ITER_SOURCE; else type = ITER_DEST; @@ -2283,7 +2283,7 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, if (err < 0) return err; - is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + is_playback = snd_pcm_is_playback(substream); if (interleaved) { if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED && runtime->channels > 1) @@ -2605,7 +2605,7 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream, info->stream = stream; info->chmap = chmap; info->max_channels = max_channels; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) knew.name = "Playback Channel Map"; else knew.name = "Capture Channel Map"; diff --git a/sound/core/pcm_local.h b/sound/core/pcm_local.h index ecb21697ae3a4..f08030e56aab6 100644 --- a/sound/core/pcm_local.h +++ b/sound/core/pcm_local.h @@ -35,7 +35,7 @@ void snd_pcm_playback_silence(struct snd_pcm_substream *substream, static inline snd_pcm_uframes_t snd_pcm_avail(struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return snd_pcm_playback_avail(substream->runtime); else return snd_pcm_capture_avail(substream->runtime); @@ -44,7 +44,7 @@ snd_pcm_avail(struct snd_pcm_substream *substream) static inline snd_pcm_uframes_t snd_pcm_hw_avail(struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return snd_pcm_playback_hw_avail(substream->runtime); else return snd_pcm_capture_hw_avail(substream->runtime); diff --git a/sound/core/pcm_memory.c b/sound/core/pcm_memory.c index 506386959f084..2d55d3bf72d5b 100644 --- a/sound/core/pcm_memory.c +++ b/sound/core/pcm_memory.c @@ -63,7 +63,7 @@ static int do_alloc_pages(struct snd_card *card, int type, struct device *dev, __update_allocated_size(card, size); } - if (str == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(str)) dir = DMA_TO_DEVICE; else dir = DMA_FROM_DEVICE; diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 4057f9f10aeec..5e57ab50f4c0f 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -972,7 +972,7 @@ static int snd_pcm_sw_params(struct snd_pcm_substream *substream, runtime->silence_size = params->silence_size; params->boundary = runtime->boundary; if (snd_pcm_running(substream)) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && runtime->silence_size > 0) snd_pcm_playback_silence(substream, ULONG_MAX); err = snd_pcm_update_state(substream, runtime); @@ -999,7 +999,7 @@ snd_pcm_calc_delay(struct snd_pcm_substream *substream) { snd_pcm_uframes_t delay; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) delay = snd_pcm_playback_hw_avail(substream->runtime); else delay = snd_pcm_capture_avail(substream->runtime); @@ -1419,7 +1419,7 @@ static int snd_pcm_pre_start(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; if (runtime->state != SNDRV_PCM_STATE_PREPARED) return -EBADFD; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && !snd_pcm_playback_data(substream)) return -EPIPE; runtime->trigger_tstamp_latched = false; @@ -1459,7 +1459,7 @@ static void snd_pcm_post_start(struct snd_pcm_substream *substream, runtime->hw_ptr_buffer_jiffies = (runtime->buffer_size * HZ) / runtime->rate; __snd_pcm_set_state(runtime, state); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && runtime->silence_size > 0) snd_pcm_playback_silence(substream, ULONG_MAX); snd_pcm_timer_notify(substream, SNDRV_TIMER_EVENT_MSTART); @@ -1798,7 +1798,7 @@ static int snd_pcm_do_resume(struct snd_pcm_substream *substream, /* DMA not running previously? */ if (runtime->suspended_state != SNDRV_PCM_STATE_RUNNING && (runtime->suspended_state != SNDRV_PCM_STATE_DRAINING || - substream->stream != SNDRV_PCM_STREAM_PLAYBACK)) + !snd_pcm_is_playback(substream))) return 0; return substream->ops->trigger(substream, SNDRV_PCM_TRIGGER_RESUME); } @@ -1904,7 +1904,7 @@ static void snd_pcm_post_reset(struct snd_pcm_substream *substream, struct snd_pcm_runtime *runtime = substream->runtime; guard(pcm_stream_lock_irq)(substream); runtime->control->appl_ptr = runtime->status->hw_ptr; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && runtime->silence_size > 0) snd_pcm_playback_silence(substream, ULONG_MAX); } @@ -2021,7 +2021,7 @@ static int snd_pcm_do_drain_init(struct snd_pcm_substream *substream, snd_pcm_state_t state) { struct snd_pcm_runtime *runtime = substream->runtime; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (runtime->state) { case SNDRV_PCM_STATE_PREPARED: /* start playback stream if possible */ @@ -2130,7 +2130,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream, to_check = NULL; group = snd_pcm_stream_group_ref(substream); snd_pcm_group_for_each_entry(s, substream) { - if (s->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(s)) continue; runtime = s->runtime; if (runtime->state == SNDRV_PCM_STATE_DRAINING) { @@ -2916,7 +2916,7 @@ static int do_pcm_hwsync(struct snd_pcm_substream *substream) { switch (substream->runtime->state) { case SNDRV_PCM_STATE_DRAINING: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return -EBADFD; fallthrough; case SNDRV_PCM_STATE_RUNNING: @@ -3215,7 +3215,7 @@ static int snd_pcm_xferi_frames_ioctl(struct snd_pcm_substream *substream, return -EFAULT; if (copy_from_user(&xferi, _xferi, sizeof(xferi))) return -EFAULT; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) result = snd_pcm_lib_write(substream, xferi.buf, xferi.frames); else result = snd_pcm_lib_read(substream, xferi.buf, xferi.frames); @@ -3244,7 +3244,7 @@ static int snd_pcm_xfern_frames_ioctl(struct snd_pcm_substream *substream, bufs = memdup_user(xfern.bufs, sizeof(void *) * runtime->channels); if (IS_ERR(bufs)) return PTR_ERR(no_free_ptr(bufs)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) result = snd_pcm_lib_writev(substream, bufs, xfern.frames); else result = snd_pcm_lib_readv(substream, bufs, xfern.frames); @@ -3433,7 +3433,7 @@ int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, case SNDRV_PCM_IOCTL_FORWARD: { /* provided only for OSS; capture-only and no value returned */ - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; result = snd_pcm_forward(substream, *frames); return result < 0 ? result : 0; @@ -3596,7 +3596,7 @@ static __poll_t snd_pcm_poll(struct file *file, poll_table *wait) pcm_file = file->private_data; substream = pcm_file->substream; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ok = EPOLLOUT | EPOLLWRNORM; else ok = EPOLLIN | EPOLLRDNORM; @@ -3620,7 +3620,7 @@ static __poll_t snd_pcm_poll(struct file *file, poll_table *wait) mask = ok; break; case SNDRV_PCM_STATE_DRAINING: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { mask = ok; if (!avail) mask |= EPOLLERR; @@ -3876,7 +3876,7 @@ int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, size_t dma_bytes; int err; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (!(area->vm_flags & (VM_WRITE|VM_READ))) return -EINVAL; } else { 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: 13752849 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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+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/JMgA780B9emZE4Ikic1zRQo9TkjnqBhEKhJSiLOr4/B8H0P3ni3WeulTbfFBNexYFOQOF0Qe89RwQflCPT1L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xeNx/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:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752850 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010015.outbound.protection.outlook.com [52.101.228.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 CFFBED304 for ; Mon, 5 Aug 2024 00:37:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818263; cv=fail; b=qq5kxx9K1soIhhf/KSOcD79FOrtS81mfj1fWPr7f2cuUt+oEZJNTFSWg0sYmZOrWwJNKXOt2qlefOOgYSHkaM1V5j+1gEAoQRoLoK7YfIO8TCGlCsrXIqvgodOWi3XBm2tne68oW0EKpPNG9SrCY0wodsbhYFoGGFXAiiCRcftY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818263; c=relaxed/simple; bh=YzANhlxxRYqAXLpj7gdu/SdnFjIfvoworiPH44OC4pE=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=ljQ5Rffg4ldKGeuvREejKYmIKkLCcKUHbLBSY305RPLQLQ2BJ5wd+wHOGOz9ebyka3YE1IDkPDMvTKYEg0hexNYebmFPytFOWkTiUN7Q9CsP2S/6g2tayJUEDl/zxaGwnAIdBlhmGw05lJpOHyWvWvyQuObakMVZsfT8KQQBl9M= 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=NEMsNM+y; arc=fail smtp.client-ip=52.101.228.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="NEMsNM+y" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZD1cHkGOctafzfyB+6dDPwFqrkJLqv6AG5jtY+4Mdd0SX1a/diF/HG6Kita+YPCsWWotwiD3ry056KlSjV2EyCkXbGXXrvPBA5gMbfXRIgbQqcjMnngq0tc1iqFnzdFPffPv03gYdXp7ZrBh7s3EvD5p0wbC+sSoMyBNsp55wlro79EH/UvU0A+vfAKfvEnwAznCAa5iACl/78zplKPVndf9uhqLHYfxTHYCa+4YN+D6/gE+JhJEooD9BtI/pNyjBJFbxCmWzavGuFp8CdOCocDeDtlYjVGovN+P2S+Z2ciSd1R21bhgrHaP1qXSWmnSeEtbVz16hYwy5lBfuMOlDA== 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=CIxH8knu3XKO+bXVAdI10kw5MlguLpwB/Y24QVulcnI=; b=BZysqBHCqUDa3tqDoftZnIGNaD2eMFrb/hLHFsRu1TZkc9dhPXj7NkFl37xDSJR95YGEfGOT1So8OL7UeOSZ33lIoVoEnjiZE+YKzwrx1bIKyfEKmXmxd+q3jNG14d2wSDSqMrKjf8N0W/kM9xhmkJaHGDf16LIFwucFc97P+cFOCLLu5iI/3/NZuTA6kL3t6MUV+D2DP56Y/yrENXiNdYbDINwvawlm9Uf7hB6KIwxAGez3jvHnc3H2dQDQzDJeuHJDRi1H+Py6qBjoRqg0NDVtBwfFabIhQqxSkgIZ4JH9ix41mRdv3pNieWE1h3Bi9U2yE+n5BYe4VqAd7OQeKQ== 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=CIxH8knu3XKO+bXVAdI10kw5MlguLpwB/Y24QVulcnI=; b=NEMsNM+yaz9+i5wB4kqS8/vNKdYhHbUdvSIggic/ba/xRkggxXiqrjatpJsKiUWVyA0rkyFESCH6qbLZqWdDz2mGXF5q1QqFHsaeRAwAqCUHdL5FjJGbvuBP4Wt2Edgt/K1DH0xyxZ1WoS1Sov/MoUjv42yKRU/FGvMBfv2yNPA= 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:39 +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:39 +0000 Message-ID: <87ttfzztws.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 032/113] ALSA: virtio: 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:39 +0000 X-ClientProxiedBy: TYCP286CA0254.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:456::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_|TYCPR01MB6318:EE_ X-MS-Office365-Filtering-Correlation-Id: 00d772a8-c236-40c4-99ec-08dcb4e6cf7c 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: YgZ3VAmhbPPgyLL1cx57Zo/mPePYGtZlypnkzJ59B5xJyQpc5xl+1B2myIko42rOF7kvKRlq/4vte0SzOr369PUT0A70pOJYLZXFUkcKbkksz/75gfFNnhx9uneM10mJmTv+UMRZsOHbuu8ULVPRyg8zZZsFcIQQOWIBZVNPJCe1d2W6oweJesO7viE329nagiOVYJDWFlFFmi+MQPRUKp11GzT7nQ+4kYSH3+TcAh6yebLoMMBATDTX1M+ziWzaFmePBjEQ9gBTDS30PuOsRBj2YWmhOXOJ6kZ3KlE1acOuooUV6jKOSoAKZobOxNpzUpbebwJ2Cyhw2kgCjzDBAzvtouihembLVi2lbH2N5UpfaQvvYX6i84nBcDlyd7t0pgsHvGPU4nhlHdzU5iVkQQKxYap8KzBgOHev45hh9eRoqdOl6FLG9qg4AssSv4xnx3LFM+Y6SUWxjXQKhDtedHS2sMOngRmvQ9ODZNJ231oRtT5hJRVoqk2nBJPhP/OUvjpzHPOgJcf4qmuZiwowVYIzr5l648q/ABchx31HM7PVhqtJvepRUVg8Gx7qgAbfErpgyZxda1V+cobGf5hR3w1iN+XPuR3lg60cnDh+JER/51hSSrEBOxOCKprrtq1shIUN+7swvkD5nVEeJ6pRpoj602RfG0q4sTHg6fPIvHq+N78oGQPqLfRJE1hQ8s4LWdj4DWch77JPccHVSjhfi2E6av4NNwsEdSrQ7SC8yQbn9M1q5OqYZGwddJmhMg2+8MwUtpR66p8lQeE8LPz2by792YPy95brBdbCKAt+ZHMTko1Jto9K38nuBP+uAxypWIPRfJe6E1SCSwanR7gwdN8nu3Go8PmsAUcU1XUqAXwQUjmBFaGb4g9Z6zp+H9fiwLAUvUM14O05VuaMmPDZk5EFP7NpZ7DMdCwbTM4ZEOqlvFxvhjfcl0rz1vmpQKibKcxjbcLVqDE8o30aVUIkG6oBITImjqVV5R+3Nj1PsrGy6F21HB+Z+5HgHqBxx0NrPOhBxhFiZVWaC9sqIeC9WJfvgNP/87b4mqbSKxnCDuZ3vRhGtJW0TsnXVUr4Ktu0gNhGV2yU95G5CrcNQU8c1ixKjyyjw0UDgSqiCbhqQF49+F9gO3tNc8PZWZwHvBXgJXCOCGoEuu1c/RGZsiAXChp+KNReW3LhoNQfHER6uosm1EWmdm3SI7Wp2eX15lArKDk/jJxILkU2i7W9Lo4ShXsV3q3+WuaYOKJtp91ukCb334l2nQiiGKFFzV8Oi4OiymQDf+PDxZpgAShNOt/nuOpRkvw331fbicNYgwz3mfprlOvCpOGXrDbAlqKWjbe9NBkw4fmT8N4I6u4h43qFs0tr4DFzC7NuI9g15mGCam1fUnjDYjkSwFpfX48LLntSJ+3hOXTHQJ7Cp5v0iCYM/A== 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: Xy/wCmR4W/O0PVrBnjEWxiWEDKm/EtOiq7gfd1o1erSzDzw7TPi+GxMkvkKHkZXYjOE+dNpW0ofvqBmHPI51hyn1WcJDKFggUZK/YvYaS9hhwEYymoNuhSfn/3+ZvqgTZxYP4kx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H2OogapYUgXJ5RANYgmxmFnKnPfamXhQ5z/v0sT8fLKJmHzlWdQWi+EHn1eUqBMTc5oAyDwFAkKcoao/bI68v6H/yTS3GMN6kJ7f755acJnrfnCZ5pRrANk/wE36zJcJqSxmYMbAXvOwS7AtzebnDleibAZ8VswPsHR70Oec+y8wsafDczJD9oYugNrOz2k7xh1Qyis28J//gb9a41tcxHjfKjI6jECUCRWC92iyD/5IOrAWAU1TCKTl4BwC42TWngoK3C1e5PhoToiZYPWqtSwnACZXooDjstTLsHdtVBKH4jCQYOuqb/3yYPu9Nf6UN08c+lEhpAszNwXBqj2LsOMz7G/0QgEqqVa6d6TOAC3bfaouOzo0byNT9fqOacz5SOr1kpUldcE6nzfe0/Lm2y15aRWKQUegj+NytMVgbC/PUBDa11kfalMM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00d772a8-c236-40c4-99ec-08dcb4e6cf7c 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:39.7420 (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: iNnEt6nP2eThHsIE6wc6Id0M2VeTFfXNc51snJybgRtAP++FPIu4yuuvkqanhO/DX5KiARirc8a2+1CbVSXWBfX0ZfWySS1R6LlJa/GVeyuoAwLcavhtR0aBU1//NNXm X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB6318 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/virtio/virtio_card.h | 2 +- sound/virtio/virtio_pcm_msg.c | 4 ++-- sound/virtio/virtio_pcm_ops.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/virtio/virtio_card.h b/sound/virtio/virtio_card.h index 3ceee4e416fc7..db6d164fada99 100644 --- a/sound/virtio/virtio_card.h +++ b/sound/virtio/virtio_card.h @@ -107,7 +107,7 @@ virtsnd_rx_queue(struct virtio_snd *snd) static inline struct virtio_snd_queue * virtsnd_pcm_queue(struct virtio_pcm_substream *vss) { - if (vss->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(vss->direction)) return virtsnd_tx_queue(vss->snd); else return virtsnd_rx_queue(vss->snd); diff --git a/sound/virtio/virtio_pcm_msg.c b/sound/virtio/virtio_pcm_msg.c index 8c32efaf4c529..40e113a2de73f 100644 --- a/sound/virtio/virtio_pcm_msg.c +++ b/sound/virtio/virtio_pcm_msg.c @@ -230,7 +230,7 @@ int virtsnd_pcm_msg_send(struct virtio_pcm_substream *vss, unsigned long offset, msg->xfer.stream_id = cpu_to_le32(vss->sid); memset(&msg->status, 0, sizeof(msg->status)); - if (vss->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(vss->direction)) rc = virtqueue_add_sgs(vqueue, psgs, 2, 1, msg, GFP_ATOMIC); else @@ -313,7 +313,7 @@ static void virtsnd_pcm_msg_complete(struct virtio_pcm_msg *msg, * If the capture substream returned an incorrect status, then just * increase the hw_ptr by the message size. */ - if (vss->direction == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(vss->direction) || written_bytes <= sizeof(msg->status)) vss->hw_ptr += msg->length; else diff --git a/sound/virtio/virtio_pcm_ops.c b/sound/virtio/virtio_pcm_ops.c index ad12aae52fc32..5d93d50f24023 100644 --- a/sound/virtio/virtio_pcm_ops.c +++ b/sound/virtio/virtio_pcm_ops.c @@ -337,7 +337,7 @@ static int virtsnd_pcm_trigger(struct snd_pcm_substream *substream, int command) spin_lock_irqsave(&queue->lock, flags); spin_lock(&vss->lock); - if (vss->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(vss->direction)) rc = virtsnd_pcm_msg_send(vss, 0, vss->buffer_bytes); if (!rc) vss->xfer_enabled = true; 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: 13752851 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-Anti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4wO9pux0XU3r0AOQjVoUYlcMQWeDj4+FjESkvPM7rMn72kaaqxWWSoky5M5bSu7lJk5KLYMtS5BMebyz4WoKzNXg/zLiKIFzqJGybRSJgYGWA4bWmeKI2T6u8igc2Lfp2CSsqsbOTBHmxlx4xJ7J4tb2z80/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: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: 13752852 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010046.outbound.protection.outlook.com [52.101.228.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 60BC2FC1F for ; Mon, 5 Aug 2024 00:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818274; cv=fail; b=ftxh2vanX7Jpl0jiwQniTMsYZT7BdHw8pwNsqP8Vni2MD7sVzP+fCr5CtPghq3shz4Eagud92LB/t/pRo2c818RA9sITYf3rFsV7s7yNJqLHjI+YfyLhkynD+6zyWGShL+QpM6WIsBQUTSBxJvC3YK26ZifP+twzEme41S55pfI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818274; c=relaxed/simple; bh=1+yuDF6s2LKsFPJh1ftoaKrbQmW/xr6qQDzGnVEOepk=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=lhd9CXprWGsVhkb4hU04DfxIjHJq0ukqcGelOH0cGIoIkq+eT1CDTyREy1WcaQirzFjaiFSlCWrV2Tgbdpi1tvl3sCH0TJJmFGLkyl08SbZwQzHGZmkk12naAqn5FNlUiL95ytBAYPNZWy02YlwH6JtJLyIjr0fMVgudJsjy0GI= 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=MUHnCLzJ; arc=fail smtp.client-ip=52.101.228.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="MUHnCLzJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bfK+6x1NP3465brh1BKLIFk6wENg0bccirBkJsyZ3Lg18s7ZGXiNjpJxVHejMPxSV5hPok33nj6YWejLP1B7RTAj5vccWTMyPrJofTB+7a/qvmf+l78eI6zt2h5YXAoynr5G1ijneftLVYiA/uZsMAH+5+NRz19e1h5XA2uoRmh87nZO9LTteMADIRLh1BeV9eX1JmFB3iJquk9PtpKE8AX/adewoxCcvUjaIzjP19ZU3fHJroEVAOq44t5Tt5nTcFYndfwFR+/QmYf6s7MHWyk1n1P2yMVtrdSFInW6YQeQR05IZYovC7XlIgidPJH71i9w1+fLthFJlBAi+Ek8qg== 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=acvnMh1XypsY24mmC1F4wdUAJRkWHFir0PyFewqvnfU=; b=zLVGJyc9a8z0pR1jrYzj8sTyg3xvSJVuM3zoLJMpbsVdT8itcCFS8aev9AwJ6GMpC1EYZKKj8oFbagjyahcaIZy9WbfiW0jRxgGB1hlz1XXLUkONv5FwDkuOWRm3zCgmeHcqAldSbaPpj/N5LUdbbtAR//Sw3MTd3iG8eymkek7ziL8XsI7uzo7ch76l9ASHMnad81uPxMhVSX/roTTaqiBqLlx3flyAR0+efhKoor3eC6odc5D0z/Ly0SUkuxm2qVajSlz6qgFXpDQuY995gBZqygf99iY3jReCTcxpWe2fLNlqUSP9U8RbG+tQ0q8oHmxJh4nNqZvg55Pyqh0N/g== 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=acvnMh1XypsY24mmC1F4wdUAJRkWHFir0PyFewqvnfU=; b=MUHnCLzJwi5Ta6Ugw7gg4kVqbNVmsLVorvWEEvNaKNQLp8+RED2EY4GTqdQQYD+ny9TZ+dVLk8jjDBwu5eF6a0VbyI+ln8m0QW/LZsL5QkIYJyeCRWmBiWo7i7Wd49VYjwKJxcRvYs2qlpdrNWIR/bpHsqfjVMZ+Z0SFEzv/Qok= 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: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:37:50 +0000 Message-ID: <87r0b3ztwi.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 034/113] ALSA: drivers: 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:49 +0000 X-ClientProxiedBy: TYCPR01CA0115.jpnprd01.prod.outlook.com (2603:1096:405:4::31) 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: 27e83857-26ab-46fc-dc09-08dcb4e6d5ac 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: j9go+/3NE0ATkVQrYmvW9CqMecDBdd5uy/RovyUSkZmEiTHWPF+nsyRkWXe2Xo1FtkRVBqrXYKoWdc9ujaIStEPbYdexYZU6gECGQ+XqbzKhxPMgcQbRp+gssRgwbwzMBHmxy4KEbvv3hoAGt+v9YVSdbQH5RfA94fSEcyXusz83jfV8RwhNSWeTMdiHShR9RciOBuie4Qm4K5U7lok9lSj9+qhvsqD/Id0tcA7S/I4ue4+SS4lH2NXFQ07Rst9ytE8Yb36TclTtPqHMgnK6Tk8gUHMJkqb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uhQuz82OPNh0UH4ao14A0jpavTaDDqUH1VqaxuhvaZHsWNJXhg== 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: O89QqK9LveEuYtCe13/qYH6XjI0sRKtQxFz6Plrlqx60vIegk7WAQ8v8U5DDuq8H5jDs6N0CeD4C8IcualfryQuv5NDD6mRSZc+f/Bedb/wxsAJEHXjQomJ3tlKKojYMqu5nnLLXJsl0MWeWPzBNcIIP7WnmLj3dEAvBNrMu958999bie6meWxvpIjdpWnJisvVlCIwxVxxooBrhFDj78Bcd639QiAC2tv4ftsDUk6CCdzm3B2I82y7mBeDYh4rvU7Hv/jybnJctCFrTW3QLZizyDwS62fwg8+RNkAiRPwPVtbBX2EEPmAHLRzGQdkwdXjeW8cg4jMWQnFKNQ6L6A6I1lXySMGMYudROGRJcX0mQ2ZOc4Gfq9+YchBes918as3vFNXcXctUYK4bkaky1kt+hWw5i+kyr1GyD2EOsU2298/jJ874UqU3Ir3pZTrD+qI9+2kyH8w7q57CnzJJJQ/hY7WTEdvU3clnvONuIuscfUt+fvfjte7Rt4l23EDkcH8xOsxGVtfdcfqXkN1fr0C4I5m5PNIp5O1TdEo0IWpH2tqEGPUR2MX8K2eRl+KL+iI7mu4J5VCNYM+JkgdKioKoajkFLxsA7o9Bi49O5Y+Dc/uDVlYjZ4zF6WPcIbA81pmpAHTTiPPtTFKrXlQtEhgasZjPs2z9rC7G4K/bPfdZrYN02+hebsZH7VwoXJeAtkdGyUsDMneSgKzPyg2m1ywR7NdKLJsxEl7cSfHVmFjMN7hE7vyvEkvOpu4uAd7BmLmrMNCnlcF6yd0VBpFrkQV1P4U2dMWeimRuvs2bdaXskI+2QwhDIuHvBQEVGRDzQPxn6f4cDevuXHCKIjF1yaYn/2a4vC8AxXo01RhmD0gvFHNbnA5wjv17RCQulVUEJ0ZKSjsh9dSOU6X7XLt858kqzfT7TOPCuZarxqizLk5tYd3n5aTWbcJsMDSE34eWy7Rjunm5Zay/OG3pUJmmIJf402bM0nARKU/s+lVwkhB6/ediHOHONf+N8CE2ntEhu4mYW0gnt4MH4USk3rQcc2o74J4ZRIsh8iNRs7aFaiOV1VDMhyGMwXgaQwOmXHCdX0K4mP4GFItt4ZH8T72ozJ0cRVHV7LaNNSMTNwhAC4VONIfRbcCXboJfKzQGi/1Om0HelE014BZztl7C3LmluknYLbkmuksuscfg4H1kApQ15j6twNsFzoyIuBhMWzdr7r5UCeyc5NCsHNJPAZ8oe874YjwBe0seD00eK20Ydjm6Q2QYvDK5wu6mQc9UuNMvczaBQyZRo4Pbl1XZIi6hiok4kCWL+bH3pk8p7T8eJEceJNM/sO8F6ucAWxw0/oytbz2tTaC6tAQeDzBlpphgJdeCJI/A/1oJ8s5Oiawr6TKWJI2rJGqacduGhQf8BEznCbNJn+nHP97/lv3gOu/tqA0NdMOWKUlvh4NsPSSI7EkycSJfL3B/kysLZh54B020Dn24d5XSHUuNri6hPHakzk9nHr/kFomFGHE0lRTHbi/UrmgPXpZffHn7oGhV09qhJTFRdpk/ROBtykLqJNs1sB2VfN3xicIUzYp5kC5Rdl+JCyDKqtCmm0vcnFN05l8xYaZ+W7Pke/KONYuFP949SanfNFaQRzGQFELiRPlE83U0= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27e83857-26ab-46fc-dc09-08dcb4e6d5ac 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:50.1437 (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: ZvtkxgYDxWRdL6++nCXu/dTJjGjqw0DfIE2yUbdpXBQJtRZJrUl8B5+aVMDus2dBw3YGhayLAzNN8bMastwhRddxXX68kxne1tAyxq5bk+3+ugYu6YrgON+Va9vFlDye X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/drivers/aloop.c | 18 +++++++++--------- sound/drivers/dummy.c | 2 +- sound/drivers/pcmtest.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c index 439d12ad87879..9d33aef59e95b 100644 --- a/sound/drivers/aloop.c +++ b/sound/drivers/aloop.c @@ -193,7 +193,7 @@ static inline struct loopback_setup *get_setup(struct loopback_pcm *dpcm) { int device = dpcm->substream->pstr->pcm->device; - if (dpcm->substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dpcm->substream)) device ^= 1; return &dpcm->loopback->setup[dpcm->substream->number][device]; } @@ -341,7 +341,7 @@ static int loopback_check_format(struct loopback_cable *cable, int stream) int check; if (cable->valid != CABLE_VALID_BOTH) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) goto __notify; return 0; } @@ -356,7 +356,7 @@ static int loopback_check_format(struct loopback_cable *cable, int stream) is_access_interleaved(cruntime->access); if (!check) return 0; - if (stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(stream)) { return -EIO; } else { snd_pcm_stop(cable->streams[SNDRV_PCM_STREAM_CAPTURE]-> @@ -418,7 +418,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) cable->pause &= ~stream; err = cable->ops->start(dpcm); spin_unlock(&cable->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) loopback_active_notify(dpcm); break; case SNDRV_PCM_TRIGGER_STOP: @@ -427,7 +427,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) cable->pause &= ~stream; err = cable->ops->stop(dpcm); spin_unlock(&cable->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) loopback_active_notify(dpcm); break; case SNDRV_PCM_TRIGGER_PAUSE_PUSH: @@ -436,7 +436,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) cable->pause |= stream; err = cable->ops->stop(dpcm); spin_unlock(&cable->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) loopback_active_notify(dpcm); break; case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: @@ -446,7 +446,7 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd) cable->pause &= ~stream; err = cable->ops->start(dpcm); spin_unlock(&cable->lock); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) loopback_active_notify(dpcm); break; default: @@ -497,7 +497,7 @@ static int loopback_prepare(struct snd_pcm_substream *substream) dpcm->buf_pos = 0; dpcm->pcm_buffer_size = frames_to_bytes(runtime, runtime->buffer_size); dpcm->channel_buf_n = dpcm->pcm_buffer_size / runtime->channels; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { /* clear capture buffer */ dpcm->silent_size = dpcm->pcm_buffer_size; snd_pcm_format_set_silence(runtime->format, runtime->dma_area, @@ -513,7 +513,7 @@ static int loopback_prepare(struct snd_pcm_substream *substream) mutex_lock(&dpcm->loopback->cable_lock); if (!(cable->valid & ~(1 << substream->stream)) || (get_setup(dpcm)->notify && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK)) + snd_pcm_is_playback(substream))) params_change(substream); cable->valid |= 1 << substream->stream; mutex_unlock(&dpcm->loopback->cable_lock); diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index 52ff6ac3f7435..5e440f952449e 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c @@ -570,7 +570,7 @@ static int dummy_pcm_open(struct snd_pcm_substream *substream) if (model == NULL) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (model->playback_constraints) err = model->playback_constraints(substream->runtime); } else { diff --git a/sound/drivers/pcmtest.c b/sound/drivers/pcmtest.c index 21cefaf5419aa..ae308ede80929 100644 --- a/sound/drivers/pcmtest.c +++ b/sound/drivers/pcmtest.c @@ -351,9 +351,9 @@ static void timer_timeout(struct timer_list *data) if (v_iter->suspend) return; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && !v_iter->is_buf_corrupted) + if (snd_pcm_is_playback(substream) && !v_iter->is_buf_corrupted) check_buf_block(v_iter, substream->runtime); - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) fill_block(v_iter, substream->runtime); else inc_buf_pos(v_iter, v_iter->b_rw, substream->runtime->dma_bytes); 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: 13752853 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+keQZfmT7VmpulA819ADf1TAGNSAUtKMaBTos2W4C7yqttt+X4KugrLugRZ/5/Ng4O8eh3FmV387Ysk2cjEtYwh7Wf8/zW7CYPKUsqiFgFG/MThXLDBwhqky0SUj08S+ZRmWvYCez+RcaFdoq443cQKvFc1qJ34/2cfR5i7lOYRJhACDYD8qvXehUR1MTX8y6m4Yd/lO7BH4CR4kSMHW9znen70Ll/M7hFy640lHiLDeI7Oy0xv+uT6BgfVBXeG//RIBiODY0EBFdHsT2XWHydd/zvZtVfHCxJVpNZAipj0iTLigJK9Gv402wIwckRDKUJBQDz+i0Bez69eGYhmyr9enEagYgbQX2GOI70HMTTfV8hFXbg1J09Z9Z6/JAKwCrosgzxOlSRY04RQzT5RQiw7OD+1QQqPJQ0NBj3KRtP4NVIkvsbbXmDEs11ncEr/gEvHY1j4tPKiGiiFHssvmuWD0+56FaJS86nGCFU3sClMHXjMZRfu7zdclKDZYlelQFrRO+stRUr/xbWSrZiDlgrG6Ww0h1wf4ze1hGKQZMqGeLjK7TLTPVcM/JWnxMVtc4d4QpwoJ/ALtGi+VBGYs+g550usuTZeLlMlFMpD4nAFUvfIB2lABBteLyWeXKbKroHybICqKCBcivlzZxpNjq/ad+diAdh6eEiSgyBLijHrxTTfGxc8T7nBD8/EcxW0OdEagkXFzU2HyN9CH6b9hTE4yHT9Y+5t/Yaz3raaBwy0dvwJcpdFFRXlCbmdhLIoizyiFwuJrPeMWBt72pARgnCfitskAWT3bqaOud5qp1TYeOReXTR/izhgFLQTRNcWSfa2yxQHHDDsSzbwamDNqgoPhbGNSwMzTzffkLcUapTBsY0jBYTqKCzhyTpSjfbLJKifPC3dNbQ+/RKv170f4w0rkWl3DJM1j+DMavCX6/8cS04qDdyCpYnSgHmcr2Gi8Qa7ihp8/Nu9WMWA1cdfQ1VsfdSLeaJjZ7KR62Nsghf3WmPypCQQTPc/tQPoJpECzuWizunEsPwMbUet13wUjp7UP5x79F9RJzwN8N4KWv45QXPatQ+JK1BXs5m1dj8Lcg== 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: wxve3N1lrD4Nlr19LGvcxifevHMwNQStD5QMZEuiVEeZPEjSSVN6NAWIKN02rRsfdirC73jWtIPnsWdTTDEvEnI6G2KI5+sfdJ8CPm2aY32gCmTniHIQbL+dm8ixdo5jBR/KhlWUiojojL1r+owlPJJp2kU530REhLFDLX2+wUenHPxkDNz8RXDvbP8IdXckt/YEcN5prpx7CKL3m5dMDfj0CK8CqeJZxUT88BtT+JNsgLd8adEtukkDRl6gjVVDDNTdjfkB92pr4tn8XH1JfQSGU5NqAHceddG5l1ILN3eGpzcSo/kfJC13g8pc3kHTwzecaQIlScfabteEcQHdr6b5gcn0v7eBnSQyGYdWuMm/lbIXLt15KKbrpPCwH4ovRZQsXsujc53kZzOCbPPrjiAfvEiQf3Yij/w7k7hxDkCth/YKQCEYtzkFBSV+C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Rskolb1kbx9m5hMIU4wwRjZRwtr4JpFs3I7Dt7CdQ5HOUxkWzjxl/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:37: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: 13752854 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 2E3EC111A1 for ; Mon, 5 Aug 2024 00:38:01 +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=1722818283; cv=fail; b=bKyABmukqYyAl8guPBYyjPNksq1PxGdtDMhaZVbI8jqWgqRJ02Koc/HGSbo1dGS7FOPItBLVgqGO7kvKeJaA1YNypaq2Vdoim8N/KEJjQlTgExnSvl0be3FSl0FhsMRDZ5AJmjg49YwrK34DtEhjObJMep3tHumzyziF05BA9i8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818283; c=relaxed/simple; bh=s4ttF09PIwfgLQmzw9LZqIwH70GVJX8Aei/bs+/cH+Q=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=QZYNu5oianbHEPwvhzYdbYFVfkSu3D8689trhLBrHE0wkAuLd1Kfb0KUwIoE7VcqU/Hos1/c29D+w4YkR3F0tffispPSwoWCM6ZZsZLq/jCdj9HGt/4PtXYl1Xn7ZZWxfLEmDsM9mSA0xYg6dB7/guGGI7CpeCm2wZbeAQYdg5o= 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=kWnUkkni; 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="kWnUkkni" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mdlzyEXNPKkK45qAdzRt273gWB3ZcENUp21qM3cllHUwXk4iHWOr3e0y36ycmRa3fBwlsHLWtIwFJmfFKWdFfp9x9KzAIaRLgkPre7eeCx4lQiH60iix+1tEWTg+30YYfY6o3AkQ+50mVw35KNmyXgrDeCXuB9xYOZwbFJlG+ihqoS/0YGQM0sjQ+ceeMjBOOfWlQDD19ztDXJv8C4iOnrICJbuOuTB07wUyy3wKRxQssT/deEXqM4Pn30JyY48+ahl6d/3KfAByEgPwVmj0mVoUGrEjiSRpAx3hlWmJIUH9Cg0UY50kGxR0msLggUt66wRRMWPjdPfchAwIOosqcw== 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=jovqRBzEtXrZT+MXCP4/uH2eQxe35LQMDQmD4cxTZ20=; b=y+Nz2UbaNAt2CSYDhIbNTLTTf5I3qfthbaFadZvDtcpkE9SPpg97nxSxNGHJ1rPFbehePy5p/IzQ990JTX1DEuV9/geNbccXgFIqO2fFhfpBTO+TW42qA9bOZZyAfzst4ZFzHvVvzG8DTYr47BllzKkGsrAnzD7fRlksH4I56w7UM/C1XhkQnRUHGeZqHM+EiZJfsRxp15IYJsCts837puoy7xXPnHP89YKZqYIHES7GfbJI9yonAybY+Ktom6kHwcWV87AbCmpo9Fsi6jmdrTWmsyPta0Q4B8/bq8psUKcGQd88BNOFJ+mbZoIatH4JOKEJJIVvusqLaaL3WzVO4A== 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=jovqRBzEtXrZT+MXCP4/uH2eQxe35LQMDQmD4cxTZ20=; b=kWnUkkniaR82tRG9rv6w4VQeNxFvBoaHq/eEFHNrl7XWUCG38IGCozdA7wy18YiDx/EmDkMKL3Ur1UgnqeTkDmi6LNIX6S7EXJ1bcMmoeWKy833b+qCwy6ktXvk/76QTpikwj7l0NxJy280JC3sK3pHN++BSXcETWMKC1WGmNX4= 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: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:37:59 +0000 Message-ID: <87o767ztw8.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 036/113] ALSA: firewire: oxfw: 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:59 +0000 X-ClientProxiedBy: TYCP286CA0212.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c5::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: 3c69c696-cdd3-4dbf-8514-08dcb4e6db64 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: KRo3ZJ8AfL65lb+ElgEEVZcFfcXtVR3CO6BxK0SHBD8p932mJLgkcfiBlCOoGfoma1jdW878/H/m2IAktJON0tx6s7eLcymyWsiKkzS+HlAwLWkw7x5KkYLlWEOQqxMn8DTsXloWpFsdSpypbKsm49Gix/9LLiGFWLoLLViirIs7jac6TJ67Boso02UM5w0b6HyOhd/Yo44xI9VwyZ5fAPR1FQKj94P6VW4cVzbXiUpzLQtUwm9R15QryErE9KmBiFuyEnXHP767+fSjgYTotEqG91bLcsfhILQgOZcVLKR2nlF/A/Px6HPpbjmS1jCsS0aok1ARPO3ydDsrqW02Rty5KCgp18ZYPJoE/HBmx9dWLCut6ClGQJ82z0v0yDYilbsap6vu28Jf21DYaapog6S3i/zXQrJGaLW/OBZqlUUYNCv3X0v5oobJ+AaF+VM/u5TN44bebc1pVed8R3mNiZWyQCKANfX8DRNgEow7aFfJV5pC9kpduWQ83NQt2NwdgSb37LRCbQRYHg2qs0G4E3PiBTVrCKD109tVpxeImqox9dx4tOyBLRWOdGo7K7DPd89betVy+T8GJPJTT1nYVuHw/qYTepe1wswR5utJQrxr96uSv/tJK1wSGpw5q0+JI1GPqFlznVsUg9ziHPtZ5oSOsaCdozIm8WJfQXqiPMMUT0PiBp2Re67ZwnNlQ9esF8fuH/V4NKE9hDmths8ZyygyCS5//udUf9OTWe2Bl9Y5dZnNtjtko95CgH4WCUE5lenqvMZttDiDKmgVIRmKlLWn3l6fgjo0gVI6QfWVchWt7JJxRf/STzCT1LLSqJ7B2WcqctdTzjIIfrD1CogU7ioJDVVX6R6jQu99B3N8/diXVqoi0XmYx+h/WScBtcHEpqTBhywJjk448OWH7Yq+/agzmBObIX+e1O9vqwe265zutbco0IqTSgfABaId7f1GPGdS3eQErBDs7iO8CqfFy7IZw79KeAOd8k6V6TFyHew8kaJDdTMyI2e7Lfgj9M1WSCGHL4QUoWOacti9LKxq2CcFyh2NPYM/dFTRMg36QaiCGcsYPm3BDumrJRaC823qcT7DLNbD8r3HOihtH7XemUis/+eI/MR3WW3WY6DX+mYBMOeTjXBbZyrZydMvoQ4dD7ze6g4y+oLE/pwkRSjztF/KorPoJik5QcBhGWEm7DmpHYCftfrT8orgEEi4QZYtXQwVIG7BxJrAqv7BOyOYqLsNdo6bhLTTI9Gqhzxx3QfRVOlvnGwlVvtlRSJC/muJVVjEqF6Oe91sDkmCGOGTP4GX7grG/mytqmXhxRLS9J5EEOfsief1nI+QQm1n/GekjcO4cOraliY7jPl4fovue8KytFYFhUwZjcXGsY5i1E3RxFBfcefj9M2tLElXq2TJfZrLgyN43QMjRVGh2WT8WA== 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: QeVO7Zd9skfyfBFO0gPRuS/xuA/7xK7xKnTKoa5Y39PY9Vb80ziHiThzv309+QAV2YXZT3fdK4q3S6WsHtlzB0IqysHd93yibuyn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XYvD/rTJNqozi82gp4/6D1jq5nWmM1RomvwR9noaae/pdkNQWdsUOOF+EhGMMRrXG1B4qoP/6PobPpjIG4oFIcSad8VePTCvDnMfYPHuisofRmlwHQJ8WcnBvF0Mrb9uXQLUpkd0X/WEVa6MSU9nXy5eAI5CRLToTMKp3hUMgG/juIaWM4rwPKzHAwcBR/DIngyKIZ5IW+rrBNZDr8ElX3Z1njDO/txK7zv5wLCbb2lpbD8DJ3SN+dK4sJfAFVn4d6j0Gu35C+86Z+e8pmRcJlVsC0wULd+w5+TvtQDtCnHFTWkq8FDzmGzSE2Aw+pfvzURBBNDMBmW3k4NvM5H2JnvLgzfH4b4IHGHZegTbcewpzv2BCxPbJuSACxxmY/yl8txJR+lvyvdFvjkPa5On0ku0TsDdtxi5RDSoq+7tK3QmNghfiEyfubAelH229+wPW4Akl1K2TeKgnhs0Ceak7sWI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c69c696-cdd3-4dbf-8514-08dcb4e6db64 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:59.6812 (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: odP4ActdDrgr5sxL8W+KSbWuZzfXLkZ9K429x4kSyjfe/AY2MEmqBUxl+6yucL79HyfMOdMNzxBeS93ZYNuTI/oEDHw3JwKkmWw1pomlEqYhgn6NhkP7SAttiYv2cfaG 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/oxfw/oxfw-pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/firewire/oxfw/oxfw-pcm.c b/sound/firewire/oxfw/oxfw-pcm.c index 5f43a0b826d2e..c0e67a0d10f1b 100644 --- a/sound/firewire/oxfw/oxfw-pcm.c +++ b/sound/firewire/oxfw/oxfw-pcm.c @@ -114,7 +114,7 @@ static int init_hw_params(struct snd_oxfw *oxfw, struct amdtp_stream *stream; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = AM824_IN_PCM_FORMAT_BITS; stream = &oxfw->tx_stream; formats = oxfw->tx_stream_formats; @@ -150,7 +150,7 @@ static int limit_to_current_params(struct snd_pcm_substream *substream) enum avc_general_plug_dir dir; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) dir = AVC_GENERAL_PLUG_DIR_OUT; else dir = AVC_GENERAL_PLUG_DIR_IN; 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: 13752855 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+n5E7DRKF3FyWXg9qIh9T20CVLwcfxpNRGXEAbeD+V+wsTGaVHsFc1fBhzerDjoxWH3gJ1THWk8Z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vKOqv6Oa+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/8RR8leAqDpvFtaZ1v3wYIy0EskPy1DvNFGPvLT+OqB0A3ACcs7+G+7tth3ObbKwR+wZleJhNyV9rhw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ant-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: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: 13752856 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010008.outbound.protection.outlook.com [52.101.229.8]) (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 574239457 for ; Mon, 5 Aug 2024 00:38:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.8 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818304; cv=fail; b=CIHyN07Vf5T3qH2VtB0wYgzyv2LR7lnknj1BL2SIZeie4C8o7ELI0EkeHsLM5x/z2vx/d4Ol2+qaAKX43syCaud8Kb4/QjpBZPF2nL7K1luvNpovtsuCkuL14M9oP+YhWgSAoXDmpepB3/aLymesuk8g/MmOZbGtUR5alrbEa0k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818304; c=relaxed/simple; bh=1UujL1eLs4rK5a5BAs7CgUYbrOlYm6we5h3bR3Tkk84=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=BZCsZz8qEIW4ezcRYdF6xTYQcrMlH8U38iUCPFOij6Yy2sowKU3RiPecI3cJcvqETifRD6agvrki1afYrhh6ISSO0EkU4/NTCIPsuSefyky16AtPPYBPatTV1q91g2Dfo29chKwr2kBnrBZ+4MnekVWx7WlzBwNb163qhwlveOA= 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=aIFXTCai; arc=fail smtp.client-ip=52.101.229.8 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="aIFXTCai" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TNUaQ+NDW/a1wabIIZsVE5m5E38H8+g2tfwT9tgg8f7wIGORZGgDHxeJ+dxGBzzOasX1m5bB04VBo3VPS487l3KHVcYmpZzbWsjEEGD1vG22y2uvNSYY65lCbqw1UFylhn+GIME2GQL1IjlzD0mtaauaJJ03F5mAB2gcW1OxPzRHVHi+p68RMN2JJTQ5BLZ9amMRYQSZ/5kRRfVahnkgH5vcMzkeyozNMrMMJ5MnleHNpxp1P5PKxrm9nalsoqGbTKTRycpDg+1v2t4eBIBlYatqu4G/1LSt61wE9XJEKQ/9QzQlNpzd+aXKDGDjB5/0G/G2UhdsGOEFyjjCJ+L5fQ== 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=x79X8snJ4NKIkcwVBLfwQ3bh8abPmmro7Rwu7naeTIo=; b=g9UoX7O0UnRae7prdziXC4RDPg+Vi7nMUZMorTF3iLF6FJNtUQ+1trLxAn6wUGcSmLhMnuM2UUDy+xItPA4MlTZrTSVWHNCaSYOVb7ycknAEsr7qnuCfHaXyV7+Kzy9pIh5Pl+6gX0J3r32LcvOsQfamhZ2vsffQAnqtcKXlGTTvUfrjoFHL2mtxEbM2BBgaQfPd9PqU1/PpN4g+zTxmFn6valhYtcLkTqa55qbRxixOBKTpFtt3brFffoep8oP00YdyO20Ju6sLkDDpUQWGbJY1Yszq32ROTOb3BIOrNARF3Ohp9+M+mXA70EW/udCyA4zZ6iCcLZoLDRaUAUvbog== 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=x79X8snJ4NKIkcwVBLfwQ3bh8abPmmro7Rwu7naeTIo=; b=aIFXTCainh8RBb4fGpVQ1wiv13M450VxussYrN1fo3aHVZL1sT5xLtmY/+JbqUzdUwGJTBSYOdpQTzRKfVxyT3yaEqpK448OjjIFW2iNKKcZLggX14XoosNSXeZ8Lp8ke9OlNTNMPp6L6tu/Ejny0lniA7yL/obACKeqULp96bA= 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: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:38:19 +0000 Message-ID: <87le1bztvp.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 038/113] ALSA: firewire: bebob: 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:19 +0000 X-ClientProxiedBy: TYCP286CA0335.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38e::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: af0ca22e-5cff-4a8f-e5d6-08dcb4e6e713 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: IMKe6tOdRzFWQibq464USUUb8tA1s5Gfy6ATx+Ir3c5SxIQYjDxQicSdpMc9V5JAztR1CQuUBcEXd6Y6L2F9/yM7icuxV8VJHSR4Vd+DByAHKaws4zeff2bt+3IDdsiz9xO6DN0Ar5lggzH8v37AIrIs5673Mk775iBel2k0mTg5Xjst+mdOaFFnt/dFFDQPH+GuVEhTXoK+ebp3MEdGTgFCAl8ZHZhfk5QskYh5T8UmXvdAyqCaefnCDQi4iuxLtMzz3TgFcnqscpRRZmGfGCIuZOG7kl8NVjz3OHkaTlBGZCfIkyYpo8Gjg5ry6vbCabi4fMnPD/CA+rBAQiCA3LnaFLCCBmH5k2otE9EaUJngirx835Hi5UtW7gEq9W2deLcXo4CQnCj1sDmy2EfEQ0JAGqo6mAlW99JGQ7974PkpOcUbDisZNMBbBKoWpK7JKogN2eD+H5A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TR:;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: uAsp68PVC4paDCg1Q0FkvAhS7S5rXyo0PZJnYyhr8Nl8+2BV7LieT2EO7cb4MTWZBzNeQT7CJ98NvjBQG2w1TkxlovYeCIXUR9E/DZuB3gNth0huMpOdC9P7A+sBdVadBd1AwaP/vfrbgB9j/X3QwAHkBHNjmYffyl28L87FGURIjh45SGHnulZA7Llxjk0bXbqfJL2xlf1+RR7zaLRYiNVllkLFvIFUuWWeVyzDL/T6RCGR7QEQSjHyiuKZbQbwC3ppPe/8GyvB35jqCesbfCDpm3n4LcnSqwui59DSfwtLjhaKdHSPP0n/7yMmQlkqcH8PdA3kSFIVXmprnJ0/yoTq+2Py3ZSxa05PvkvfEnf6DUvmmVB6xdNKDsBUmGZU1kYbb6hsmWIc8Bas1Psfa9dV5x7i0BvJayKIU/eKqg3ngg35B4YyRJyrhSpKc1CxV/3R5xIbxxgDJTqrUAIuDeinGGWfyqqe8qfZ3slzQgUgO0KiLjMbM1/AB1GOJ3eH4wfoPni3OKG56tu/JrZBr5XYGqb8fuo2o1bX4oMYulKy+VM8Gca5mq9mElbYFxRfC9QyI8wUKitHgrAXGmqQP1GatVhDuMN6mjL2euLObbuIgiW0hPdpb2bXXP9qiJV1bnZvrsfhayxo3YNljzCiPfdLuBZXIy1l/V5O0gudvjXxMT9Q3NEyDv9+XhTMqmVuiYnnr7MEQj2G3fa4ZYTybt/1IIKs7+4Y1R5Bb2zDdVmnBVCug87fmVwklLV05et5dkz36UCXtsM7+LuNbZFod3oLzpIimmdEtPHGp8LJfxy3NsCbO1LCvfCFVL1gNpvhqgDvIR1elx4EHLx4AF/2i6YIaim+BdNawa5jRkdAO0gk4f3+OJUhGLTj83C8rB6MTwjfcpv7orHaGI8VjJUW2yNh0yVZbn4aNCTPgBx2Li0IJqBjThgkVvh8PIGihczHTWb0goJ32coroTtjanxj1rNne4iXmGNRij6+STp0Iboi/CcdXSsPxTvY+wlh9TSisWO7wbEBxlxnfea7XT0BWBpHXfh+8euggvkgmaKwp0z/zfntf5p4QVdqIVO3YDYchWpK7eA/9h2K8mIl6Axm2MvjaQl9axacnN85Lc1QhBZqSyh4ahKAFOWUVtS7jzEnTSipo5mOdVvDxizIw4hSMEvwMHM+ZYSoPXwXoLZh5u35gjcGkwf0mhUvaY6qvkzRcuMj6MACcliwR/wPjp1Rrw2FAKezLyuNR+y/1LT+3ZbQruTnFZFSM6rQQwPOKdStgSgfrOQtsuETwFaTlZW8qk7j3BUnCybWN7jSbU0mTxIpKl3gPORGahIG6SiwonNZwFYU5QUN2AFsVVGwBqJiXKRQM1tkUVJ6F5DpGnaC2wbmpS8KoILpv/FTgSehvgQrGOBp7cfSo69i0cYdrmZtQwOZPsa+KvfP4+8w02U6uiyMLCPvFhwRjRa3vK9wIMj/3YmW1oVANacPeBE86DHTlwJ/2LVq9rAbnANC4RNymgLLQEBK9nqYskt3/oCB3ULoeeZawfc+Pi9oXgZQGtWrbcTcG1reoCwDaEdTM+904Rb+xHQG7gZApz2+GE2oEazeRybIHdtWecs9UiTtjjXeCp1rXWDSmixMwAQQ9wKBbZ4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: af0ca22e-5cff-4a8f-e5d6-08dcb4e6e713 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:19.2788 (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: B+5RQmJFyywznd1FJlvHqCYZHeCHKPR5w+aP4pBbeBGFfk6EANdGmT/DMLIK7jW0GBY52SGU15a1haw3RsIVHVzAIV1kjz6aS+CtKl+TpipGRxUPCJSBH2Tk3/fciKVC 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/bebob/bebob_pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/bebob/bebob_pcm.c b/sound/firewire/bebob/bebob_pcm.c index ce49eef0fcbaa..882aab28dd96d 100644 --- a/sound/firewire/bebob/bebob_pcm.c +++ b/sound/firewire/bebob/bebob_pcm.c @@ -100,7 +100,7 @@ pcm_init_hw_params(struct snd_bebob *bebob, struct snd_bebob_stream_formation *formations; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = AM824_IN_PCM_FORMAT_BITS; s = &bebob->tx_stream; formations = bebob->tx_stream_formations; 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: 13752857 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+lzD3l4Y4MKjT9kEosCeSZ3k9CggYVvJu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OstAHElfqY8oapAM5DTyWOOrAkmhF58s0/k4rhS6XqfQDKcSQenynaGQtnUEP9K0fYfEts3rA3PkiNUeWzuk9YmGRa1HB0jYfWs53gDGD+q097rCpPzbAicUNay1rPjsCCHZZjXzK5rdNtJpZF9JmCPaTtU6wVqrh+eKsEk06jQCW8vbPhyQzM6wtbjoikryiFCrBaBeIouNrxVuV/0N8/kgaLT+ES5z3WWScFC50hlvkzyvXKjqQcsAPCQe66csEKnZKCAbUTcCNNI/zWzWdKsspyLedCw== 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: 7sc34kxOcaoXvuHWEViytn+5+9Ln8r0Tm8nmQEodw6tFosuL6p/UNmZNoqxuBtEB8UMCH8JJ0hTNoHDaxWz9jcNfyGdfRrJBNot4xGG2bC5pvlx8o/7/Btud5r/HOjoRYzc/mnqPhMPpFRQyUpEqaa0MY2hCxxMTiHclODsCCOuUWGucOEecGVW6q1TmXoPcvytB2YqjOMn8fLaw0733fVBOduBpy4K5ejo6lD+lr9+TWvx2vDH8HNA5evfPpjP6f+sKHGg+PADst87CpGBxd2NNAyw1K6yAkCp1bakO2hcd94XL/NCbj6r1wQ748yCtsWdUgOsBNNBv1RRRy6OagmOZAr+wRFxAGj56eYxR5QfQvzis5uFVCWymRPsN6qf2Rsk3bzQ8uJJJUhg/LCp2tfao5bldefbjfPEJCyJhdhJ1PRY5KdhmYh3qQn/DBU64RTitzU7xamKVlgmfZAJkFJ3dHvhEoQooCYrduMxMIfaH/+56kEjASxP+qQV/qe0fcVp89v3hFxPFm7fO8BXXDL7WQAFnnNaER98IJFS8tGOhm4HmWYKzdGqnPvxnFLY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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: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: 13752858 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011070.outbound.protection.outlook.com [52.101.125.70]) (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 A12E712E7F for ; Mon, 5 Aug 2024 00:38:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818312; cv=fail; b=qDCWKgyzrpqL768yCpdCokTLfBo4iwOf6qcnay1JuNYItKrl3ztbbV12YR8bdGITNJ/K0v05N63xgS989Eh6vhorSqQtkrSSYqOQPam7ReyM1Ek55uyhVnvvekvB3XAqlv7onYeoGsQhXABev9+c/kvCxkiEm1tsNuqMPcw5BIQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818312; c=relaxed/simple; bh=KJ7hHIXeqPpXiCeZu4OKeUR7q5AtfLVCay8a1Iub3QA=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=c2IHn8xr1dxa18s7X3dL4cWis8L7ghq+VPXxr+KWptEg/9gd+MG0MRgEmt3bqATS8O5E65cAfYNehhjs1BTX+XYq7jzjqjWPg0FUjJayNYlbBb6rWJmhT7H/TwfjGzr9UklEsna+j5HkzDZrKn39Qcpz/aBd6XpyZgXietTxfvA= 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=jhURBzIY; arc=fail smtp.client-ip=52.101.125.70 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="jhURBzIY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bDMgrchOgJqRRwSkmEYwEJa71tvC791lxdLKCZmOMYbmZEUkgs4i/mCZSgSzt2dm2Zdg/1DfHyFp9taV7iEZFfl+2a/v4YKXZsovl751rnBBikUFEP06vSf5aQghkgbcIj7mLZbZ8MEKWTbMRqkMuk9RGPB6ylDyzumCCUe+JJHNW9ukvFHeomKfQKCIVQ1MaLghFW9UuHPVriixJghad4RJEQmXjwjBIx0XGlXQkka6M7Gw6aeFi8NnkNVb6WSJt5hacCl5wiwGdg50qA/VLEO3sOsp/gVcCdgolSvYW7gU+WREtYkyxmFvUt00gaqoB8A6KDD5x/aeHcQNskPxJQ== 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=ZgMXDh5BBrEx3fDNH4NG18IPsWtxZY0FHEAj4bUfTqk=; b=Q0uRhwE4l9/B8VEZUiofoCSxfBf2N6IizPQ9u76F595d2taBXYDOMtAau4Nl1/12EbT+r0zJmxX8QvSrdilE47xiaQJ+3FUmAmnYdULwEDUihfYZb7rvg1ZEJPvca0m/rry9/cR0JANv7+BnWX+dtNfhdlp33znLejpAoCVnv8Yhz+mU1f2fwpVizcC8q+ZJA3fDXZeZrL4SEcdc4L91blDEt8sSqLt/bZORZ51Do6eROLYuPYApOyFa5nMbrTiJx5Vh6EQOMd4EHXVdnjzJGj3Hgc5R4OMF59KwMqDaZ1KqHAyOuLb41i9xlFlbWPk8GteRaA3NLBOryIXsOZ3AvA== 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=ZgMXDh5BBrEx3fDNH4NG18IPsWtxZY0FHEAj4bUfTqk=; b=jhURBzIY0kv2UIW85vIswfbBL54fKwpjlCiNvsqeBmGXcoUKSBhWpqyNHjADGw8SxbnYFcP1OGsM4auowbiz2CuHs48+6ps7dYiQgQBG/LG5C/746cBsFnLDItK6wl/DVIDpQ4hyq3xMyefqDwHUAKTFBxblT0Bs8kM6WoIMzuQ= 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: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:38:28 +0000 Message-ID: <87ikwfztvg.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 040/113] ALSA: firewire: digi00x: 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:28 +0000 X-ClientProxiedBy: TYAPR01CA0100.jpnprd01.prod.outlook.com (2603:1096:404:2a::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: 567a35fe-b585-4412-bf76-08dcb4e6ec7b 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: v+sO8IglqNAxnVp1KTFsbgd6NyF3W1xypioNKGxk8z9U7ooXVLzvQf0p9vjMD1U82ne5Ljvyf8ISj6SCDGM7FXMjnwDke3gFC07UCGdQbyNK7zaaDREx6+j3WRXg9rJd8btdXqkw6PIR0tTS87a1kEFGFxbHrAvtcouW24vgNoJ2vHyCPnRF5mAc2lCjuy28bKNMd6QIHz2uI853seFvv9T8MQ/yVp/BFfukHv34tiiKf47FXLqsJPD6flDSJesQAl5if7b6x80AwYAV6CfDs+cHhlx0fz5iPwwTtqBLtaCApA+QC2pNRS/TKDnIcQvP74cQp3rmsDXmFLQEEqiAIgOQAvdL0FcMUMNesSuTAHRgeswqKagQi3wrmtArg4k0Bj44NVZ/vXKXcICWPFUCOA0OkA1/G2NfL6Kej3SHfTKIXkkCgc4FrIAMZawI4+wiquuictasxU3tn5he/il5hMpyR8kJk7uggwuXoQxo1GOlOvA65gMPyS0LOM34vIOaj2pUeTFdhmCejaupio5lKh/e0pw1VyZkRZDWZLxqDwE0optIXxTL7PjMFbbY5liECu+5jcsxs98AgoBdCJY6evAXHb1nl87hXonQpO1m+dKtFG01IlOZUHRtmCuxtVbmu1lEfvRYBHX5utqlM4rJ4xXRG4SHwxMPLDdcXmoilVF3bzwCKh+PWjAg+pTslurVlcGmjZ2Zz4CP0+6BQlxudyFIllKmm6lq9xn6V4QTQcqFwc8qtAldazLBeWYcGXY70OTwyuNOX5+YpgyI5dHQjJzjl8d+BGxAhU0hf0qfOoFAISa7dz/YEC91RQ8TqYhKPpYiSvcJlNANDmIHiiDpqdqeWJaQLftLM8711VnqxN5M1bFLUa/gQ6b/C3xOmZ9w+Co+vVZVHmpABbNZU/Eh6VTZDMbFXGHu2tpO6eo4unfDeHP5BvOf4+Uig3AYIx3TIJ4SAeFOBKaqBbwkNt3Cc5e22/fK8Jx06O+IhljDotPTwHuWuSvTg2saTJafHD+N20/ORXDrksBhlev7gF1df967UakNM7I5vRD9jC6NJpCjQWgYrNOhHrN34iOzM7x7HFZm4/bo0+CWUt8kQAh1hEhjsrN9fkrLffk9KfPTgbfpddK7tR5IEyP/EOdu/vpJiN62+OgDNHLkxdA9yLMTphVPwcLVKvLwXkyVBkA83m2RVyebyT7J7qnW1ZqrhQQldDnmJ6rWgrtArd6aYQY5FK9wsuWeJ0TPnL4XPMR02pnUmw6HexHN3sChAS3mguClzDdXXRmF9XWMArck0fQVbIqrAoiEev6i2tTVYgZhxZKmskV9H+Iap2y/wR+asUa6s1FzsGCVc3A+JhNtdiDEgtnxAOWkZkFWj9PGLQzRTtTiLr9q5c5PDrAkDOSLOVbRRcD9WQPRVSmwo7DPHtSs2A== 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: zARYYYA9C5Qm/g09JRUgaxC3uwjGLvfxdeIC84I/jiAhVRDb5fF6QDBXz+ZyulOSr6A45Dsy4cpGHxBbWvF9tvgPJMX4utqxkArY1pq8ASfS+0w1NX6Yh5mlN0hHJR6kzhvDksnB1fYMvV1DWCSuuOKkH52FQUapLgmz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o0Vpv784msPgTZbnGyJcRoF88eTX3w/XJBF0VOqsAh44kiJop7boRjXKasyIZaSNBqY7UkPhysQe5hQBlLDDDxz8JL+mB/dmctsHhjC4Jp0qROYjs/H6k3A3PpVeyz42WjfHRqF8cCg5HeXbEsA2jx+HIZPpve5AjokJmC30dSCI7AmNGJiahTXsfjg+OsxoJhFSJfxY4ZGHRDKqobqPtwSlreaGmeeq1PJGzklRBKw9PG9Yijg5dZeZe1OQAl9YqEjThuJ6rLn7kElU04WnDGynwcEsMBa9pBeCcesNpvl487r5AqXaLDEQ0O48B7lIzUk7skVwgIFx4DBzDCXAhuHVB6dQZqa6VgWK4wOXSr91oV9Q6CMRkSqSQrdpQT1QK0oy1Gsy1MU6rYmWXs9QW/Q= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 567a35fe-b585-4412-bf76-08dcb4e6ec7b 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:28.3768 (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: 0++0KTCfFAGHaVIYs+DQlU8eiciyrsEM4mXK/ICuIGtaFC1/ikZOH/i75BL7nDsF15yyTa7spBCLkKY0EQZSxrxMOH6zI6qgKQ52PtODTM0CY6PRMecfxxehlb+nErPu 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/digi00x/digi00x-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/digi00x/digi00x-pcm.c b/sound/firewire/digi00x/digi00x-pcm.c index 3bd1575c9d9c1..42ffed7b19e36 100644 --- a/sound/firewire/digi00x/digi00x-pcm.c +++ b/sound/firewire/digi00x/digi00x-pcm.c @@ -63,7 +63,7 @@ static int pcm_init_hw_params(struct snd_dg00x *dg00x, int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { substream->runtime->hw.formats = SNDRV_PCM_FMTBIT_S32; s = &dg00x->tx_stream; } else { 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: 13752859 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|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: S+yzwpQxdf+ikIyepAdbNs2ZB+MBrP7cvplZO5ZITs1dDv5ZBKhdDuMZm1n4xfug7gBL2m3OsM5qScS2OwacXMiRQnVTOIikA72/vLaxnsEswUkjpCliuXQt8dBh688xmN7rHgLx9UTE+GKWrS204omHy+WXohxxAK4O5BWFXumAwEHCPhRrTwHIKfOKrfF2PmuuZnJDaM4cDrbZ/5MX3glGoDoIk+1x2xj4vFaJuX0mOtylB/W/PAGXfNKj9IQKurN3Bd6ziL4d4WlSCy65weObn+umIImzJxkRBjkRWcc2tKJ+q167t92Yz6lrdhkFCA3A6/CIecNXonOX+IwkowTKtCVIn5qn645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-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/mALeztecka0rVVcqMKrJDprDxf5O4BJl+Y6l4GdQkO58NfgOl21c3dOJEiIEi9I4dd0fUS5WOtOnUrPnLLmryQuott8b9NNdrRlQWLBg2JPVvY0L2Buq5/C2E1OBtP9TJXIoHcoEI3olsddefUiDlW/zekl1nJgg9ok1NdSAJs+/YG5E4CL7bBaqdK5lM7lKF3bTqQlFohyW/HmlRiagMUTQl668UmHzUkc+MF9RbNIeM0f9/I+h6BpU4mSN7p8QfqD2EG0HFPCC3nHS30AG2en4y0nAbfeynT9DYtWOLjvrinOG+gAKFajYGPXTbKYArL0U1gxE2lQECmAfxGSBWL30zyjCOxW2hc6LFwYniCcY4654jcsdkJW2vagLA+WAldXbqI7AXt5N2rCEp2+OOEyAEAqYP1sD2vFWV6UBGmWXQCWCWUnwg0F/Jw8tHmP8TYftUFgf+WjXLfaNpMm0RZXWYIvpIMviTGw5/9BTzx+RbE5b5beDMBHWI6Ziea/T3YNgzsVAps3cb/5JDW6E3inchoUHQy2xRK172eI5yIuLFqd/cXmQXsJBEHQKRdK6wrDK56Q9IIn4ej1Nbn7TvUpo6uIVx9pq+IZg6yV88ZSLJnHsJ2LWPNF7WyBkbCA32YU8WaB3x0ctRlxPa9Voio2qu3UgMU54CmdMDf2YqQbBkQYV8LEVxWoYhjssx/fsLbmrRGcUCBMTDNR0+hmoEnnEmb+v1rZ833uED3uAw6bU755WqLZlFtJjE5ZQIuE1CPAONFIKDcpZf0bOqlA9Vk7O9gaQBhzbI+/P1GMu0K15NmQveqpqwU9c4v1tX7LMEgIPGbfokejA2cJguK8daZwuTNDE9M2vndO7iuUQRJ2HZFVrgk1HFVfo4foWHRNDj3+OT8m5uYvwgy9pQEot56YkSu7+/Iy52ZT/WnD2zIpXkHb/j+/hr06R1DvbbrebuA9y7P2jU8d/ZbTR/sAVop6Rd9zAOLNAS/qOQ/qXUvdgi1G8cGn78IAI5iA6GfRNLKJHFiaihVikw2SjgVgxSB1m0l9IPCJnyAdaAr9NTjGUYLv27k72KcWv/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:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752860 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011057.outbound.protection.outlook.com [52.101.125.57]) (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 9CB19E57E for ; Mon, 5 Aug 2024 00:38:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818321; cv=fail; b=PA58hfQ176iKQJNeZuw+VKoHbg/oKhStMS4Je5TllSpp3vv+MxwtjPlD1h/jzOCOoHqeLC/JzfNiwjqRTeDnEb2xDGvdgsgHypqdLdC/U5Z7/yHlrPLgRs8sOY8xhcaQ0I6velwbJ4PPlnBm5bKiWl+CeygB5Rt2bDLp9waB2LQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818321; c=relaxed/simple; bh=jXgaZdZKOl7qnpPkbnaRcKfMOOayye5uwYZuglSBSJc=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=BnLjkR9ZQt5leezbLXfJJrTBI5MhEp5ElIGzPnFpDz4i1f99WFJczc0s969SRN4PMAONu1YenJnw+q/pjtUT3StSSsZrzZZSovRYErez9NlJQLG+PdPdfqiAHJ0+6CsZQRylG0ZYRXRZGUT/MMh2xwzFnnfl2NFIPdiXF/qHL0s= 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=nDzjTtjE; arc=fail smtp.client-ip=52.101.125.57 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="nDzjTtjE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jjkH8aq9i/wWh9nf5H8DIt80xsLlLHkPK6qCuDsNAbNJymnHyt34hMC3qARBC8w2uuSleiWw1fN9dfyKnIB1SpFZR6KC4QZNIDg5C9FHmPrvLDGvs8H5ECnmFbmk7IslkTMN7vKzLZIRBbVMEfaa272HMaiMOOYFBBRbI9t7F6kRdYVwOXAyv1li61Wt1JCd3T7R898Y9dbZGg3zeCO8nO1QdQGG/3qAAbaJp9wPlFST7A1HGRurTSlFVTrBBWj3+eBmKfhzBeZoL2XBfwVZrIo9qTHGCo7lm+Bi3w4YeQjgG/Ic8QmLDR06tTw/VHWvzKKssCP/HX0apnyEXc4b8Q== 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=12hFgdz9hQo/9MZP/E11BDxFAIYz5mHJ0vBTVsFlMrM=; b=A5b3FKp2ZDrdnZCN1SW5NR4/BYgE7SzWSCJncwava31aBWyNkjRRP7fZQkVteUfOw8pp8d7/WcOZ1pF3bEHN542RD00aRtKX8gQ4TktnioRIofmsuu2u6LuX2USgzgNmJCMHg5ZifEBUaqK7Lhdpwz120qO5u356WwOIdt6WgUHv+AN3ZBcJmQp5v/8CPrj+KTY4EpXBwKafdEpBxgu8qdtHrIGQ/MZ8EQCdpEV4SHrcNIxGfmvpfotNQXJHDvemBFYtrJpzO41YJmcNg2LIhEVbEDuyL4VxnLFXigIlaPSuyDCHb702qOwumu/MTUVjQTE4GmW8eegPp4oRDjGmlw== 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=12hFgdz9hQo/9MZP/E11BDxFAIYz5mHJ0vBTVsFlMrM=; b=nDzjTtjEbqav7M4QPHVy/UbJgOlVOInSBPVbY4Hq7W7eUSmIQfRto40Xt7+ia9nx69AbgD8MU57yj7lECXMXe+koKyY/LXn9OZnkgEJJTESDbR1fCvk5yJS1zrALYYko7Gsnl7nmzLFmCimREWo/A9S4BjLqc+Sq5N546upVJBQ= 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: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:38:37 +0000 Message-ID: <87frrjztv7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 042/113] ALSA: firewire: fireworks: 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:36 +0000 X-ClientProxiedBy: TY2PR06CA0022.apcprd06.prod.outlook.com (2603:1096:404:42::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: a3464bb0-00d2-49c0-d7de-08dcb4e6f1b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|52116014|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adDGpaxH/8AVSydDfBxenOlrljXxnuLltimH3babq41rtPr/4232tJmuOyyQuE6a0AxtnXC92zhS0WIYbNXyvtuQJBF0xhpOe2aoj71FyeH96ayp2+NBA4WbRNoZqUFYdVr8yiO3K4cotKkrvwwo2BPGjVafUgJ87UJeabPXTKTZPBokAYpCyBmUvk1/f7F88zXb6iG1dT1J3xmRgq8bCO/5VJeQGTyIhEEMi3AlEwL3zRniLro5eoBPIVI8KU0dc7GNq2UhRAsj+Qn223qCHwSNqJ9stHiXsosrQiZceXyNmB0mnfe308Pbu0N8w2oZ7DhgslvfCkS4Is7S1b4+wmbshDV2gD6QkVEXD6V2+X8FA6HEzOPWAOfIqtYAbDjGccgYMmBc+w== 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: kdQFXZlq9rC/v9Lu2zeQuY5P01W93r1CgN2a5YKS+5m7nBMUrQTU+1r9z7kFUXOMxGdKogm1XHLvGXTqKF1+yYEcbLCi6qIKZeOPJwM5eDN/ZzOnWLuRQhDlHVXS/FIbpRG5wgHtBqlN+4+9d+895G7+wW5HSpFZxdTLO0EYJWsMzLsJpHV30rxzmqaOxslkdOw5DcOb/IecD8G1p/aAzNoWEo8J3KNaajdfcwa22byre+LOYIulxwQNinf67ruTwVyhgSMWK8ii1+Bpaqz2TFJ9Gat8ahtuO/bkyaV46RFh/3IVFG9p+u253VV26lr93hVdBDapdbziWl4DcuXU9CLNg3vlNrOWcS7P81FGl0Qufut+DsJ4I1fbodWdfWgqzKZflWGQxj6lIVSghLE0aG8pg/TZiCwb3Uy/DrVluvUyqcaiCI9cKNpB1H4AkPA58Dp49ms7ziBqeNVL7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BddkF29mCOkc9eHeFDXjGa4l57qCDI0fpdgQnMOpOUdmCHK9xmxXyyRyunEqlyPD8Pq09mg6stkdwaRf+J664a2+J7x9A= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a3464bb0-00d2-49c0-d7de-08dcb4e6f1b3 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:37.1073 (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: h8TZArFHHtV2khCRq6OqUEGqDiEg/pwSpljCQ4paFjAZVP/bP2EDNuNOs+Idt2+DDqfnTOcZFD1/HWkS8M4ga9GbhuErXPhLNMfCX642JlEWkimBT7vhnJu+EpH9Q588 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/fireworks/fireworks_pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/fireworks/fireworks_pcm.c b/sound/firewire/fireworks/fireworks_pcm.c index c3c21860b245b..7ab42a6903e40 100644 --- a/sound/firewire/fireworks/fireworks_pcm.c +++ b/sound/firewire/fireworks/fireworks_pcm.c @@ -137,7 +137,7 @@ pcm_init_hw_params(struct snd_efw *efw, unsigned int *pcm_channels; int err; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.formats = AM824_IN_PCM_FORMAT_BITS; s = &efw->tx_stream; pcm_channels = efw->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: 13752861 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+xrF3JdBpHU3U3qoXMFTpnufHuMPRSI8xaYw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PGerxX8m0rWw9GkRETmAAle/0rwIJhOB/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: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: 13752862 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010070.outbound.protection.outlook.com [52.101.228.70]) (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 210E811717 for ; Mon, 5 Aug 2024 00:38:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818330; cv=fail; b=IHhBZpgaBsrfq7jOUJPJYcE95ftx0UCIRa5Ywepe5LZkzq3cMoc7dZQolZsyQIgovAvEroYyqt3pEBPJZXBFe7S9wCCpGb0txGJPYB1QEmpDuwcD4NKF8wXyo+r19az9dygEq/7sjdt2Xy+6Pw3Dh0g54c55H9ZmiADuk3wV/Rs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818330; c=relaxed/simple; bh=IVl5Pnocno5JypN9QmpCuk9Uqn9w1YkaCklg587gOaY=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=RRJzTgALnG5+T1K0eJIFGJiuCKq6halcLIIxGdnB1VrlKZHobHVBy8c4R6pST0gJZF0/csXQT3fykUIojO8GoKi88jLKmt9aiRY5U4BmMxUeMK+WzQJDclhvurF9DQe5+w/bPnQCXfJxcI5hZFIhFdfZHpVZ156bknUbxWpF00E= 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=M/aDZsmH; arc=fail smtp.client-ip=52.101.228.70 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="M/aDZsmH" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XM/7Dr5DcJh1ASq/aCgBu/4lXKvs0N1WUIS18Mjc925senksRmfGv0pTwEwC45FJ2cl1YcGaHr6Qq94CCiT7JECb1hfqHvuTyL59gZhBuqj352IdVWDybE/SPQSKJlyebQNo8S0lnMfSp+Xj5Eb5UbqaWT4GSeOGRBgQgd/22BEmyZK+/19C//AdEhT6iBe8paXr0UoBHn4SKRqtv6AtToMY/Oz30el7f5WpBWtmG5ni0XmDqbN5MjoT/FWY4v7N0YioHo02+snSytQvqA/aIwmzYdo8yZTBXGzyYhlFVAGFH/QXvmXlJhbx6f8bVZjzDltAs/XYTFKmVoo8W8hiuQ== 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=d1Tnz0jM8EDkt1JVWqMhraSWs42HkTV2gkn31r6HzZs=; b=wkWbCgS8ddL0xpX2rC2qYNSjRXhdFoXr2BwQZIctHrIsAeqVMF9cnWcllo8y7HsSug5z3QC715EnsY6AkDV9LmGeodtYgOgzsyItsAw27aPxP/id06zLHp9Pnyst3265UMFIb0xKrCJX0PWS1m1sUaMZyUJ0NQZ96friAH4dyKO42jARNc1z9usEMIikl3qHc0v7bejnVSP8TdPoy/hVGqfxC4qBjIvLOT6T7iwd9RRxfkztyoVMhnu0h3UMn8GXqun4eCWwqcm7vBif9XawYnW/odcPBHU7aVTGg047wUyJ/3cxpMCPLRj0+MhEdEGXZvhh+vd7Tnnle3unXsxggg== 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=d1Tnz0jM8EDkt1JVWqMhraSWs42HkTV2gkn31r6HzZs=; b=M/aDZsmHQTIq0Et5PcPZ95F12FYieMwUaUa+ijA3sH77b3PWvPiZWw2Jc3koOQhOgO4EF0O7rqcJ+32Sp1Wy/hxoI5e5+78VI5JchD3vXmxaRaqxmM0WnRrvbJa2hr5DzAEVVIkwGsiX2ZsACxEygOryldSZ8LHawwWp0Uk/GOs= 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: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:38:45 +0000 Message-ID: <87cymnztuy.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 044/113] ASoC: sh: 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:45 +0000 X-ClientProxiedBy: TYCPR01CA0199.jpnprd01.prod.outlook.com (2603:1096:405:7a::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: d10e942a-6d6e-41ec-5c28-08dcb4e6f6ac 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: UUE2ltwbmyhmJrIlfN0m6ZFpi0bnwjjifaAWe1IaNe7UpTBDJ0SKr+93hrIzOMOz8TyfGxud119orYfgbx02jKYUkwzl+OVK5QGf/SSwJEFUBkSLGR2ovue6Q6MdECnMEFKvqBMk99icH5nO7MUQic4ejMUkoUCPfuRfuG2zJ5eW03qJWkrD1jzDwQfPB8hZQwz9461j92473C00+xLDjHuDfXtfQt4L0kscvBtaYE4i/vrKIs8DbfkMsq9LJjdIGx/1e4Un81APgXVf+hjAfY9tN0Sg4hf0G4bxv6iDaNSmgfMtfIQrC8s03qJV280inKO/ISMYnmCP3weHj1QtJ/tpShCMLvVOEwcs0caO9h2oBp6SJjZGpGWALyUNycckDROE1EddhND5NVXEb7wFRSInsWHy4bRnykzRKqiWZxMeRjxBKZpnKZGvFCc0IPsVnwF51gN44LnNL9r3dp6THwhUvBSO7jpej2Bj7YPPM6Gwel6JpWjnwFK8et6fYv4+pyYHKWteeTPsl20iLRq0x9O1f8R1qo0Xjefu1Xwi/fZR/Dq2ULBkRlT5vYfU8e2GrBiSZo92+V41zRqlhvJFEHGX5drd/bmIS2ustt24yWI0U5Q9dTEqydrId7V9XuFYHcGu6zgN5ThA8YrslEobKdfuNMXldrZWylCTPAZ3Q6NNMEUEXvqAxsckDH+VO00DOvylo4PzraRIAdZkgzLgRSjYIgs7DboHWnfEw33L9pcLHnT1Mr1ZodkilK6tKbUJ8aEH3FY5DkJ04ybUhcXv5VQbg2rsIzxaKmZwUcVigGfgoM6Be+/JTMWZm5MaE9A1xgZ72+anIPeSpzsoqCDnjavUgWZxVapUIt/lkX71iP17BGvPYwjDJ57wdIet68mslWpD/McO2TQ5qFNSnowZCKSxxjP+iHg6uJ5mvcc16ZjveyEpup3a1je4gBgvFsAnp10qFYqUX8ylLuxPQKyHU6MV8GZp2WbNFg2usE3PNm1ztc687UCMMg15Gq0rQ877AwQW3bi6Y9tkvwYHTrXxU6dCLHFET9tmX9R4BCrKtb+dXHLc1/jzUKc0Rz/JNIha9RWli0er86V7SzrBmtlFrC/OGUkNyyIYyYaD/FC/+3jJx2rhF9m2xnHMCgylgQKDVQOmGQiWfoB+0yAM8H1sax33BEqR8n68XHNLMzNO2W7hXn2jnRnpESfYZryYzl9k3NpvF+4aGsJyuz90QdEBnDD4wET3ZpWraFQ0fgMqyU1ZHOPbZw+GfByTOPrGeTseSTwJOLna+33f823On9lpV4zauPzNr0Bbm18dHsVDNwD03UZkdwTfxm5oJqZhRZwaShS+RFkDsyjbQ7przE1UoztGh1xKj9dBFaBCsEX7OUls6aWJEg+QGC3NSZYJlcCyeACDZQc2sMGTYkbtDx5tww== 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: Jg0oyS8VxK0fvFnyXZPkjjpJLwaNHOaGey3qZI1iN1j3+g9xTLPs8pXhm06De42BCIC/YyJCryt8Nw0woQO7einx6tyaWZtdciw+PYYC4/Sc7SMkLZhX3iRqXCJwNOdTdqQ0S7/sn+rd+rYNhCFp315wvU+jjOaBTMrPHGJnOy5WUbyph0+Uq0HpXANJ3tTzZOhv87URfe4AOXs5eeKBfvdhe/V5FfBocJBWjTNevxxftXmGXHp3iM0NYAuinX6q5tK0fFUP4B93fYexlvJ5hDmVuYy9ExuRekqyXNZiZtrmRR2TTHX/JFpyUcHyFyeLHvbVFcO1YnMHmo3ujB8b63neezQfN7YEMHTe0t5+g2iL6O8eO2tke+9A6UvJnr7qf0D3bchxRFXgd+FtJQMP5s8R7PMI94pJHORr5ZI80CatSBMLLEYn539/4uFuWHwQ3fFMxileW5AuQsPafmVjurBifUbyL0dqA1h+T8YKRR11dPqJUAyBeXVPPycP5mZQzhkoAQmCI8+Z9quTMZw1pXr9irePx9BSDs0QU8/MZneCPUjvBqZfzrQOAnmeqgWd86UwaK0RYYKPO1xH7JyxVFjExDHOtN2OMIegw90HLparrGqxu0tg2x5fyZMyQe8O4/13hGA2OVifABsfh63xmwzTyn53gXhV7Iw+qywvUjKpixqhCgOFM3ey8TtB8QCIOfchltd6gw0bqXkSqufk/O87McmBt11PKAebabLMbcpuwy7PiTWehpas1MXeujPVT8IQvYfum3+ujWGgT7HwGgm8/XkjMZFBX43dMY97LdchEWFe3X6jXqJZTJLFiN3VJl+6D6ml/7nhe/k8zbyCC4x7acD0vXO1fnUjvOEZZx1jjF7qaDyaxoCR2+w1wUvnHWJ0h2QGo7bkW8UiMpu+oH+YVJgryTvWfu8o12xDv+gunaqT0oM7cnW7+TFw/pKuSxu6kF31TFlLk9uiJo3VCfpnXFEfuJtae+zanPwkiULTzwS/9NCFruRy99Sc2+a+D8Slhj7kTb2vydB4Ux3KWrC1aAVl1DiXmby48Ij6DC2fc6h9O9B6pglhb+i0LlXPit15ce+o6lfGHOUWn2OdeIddT6bdeQjOj9NCqcxPGG7a9M6aYp2uVRDWwnAUXdx7Th7kPkOAdhM3uSLEDPlWhkCgNyefp3gXArjni9Lraw0aKnmXuCUtzifqBwSgIj23L8STooz+clTfV9zVrgYNpuRIyEYufJy5sFJcngOYeuCqmo5uhcB1qwTH9Moxw2gPcIOrEJ5z5OnL+NkU+tFGKM2ifCGkKaORcESe8kD426ODjvjXHlwZyHuCGCemzfQwjq3MO+Usk6YUm1XBvWYspmPm12lxryzWsKW0wrAmnAb3p8IeV/euWZLJadfcurUUHloa8QGHegZqjyBJUXHAj2MuDgNkBLx4pOyjb/18pIUsttVL9TIkXWaVUM++4YxAi5sGxCjMaSm/ZPm5DAZx6BZgGKPTOTtJzCMuf0t33vPNt90eWgPE+kThck0cHho49hSSWR5gbeaiBcw7YZCEfGnwS/saaIq93LR1bwpNAiY2Z03A7zZ+anL4a7OajUQ7TrlK2qOsYXwGWsj+FkPPY5ibry24DqX3K9CeN4NV9FU= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d10e942a-6d6e-41ec-5c28-08dcb4e6f6ac 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:45.4687 (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: 5FFhpisahyfj2QOPNKwUfZqfiwHlCLTXC7f7syE6zs1/DVIxxjG4KyhmDKSulg2OvyzIA+j6sUlqMgA3IHkv6I7QFtbmOTrH0liMLEGqfsNjYkGyz1E+mVzznuz+AjIu 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/sh/dma-sh7760.c | 12 ++++++------ sound/soc/sh/fsi.c | 7 +------ sound/soc/sh/hac.c | 2 +- sound/soc/sh/rcar/core.c | 4 ++-- sound/soc/sh/rz-ssi.c | 14 ++++---------- sound/soc/sh/siu_dai.c | 4 ++-- sound/soc/sh/siu_pcm.c | 14 +++++++------- sound/soc/sh/ssi.c | 2 +- 8 files changed, 24 insertions(+), 35 deletions(-) diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index c53539482c208..32b30bbfaa88f 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c @@ -120,7 +120,7 @@ static int camelot_pcm_open(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); int ret, dmairq; snd_soc_set_runtime_hwparams(substream, &camelot_pcm_hardware); @@ -154,7 +154,7 @@ static int camelot_pcm_close(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); int dmairq; dmairq = (recv) ? cam->txid + 2 : cam->txid; @@ -176,7 +176,7 @@ static int camelot_hw_params(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); if (recv) { cam->rx_period_size = params_period_bytes(hw_params); @@ -198,7 +198,7 @@ static int camelot_prepare(struct snd_soc_component *component, pr_debug("PCM data: addr %pad len %zu\n", &runtime->dma_addr, runtime->dma_bytes); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { BRGREG(BRGATXSAR) = (unsigned long)runtime->dma_area; BRGREG(BRGATXTCR) = runtime->dma_bytes; } else { @@ -242,7 +242,7 @@ static int camelot_trigger(struct snd_soc_component *component, { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); switch (cmd) { case SNDRV_PCM_TRIGGER_START: @@ -270,7 +270,7 @@ static snd_pcm_uframes_t camelot_pos(struct snd_soc_component *component, struct snd_pcm_runtime *runtime = substream->runtime; struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct camelot_pcm *cam = &cam_pcm_data[snd_soc_rtd_to_cpu(rtd, 0)->id]; - int recv = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0:1; + int recv = snd_pcm_is_capture(substream); unsigned long pos; /* cannot use the DMABRG pointer register: under load, by the diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index 087e379aa3bc4..59198f615ed6a 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -398,11 +398,6 @@ static int fsi_is_enable_stream(struct fsi_priv *fsi) return fsi->enable_stream; } -static int fsi_is_play(struct snd_pcm_substream *substream) -{ - return substream->stream == SNDRV_PCM_STREAM_PLAYBACK; -} - static struct snd_soc_dai *fsi_get_dai(struct snd_pcm_substream *substream) { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); @@ -492,7 +487,7 @@ static void fsi_count_fifo_err(struct fsi_priv *fsi) static inline struct fsi_stream *fsi_stream_get(struct fsi_priv *fsi, struct snd_pcm_substream *substream) { - return fsi_is_play(substream) ? &fsi->playback : &fsi->capture; + return snd_pcm_is_playback(substream) ? &fsi->playback : &fsi->capture; } static int fsi_stream_is_working(struct fsi_priv *fsi, diff --git a/sound/soc/sh/hac.c b/sound/soc/sh/hac.c index cc200f45826c3..dc724042d336e 100644 --- a/sound/soc/sh/hac.c +++ b/sound/soc/sh/hac.c @@ -237,7 +237,7 @@ static int hac_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct hac_priv *hac = &hac_cpu_data[dai->id]; - int d = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? 0 : 1; + int d = snd_pcm_is_capture(substream); switch (params->msbits) { case 16: diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 15cb5e7008f9f..9e719a01769ba 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -683,7 +683,7 @@ static struct rsnd_dai_stream *rsnd_rdai_to_io(struct rsnd_dai *rdai, struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return &rdai->playback; else return &rdai->capture; @@ -1004,7 +1004,7 @@ static int rsnd_soc_dai_startup(struct snd_pcm_substream *substream, * It depends on Clock Master Mode */ if (rsnd_rdai_is_clk_master(rdai)) { - int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + int is_play = snd_pcm_is_playback(substream); snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, rsnd_soc_hw_rule_rate, diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c index d0bf0487bf1bd..d0afc9ced950b 100644 --- a/sound/soc/sh/rz-ssi.c +++ b/sound/soc/sh/rz-ssi.c @@ -171,18 +171,12 @@ rz_ssi_get_dai(struct snd_pcm_substream *substream) return snd_soc_rtd_to_cpu(rtd, 0); } -static inline bool rz_ssi_stream_is_play(struct rz_ssi_priv *ssi, - struct snd_pcm_substream *substream) -{ - return substream->stream == SNDRV_PCM_STREAM_PLAYBACK; -} - static inline struct rz_ssi_stream * rz_ssi_stream_get(struct rz_ssi_priv *ssi, struct snd_pcm_substream *substream) { struct rz_ssi_stream *stream = &ssi->playback; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) stream = &ssi->capture; return stream; @@ -349,7 +343,7 @@ static void rz_ssi_set_idle(struct rz_ssi_priv *ssi) static int rz_ssi_start(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm) { - bool is_play = rz_ssi_stream_is_play(ssi, strm->substream); + bool is_play = snd_pcm_is_playback(strm->substream); bool is_full_duplex; u32 ssicr, ssifcr; @@ -682,7 +676,7 @@ static int rz_ssi_dma_transfer(struct rz_ssi_priv *ssi, */ return 0; - dir = rz_ssi_stream_is_play(ssi, substream) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; + dir = snd_pcm_is_playback(substream) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM; /* Always transfer 1 period */ amount = runtime->period_size; @@ -808,7 +802,7 @@ static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd, if (ssi->dma_rt) { bool is_playback; - is_playback = rz_ssi_stream_is_play(ssi, substream); + is_playback = snd_pcm_is_playback(substream); ret = rz_ssi_dma_slave_config(ssi, ssi->playback.dma_ch, is_playback); /* Fallback to pio */ diff --git a/sound/soc/sh/siu_dai.c b/sound/soc/sh/siu_dai.c index d0b5c543fd2f8..e747d34b51580 100644 --- a/sound/soc/sh/siu_dai.c +++ b/sound/soc/sh/siu_dai.c @@ -521,7 +521,7 @@ static void siu_dai_shutdown(struct snd_pcm_substream *substream, dev_dbg(substream->pcm->card->dev, "%s: port=%d@%p\n", __func__, info->port_id, port_info); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) port_info->play_cap &= ~PLAYBACK_ENABLED; else port_info->play_cap &= ~CAPTURE_ENABLED; @@ -550,7 +550,7 @@ static int siu_dai_prepare(struct snd_pcm_substream *substream, "%s: port %d, active streams %lx, %d channels\n", __func__, info->port_id, port_info->play_cap, rt->channels); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { self = PLAYBACK_ENABLED; siu_stream = &port_info->playback; } else { diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c index f15ff36e79345..27ee6fd6d35c2 100644 --- a/sound/soc/sh/siu_pcm.c +++ b/sound/soc/sh/siu_pcm.c @@ -214,7 +214,7 @@ static void siu_io_work(struct work_struct *work) return; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { dma_addr_t buff; size_t count; @@ -306,7 +306,7 @@ static int siu_pcm_open(struct snd_soc_component *component, dev_dbg(dev, "%s, port=%d@%p\n", __func__, port, port_info); - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(ss)) { siu_stream = &port_info->playback; param = &siu_stream->param; param->shdma_slave.slave_id = port ? pdata->dma_slave_tx_b : @@ -340,7 +340,7 @@ static int siu_pcm_close(struct snd_soc_component *component, dev_dbg(dev, "%s: port=%d\n", __func__, info->port_id); - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) siu_stream = &port_info->playback; else siu_stream = &port_info->capture; @@ -363,7 +363,7 @@ static int siu_pcm_prepare(struct snd_soc_component *component, struct siu_stream *siu_stream; snd_pcm_sframes_t xfer_cnt; - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) siu_stream = &port_info->playback; else siu_stream = &port_info->capture; @@ -413,7 +413,7 @@ static int siu_pcm_trigger(struct snd_soc_component *component, switch (cmd) { case SNDRV_PCM_TRIGGER_START: - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) ret = siu_pcm_stmwrite_start(port_info); else ret = siu_pcm_stmread_start(port_info); @@ -424,7 +424,7 @@ static int siu_pcm_trigger(struct snd_soc_component *component, break; case SNDRV_PCM_TRIGGER_STOP: - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) siu_pcm_stmwrite_stop(port_info); else siu_pcm_stmread_stop(port_info); @@ -455,7 +455,7 @@ siu_pcm_pointer_dma(struct snd_soc_component *component, size_t ptr; struct siu_stream *siu_stream; - if (ss->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(ss)) siu_stream = &port_info->playback; else siu_stream = &port_info->capture; diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c index 96cf523c22734..f77b4d9a4a205 100644 --- a/sound/soc/sh/ssi.c +++ b/sound/soc/sh/ssi.c @@ -135,7 +135,7 @@ static int ssi_hw_params(struct snd_pcm_substream *substream, channels = params_channels(params); bits = params->msbits; - recv = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? 0 : 1; + recv = snd_pcm_is_capture(substream); pr_debug("ssi_hw_params() enter\nssicr was %08lx\n", ssicr); pr_debug("bits: %u channels: %u\n", bits, channels); 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: 13752863 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-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TEeizDqI6UTkgvCWDUp0IoBdDxK0/wzIQexoy+WDklZp8rZqWkwEYNvIfgceT4pl0E0ysC0RgRJ6oWmPzMJJnYGLyIe/ClK18Yo/jtn1MsEGFMMhrRQVeZh8VBjt3RAMqjuWOXXcsB5zyw+Ey9X2wZ1zb4XGS/SNsIkmgBqSOwm53YDWwE5tMtRdUiMiJqn/wEYtGyxwkVhnxIv37cRHzSvkXrthID8IUyde5Z059MN/txF+V/YoROx5f75HZEns2Ebx7TvW4KiuxVmtC/ccjvk0f9jyuV6dvqMqOfgmsCcqnXxwq4nGx60C6t8nS9HGCtykfJpI8LH5L2WuTtU9JUNFSFY5oN8GAqQW+FWkSRP6VJMgbyOd29LbcWQwPbdK8RwqIzlh30hTLuXOtubhY214Ub5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VNxieazt2CBSWiCHZNshn8tOsuzNGEQaSdZcoWJm2hfFjzIIXpWYFOOH8Ea2V1cEHB1BAcx1kmBgExgrHone+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: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: 13752864 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 D44F2C148 for ; Mon, 5 Aug 2024 00:38:56 +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=1722818339; cv=fail; b=B/KsQUGcJZaErqfuAPA521XN1zBT0VOqPtR7pGlvGM1QRbHiMcyrGIuQEWVdUxEKyMZaeozHuGzXKnJqryzdNmdlyhT+mGq3DOHFTXvo7U+2G0n4noGboNeluruNSXO9EtTp8GD+TntikdHTIjHUoORdYGISq5EPUFcvHyaFE/g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818339; c=relaxed/simple; bh=nsEKi7KDRRpua5sTetmxxdDql0FNa8KTpJPJz/m7DLo=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=szD/NkqTQyKT7BScg6Hk+i6HP6oTPTxE+aNkdmq1pf4wxS0LQpMagso17TVHEYBqgzayvMKnS/lxGfRGaBExitQOep2uNCKAUD3VnKreKEaLcwLtSrjC0rfgATyYdd4ImXSRLRqIKu4/RstbSzSj9ZXMaxSVqFtDYnCeP4HPpLM= 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=CcGnlDfg; 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="CcGnlDfg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cNqOKONDz+eIxdTxg8bRAt/cN+ab0AbL6w8i7dxgxc6m84WkKyPRIJonFmvPBfDpRtsmKr08P7P9RWS+6NSNjwOz9kSyDAaj0R26kuYl0YGO52p84n63iwLl5lIAfW4uGxIcdaW+HahnXWzBLwuzzhEBTzkp9AF6Ztj/iGytSoZodd4rV9m0KHNowr2R5l9gDWMCNatz0jboOOq0w5Baxcn7snG9wkPCxVDS3h9cXZmNp73TfQGL+Szc6Gz4I56Q9Vn6x2Hqe4zXCwMaa4wtDt2zvZbpN1Ef0a1Vy0fqcLNp/3odv/Zi0AEJI/42Fx4yVvZhOuFibpF6lUApevLN1Q== 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=kqUXevHHAlixeXM/1OxjdcwV14TUzsjb7SmcQR/fae8=; b=xuaTiV+GdEoj7O2hokpN46MknC4HKYYpksjEF/D3shBIKuPnf5BuMhJvilawLlSQ6lrBtHaVwlT/T4JDLuFqbOswoUxxrnD6zTTQQ6XuDEKhaWij/AI5SCRePjsd8itwwKGj5iCOf2x+t45lAk0UIgVup0k+jkx5F9WvsLb0mlrAhq7+L5TZFJHi3Zsrk2Fptis6Qj8uaTLXuqiO3Gfe4RzeWUudIdD9y5bv7uuwmn2S8FGwbr/Se65ZD2KjJR1avae34I2h6ub7PeX60jf7iRPwfXiV00j1M5gUpoHbPRWMzKVTDPbLMcFCL4ukCS2410+w5LHo0ncWLIA5rf7zAA== 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=kqUXevHHAlixeXM/1OxjdcwV14TUzsjb7SmcQR/fae8=; b=CcGnlDfgW8a43Z2z8rqmuazEs3TNSOKOEi2nzddho8JM29NhZ+a5RDyNOin2juEGGCas5k41pL2gRc6V5JIlsyhrL4U477VfUhTR6R7D0wKd+ax8YpR6I+oTH5gvGv+OWAfQRullW5d4GLp8DmPyRK30QgmyYC2rMunRc6BaHzE= 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: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:38:54 +0000 Message-ID: <87a5hrztuq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 046/113] ASoC: amd: 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:54 +0000 X-ClientProxiedBy: TYAPR01CA0159.jpnprd01.prod.outlook.com (2603:1096:404:7e::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 270868b1-cf64-4947-47c5-08dcb4e6fbeb 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: n/W1zy4lqG3EH0JOeQ7anYvaJFOAh2pRv4z3lfzSM4IvL9U1MoOQJH88Mn62CQyiBv7V82KvP/vdPtw0TPXnnHxQaNbMAw66DM4mE37ODXyAVDSGbJbBYXG88JNFAJ6zN0BgR2EpogvFYSXh7F5ZWAmeH99cdunpBjR5UX9YJQcwGIjt/NPocLRf60dWnKLdy0xEwkt49Fq0W/33UH4F9oNSHSAU3rTWQ1tVs3dJleVWOuNuyhoQkWS1uZ9qLAuChSMCZzYT5MaBIa6yAW3b6BtsWbAcgpeCLmGSDun8xo2lNZbxRWKsSoWLp5ZTOfUWn9sn4WraoGIlzX21qUA8XRdoq7MlvJc57W1khQXC8FjHURh4CYjg8+COHtUA7gTEtGOiadkRMe0l9Yigx7HYzsp7G2OId4tVGcGvHAde+mzVhta88ANdxQrcXFjNA1b+KYoaETD3PFKc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;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: WIyvfWxZEO1j2tmBbUxUvYusFvPedCwAh6kmYaZqoIpcrF29waX3tew5PKINocwWIOXJh+k535Ck6Bc+PIh8TXKuCwVHDkjpBDTJmL05jsX0CS8ikVAi8Ujd7esWUInUSUD6WgpMcNOleiz0oOxseD5o2q8ID5jjjRCrt0JtS4eHvsrRTBU1//drKMCHPMkVUnnlTM9Hbs7gBMFbeh55NIg2TMMIxqjlnBgsaPk3F3Wjs6p5OX1YbI40N/VF7xR5ATSCtvTGwt7bOxSJFAbsDl8Tb3Lc63XYLZMTYoz+ABsO5RRCJ/vcVew9tahJLULRf0Mm3gojgShoRQeZog7Aemy9cdW99NdHQDGxtqXMhy3v2CfFhfz8Dpa+whBA6fFwn32/52qHH3JFHz5YK8xqBx9GUBOKP1zJg/cWzddrfF2C2KhnNvPXDux6jzLfnKvDrn87PicbXos7N7cUNza1lW1ZGvxPEaIo28IC17/9m14OJnhPqtoSW+Q2us+PDb26uFY/he7A/y/oZJJnajCmbhHg2lrNPpmD3Onqf831ehBbWAvGwoTUJ5WtmYE+p6+DcZFZ+7ywIBwl/gmUbktiMT8sGpHduRYeRfxRbycdE/QDrF8u5GnLQZe8gadJsyYi8Zbl6Dm09liVZEqMS7L01PrW51sKYwnmpl5kwdIeuaUoyMcjn/AkrAGb83M37F2G/fIvw4lGlG2G5QecpuohSGGalcUYfPosSVSFyCxx1tFvqFFP6cGa8N0L/5e7lOm2Z2kmXQYyouE6TZXWeYnJbJQpyC86TMB0sugJmYXTAg89cywfzrP1CZuhxBQ6HmK5HybrBf78y6FpZsUBvspp3t3C3tzubDevOokGc6aNvKP7JJ71QT1f0mRGf1XggAT8wr3BGUTNSVI3GN6A9tu/MwbLDwRbcWcbJ46xpXNpkIIxreep2FO/EhI6I7JNGLSuoe1TKDS+tz2VvEPY7F+I3HSrZYuL4C/W4nQY16XRw0mD2udhq7z5SR6QzKHkO/Y3N7EErawJ9iEmFFtPpRXs6OoHfJNSL3JHE669DiZcZhxQOS2I8mSYiftXePakEbvlkBIaJzUQzHU6W9AQ4+JMLhfexSL0FXybA/l3+YKlGxAU04iS/4XXhq9DR5QNb1Spn7KXcAShpHLATX91w7WYg2XAWMxMz+4og0eIoxKLmyFLwvHgr3qCP+rDJLCAX33qz427YX4tLCZ9+7TBIPVZWhUKL2kU3HTonK4UKJn2hznfIObj/TMmnk5xRzTHxHbZaEAJyvnqF4WSHPxg5fqcR9FzyaQWsSIsLp4E5oG0X5Z0Xn7apaxLL4gZU9jNg5mYncaxo+XW6VnB/GFKNm/Jd98kQgcBOyEvH14etDo228cKkBQ8VLGXzI/1y4vXVYnqKOi4w1nAfzYxjz5Z7F6pq4JUzgfNqeVYFAvWpWtdLV03WObImqyjyv7xfvsercEV+drfuSwITXB1zB/A0tGMj79uj4XG50XB9ILBgnBkyeS5IkwfeAa0wMow6ke9/SMFPmbJMB9cfF5YM+T+q+H+hDvXrYlWctNwHQe6TCWXX+qy9VqHtR2IMLiIXmrUrxITrfjkrOqltQC7lkkxJq6Je6/+2p3g7hc1psQ0YVI+bcg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 270868b1-cf64-4947-47c5-08dcb4e6fbeb 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:54.2734 (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: h49qLPR68J/jkTVoj2D31zW1ib40A1oCNVjDRe3Sp9CD8LhG9O2LFDrBu32RIxteVE21TjU2KQ77rQIlC+ATq1zpk/JjA0tdKEhBqzowRzFLUJNkhKHPvgaaCNrk9VXH 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/amd/acp-pcm-dma.c | 24 ++++++++++++------------ sound/soc/amd/acp/acp-i2s.c | 24 ++++++++++++------------ sound/soc/amd/acp/acp-legacy-common.c | 8 ++++---- sound/soc/amd/acp/acp-platform.c | 2 +- sound/soc/amd/acp/acp-sdw-sof-mach.c | 4 ++-- sound/soc/amd/acp/amd.h | 2 +- sound/soc/amd/ps/ps-pdm-dma.c | 4 ++-- sound/soc/amd/ps/ps-sdw-dma.c | 4 ++-- sound/soc/amd/raven/acp3x-i2s.c | 8 ++++---- sound/soc/amd/raven/acp3x-pcm-dma.c | 10 +++++----- sound/soc/amd/raven/acp3x.h | 2 +- sound/soc/amd/renoir/acp3x-pdm-dma.c | 4 ++-- sound/soc/amd/vangogh/acp5x-i2s.c | 8 ++++---- sound/soc/amd/vangogh/acp5x-pcm-dma.c | 10 +++++----- sound/soc/amd/vangogh/acp5x.h | 2 +- sound/soc/amd/yc/acp6x-pdm-dma.c | 4 ++-- 16 files changed, 60 insertions(+), 60 deletions(-) diff --git a/sound/soc/amd/acp-pcm-dma.c b/sound/soc/amd/acp-pcm-dma.c index b857e2676fe8c..39d2b1538b27b 100644 --- a/sound/soc/amd/acp-pcm-dma.c +++ b/sound/soc/amd/acp-pcm-dma.c @@ -210,7 +210,7 @@ static void set_acp_sysmem_dma_descriptors(void __iomem *acp_mmio, for (i = 0; i < NUM_DSCRS_PER_CHANNEL; i++) { dmadscr[i].xfer_val = 0; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { dma_dscr_idx = dma_dscr_idx + i; dmadscr[i].dest = sram_bank + (i * (size / 2)); dmadscr[i].src = ACP_INTERNAL_APERTURE_WINDOW_0_ADDRESS @@ -268,7 +268,7 @@ static void set_acp_to_i2s_dma_descriptors(void __iomem *acp_mmio, u32 size, for (i = 0; i < NUM_DSCRS_PER_CHANNEL; i++) { dmadscr[i].xfer_val = 0; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { dma_dscr_idx = dma_dscr_idx + i; dmadscr[i].src = sram_bank + (i * (size / 2)); /* dmadscr[i].dest is unused by hardware. */ @@ -336,7 +336,7 @@ static void config_acp_dma(void __iomem *acp_mmio, acp_pte_config(acp_mmio, rtd->dma_addr, rtd->num_of_pages, rtd->pte_offset); - if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(rtd->direction)) { ch_acp_sysmem = rtd->ch1; ch_acp_i2s = rtd->ch2; } else { @@ -779,7 +779,7 @@ static int acp_dma_open(struct snd_soc_component *component, if (!adata) return -ENOMEM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (intr_data->asic_type) { case CHIP_STONEY: runtime->hw = acp_st_pcm_hardware_playback; @@ -819,7 +819,7 @@ static int acp_dma_open(struct snd_soc_component *component, !intr_data->play_i2s_micsp_stream) acp_reg_write(1, adata->acp_mmio, mmACP_EXTERNAL_INTR_ENB); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* * For Stoney, Memory gating is disabled,i.e SRAM Banks * won't be turned off. The default state for SRAM banks is ON. @@ -861,7 +861,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component, return -EINVAL; if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { rtd->i2s_instance = pinfo->play_i2s_instance; } else { rtd->i2s_instance = pinfo->cap_i2s_instance; @@ -871,7 +871,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component, if (adata->asic_type == CHIP_STONEY) { val = acp_reg_read(adata->acp_mmio, mmACP_I2S_16BIT_RESOLUTION_EN); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: val |= ACP_I2S_BT_16BIT_RESOLUTION_EN; @@ -898,7 +898,7 @@ static int acp_dma_hw_params(struct snd_soc_component *component, mmACP_I2S_16BIT_RESOLUTION_EN); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: rtd->pte_offset = ACP_ST_BT_PLAYBACK_PTE_OFFSET; @@ -1043,7 +1043,7 @@ static snd_pcm_uframes_t acp_dma_pointer(struct snd_soc_component *component, if (!rtd) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { period_bytes = frames_to_bytes(runtime, runtime->period_size); bytescount = acp_get_byte_count(rtd); if (bytescount >= rtd->bytescount) @@ -1092,7 +1092,7 @@ static int acp_dma_prepare(struct snd_soc_component *component, if (!rtd) return -EINVAL; - if (rtd->direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(rtd->direction)) { ch_acp_sysmem = rtd->ch1; ch_acp_i2s = rtd->ch2; } else { @@ -1125,7 +1125,7 @@ static int acp_dma_trigger(struct snd_soc_component *component, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: case SNDRV_PCM_TRIGGER_RESUME: rtd->bytescount = acp_get_byte_count(rtd); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { if (rtd->capture_channel == CAP_CHANNEL0) { acp_dma_cap_channel_disable(rtd->acp_mmio, CAP_CHANNEL1); @@ -1190,7 +1190,7 @@ static int acp_dma_close(struct snd_soc_component *component, struct audio_substream_data *rtd = runtime->private_data; struct audio_drv_data *adata = dev_get_drvdata(component->dev); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: adata->play_i2sbt_stream = NULL; diff --git a/sound/soc/amd/acp/acp-i2s.c b/sound/soc/amd/acp/acp-i2s.c index 97258b4cf89b0..eafa6262e6feb 100644 --- a/sound/soc/amd/acp/acp-i2s.c +++ b/sound/soc/amd/acp/acp-i2s.c @@ -132,10 +132,10 @@ static int acp_i2s_set_tdm_slot(struct snd_soc_dai *dai, u32 tx_mask, u32 rx_mas spin_lock_irq(&adata->acp_lock); list_for_each_entry(stream, &adata->stream_list, list) { - if (tx_mask && stream->dir == SNDRV_PCM_STREAM_PLAYBACK) + if (tx_mask && snd_pcm_is_playback(stream->dir)) adata->tdm_tx_fmt[stream->dai_id - 1] = FRM_LEN | (slots << 15) | (slot_len << 18); - else if (rx_mask && stream->dir == SNDRV_PCM_STREAM_CAPTURE) + else if (rx_mask && snd_pcm_is_capture(stream->dir)) adata->tdm_rx_fmt[stream->dai_id - 1] = FRM_LEN | (slots << 15) | (slot_len << 18); } @@ -176,7 +176,7 @@ static int acp_i2s_hwparams(struct snd_pcm_substream *substream, struct snd_pcm_ return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (dai->driver->id) { case I2S_BT_INSTANCE: reg_val = ACP_BTTDM_ITER; @@ -224,7 +224,7 @@ static int acp_i2s_hwparams(struct snd_pcm_substream *substream, struct snd_pcm_ if (adata->tdm_mode) { val = readl(adata->acp_base + reg_val); writel(val | BIT(1), adata->acp_base + reg_val); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tdm_fmt = adata->tdm_tx_fmt[dai->driver->id - 1]; else tdm_fmt = adata->tdm_rx_fmt[dai->driver->id - 1]; @@ -318,7 +318,7 @@ static int acp_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: stream->bytescount = acp_get_byte_count(adata, stream->dai_id, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (dai->driver->id) { case I2S_BT_INSTANCE: water_val = ACP_BT_TX_INTR_WATERMARK_SIZE; @@ -379,7 +379,7 @@ static int acp_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct 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)) { switch (dai->driver->id) { case I2S_BT_INSTANCE: reg_val = ACP_BTTDM_ITER; @@ -444,7 +444,7 @@ static int acp_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_d switch (dai->driver->id) { case I2S_SP_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_I2S_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + SP_PB_FIFO_ADDR_OFFSET; @@ -464,7 +464,7 @@ static int acp_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_d } break; case I2S_BT_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_BT_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + BT_PB_FIFO_ADDR_OFFSET; @@ -485,7 +485,7 @@ static int acp_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_d } break; case I2S_HS_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_HS_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + HS_PB_FIFO_ADDR_OFFSET; @@ -538,7 +538,7 @@ static int acp_i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_d switch (dai->driver->id) { case I2S_SP_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { irq_bit = BIT(I2S_TX_THRESHOLD(rsrc->offset)); stream->pte_offset = ACP_SRAM_SP_PB_PTE_OFFSET; stream->fifo_offset = SP_PB_FIFO_ADDR_OFFSET; @@ -549,7 +549,7 @@ static int acp_i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_d } break; case I2S_BT_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { irq_bit = BIT(BT_TX_THRESHOLD(rsrc->offset)); stream->pte_offset = ACP_SRAM_BT_PB_PTE_OFFSET; stream->fifo_offset = BT_PB_FIFO_ADDR_OFFSET; @@ -560,7 +560,7 @@ static int acp_i2s_startup(struct snd_pcm_substream *substream, struct snd_soc_d } break; case I2S_HS_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { irq_bit = BIT(HS_TX_THRESHOLD(rsrc->offset)); stream->pte_offset = ACP_SRAM_HS_PB_PTE_OFFSET; stream->fifo_offset = HS_PB_FIFO_ADDR_OFFSET; diff --git a/sound/soc/amd/acp/acp-legacy-common.c b/sound/soc/amd/acp/acp-legacy-common.c index 4422cec81e3c4..35cd4b2b86cf2 100644 --- a/sound/soc/amd/acp/acp-legacy-common.c +++ b/sound/soc/amd/acp/acp-legacy-common.c @@ -112,7 +112,7 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream, switch (dai->driver->id) { case I2S_SP_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_I2S_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + SP_PB_FIFO_ADDR_OFFSET; @@ -131,7 +131,7 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream, } break; case I2S_BT_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_BT_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + BT_PB_FIFO_ADDR_OFFSET; @@ -150,7 +150,7 @@ static int set_acp_i2s_dma_fifo(struct snd_pcm_substream *substream, } break; case I2S_HS_INSTANCE: - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { reg_dma_size = ACP_HS_TX_DMA_SIZE; acp_fifo_addr = rsrc->sram_pte_offset + HS_PB_FIFO_ADDR_OFFSET; @@ -199,7 +199,7 @@ int restore_acp_i2s_params(struct snd_pcm_substream *substream, soc_runtime = snd_soc_substream_to_rtd(substream); dai = snd_soc_rtd_to_cpu(soc_runtime, 0); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { tdm_fmt = adata->tdm_tx_fmt[stream->dai_id - 1]; switch (stream->dai_id) { case I2S_BT_INSTANCE: diff --git a/sound/soc/amd/acp/acp-platform.c b/sound/soc/amd/acp/acp-platform.c index 4f409cd09c11c..d4b7355a1d989 100644 --- a/sound/soc/amd/acp/acp-platform.c +++ b/sound/soc/amd/acp/acp-platform.c @@ -192,7 +192,7 @@ static int acp_dma_open(struct snd_soc_component *component, struct snd_pcm_subs stream->substream = substream; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = acp_pcm_hardware_playback; else runtime->hw = acp_pcm_hardware_capture; diff --git a/sound/soc/amd/acp/acp-sdw-sof-mach.c b/sound/soc/amd/acp/acp-sdw-sof-mach.c index 3419675e45a98..85f9fcbfe822b 100644 --- a/sound/soc/amd/acp/acp-sdw-sof-mach.c +++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c @@ -450,8 +450,8 @@ static int create_sdw_dailink(struct snd_soc_card *card, cpus[k].dai_name = cpu_name; } - playback = (stream == SNDRV_PCM_STREAM_PLAYBACK); - capture = (stream == SNDRV_PCM_STREAM_CAPTURE); + playback = snd_pcm_is_playback(stream); + capture = snd_pcm_is_capture(stream); asoc_sdw_init_dai_link(dev, *dai_links, be_id, name, playback, capture, cpus, cpu_dai_num, diff --git a/sound/soc/amd/acp/amd.h b/sound/soc/amd/acp/amd.h index 87a4813783f91..90b0716e5f2f5 100644 --- a/sound/soc/amd/acp/amd.h +++ b/sound/soc/amd/acp/amd.h @@ -253,7 +253,7 @@ static inline u64 acp_get_byte_count(struct acp_dev_data *adata, int dai_id, int { u64 byte_count = 0, low = 0, high = 0; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (dai_id) { case I2S_BT_INSTANCE: high = readl(adata->acp_base + ACP_BT_TX_LINEARPOSITIONCNTR_HIGH); diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c index 7bbacbab10950..256271a270286 100644 --- a/sound/soc/amd/ps/ps-pdm-dma.c +++ b/sound/soc/amd/ps/ps-pdm-dma.c @@ -193,7 +193,7 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component, if (!pdm_data) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) runtime->hw = acp63_pdm_hardware_capture; ret = snd_pcm_hw_constraint_integer(runtime, @@ -206,7 +206,7 @@ static int acp63_pdm_dma_open(struct snd_soc_component *component, acp63_enable_pdm_interrupts(adata); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) adata->capture_stream = substream; pdm_data->acp63_base = adata->acp63_base; diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c index 2f630753278dc..0f253912f032e 100644 --- a/sound/soc/amd/ps/ps-sdw-dma.c +++ b/sound/soc/amd/ps/ps-sdw-dma.c @@ -228,7 +228,7 @@ static int acp63_sdw_dma_open(struct snd_soc_component *component, if (!stream) return -ENOMEM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = acp63_sdw_hardware_playback; else runtime->hw = acp63_sdw_hardware_capture; @@ -270,7 +270,7 @@ static int acp63_sdw_dma_hw_params(struct snd_soc_component *component, sdw_data->sdw0_dma_stream[stream_id] = substream; water_mark_size_reg = sdw0_dma_ring_buf_reg[stream_id].water_mark_size_reg; acp_ext_intr_cntl_reg = ACP_EXTERNAL_INTR_CNTL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) irq_mask = BIT(SDW0_DMA_TX_IRQ_MASK(stream_id)); else irq_mask = BIT(SDW0_DMA_RX_IRQ_MASK(stream_id)); diff --git a/sound/soc/amd/raven/acp3x-i2s.c b/sound/soc/amd/raven/acp3x-i2s.c index e7f2a05e802cf..8debcd2487fe6 100644 --- a/sound/soc/amd/raven/acp3x-i2s.c +++ b/sound/soc/amd/raven/acp3x-i2s.c @@ -86,7 +86,7 @@ static int acp3x_i2s_hwparams(struct snd_pcm_substream *substream, adata = snd_soc_dai_get_drvdata(dai); pinfo = snd_soc_card_get_drvdata(card); if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) rtd->i2s_instance = pinfo->play_i2s_instance; else rtd->i2s_instance = pinfo->cap_i2s_instance; @@ -110,7 +110,7 @@ static int acp3x_i2s_hwparams(struct snd_pcm_substream *substream, default: return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: reg_val = mmACP_BTTDM_ITER; @@ -163,7 +163,7 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: rtd->bytescount = acp_get_byte_count(rtd, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: water_val = @@ -209,7 +209,7 @@ static int acp3x_i2s_trigger(struct snd_pcm_substream *substream, 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)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: reg_val = mmACP_BTTDM_ITER; diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c index 3a50558f67516..0a6d63db2e52f 100644 --- a/sound/soc/amd/raven/acp3x-pcm-dma.c +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c @@ -113,7 +113,7 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction) addr = rtd->dma_addr; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: val = ACP_SRAM_BT_PB_PTE_OFFSET; @@ -152,7 +152,7 @@ static void config_acp3x_dma(struct i2s_stream_instance *rtd, int direction) addr += PAGE_SIZE; } - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: reg_dma_size = mmACP_BT_TX_DMA_SIZE; @@ -222,7 +222,7 @@ static int acp3x_dma_open(struct snd_soc_component *component, if (!i2s_data) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = acp3x_pcm_hardware_playback; else runtime->hw = acp3x_pcm_hardware_capture; @@ -261,7 +261,7 @@ static int acp3x_dma_hw_params(struct snd_soc_component *component, return -EINVAL; if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { rtd->i2s_instance = pinfo->play_i2s_instance; switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: @@ -334,7 +334,7 @@ static int acp3x_dma_close(struct snd_soc_component *component, if (!ins) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (ins->i2s_instance) { case I2S_BT_INSTANCE: adata->play_stream = NULL; diff --git a/sound/soc/amd/raven/acp3x.h b/sound/soc/amd/raven/acp3x.h index 7702f628ecd68..2200c4f5ebfdd 100644 --- a/sound/soc/amd/raven/acp3x.h +++ b/sound/soc/amd/raven/acp3x.h @@ -126,7 +126,7 @@ static inline u64 acp_get_byte_count(struct i2s_stream_instance *rtd, { u64 byte_count; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_BT_INSTANCE: byte_count = rv_readl(rtd->acp3x_base + diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c index c3b47e9bd2392..0bcd20ec70a6e 100644 --- a/sound/soc/amd/renoir/acp3x-pdm-dma.c +++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c @@ -215,7 +215,7 @@ static int acp_pdm_dma_open(struct snd_soc_component *component, if (!pdm_data) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) runtime->hw = acp_pdm_hardware_capture; ret = snd_pcm_hw_constraint_integer(runtime, @@ -228,7 +228,7 @@ static int acp_pdm_dma_open(struct snd_soc_component *component, enable_pdm_interrupts(adata->acp_base); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) adata->capture_stream = substream; pdm_data->acp_base = adata->acp_base; diff --git a/sound/soc/amd/vangogh/acp5x-i2s.c b/sound/soc/amd/vangogh/acp5x-i2s.c index 7dbe33f4b8678..9e05816d4f5c1 100644 --- a/sound/soc/amd/vangogh/acp5x-i2s.c +++ b/sound/soc/amd/vangogh/acp5x-i2s.c @@ -101,7 +101,7 @@ static int acp5x_i2s_hwparams(struct snd_pcm_substream *substream, adata = snd_soc_dai_get_drvdata(dai); pinfo = snd_soc_card_get_drvdata(card); if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) rtd->i2s_instance = pinfo->play_i2s_instance; else rtd->i2s_instance = pinfo->cap_i2s_instance; @@ -125,7 +125,7 @@ static int acp5x_i2s_hwparams(struct snd_pcm_substream *substream, default: return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: reg_val = ACP_HSTDM_ITER; @@ -249,7 +249,7 @@ static int acp5x_i2s_trigger(struct snd_pcm_substream *substream, case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: rtd->bytescount = acp_get_byte_count(rtd, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: water_val = @@ -297,7 +297,7 @@ static int acp5x_i2s_trigger(struct snd_pcm_substream *substream, 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)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: reg_val = ACP_HSTDM_ITER; diff --git a/sound/soc/amd/vangogh/acp5x-pcm-dma.c b/sound/soc/amd/vangogh/acp5x-pcm-dma.c index 491b16e52a72a..73b4d879bbfcc 100644 --- a/sound/soc/amd/vangogh/acp5x-pcm-dma.c +++ b/sound/soc/amd/vangogh/acp5x-pcm-dma.c @@ -108,7 +108,7 @@ static void config_acp5x_dma(struct i2s_stream_instance *rtd, int direction) dma_addr_t addr; addr = rtd->dma_addr; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: val = ACP_SRAM_HS_PB_PTE_OFFSET; @@ -146,7 +146,7 @@ static void config_acp5x_dma(struct i2s_stream_instance *rtd, int direction) addr += PAGE_SIZE; } - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: reg_dma_size = ACP_HS_TX_DMA_SIZE; @@ -217,7 +217,7 @@ static int acp5x_dma_open(struct snd_soc_component *component, if (!i2s_data) return -ENOMEM; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = acp5x_pcm_hardware_playback; else runtime->hw = acp5x_pcm_hardware_capture; @@ -255,7 +255,7 @@ static int acp5x_dma_hw_params(struct snd_soc_component *component, return -EINVAL; if (pinfo) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { rtd->i2s_instance = pinfo->play_i2s_instance; switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: @@ -328,7 +328,7 @@ static int acp5x_dma_close(struct snd_soc_component *component, ins = substream->runtime->private_data; if (!ins) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (ins->i2s_instance) { case I2S_HS_INSTANCE: adata->play_stream = NULL; diff --git a/sound/soc/amd/vangogh/acp5x.h b/sound/soc/amd/vangogh/acp5x.h index ac1936a8c43ff..0d08e734f0db6 100644 --- a/sound/soc/amd/vangogh/acp5x.h +++ b/sound/soc/amd/vangogh/acp5x.h @@ -154,7 +154,7 @@ static inline u64 acp_get_byte_count(struct i2s_stream_instance *rtd, { union acp_dma_count byte_count; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { switch (rtd->i2s_instance) { case I2S_HS_INSTANCE: byte_count.bcount.high = diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c index 72c4591e451bd..74ecea36e3dd5 100644 --- a/sound/soc/amd/yc/acp6x-pdm-dma.c +++ b/sound/soc/amd/yc/acp6x-pdm-dma.c @@ -191,7 +191,7 @@ static int acp6x_pdm_dma_open(struct snd_soc_component *component, if (!pdm_data) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) runtime->hw = acp6x_pdm_hardware_capture; ret = snd_pcm_hw_constraint_integer(runtime, @@ -204,7 +204,7 @@ static int acp6x_pdm_dma_open(struct snd_soc_component *component, acp6x_enable_pdm_interrupts(adata->acp6x_base); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) adata->capture_stream = substream; pdm_data->acp6x_base = adata->acp6x_base; 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: 13752865 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|52116014|38350700014; X-Microsoft-Antispam-Message-Info: GAJoteSyhccrmv6uT7XyKNDl4s9jW8oUG1G2oElq3FzJy9C1ADhMOLkTRYJbBsygR3y0X/XZZpq75jc1UTefOUhKMYRDOC1GYA3hIIQvbBUrRFW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NJfavBaIXVhw0TrXaEjPZ7oNWNr+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+wytVbaKaL850P2ggqCB3AkgfjAW5ODDLwxP2AEji8x5tsiUghrcyQwIz/br2LRr7sFguq29XNZcNer+BQlgc4+IzQqpxrfLGvmmU2SXgYtvkNnYkkQjPpf1IeItJ+vKgcGWuLVYnSPmr58bk/0TFzX+o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-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:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752866 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 7C7351755C for ; Mon, 5 Aug 2024 00:39:08 +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=1722818351; cv=fail; b=sP1u0tOYv7vdSBZEPZ/SWO0wRHIpmH9QKQFKFSGSuPIAp+5HYg3jkLXmikKUD6CdToq08bzpX6yPKYzgVdKRiiun3e2a8cAwXKr8i4wgWc56SHkhAQIPw0hqudbUAxHbxAdKkFETuya/Lj3d01M2c4Q3OjYX+QdCgk9J7s9Tv/U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818351; c=relaxed/simple; bh=ZVla2kCVfa7OyH6JF+K1WgC/yZlrEDto9pnX6hfnapI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=dzfwetG1Pnoy9GQKcEpE0Qzvt/OKjtgvVz1ZOWwolJ9eBJl0UOoDkqPbBbIoiLBQTAjU7bTliogNoHxnAEopex0CVsgjl0I6ELL7N0oxZ5Tm5It7Wf8Md08fVuYxXzXzx8TnRvj4xXmO/9qVxeJQstnH3Lzbj4sNMzgo8kuGoR0= 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=cSPFrZCp; 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="cSPFrZCp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Rprrc8CnulSq3eIEOjYdXT/R6PyGizQZARKtPK2K64SaUzO+4UBt6hf3TM/8VN5sez+6Z9YDpnvpqLJ4ro8gEYipTeGF+8aOr2dPyB6t6YZzRyFrqqDr8kVJRZKfA0Rdlf/cu7kOzS7AaBqQCQTz5fSv7hgVlmlGBhezTpwRO2bYZB/Yp9N0QC1dwbyqkcZyF0sjoIDP73baSlCdMaWX8K49LzUY7idg039LPVNDsh0VANX8M/DRWBCxe01eYUO0CY9XWUTMaktDfZcON4FP9H6X2d28K1g59AaDiDL6eWcWMJx/awPW1ZZON87Jh5i+MVnYI+mo3PdhBV7uJBVUwA== 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=diqNshMfNO0lQYIcWhAiRyqi4EE1UTUgbAzeKkTFsGk=; b=dNJPe1BOH/sAC916ZAjz4qRyeEmYlUBJlXczSdihT9EKreIRodsXObZexDzPohPWad9Se+t9t9mZbP9x52XcTq3UcrqpBA2ffXHbJ6eRM6XNOXDFtL2qfyDXdBAVdruRRnkUj4xWmHrlwuTijJWpxSSLNCboQiVYjzFKDoNCNVIytHHQgl0e5G4R0vr8hmW7h3JFO32CxDLKkuDNiB3LNxDoRH4m4wtzYythnB2x5rWYDyKhmNnlaEeWTD/xDYoZ2gGR6nJ+bEuGIRG5vdXy5ssBGPjatjlnVg8L55iq43sxFUJ+LNkWk/l01sF04JnYH37bc4b0DGLSsfFoq37FeQ== 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=diqNshMfNO0lQYIcWhAiRyqi4EE1UTUgbAzeKkTFsGk=; b=cSPFrZCpDPme3CZ63yjaEGBM3H+nhzn1LKmOtWadcaEKMfKh0C2zgb5a4/Jz+oYMwagkv2Fzt4ZVlrsVtNtxWWblJbel7DpCWeU4lwuuFxhOBrqDRFd31bYwDbXS1HcQn6yT4TkeOQmG7y3b7tjx/YNoIF5Sj2zBLWEl9afrzCg= 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:04 +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:04 +0000 Message-ID: <877ccvztuf.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 048/113] ASoC: dwc: 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:04 +0000 X-ClientProxiedBy: TYCPR01CA0148.jpnprd01.prod.outlook.com (2603:1096:400:2b7::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: 70b70dab-b8b5-40b7-00ba-08dcb4e7021c 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: hsebqS8rhKR9qM3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GVjkHKqLc6BCDhBZiX+Xh9wnrZoJB4oz44Wvi3ikDQb17C+SZfMu9mfKESXcVsKTmj2edGDsFBm5I4420rtGeOCQxuB6Qsa/WcSze11CbxN4P4RM1YG80sygInRgIDMKCLrcnNVH1slRtdNplS1ngKNDtnrub7O9Ki425XXXW3g5LLegUwOmqA8wVXVl41Ktn63RQRqfkjIpXlWdRbt4qomRvWs8aLoDXySm5neyL6sub3qrTmpfYIM4CFnqvrpcTlfPExIfSB72TZ4DgPAutUTf268jj3UmKH3hnG6CgFZHVKmFSugroDCah/yjcwqfcazNYdql3eZV6yi7Q== 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: 6fTSicm4/IPXv4G1kdyWqBbzdq8GGf2+eGuUHtLlyqZTWIyeMfMBs0RMintsudNSnRM5lXhstr+NqpxMAO/4hsIOEsGewsOAkZTyttYWdrljk6kWnGGVu589Xp+05gddzV/15m+X0K7kZh6CSvSXZPCGBrVuGik4ev4XZnm0ZBOzOhHfLpj1HZbT7gRV6Iy5owV9yFLDa4IuBS8PbLdOlx7ETJPe+wDXuH9q/yboCSw6InSPT5yVa6nN/OWypH1lC1CSAzheRIttiw5gJ8aOyDQRshu+4197aCY5UxAs+ZzJiHsWKWazYLIu7aKQQl8xMLJPHhMlnNd2jRG+qS+BT1zVqmC7XcVGxdypU1wW/k2w8JhhRpsC4iRfFpHYKk+Ll3uKD+T/rXh71k5GWTsrfVMWDT7V7sArSLkEkag2ZLubmDsVWkhJXjHsHaexeW/fRG6jrEche4sE+iO4LuxERr/HPMgy1rMsGX2r4RtS3xJRJbBuf6EwARCO+dFqkh9BNb+67rfviHfCh1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WpnaTA0yCKKqBjaH2jjs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70b70dab-b8b5-40b7-00ba-08dcb4e7021c 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:04.6655 (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: +xtTOvRolP3bWeTJIyogDPntqzmq2DaNmUwtDE2S44XiMn262FugBThct+zL5lGMNDivsk9TTMOMMmcHtm1sprVAbo549oK1Zt/ma/dob0y2HBbzzFJ3kEWohbS0+yGH 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/dwc/dwc-i2s.c | 20 ++++++++++---------- sound/soc/dwc/dwc-pcm.c | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sound/soc/dwc/dwc-i2s.c b/sound/soc/dwc/dwc-i2s.c index c04466f5492e9..874d5bf2985e6 100644 --- a/sound/soc/dwc/dwc-i2s.c +++ b/sound/soc/dwc/dwc-i2s.c @@ -42,7 +42,7 @@ static inline void i2s_disable_channels(struct dw_i2s_dev *dev, u32 stream) { u32 i = 0; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < 4; i++) i2s_write_reg(dev->i2s_base, TER(i), 0); } else { @@ -55,7 +55,7 @@ static inline void i2s_clear_irqs(struct dw_i2s_dev *dev, u32 stream) { u32 i = 0; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < 4; i++) i2s_read_reg(dev->i2s_base, TOR(i)); } else { @@ -69,7 +69,7 @@ static inline void i2s_disable_irqs(struct dw_i2s_dev *dev, u32 stream, { u32 i, irq; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < (chan_nr / 2); i++) { irq = i2s_read_reg(dev->i2s_base, IMR(i)); i2s_write_reg(dev->i2s_base, IMR(i), irq | 0x30); @@ -87,7 +87,7 @@ static inline void i2s_enable_irqs(struct dw_i2s_dev *dev, u32 stream, { u32 i, irq; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < (chan_nr / 2); i++) { irq = i2s_read_reg(dev->i2s_base, IMR(i)); i2s_write_reg(dev->i2s_base, IMR(i), irq & ~0x30); @@ -156,7 +156,7 @@ static void i2s_enable_dma(struct dw_i2s_dev *dev, u32 stream) u32 dma_reg = i2s_read_reg(dev->i2s_base, I2S_DMACR); /* Enable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) dma_reg |= I2S_DMAEN_TXBLOCK; else dma_reg |= I2S_DMAEN_RXBLOCK; @@ -169,7 +169,7 @@ static void i2s_disable_dma(struct dw_i2s_dev *dev, u32 stream) u32 dma_reg = i2s_read_reg(dev->i2s_base, I2S_DMACR); /* Disable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { dma_reg &= ~I2S_DMAEN_TXBLOCK; i2s_write_reg(dev->i2s_base, I2S_RTXDMA, 1); } else { @@ -194,7 +194,7 @@ static void i2s_start(struct dw_i2s_dev *dev, i2s_write_reg(dev->i2s_base, IER, reg); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s_write_reg(dev->i2s_base, ITER, 1); else i2s_write_reg(dev->i2s_base, IRER, 1); @@ -213,7 +213,7 @@ static void i2s_stop(struct dw_i2s_dev *dev, { i2s_clear_irqs(dev, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s_write_reg(dev->i2s_base, ITER, 0); else i2s_write_reg(dev->i2s_base, IRER, 0); @@ -253,7 +253,7 @@ static void dw_i2s_config(struct dw_i2s_dev *dev, int stream) i2s_disable_channels(dev, stream); for (ch_reg = 0; ch_reg < (config->chan_nr / 2); ch_reg++) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { i2s_write_reg(dev->i2s_base, TCR(ch_reg), dev->xfer_resolution); i2s_write_reg(dev->i2s_base, TFCR(ch_reg), @@ -352,7 +352,7 @@ static int dw_i2s_prepare(struct snd_pcm_substream *substream, { struct dw_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) i2s_write_reg(dev->i2s_base, TXFFR, 1); else i2s_write_reg(dev->i2s_base, RXFFR, 1); diff --git a/sound/soc/dwc/dwc-pcm.c b/sound/soc/dwc/dwc-pcm.c index a418265c030a5..673218e010607 100644 --- a/sound/soc/dwc/dwc-pcm.c +++ b/sound/soc/dwc/dwc-pcm.c @@ -200,7 +200,7 @@ static int dw_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)) { WRITE_ONCE(dev->tx_ptr, 0); rcu_assign_pointer(dev->tx_substream, substream); } else { @@ -211,7 +211,7 @@ static int dw_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)) rcu_assign_pointer(dev->tx_substream, NULL); else rcu_assign_pointer(dev->rx_substream, NULL); @@ -231,7 +231,7 @@ static snd_pcm_uframes_t dw_pcm_pointer(struct snd_soc_component *component, struct dw_i2s_dev *dev = runtime->private_data; snd_pcm_uframes_t pos; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) pos = READ_ONCE(dev->tx_ptr); else pos = READ_ONCE(dev->rx_ptr); 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: 13752867 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/7s7LilEAiETtyH6F74DnorY5rRjDz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fafQFlKPg== 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+sKWsZI2BTzVhcppZ0Bl1AbbUMBWHN1d1d4l5yIcMnBKX7x2iqNg/p5OLyc2aB0eKOBCga817QoniGELRENR/6h6VQ2BRV6uRwWxSnVIhC8gQwMT6xabgcEQd7aQWnPnmIPg0/bT/SLr0cHu7HDRDQNdH9bjY34UmIXoL4kUXARIlA5Jp0tztm2acXLp+879+vdFsikPyo2Z4TcX6e2eJM+PrPp2aXm4/htOUxq5eUnnAsKrOpn/DUxbShD6p6w6qGLgSoiWXmSD/7FZu0yVX7z8MX4kygfWAafUkMrBL5t7GAmTvgTotWT7bUgT6dU3wGk7sBpNrb8zYkb+5kstk5vNhls6nSYs7EswyZkZadZZ8yTYMFpnDe+RAjaJUmgcqe0I3AL+K/JYgBXREXeS+NZP1j1UGfWi+EW53+ZGzoH9YtBGLXAvgBlSLvPpwIO83PSREqHiIwXTfWCWH9I+WHfRL822mnxemOguuNuXqUktVmRpESeQ1HeUkVrU85kf1+7XXOUoTzNtNqAI2TqQVFPrgPZ7AqEp3iYIvZN3SHW7LUyldbzp7kHG1wx/fpTAzf73rCYRNAotvtCxjgXf+2UAZVkiSxbSzUqTEvVqdKdinjHW2+ldCBuiNusFSroY1oVEO40yKFHaQhPHclW27+32cp20n4xGpKiDD0JsSiH/N6sNCQ9mXnpTE4Qk9926y3zLVUQYqOizCwBts70KcUG3IZaN75N9Jk4p5IIdNGzAPlC5hv66j65GrP3HGQ+ZBqTsJBoJpuvcoxlW31dMQHmb07pzuUGRqFfnLWAKF9MlL+mEsrW1Kvj80gVrFNwwttOdMnliP2tIMFyks7UzX1RqxJyKwizFNX6/oiXV9/iqc6sccBvt20vbeCJJlRy3/ZJwH/WbNiQ/FTOkAaAdw22Nrl56lHxI9zsnmsVZvNWDVvztB9AyXxPI2oqUb8GFUz9UgYhPpzJhsSxOEwiY6KP/KoZ8csfmuuyxTZ/8jBVVcQW4zSrftMonXxt32qSNuXslBpTMSlal4Tq8IAip+32XlTmvMoGTln22MJGoDZZhrfPn/h/8Ue+NjRrxu/ATtiXPwJ8D0gqnM48VXCfmmHUMOPhkpu/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: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: 13752868 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 2FD97171D8 for ; Mon, 5 Aug 2024 00:39:14 +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=1722818355; cv=fail; b=r7S3lsI7cUoKHYadYl19QP4D7S4ecpouCecMGNqrYl9F7sDqVRB16BGZoAdJDBHAFjRAc1MdXNp7SxPeyvQCiafq0mlGee9bvx4CPOgKfLNR1WL430CmSYveSoHMeoRj7BypCWoGwn2W4ou1h4SytVbApge6Cg/YD5CCVZCTDmY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818355; c=relaxed/simple; bh=57sckNHNa8QKD13VJgOcOepyqlHAeuMNZ8R3gh27Ifs=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=KNiu/nW9nYqRzCk3qZbtj12vcJ7fdzEddj2NYaEpjHg1W59C4Qi/rDZNQWYisCK4Esm2Rglax8v5oxdcYbwTGjGadbZGCgQUgphKcgy2SEH4rRqbHRzzX4pV7MXHesaP/YBuiSJ3eIJ+sav1L0ixXdpRaH20dUdbKmV7La1WKIs= 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=py93YUlY; 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="py93YUlY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HMjXHMq3AQYvj/b8KBlKpgniBOCKewdA3T7704NWdnAgk+VtoTBRdW9TyHAIKC0q6UIfs7YOUrlfkjP/zOXxNwHhWrdckCqz7v1w68MpXy3NYSLR4A6atRz7DlB8dRWwMHAspR5bTD3zSH9Ej8crtW3oCvpGnyZ1LbYEPrgk3vtSU3HkwGQm1ERKBVVbd703eIeCDKhjjtfJDAyEvNut5fnpPrcqxDZRyvawNUGKTUN8CyoDJOYYJf6niUek44mCqahP49NUrbecVl3W6hTdZ6RiHti6IBhCL4j7j98F0MWGrAe2IIN0d3LvQhR2x9FpYtzHqFO446GWuoBlFrPkhw== 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=Kv7uzY5AJm3G0Y5hhGyeH1bVSTRuT4ydXV9fgIk/S74=; b=fiTCrh98Wi5sfoLy81sWk1u0LiJL3AqseY1cAWd2Ri1hLCZLxPS0KEKO+uKS7U2k3mIrDxz6Wjq9o8djCZbeddt9tindwdXtWqMmV1QbJOMNvGS5a1y45zDTwiorD/we9Ww/0chNRggdfO+lbQDyV54bhQGbjJBYvwvQkZCaYDROFaz4uCLbmczuN3mRuPHuFkPYBJDDqI+4hKDeQ9CiLKrfNS9cm8zyOGE4lOLYYuaSyKdmo8MFg9XqudCw4n9+ywPbD2kGYyUeoPQZZ9sogwqgqV3qyqw4hhybIsQ/BBRmOWUbQCF+x+3ZH3EoRjA1ZJZeROR4Pe3cbJrnvrJGgg== 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=Kv7uzY5AJm3G0Y5hhGyeH1bVSTRuT4ydXV9fgIk/S74=; b=py93YUlYOILYJ4Zjpklz85ZTfrP5j1aLCV8P4HB7ANmHUg3oDsVayfN9D4ltDwCmzjdLkgQZGYMfsQXx4mvVGY9p034rMqJDWPi3dJIB6Suy9Cg/smfD4maCQofE9urQdfyTalUgOVg//jJfO4+MKYe1I7vg8J+wbOlqNQ0kYaw= 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: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:39:13 +0000 Message-ID: <874j7zztu7.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 050/113] ASoC: mxs: 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:12 +0000 X-ClientProxiedBy: TYAPR01CA0023.jpnprd01.prod.outlook.com (2603:1096:404::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: cc673470-5ab7-4cbe-9288-08dcb4e70713 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: s7KmLPdXpklluM6Bz8rBLciw6iWwuRzd0+wRZyou0hW572CLnnEvGOP6HgvbG9nAolSMiBkZmDVCmzIukDAPwkNXjg08Ty5mfIjDzuVBF34tgfULp1S+4/OYwo/qyULzTBBw5btw61UzwaZ0pkzpVkFeGY/4lMqgkiN7ZntjqzHaBFJ9P6/wTu/HIzLL/ReWp5T6pTvskc0q8kw+nh5z3+NAk+Z3HxhmSw95E8Bs+R2z2uk7/blRUXAsLTziVRF6778z5parmty5tQRwgHiyz4r3n5rmvu3qqNnhQwdckmLnSyUy3db3akgqt855DG8zGls5VzfNDvfXQGxzMPZTXqQD1j26m96bhi/ytuB92sHsMJulXO448n60f1ziJZZjVqMNXtVZsecRqPaldDWBcAtMqXpDSsbApuwSfyoTgpYSNg+2TmPMVn4ZKPF5Hpyof0jLinfiwUAGapJ2seTvgNGNVmg4OOP5tXGco12LOjNeMS6HtXemu+zafLhBHFMrT38mmjVK5li7ClTiQIXxKhw2slE2aa9/ZSoqBK1JclV0TmCYHFGaf2K7WXIrumKW7Gbcbyz5QyLiMyX93U5Y1mKTx9h5Cfyyxwp7q7pr8x8fP0JSajeOiwOi8vO916BOECJlHD284AnXY1E8hZNxphTYjFbRDJLc9szUk5r+GEsPcrQ7vS4hh7XUpN82bO26pqag2lg9VPL+DwMCJB4O1aE3YkX/zVp0URbGW8D23VE2N7GVDod8+Vr2GV71fcJT8mcbGiKE4ZMo3o2FYwGyd56YzcUqELyBbZ+ckgL1RXHbaDoFZEsaDPYZytVU4WOOZTya5vXLRT0z8bKZvFajxHuudHRQHyA1p9HPiShVHo49w8c1FvBaFHa7V4UIW8Q8W/KdI7ElXZOqCNLIH8CEGFZuETSXhWW69XPw2ntQLkS0pPRJNXIc+xWwFMKhvDX95LBnvZkYFkEzr7d66TDbj1FGajHL/lalwbwBkQlVtb/wnhaTRwP+KAAg9/0Wsbhrm9KR9J4+/7mXh5x7Cj0mqeeEeBtvejhunChZgUIER95fNXojdWPMoPZuqaQLPatcGBMZhfV3lMhmP3SfXnVRFQToEe42OSdeR/eyKsnONVreQgutJSBQvpwQzlzl6R+rnzf/8njfdCEjtQa49UbM60QJ9KP/Pd9W0a2WETBdX1HK2XKupfv2FVzEz2Ed0s0kz3rlnhut0Y+1P8LOT6dCyhbuVDjuPxYV+URtewuvnFzbe3t1BzzuBLTw/HAQPItl4gvlVTkDqL1/U2jhgPG+DO2chOQGqqqLcp1WYpmDZHU79uPJbA+9xt3lrF/f/EpYXEPPW3YBLXbpaEIqzYUmyssrxBzKKDUCWbTYzRYmgO/EhzJguQvm0e/KKiYHGZzYEuYUMr5tIrLnh62JZ3Jdyw== 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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SHrssCDR+Jd6IQMpcgg633TrxrELyqosL+S3TqehhKDQU7pGGIt4VUZxf9WrH+B1F/YUSGQpdQqzDtwvX7dPRMB4LIA/L0v4qi2Bbds0uIMadtmaoZ/l9ZnBoVV/5m+/lMJ2JyB9kN0gz5TMRR6dCdrmyEcgouGBfKD3cnMQV8YUiSPglcLbB4DbO2nIsbE7cYy16e8KNVQSvbswd9/zczF8hnucglyzD71KO75hY2YSX7DuPOGanBwnAw0Tr3zzQX+I4OB49p0LhnIpp50/IJ3j3qx1HRpZ3UomajsGfP3kl6i7l5oUh8NEZPOjpHY/4XzIjmDvbWZa7Ti6TvQefpIHvP6TpRgWbiK7VFE5Orfyfuxu+OCvbrE8zl2DXxLa9En+MLIvNz0e9tDkCCF5CodKR8efVXP09hR37XHo3SAo1bYLV695RQg/YtCQpbRnv6S6sMCAmHB1o7GOWmRJJYgq4UuEUy6N2C4cacYZN1ke6s8No4ES8cNswbaTNw404dcITfdeou/+zOAeY3dARt0UTQ4epSjOPmESkG4Z7tQK0NjfFm/hZox1UnBZQNd2zz9ykTlSRbC+q9Wv7ZGFsVeaFJa0RKv44w8kZwUyFBwu4v90JauckoGe3D4YCcekJK6wckLg= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: cc673470-5ab7-4cbe-9288-08dcb4e70713 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:12.9670 (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: SouN3OWDYbLQhArShV7ux9zSvki/Jt0kbb+L9BsAzubTKhuLkhAcmSnEZF/TTpSSG+hkhz8X3p4erGLiZ9Ds2gAAEpN9+BoylrnN5z69DMHJEOgNJttlhIJZ3U93zUyx 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/mxs/mxs-saif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 3e3a62df3d7e3..2a3d8038d4362 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c @@ -489,7 +489,7 @@ static int mxs_saif_hw_params(struct snd_pcm_substream *substream, } /* Tx/Rx config */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* enable TX mode */ scr &= ~BM_SAIF_CTRL_READ_MODE; } else { @@ -560,7 +560,7 @@ static int mxs_saif_trigger(struct snd_pcm_substream *substream, int cmd, __raw_writel(BM_SAIF_CTRL_RUN, master_saif->base + SAIF_CTRL + MXS_SET_ADDR); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { /* * write data to saif data register to trigger * the transfer. 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: 13752869 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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aQjqtIFc5oQvP0LD8qbuN4ch/ZiCsGQClZjqUOcI3ksNrDLYyh2QiQijI1vdDhDdahEEm/5hUxHPU3T7kYIhlPvhNM4I82hJtEiBr/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+rmUwMJsjabzHu6aylUIU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5tH0QFV+WahVMukI5TLJfamz6t6eVpyxrC2gDzdeGxeJVutz1PE0L/yRle2L70N079FsGH3vB/1z5UszFn17hRJV7VwpHh3LlbVS3NEmSVECrRkVXTBledgkv4LoWsx5Airk1BR7QOk= 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: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: 13752870 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011036.outbound.protection.outlook.com [52.101.125.36]) (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 BA75217577 for ; Mon, 5 Aug 2024 00:39:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.36 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818372; cv=fail; b=izk4HrxbJJSwvW++qRPkiGDAoqYFnKR12eXVXzWmUMcjebkl3PsX17mOQZV5DUPUysR1rN3vZ7/z7GpScZ+Xiw8sK7LrOvJcG3/HcJsdzUOypuoOlHV+OicaH7bs2XYjiPMldNaP8llGYmyQmDb+SYoVceWcOw9QiOZtUKaEHcA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818372; c=relaxed/simple; bh=OHcwhhRaCQ5nNh2KNCNC7TLahmlzqbvIXsQPJDIyK0M=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=N38TWkTl/kBJYa3Gm2JvlWk6Hhonisv2F2+h/KDSZMPJiPgf+DUryYl8vdB25f/UEoPSkmbYtH5+6+wU/WNf5P5GDypGZZVAyg6kQnnPR4ZnQCWTWG19PHEhIFoPy6aMzF+Apvry89JBJWLjiWgqvj2QtLq4eroKeCx1iECTSsU= 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=jC91EYWM; arc=fail smtp.client-ip=52.101.125.36 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="jC91EYWM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wBf4EFiBDjJGNpr+wb/9r78PskstqyuHJiWQXhC7AV30RG9nBh0zm6n8DaKZI6azp9GnTJWzzdRLoJbI/S5itrRmwpQks4tjJ+oYl1aMmE2Mx2jD4WwAvLrRDWHpc6W5pFvZpzHRRuutAe1ChNG808O6DXdyOl5CG6gcl2U6+dcHf/nZoiOKbmXHc+5YjrSkZe9ufqk4syHtewuT42/rBdCxmqwl3GygzyJd0Mg65pgjKofzqZzOlJHtFqy3WzieVw7k2qF9yVbkJGnINtrgKmje4/WkIm6WCxIzJHgsIdefnyJr2qW4mAEeoh0W73eM3Q4p+x2ifjTI7Kr716MjSQ== 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=ZiIntsRbiAsnvD4yM2VDU50+xHcFYUuOQslpju++csQ=; b=GvB+fm3WNYGVxXouct5Qz6hDbjpzgfLb4N7hB2r5SgZQU7RgpXPTQMXhVr4KEvzggVkuWrEWsRGPrvnGUk4Z0ZlNmrCh50L2tKOixXE8Et8tqkKz9FwP1zMwFp+GGFBW7e6l6RAcjvQemQZ62VKM14ZuCgUWAxYenoKIkYcZ6EAC5xdJ14FtDq5+FhNrIE8mhUX2Dp1WKzWAKJD24ztcAh0oAUmW0TYyjSyl9EGHnVypECvidC/+pXLhUHkT7DxFfTjkzp91vaLLVq3PsXoq833k5ZfW5gLhHssahFC5OE9OkpNA27JWHuTkGbJkAs5WRpo2JhGEdlw7D9uuk4ZsKA== 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=ZiIntsRbiAsnvD4yM2VDU50+xHcFYUuOQslpju++csQ=; b=jC91EYWM1apzfITeU8D8EcOVMz0BheUFA1h4fAnRTAQPdGr2857d4Qyj7YPAV4kO8VNosMjJqDIRqkDRgsVVS/wIqYm7crT85B/gR5JrN7SFwf3ZL8t1+0hxYigw8d+H+eAfy1Xn81DqrK0JNaOS2k49ebtQhvPDB0ORWuq70CI= 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: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:39:28 +0000 Message-ID: <871q33ztts.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 052/113] ASoC: sti: 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:28 +0000 X-ClientProxiedBy: TYCP286CA0315.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:38b::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: d920519b-067f-43ec-0cdd-08dcb4e71030 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: 3khgLI2xAa71ybtAmUa+/BpbackG/kbAZQIrMKgRB0zZAvemTGJNFQu8WEUaIPZJfgitokpwEXS7vhns2Fh00MEzvqbWVepP7P9K1uC/s3Y7Rg8zsz7b85SMyob5AZ63/geya8zlRqEmaJG0N5LMC+BBo2BgPw9JtO2tZBEXsFuwHoemhTBkV53Z+quHEt41e7IuSVC2k3xhfYAp512KKLK5UGTNvBkGSBXIYYBuP0tuvJvtf4ktHIlgCKE7AqeJNAKWNb86lF9vefpIVmznPj2R81SC/mOwJVwMb5Xve871P1LJqWPv+unReEDT7X+sXaG96Te/tVxPYa6FDtRC5u8rZxoXjK2hghvvacokeuLdYQ5VddJhnGfn3voouUE2Jq5M7Pezl4R9ls7pnzQXG1EZj7pHr5nG0t+VMmPgCqI10xBqcUP0LPgQbVgV/l4snpbOQi/DEsIoTL+ikKYy2l7taSf6nWYj5jppW8kWzpmXQHRm/rsYMLyC8Pl9gxYsYBVOxEgEcnd+gmtS2OgvskDZnnVmbcnuJ8g3uH/c//SXDA+ufwIwHTAxLkDDHMGUSJtezf7/2LCAeqHXlQS1pvJV6bc9fRR8HRPryYEzwjkN4FwYd1qlPSeMbuJUg5EpzShh47TVl7R3cIaOqo9MgmmkBr5jqBOwnCEuGHlta/40rPvPt1FNyac2ZceDMG8s9yotWKjGKZZkCfy1vuZiz0yx4MKpLlBFRx6vIzc0H0KifWDMtqIdORS31TI6691/qPhlMetq0I/37xPel+ZPwSRS4JGx/B2jl/c2pRLcjxGHcdCUxKwsBvObc4nu7s/C/epLbeBfqxXwJ/8pMlYQ0kyZhfPaCuUkvY5JgeNtz2QW6iX9UjaJm9ELmSVokp41N1xS4+3wcizZ/6SnwM0tJDgmfqOr2OO6y0HPSk+YtzyBPTkW0PGljg8bAKsUjZC8x6F/17wAg/9JpeU19pthTQDSysR7I6Bziln2IP4ZT4YoEUq/AJSho2vfZb7xjnBGM3Eh/IiXn/fSV+gt4IPL1JoSFi4+g84ZcrOhi9WMCu4ZG/Kl7ShQFHnd9QNvprHSiQyjym2cv8UqejyMXNeaHw1wYL+rTmcCwkfl+stynGRXm7Jg18mOol26u2Mt2rtz6jZOw/XfN+Xf0FK6zf62o0CAm6Lmx4YD4/f0/5TJHh5PfZVwrnh+qrHKX5Uonod+YdNodJgKO3EZC9louclGVfdwRbJZRKV0dysgjoqO58HYRJDALUZCooAsOTw3TKiCTPojSySl2xfNU6Znmw1hJMWO8rUzwcvOjSBciSsbnQVE2iO3EhAI975CTSNbicvVFadgXFCDFiwIvZFIwTe60vEObaTgAxgR4TQrjz9gld2gvytkt2iU4pAobGFHbBNLDu0GBLLVkIcdGxmUA4TutA== 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: Mg0ca+X11KeGUBnB15Ib13yZzC14HKLu+UByrvaVJvO3NsZXdHWEfZMu/WW6SE4DGfxJdsd3FXB4p/YCrEZKzlfOmonWlP4HYOIHv2BZu+0r6X529f9hkGL889XTHMHsKGSMTWKCkL5W+bFNe6zze8l9ZhZ4BjDqUvk5LyYbLVwbBcKqbr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BjxBIyeCVq2pnSJHUMLY1eNhtIhJZwaURVVNV43EAKN/LEps/zgfyDcDvWt+xcqsg8DK61eSIIEKDCIV9gOop3VZ2WNuuD1BrMxZNJOlnStCoWFagao9SZWTic1WJmtByC2TAqBFTgHSZnHcFmRMj5CA5eL4I0Y1J1oL1k9Gv/N9QMIHdw1kE+GxMVdboqpW2KndRVnKMgZoR1I4zTnoZehr5rCoi0mCZNX118IUlRfDYOkIUb45WfdATyMtbaSAwWDdVzWEmyYNeThJsQmainhANFr0c7tKqVUJ5/k+HBeo0bFgUMmKroEja+hjsGA0VOQvjzjCZgYqKf98a1OJk/sxB+YuZFfECPADVOJQYTHu93hcXXqOahIcKqdES6eQWqcg/X4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d920519b-067f-43ec-0cdd-08dcb4e71030 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:28.2671 (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: S6xFSgb/kpOKddD0S9uUXgZilJ6LJEyacfZEY1hM9nzYYb8MSTJhjYe3EFZDyvlSopJ4MVnWEzFFb1I5knCKna8ji7PRbdSw5ZzbVh9k5lDvYIdOcpEznqKsO/po9NWw 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/sti/sti_uniperif.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/sti/sti_uniperif.c b/sound/soc/sti/sti_uniperif.c index ba824f14a39cf..75520b8827ca1 100644 --- a/sound/soc/sti/sti_uniperif.c +++ b/sound/soc/sti/sti_uniperif.c @@ -337,7 +337,7 @@ static int sti_uniperiph_resume(struct snd_soc_component *component) struct uniperif *uni = priv->dai_data.uni; int ret; - if (priv->dai_data.stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(priv->dai_data.stream)) { ret = uni_player_resume(uni); if (ret) return ret; @@ -358,7 +358,7 @@ static int sti_uniperiph_dai_probe(struct snd_soc_dai *dai) struct sti_uniperiph_dai *dai_data = &priv->dai_data; /* DMA settings*/ - if (priv->dai_data.stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(priv->dai_data.stream)) snd_soc_dai_init_dma_data(dai, &dai_data->dma_data, NULL); else snd_soc_dai_init_dma_data(dai, NULL, &dai_data->dma_data); @@ -440,7 +440,7 @@ static int sti_uniperiph_cpu_dai_of(struct device_node *node, dai_data->uni = uni; dai_data->stream = dev_data->stream; - if (priv->dai_data.stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(priv->dai_data.stream)) { ret = uni_player_init(priv->pdev, uni); stream = &dai->playback; } 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: 13752871 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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ajetiSMbCT6xIDa334uQkn6RNWhV6AajFphkrFHKXHtz1gaHWkSR/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/r6vxSv2Tp4Beiap5cekOJ08Ke4PSitWTnOqikEVTJSqxd0EeenByqfZqUxVFAA2fcL8CYm4WYIztAR5TXAe65CLihC8jGDqsl65MpybWflVhbGIFM72EXB50y2jawQr4yMPjynBM0BMaoLpqggnUpsbLbFh/Oriu8DUrVIcTZ3Z/34r4dYN/waYrGGbtUYkG7MMl7oA5g+LqPRnnlQOFjMs6cfbkL3I36xW2vOQCH+0SH8aGdut2kkVaYkNRaCNSRnmFL4fZa100mmTYInWxLs3Ghr8p14zTN0JaNtftYNWnNhDXzcTsSrHA7+c2U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wK8B8T4tk7Vj+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: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: 13752872 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011008.outbound.protection.outlook.com [52.101.125.8]) (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 0B7DB156CE for ; Mon, 5 Aug 2024 00:39:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.8 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818381; cv=fail; b=stimTMAHVwWaNF69ILogaimwh7eOlnzwKL16xFZmQ9pHXq5A5O4vI97gdcdKXiQqR7wRc/EUCYltEMkmce3dX/GiFGxHrn8/ghrZ+AKbxfgmm/gWxmOIERz/n/thDWqna+Kn9Q2mdFHpC92We1IwHiqdhMAYvNj1E5QvW2ROJJE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818381; c=relaxed/simple; bh=kdSk6DECpGoT28xkw/OJQtgQ0+/lr/sU50a469vO0HU=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=K3Gzv6NuazH0v9phdRwg2BmXZuhLBDapSNoYsQakhSRCxBGwFr4I4CMKpzthzh3hXvQPF/k6nHTjI90/16iUyqCkvor31DMz8f4iDcEuvtB2Th9PNcu+sAtofQJk3CEdjDuIbNVVwwIZAnVKHHrtblQhvwbDIbCNMJ4uYD0XOSE= 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=Op4tWC7W; arc=fail smtp.client-ip=52.101.125.8 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="Op4tWC7W" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R4PUV134LkWTxz0dDweF1xKaL8laVMfnRCaX7BkHNBEIFY/XUmIrVW82lHzwm7l9G3H5NJVU1gSLlCUVd7y/9WEBN8lRU1MSzEdZpHXRat+naiRbmuciTCbEM+Xxb0o+CUrtIfumenMnfZtdyiUE6S0g0Au9OnYonIj687O7gQLfznziKRjz1qu+21WyHoStsqljKLxXB8z0PamlYKzj66CkNZL/8oAMsZxr+8OtCYmV31nrv0JLfJWGOLGE0wHbDdbdl1qHbCVwDvQmwkoLos9ISctZI46aHkx5qzhxVVGcYqW7508xpHZ9D7MG+Jb5Aa61aqQdIrshfZSXrJz6Mw== 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=Sli65yhRKxn/i96KFCrnXlOcfpmE+B1fCKXllIuLv64=; b=bb4s11eca7b38Qo7EeDf3uSUDPaopnQAU7QUODoiz0CSQCudtIoburnzQwwTp4nJPqXLdiH31j+l2D2o92/HcMITD0QEywoeGWwbkgwyooE6uhx3fiIH0fQ8FY8Yhw//NqPXfOpQ/kvblnEihbGwlLO8bIYeow7U8xTkOi9Kc8GY3MKuZVJVTveEFw1XdR/Gujw7zmwTwRa6uxtZPiaQbESVduLFOG2Al5ETb+Z6r5tOBRjbXTtgOgowRMJfTqbZUabfYvnZUTmyy76ddY49SHCR/sagxvbKyfcp8Ad8Ozv2/meOA2uPjKybl/mj30pYa1ow95InxPbNpC9ehIcqKA== 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=Sli65yhRKxn/i96KFCrnXlOcfpmE+B1fCKXllIuLv64=; b=Op4tWC7WEG0VgG691e1hvoEc4LwFxvvitU/X4c4UcOaP9XBRitVAdkkxfHnAjmgEkbnQHwI+Lb5tXsGr5gQvKUjpYH9bqWYqF724vG6Q9KKr7beWfKFHnrEZh6grgI2IULVQMXNX7YWrNH/KKbT2T2SmH+x4O2i6v8UMq+cgVWg= 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: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:39:37 +0000 Message-ID: <87y15byf93.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 054/113] ASoC: sof: 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:37 +0000 X-ClientProxiedBy: TYBP286CA0029.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:10a::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: 24dcd254-428b-4c4b-4fc6-08dcb4e71592 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: vpvylBj3mw5GyiCDEb/KByALcaMz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Q1SZfxcxSDYMTzMErDlxxR77nmlnfzzXlFNqSH/jDlVcfw+yvBipEdigItQ1XXE838w2oV+KlbXJ97o35k1hJ0r3obD8WwDcfEMzj09jNCR7VlftVVd+Q7MxzeUB8s0JXUYw+rDqdgJcXA2lUzz58I/lK0mUOWFZY60QxW2ECoekc8S9IK7b3k7sub3zZZ2JWaUhX2IoVCb0zPYcwSowloUGjVlN+HimoOdhkKoEuXQE0TYZjM+PkB6RTvNT+VEwZA6gr71omXjxRvOalNHcgFvrihQuRrBq02VZQPZT2v0AwhIRdPnn+waUiEKeb14vgBDEJl3todg== 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: SzHDgS+4r6HEHV/LksvbHM4Y/josFOxL4qAVwUkqYyPGPg5w3gc94kZSmDW3b4fVw4jXwjBnXRjUQjwGSsjTogJcz/6SEZIjcVqDyDBIlucmQZdecLttVupyrxqg9CN8vnZ2QNTXvVJYOpCzjEieLiXUxIY1JN4nLOnTuH5522I6wjxv5eEujBC4Z7gpz1Avk1TGw9fyubN0x6NDLbkmCm8tyZyVSnUpqxrqnJmYrhMl4PYjO34OZ98aIUbZzSrt4kZ318ITT9Nu3ej97QuKVP09WdHd6lbBfGVXN34oHTwpGleUrUcuIDKvOlkF+fxyQuFUTCJX3onR8sP0VgSAdF9+aVtE2W6YKat7GK/Ygml0XPAsEXZQU+zDBOD1vgwTW0Ww75BABFbT9luZSuSUBS4X2y8bleyKmNErqW0XJqlp55YC9LnYcnsKNhmBDetpPkWtmn0W60DhoJNLW6kCFqeJ8HyeI0tSZZpplfYA4RjWKplTBJTFUKL3UBC9wyKvGgMqZJYCxoEA72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OhiacRWY/kqS4gyoqk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24dcd254-428b-4c4b-4fc6-08dcb4e71592 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:37.3809 (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: kf+WuqxhOad8P5aB+wKuGtz+NR/7F160Fhum98Vb34u4hD69AYtL2U7sEOTxyNvp3c+ivFYxpkex9dp851B3L/F5VrNvpBn6RYk2PBvs19Ij1+O3RjB3CsdqoLYYAFlY 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/ipc4-pcm.c | 6 +++--- sound/soc/sof/ipc4-topology.c | 10 +++++----- sound/soc/sof/sof-audio.c | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c index 4df2be3d39eba..52e6983acba64 100644 --- a/sound/soc/sof/ipc4-pcm.c +++ b/sound/soc/sof/ipc4-pcm.c @@ -345,7 +345,7 @@ static int sof_ipc4_chain_dma_trigger(struct snd_sof_dev *sdev, msg.extension |= pipeline->msg.extension; } - if (direction == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(direction)) { /* * For ChainDMA the DMA ids are unique with the following mapping: * playback: 0 - (num_playback_streams - 1) @@ -681,7 +681,7 @@ static int sof_ipc4_pcm_dai_link_fixup(struct snd_soc_pcm_runtime *rtd, if (pipeline->use_chain_dma) return 0; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { if (sof_ipc4_copier_is_single_bitdepth(sdev, available_fmt->output_pin_fmts, available_fmt->num_output_formats)) { @@ -1044,7 +1044,7 @@ static int sof_ipc4_pcm_pointer(struct snd_soc_component *component, /* Wrap the dai counter at the boundary where the host counter wraps */ div64_u64_rem(dai_cnt, time_info->boundary, &dai_cnt); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { head_cnt = host_cnt; tail_cnt = dai_cnt; } else { diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c index 87be7f16e8c2b..ce14acb6770eb 100644 --- a/sound/soc/sof/ipc4-topology.c +++ b/sound/soc/sof/ipc4-topology.c @@ -511,7 +511,7 @@ static int sof_ipc4_widget_setup_pcm(struct snd_sof_widget *swidget) if (ret) goto free_available_fmt; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { struct snd_sof_pcm_stream *sps = &spcm->stream[dir]; sof_update_ipc_object(scomp, &sps->dsp_max_burst_size_in_ms, @@ -1668,7 +1668,7 @@ sof_ipc4_prepare_dai_copier(struct snd_sof_dev *sdev, struct snd_sof_dai *dai, * of the RATE, CHANNELS, bit depth is static among the formats then * narrow the params to only allow that specific parameter value. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { pin_fmts = available_fmt->output_pin_fmts; num_pin_fmts = available_fmt->num_output_formats; } else { @@ -1783,7 +1783,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, * Use the input_pin_fmts to match pcm params for playback and the output_pin_fmts * for capture. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) ref_params = *fe_params; else ref_params = *pipeline_params; @@ -1828,7 +1828,7 @@ sof_ipc4_prepare_copier_module(struct snd_sof_widget *swidget, * For playback the pipeline_params needs to be used to find the * input configuration of the copier. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) ref_params = *pipeline_params; break; @@ -2225,7 +2225,7 @@ static int sof_ipc4_prepare_src_module(struct snd_sof_widget *swidget, * For playback, the SRC sink rate will be configured based on the requested output * format, which is restricted to only deal with DAI's with a single format for now. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK && available_fmt->num_output_formats > 1) { + if (snd_pcm_is_playback(dir) && available_fmt->num_output_formats > 1) { dev_err(sdev->dev, "Invalid number of output formats: %d for SRC %s\n", available_fmt->num_output_formats, swidget->widget->name); return -EINVAL; diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c index 9a52781bf8d8b..9ac03dc5a24d4 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -308,7 +308,7 @@ static int sof_setup_pipeline_connections(struct snd_sof_dev *sdev, * purpose of connecting a pipeline from a host to a DAI in order to receive the DAPM * events. But they are not handled by the firmware. So ignore them. */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(dir)) { for_each_dapm_widgets(list, i, widget) { if (!widget->dobj.private) continue; @@ -623,11 +623,11 @@ sof_walk_widgets_in_order(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm, continue; /* starting widget for playback is AIF type */ - if (dir == SNDRV_PCM_STREAM_PLAYBACK && widget->id != snd_soc_dapm_aif_in) + if (snd_pcm_is_playback(dir) && widget->id != snd_soc_dapm_aif_in) continue; /* starting widget for capture is DAI type */ - if (dir == SNDRV_PCM_STREAM_CAPTURE && widget->id != snd_soc_dapm_dai_out) + if (snd_pcm_is_capture(dir) && widget->id != snd_soc_dapm_dai_out) continue; switch (op) { @@ -950,7 +950,7 @@ snd_sof_find_swidget_sname(struct snd_soc_component *scomp, struct snd_sof_widget *swidget; enum snd_soc_dapm_type type; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) type = snd_soc_dapm_aif_in; else type = snd_soc_dapm_aif_out; 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: 13752873 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-Exch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M/VvGjKMPweYxA52f6x2hG471E5tScOLHnyxT0XzPRqBSutOEjnnDFb7XXR3p0HRQhqh/CCXmwvPtUdpa8FSOTlN2cMh4yUWwgsc2yT3XlwhYrWWrxAjDi7TlwzGzms/hraRzZ71At1d+FBGyEuSlAQ0kFNklQi1qcPG/q9H4uK7blKfkPVu00v3WP4Ao6De7O1KYa1ESqjuIANOiD4qGiNXy2+L7s7sosVZRtDTQQ3YluRVmBIoCrtXhf2l9rQBdc/itMBpYZhpAC6Kn0RQLOwqa1Nbvs/H/xiMatXVfKGYev3wal3ILOoxvdP1fEpsXvRs1S0UNJJ0b7cgHr5Ebu79HknsUzQQOo+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: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: 13752874 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 6C56B171A5 for ; Mon, 5 Aug 2024 00:39:50 +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=1722818392; cv=fail; b=Mf/6w7uI80Es5RMhwWTcDjYH51oSd8mkdWHgwmHLmm2N++VsiF8oVyXtbBkwrce7xhGWh84PJM/k7YHTTELIDVw7OXhI+juaxjfQEVCRlLrnQ4kXjvq9WHNtk1fgQbEz8cHM4sI4govHumwuiNxXBOctDFy6/qfWzk1c1Ucuk7E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818392; c=relaxed/simple; bh=4IKzE/0l6+rAy+h0bK7iSf8LM5SK26AwN1VMZBa1tEM=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=XdoRBD6E2C2B2rjw6FtSDi6fEfTu0YZRTvAJo0Nw+/e25q7gUnQDgND8Vg9cJp0JtKdWmPwNB67kINolhDuvZ+hHcK0wuV5jvVyT1+dHytkAYDvweSkR0R9jQY0itE/W5WKhRcrEMBse7DJS+jRnAtfdDneQSGlZGR89uYLV6MA= 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=LCpb5vxZ; 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="LCpb5vxZ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TdfgM8/HT/79HmaxQD4F6MYhNx+8/LkjFt+gpQ25b+kPHPTp747xdGalhs+SIfchtzFiHeB+/mEzsr+XqDAoxfbJE0MJCfqZ+a36xu653amNPW/+8SVyAWdMXw84UvOk8caiEZViAALnZLWtf50Km8HqohbnRgbbwoNEt/sR1TMKwcQYfIkxQTlEMOE/exKj9ywuFSOmZHPAMItS6KGuMR7JzzNS3p89ZDktCJibZshqW2hnHmjMDtQ9rYNsjw2gJacIxsZTbqit5HE9C5DWDyUXRUzu5lgTDom4YmQfa67ckJB2hZTF+FFYcwt0Wm1LcUm80rEfEDv5PAP7AyEzng== 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=sdlERduANgxTCIKQW1Wf2vcHnEtrtSsPVn4SI5YZBLA=; b=E55nYkF4mgF0imuBWN3V2RuDE5gv1lOo2lRDw8zP2ybn9TVTsTWm1HSwmCvaIu5SQONmbOuI05eRRCFpyvnSGCZdQyaPWqa0mpqLv8EfYNPfK6AvR5FV7YtXiRpnpTudJB2c+2HHp6XB6iavtazdR8aw4EkuI6bC07F6M/HgQkt6pX3zPj4ZiGPlKrUGHbPjOeGT7IHpnmXFJas71/3AvokRaYNT/YAD0C4nLuBPNuqZLqWW2MYseIW9Vu+Pa7mSuchZ9Gg+7uRaLIfcQvwYVwukiQG4dmUjtXeZ95NiNjFARYwOQnv9PlWDSwsrHuVpEnZb/zO6Xskr8DnJikGqHw== 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=sdlERduANgxTCIKQW1Wf2vcHnEtrtSsPVn4SI5YZBLA=; b=LCpb5vxZubtf5WP9vXNEhSDC9ZEqZaeWmbelCgHg9z/n6ei8AtcE1e0NayRIruRR0eI/jwJhwL7U7Aihiy3LEBxve95ZtG1bzbk9xJ+OICy+QKwGZ7RIAdX8+xSOvXTbEZBmRLaAuXifplDbOIImQqIlkrnmcDhDh6G8BKV8aw8= 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:47 +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:46 +0000 Message-ID: <87v80fyf8t.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 056/113] ASoC: 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:39:46 +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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 83b25108-146c-4309-5c02-08dcb4e71b14 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: qWtHgdWLhn52TXfwojw68TZNGk9m72zt5tA2Bj4aPA2OoeWxsqf/v9omAnrZDqJfasMjWNXCEn8ibdRnTh6I5Xqb946y5lk3h5flNFod3cjBapfZunrX8l5YtUxvKnfevgnVMSwc+Iu5XMNYgSLHshSMdXXlUwcBMs2T2MI1wUft32CNh0sBl2QPXGU7/s4AuJY2cil1HMMG37ZnqdBH1ksHuXHwSAt8gsHXlq3BHWk/TX/O0GUwdbM5O1OU1fwxI5gc1SHjflEvvS2Spj3uchdD0S1t1hXCbdzbLcgX74e9OvAcK6q7vV+cdxXqJlU75P8PIm4/PNNyRHpF4t1+T6eOTm1HIXI+JLBDanfGV8hPGRrPXHrmV2jOVFWCd/wCXdCPiHrw8Aeg5r2LMod21o5NTtaTSVoGOpFVrvCWKxHRAncL6OsbKoJFxtUJLQLjX1zgyR4JbltNpswctw407s1FgFjmPsIS/XzVh3E6KvBhEUfuiOuquxtuESwT6cQVoelN45M3vZDYq6WEGu8gsiNawJCc+8ggnzcoZdBaHjrUh1egm/z1TuEVB6Mly7pERS2j+H9/n208jPgqJBH3ZV9drdejIW8/MvH/m312shEM4sM4zsCugs5CTxCWHGrdYWyV4CNhjf9PP5ckvXyUVOphR8Warm2gzW8h7C+Dl3TCSgstuaFbSX02oL+HR3ivVO1Goz3kY30R8UuiW5wvGmt3wlrJSUnISrJ1ArKaNt+AyrUqtUyrGtr3e403fdKqrTYYc4JqCLU+DBVECgWKXhZ24/wTKUOTtcPjsNuQdHIqOmSy3NJtEtmJyXBkm5FmQo7NZTgVcXDUnkjI7UqRkOuZ7Fa2+NQfRBrHR02XrBWivdm2GwpxeEmkdwRx14UU/+Q++AG/ohFvhotFs/o4aruVJvNDDMf7UGpPxKi/AOLkO5IySzLlLo00joIXQikq1K4JY0IOHuugtRkBoDGH0Mwci0d7PVxzbjyb4s/hKz4cv3jBUSUk9K3aPJ/jia85MZpwMyI2uZZCldYbDhV1R6NhwjDLzPa5PqDpd6Twiatu6L6Y1epO3UYUhHpsgFtqDbdbwG5o/CEsatpvj1jUQ+1BBtqvChIziOAtVKKg/E/hr8NVbLaeb3uLziRd/UevMurSb9S4saoMVXonZzhDFfm5H8SrgXUOneX2QE8+2PxXIInW/MqzcHKBzggJZjVv5tITs4kpvNLOuO/XHoYaezY3d5RGBqW7QpP+79zmbavf96UNTiwObr+nb9k3n5NHX2RY6MizsTfzLnUPWckDSS39WSswVd5fPJSxzwBsCJU0Pqg/kgUb1zYHu13PHMDryAqQ7+VJbypt6F5JDQKIzVOxOD+d4AVuVQU3NCgClu8yyLvDFBuexAbWwQUqD1NU3YgEl0j7cRbxELVSxs08SA== 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: QHWQX+lJobd8a6y4lXYIrqxMhxeeNNIN+VPEHk7Zc7oSAxktuu0xz6Fy1toz2da5v4hkpYEwtrM0pcgkxpFaYUWmH9e+/SmEuL8TGoTojN+XV3WingvKHdJYVU7wfvGD2SDrgTg0wPp8LJm2u4DIL8uFMiFUDbdop6EI60pPacBQk4pmEsWhKd7Cq8vymqab6jfN2bkb4vc/AcHSbIOVH1ZCdmwFyczQSh+aBbD+CJWN65HOXBb8raJilKaLnqJZ7eu6poWLY4DBp1ZXKSoJeWUoYQS83I9t9Cvo/Sfr6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y7UoTzE3LkB4CRHLaWWKomjCIvU9xWnhfP4WZURJi2NdDuRt7nwZFlqtGnIt4uGKJdvbXEcgSLSvb9JTngJHfpe78q5YBV49fAuVPyrXMjPq+Sk30aE/PRFuhDkMRca3Mh4bwVgmmK4zy8pQwQh4c/u4xhhd8pzoNdhTvZb1+fSnM/p/W0pSAgXUicEyxHo6pR0lblAr7kNyoxDQ8m6xjCVsLgmeWWSslZaAFxF/zHB4E5P1tHY1/XY830logc83/6cCvX1qJqYMe172ruft43pEOo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 83b25108-146c-4309-5c02-08dcb4e71b14 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:46.5978 (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: 7ZB04sNGtDPzHAgPw83fsCVroZY62Kmnbz+n4BIpsCxLaTbz/1691uEcUyTrPAKqEacYMUDvxhE+s195hQvtFWWg+hD8WuYXFzsouxWEpee6VdT8odvxKg0wwMkAGDEE 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/qcom/apq8096.c | 2 +- sound/soc/qcom/lpass-apq8016.c | 2 +- sound/soc/qcom/lpass-cpu.c | 12 ++++++------ sound/soc/qcom/lpass-ipq806x.c | 2 +- sound/soc/qcom/lpass-platform.c | 8 ++++---- sound/soc/qcom/lpass-sc7180.c | 4 ++-- sound/soc/qcom/lpass-sc7280.c | 2 +- sound/soc/qcom/qdsp6/audioreach.c | 2 +- sound/soc/qcom/qdsp6/q6apm-dai.c | 10 +++++----- sound/soc/qcom/qdsp6/q6apm-lpass-dais.c | 6 +++--- sound/soc/qcom/qdsp6/q6apm.c | 12 ++++++------ sound/soc/qcom/qdsp6/q6asm-dai.c | 16 ++++++++-------- sound/soc/qcom/qdsp6/q6routing.c | 2 +- sound/soc/qcom/sdm845.c | 4 ++-- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/sound/soc/qcom/apq8096.c b/sound/soc/qcom/apq8096.c index 4f6594cc723ce..a5305f33c32c5 100644 --- a/sound/soc/qcom/apq8096.c +++ b/sound/soc/qcom/apq8096.c @@ -46,7 +46,7 @@ static int msm_snd_hw_params(struct snd_pcm_substream *substream, return 0; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = snd_soc_dai_set_channel_map(cpu_dai, 0, NULL, rx_ch_cnt, rx_ch); else diff --git a/sound/soc/qcom/lpass-apq8016.c b/sound/soc/qcom/lpass-apq8016.c index 9005c85f8c547..5dfcd547cfcd5 100644 --- a/sound/soc/qcom/lpass-apq8016.c +++ b/sound/soc/qcom/lpass-apq8016.c @@ -126,7 +126,7 @@ static int apq8016_lpass_alloc_dma_channel(struct lpass_data *drvdata, const struct lpass_variant *v = drvdata->variant; int chan = 0; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, v->rdma_channels); diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c index 5a47f661e0c6f..81036c49bce1b 100644 --- a/sound/soc/qcom/lpass-cpu.c +++ b/sound/soc/qcom/lpass-cpu.c @@ -113,7 +113,7 @@ static void lpass_cpu_daiops_shutdown(struct snd_pcm_substream *substream, * Will not impact if disabled in lpass_cpu_daiops_trigger() * suspend. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_DISABLE); else regmap_fields_write(i2sctl->micen, id, LPAIF_I2SCTL_MICEN_DISABLE); @@ -185,7 +185,7 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream, return ret; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) mode = drvdata->mi2s_playback_sd_mode[id]; else mode = drvdata->mi2s_capture_sd_mode[id]; @@ -249,7 +249,7 @@ static int lpass_cpu_daiops_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = regmap_fields_write(i2sctl->spkmode, id, LPAIF_I2SCTL_SPKMODE(mode)); if (ret) { @@ -320,7 +320,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, * turn off the shared BCLK while other devices are using * it. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_ENABLE); } else { @@ -345,7 +345,7 @@ static int lpass_cpu_daiops_trigger(struct snd_pcm_substream *substream, * To ensure lpass BCLK/LRCLK is disabled during * device suspend. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_DISABLE); } else { @@ -378,7 +378,7 @@ static int lpass_cpu_daiops_prepare(struct snd_pcm_substream *substream, * the data flow. * (ex: to drop start up pop noise before capture starts). */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = regmap_fields_write(i2sctl->spken, id, LPAIF_I2SCTL_SPKEN_ENABLE); else ret = regmap_fields_write(i2sctl->micen, id, LPAIF_I2SCTL_MICEN_ENABLE); diff --git a/sound/soc/qcom/lpass-ipq806x.c b/sound/soc/qcom/lpass-ipq806x.c index 5c874139f39d4..dbaaed1f3d8e3 100644 --- a/sound/soc/qcom/lpass-ipq806x.c +++ b/sound/soc/qcom/lpass-ipq806x.c @@ -97,7 +97,7 @@ static int ipq806x_lpass_exit(struct platform_device *pdev) static int ipq806x_lpass_alloc_dma_channel(struct lpass_data *drvdata, int dir, unsigned int dai_id) { - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) return IPQ806X_LPAIF_RDMA_CHAN_MI2S; else /* Capture currently not implemented */ return -EINVAL; diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c index addd2c4bdd3e8..f8e223e73fa02 100644 --- a/sound/soc/qcom/lpass-platform.c +++ b/sound/soc/qcom/lpass-platform.c @@ -329,7 +329,7 @@ static struct lpaif_dmactl *__lpass_get_dmactl_handle(const struct snd_pcm_subst switch (cpu_dai->driver->id) { case MI2S_PRIMARY ... MI2S_QUINARY: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dmactl = drvdata->rd_dmactl; else dmactl = drvdata->wr_dmactl; @@ -364,7 +364,7 @@ static int __lpass_get_id(const struct snd_pcm_substream *substream, switch (cpu_dai->driver->id) { case MI2S_PRIMARY ... MI2S_QUINARY: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) id = pcm_data->dma_ch; else id = pcm_data->dma_ch - v->wrdma_channel_start; @@ -1230,14 +1230,14 @@ static int lpass_platform_copy(struct snd_soc_component *component, void __iomem *dma_buf = (void __iomem *) (rt->dma_area + pos + channel * (rt->dma_bytes / rt->channels)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (is_cdc_dma_port(dai_id)) { ret = copy_from_iter_toio(dma_buf, buf, bytes); } else { if (copy_from_iter((void __force *)dma_buf, bytes, buf) != bytes) ret = -EFAULT; } - } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(substream)) { if (is_cdc_dma_port(dai_id)) { ret = copy_to_iter_fromio(buf, dma_buf, bytes); } else { diff --git a/sound/soc/qcom/lpass-sc7180.c b/sound/soc/qcom/lpass-sc7180.c index e6bcdf6ed7965..6898e9254a78d 100644 --- a/sound/soc/qcom/lpass-sc7180.c +++ b/sound/soc/qcom/lpass-sc7180.c @@ -80,7 +80,7 @@ static int sc7180_lpass_alloc_dma_channel(struct lpass_data *drvdata, int chan = 0; if (dai_id == LPASS_DP_RX) { - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { chan = find_first_zero_bit(&drvdata->hdmi_dma_ch_bit_map, v->hdmi_rdma_channels); @@ -89,7 +89,7 @@ static int sc7180_lpass_alloc_dma_channel(struct lpass_data *drvdata, } set_bit(chan, &drvdata->hdmi_dma_ch_bit_map); } else { - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, v->rdma_channels); diff --git a/sound/soc/qcom/lpass-sc7280.c b/sound/soc/qcom/lpass-sc7280.c index 47c622327a8d3..d5a1c27652e48 100644 --- a/sound/soc/qcom/lpass-sc7280.c +++ b/sound/soc/qcom/lpass-sc7280.c @@ -115,7 +115,7 @@ static int sc7280_lpass_alloc_dma_channel(struct lpass_data *drvdata, switch (dai_id) { case MI2S_PRIMARY ... MI2S_QUINARY: - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { chan = find_first_zero_bit(&drvdata->dma_ch_bit_map, v->rdma_channels); diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c index 4ebaaf736fb98..cd7d99f9b8b40 100644 --- a/sound/soc/qcom/qdsp6/audioreach.c +++ b/sound/soc/qcom/qdsp6/audioreach.c @@ -1309,7 +1309,7 @@ int audioreach_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, s void *p; int rc, i; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) data = &graph->rx_data; else data = &graph->tx_data; diff --git a/sound/soc/qcom/qdsp6/q6apm-dai.c b/sound/soc/qcom/qdsp6/q6apm-dai.c index c9404b5934c7e..26c6051a53a0a 100644 --- a/sound/soc/qcom/qdsp6/q6apm-dai.c +++ b/sound/soc/qcom/qdsp6/q6apm-dai.c @@ -280,7 +280,7 @@ static int q6apm_dai_prepare(struct snd_soc_component *component, return ret; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { int i; /* Queue the buffers for Capture ONLY after graph is started */ for (i = 0; i < runtime->periods; i++) @@ -306,7 +306,7 @@ static int q6apm_dai_trigger(struct snd_soc_component *component, case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: /* start writing buffers for playback only as we already queued capture buffers */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = q6apm_write_async(prtd->graph, prtd->pcm_count, 0, 0, 0); break; case SNDRV_PCM_TRIGGER_STOP: @@ -356,9 +356,9 @@ static int q6apm_dai_open(struct snd_soc_component *component, goto err; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = q6apm_dai_hardware_playback; - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) runtime->hw = q6apm_dai_hardware_capture; /* Ensure that buffer size is a multiple of period size */ @@ -368,7 +368,7 @@ static int q6apm_dai_open(struct snd_soc_component *component, goto err; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, BUFFER_BYTES_MIN, BUFFER_BYTES_MAX); if (ret < 0) { diff --git a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c index 9c98a35ad0994..3189a10b2f28a 100644 --- a/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c +++ b/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c @@ -171,7 +171,7 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s q6apm_graph_stop(dai_data->graph[dai->id]); dai_data->is_port_started[dai->id] = false; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { q6apm_graph_close(dai_data->graph[dai->id]); dai_data->graph[dai->id] = NULL; } @@ -181,7 +181,7 @@ static int q6apm_lpass_dai_prepare(struct snd_pcm_substream *substream, struct s * It is recommend to load DSP with source graph first and then sink * graph, so sequence for playback and capture will be different */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { graph = q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id); if (IS_ERR(graph)) { dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id); @@ -224,7 +224,7 @@ static int q6apm_lpass_dai_startup(struct snd_pcm_substream *substream, struct s struct q6apm_graph *graph; int graph_id = dai->id; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { graph = q6apm_graph_open(dai->dev, NULL, dai->dev, graph_id); if (IS_ERR(graph)) { dev_err(dai->dev, "Failed to open graph (%d)\n", graph_id); diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 2a2a5bd98110b..38d8aaab876d2 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -195,7 +195,7 @@ int q6apm_graph_media_format_shmem(struct q6apm_graph *graph, { struct audioreach_module *module; - if (cfg->direction == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(cfg->direction)) module = q6apm_find_module_by_mid(graph, MODULE_ID_RD_SHARED_MEM_EP); else module = q6apm_find_module_by_mid(graph, MODULE_ID_WR_SHARED_MEM_EP); @@ -218,7 +218,7 @@ int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, phys_a int cnt; int rc; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) data = &graph->rx_data; else data = &graph->tx_data; @@ -236,7 +236,7 @@ int q6apm_map_memory_regions(struct q6apm_graph *graph, unsigned int dir, phys_a return -ENOMEM; } - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) data = &graph->rx_data; else data = &graph->tx_data; @@ -273,7 +273,7 @@ int q6apm_unmap_memory_regions(struct q6apm_graph *graph, unsigned int dir) struct gpr_pkt *pkt; int rc; - if (dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(dir)) data = &graph->rx_data; else data = &graph->tx_data; @@ -538,7 +538,7 @@ static int graph_callback(struct gpr_resp_pkt *data, void *priv, int op) graph->result.status = 0; rsp = data->payload; - if (hdr->token == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hdr->token)) graph->rx_data.mem_map_handle = rsp->mem_map_handle; else graph->tx_data.mem_map_handle = rsp->mem_map_handle; @@ -575,7 +575,7 @@ static int graph_callback(struct gpr_resp_pkt *data, void *priv, int op) case APM_CMD_SHARED_MEM_UNMAP_REGIONS: graph->result.opcode = result->opcode; graph->result.status = 0; - if (hdr->token == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(hdr->token)) graph->rx_data.mem_map_handle = 0; else graph->tx_data.mem_map_handle = 0; diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 3913706ccdc5f..3e3d2847f992b 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -187,7 +187,7 @@ static void event_handler(uint32_t opcode, uint32_t token, switch (opcode) { case ASM_CLIENT_EVENT_CMD_RUN_DONE: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) q6asm_write_async(prtd->audio_client, prtd->stream_id, prtd->pcm_count, 0, 0, 0); break; @@ -258,11 +258,11 @@ static int q6asm_dai_prepare(struct snd_soc_component *component, return -ENOMEM; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = q6asm_open_write(prtd->audio_client, prtd->stream_id, FORMAT_LINEAR_PCM, 0, prtd->bits_per_sample, false); - } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(substream)) { ret = q6asm_open_read(prtd->audio_client, prtd->stream_id, FORMAT_LINEAR_PCM, prtd->bits_per_sample); @@ -281,12 +281,12 @@ static int q6asm_dai_prepare(struct snd_soc_component *component, goto routing_err; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = q6asm_media_format_block_multi_ch_pcm( prtd->audio_client, prtd->stream_id, runtime->rate, runtime->channels, NULL, prtd->bits_per_sample); - } else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + } else if (snd_pcm_is_capture(substream)) { ret = q6asm_enc_cfg_blk_pcm_format_support(prtd->audio_client, prtd->stream_id, runtime->rate, @@ -385,9 +385,9 @@ static int q6asm_dai_open(struct snd_soc_component *component, /* DSP expects stream id from 1 */ prtd->stream_id = 1; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) runtime->hw = q6asm_dai_hardware_playback; - else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + else if (snd_pcm_is_capture(substream)) runtime->hw = q6asm_dai_hardware_capture; ret = snd_pcm_hw_constraint_list(runtime, 0, @@ -401,7 +401,7 @@ static int q6asm_dai_open(struct snd_soc_component *component, if (ret < 0) dev_info(dev, "snd_pcm_hw_constraint_integer failed\n"); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, PLAYBACK_MIN_NUM_PERIODS * PLAYBACK_MIN_PERIOD_SIZE, diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c index 81fde0681f952..7e7ad072700d2 100644 --- a/sound/soc/qcom/qdsp6/q6routing.c +++ b/sound/soc/qcom/qdsp6/q6routing.c @@ -1055,7 +1055,7 @@ static int routing_hw_params(struct snd_soc_component *component, struct session_data *session; int path_type; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) path_type = ADM_PATH_PLAYBACK; else path_type = ADM_PATH_LIVE_REC; diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c index 75701546b6ea8..daa38d07a50f2 100644 --- a/sound/soc/qcom/sdm845.c +++ b/sound/soc/qcom/sdm845.c @@ -84,7 +84,7 @@ static int sdm845_slim_snd_hw_params(struct snd_pcm_substream *substream, continue; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = snd_soc_dai_set_channel_map(cpu_dai, 0, NULL, rx_ch_cnt, rx_ch); else @@ -115,7 +115,7 @@ static int sdm845_tdm_snd_hw_params(struct snd_pcm_substream *substream, } channels = params_channels(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0, 0x3, 8, slot_width); if (ret < 0) { 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: 13752875 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+0SFWRoIk4bnfYFQk7YK1or3E3J7rGNmRZdEYnnhv8vWCHqFXGQQehgcJ78kNu0Oo2OXtovwXFITSmgZKZa4H4XwgWrIlpy+mFb+p1k2ji8kl+/VFP7RyswqB7UXwHHQ2xYrcJAaJgz7wa7Mz7bc7CVHqtBPe3TGilrgcOaXnwdZTBknlkZNQMK9WhbCzDBgT74A8876U53JZeUjmLP0RaOS6aNZ0RMLL9N8v2DO0p4Jv5GynIghbSmNzUawAKjX3QhS5mMuFdxFNpuKaieAeM0Hz5TOU8yb8Fb6s/iBPJm6ws5Xpf/kILnFcidK/qbNwYS+xA4FlrO1tK6amtboBSAqtTp/6A8zSc8c3sfVTcjD+HquP+dgAQoIQdzUsC8GQnApMiRRM7oZVb+3xEx+r4iTX7h0ia7t3Ng4zvgQFxwWmuxnq9478hdT1/X98TOiWbkxjvUCcuGo1voqN74i0CskUDa7uT4pHvARUMm3fYTSaLPUu7ZWrvll/lR68zXKb4Mcj1FbP/o/WsHMHPxm0IAyHj20kNZvf5NnJUBSgSsHzLJfxSzChFH4s9nQ4B6PdsNE6MyW60/ruWLz2ccbrkRegENTbXDwB1WwqVppwMqDgtGiFfnzS87stiW618+mzHqSZ6od7UsvqKL1VgURGAJl3egCiRRFPlXlZroKiQQp/rgmNYlHSHfctgt+mtLYgQhOZQNlK0DuPCS9TxXKmGdUTmkIYaeN1xdbr0Jfb8wN4dUHVmlgrjjWVIZPViKaIIq/kNk02BPaYARNY/5sHXq+1gNzMN/u9sQZGmTi58NttCEkafHAmr+oHXx+Ng2o5nocS0skrYUKGjEawHfCDHFtgbw1rLoa2ctRPaZnjzwJ+gi95Do4U2C09Ctl/JL6aW0HwaIrTMxI4jOMg61DmU7lTYLcJFSMARdHHhHIut+vs5zJZ8KxY5HUzehT9N2+qUyUc2P1xb2spDZNc0IUvM3n4MyVZ9FlWAJDPvvxY+nrHq8e6dMLFDLUNUt8JB4vnfkL/CIkqTC1OgoUVt4iEEiwG+t6kJ389CBqDjlu/iXFJX+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+nNbJnI5A5Fl8OK3OCHk5ZevIbsRookb38fB7Un6YKPi3ssY1XX4CrBt5Ow1M3wXIE3qfBj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pVNqXhW/4GS4uJgyepSip+TwLWFdzxg1HnalydJUa84Lml6xg0KfYVTavk9ZsdrOsyZ6ss3t/nppA/6yCylFm9KMCfa/yPTzvVMIDUTzr5dVvGmPC57culpN/IO5cmse80NegUQb2iibPY4CvqArhR9AYvcXSbrgCnjwql7+Pej429Fr7pS/inmI6gHgWMP9ViivRLbaSQviT+PU7xH+c+Jy3MK+c9F1NWDim/USZ42mmll8tGjriUYdXbdRfnrcQ2NIWgAEvbvgT2bWqSBDH8H84gIJ89ISNf/MuRKMLxle0vMULCVm7diGhNV7YNFSIlVBHVuLjJyLXTarfCOYAiKAMN42DmAXUw4CsMNFcnpg7wNXhPHg= X-OriginatorOrg: renesas.com X-MS-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:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752876 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010069.outbound.protection.outlook.com [52.101.229.69]) (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 EB1291755C for ; Mon, 5 Aug 2024 00:39:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.69 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818399; cv=fail; b=Mmevs8wAbBlITTibXwxWdzkMMLMrzluAmMTwFbk38VA8hcU2t/rdy1N+HgQVKQEE9752rD2/nmylI/nZc6vpJB1emUCkFkNXn+0JnrGm4KrHxfK6xWN4oDYQHXIoYzrwttuR2+I+huxBzWErwlaG5QAnzzfxVd87BK7YJ3MOrJU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818399; c=relaxed/simple; bh=BF+AZguoCo7V+mfNfBSorDhXKpVTtVPWTnoPcT41ILI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=ooqf+kyddMWN1UvoPy34vVpK4bavcrl+FDP0GeFvOIKm03ROVWxGky76Gq3R8EjnqhAGNxJe4p9WUdUVZPjGG7TmgdqcabmmNLfLTWQ59HB/Pw0zX+2aQ2jaxd2x7NO+ZuwH37h4nwoV2KsmyuSsONRd2vXrrl1QerUBUBGhI/4= 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=B+eUyzHo; arc=fail smtp.client-ip=52.101.229.69 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="B+eUyzHo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ts7GP2Lj6hA3sbNu59PZ7hvMqEkEpt+DNlwPeWfxyFj5KoWdBaZt78Mi/oiVBiWyOSWKIe0cynxwJErZE7UXErDTarUwrRBbyfJfvf4BB6juJcXoiqYe3+esZaldnbXKZHH2SbTGL6be5TMP71PbUJI+OsSIBc8glmEYEcBvbK8YlFMIiCaWsxCCkbWpJ3IJKMIpugrNYMtKPpPad+m5KOzK6SgyES7JA+dq2UWYKkDX21R5XDJy5PQu8ksVve/nc2GUgGPsdkrre6NvRBbilSMi2mPiNSorpWUzaw3omUU1kLolRMdyARHrQ/h2HbLhIXgjXG0EAJnwTovyOCt2Ug== 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=e7o6TiQnaMaRLBaT95lA/r0JnmPt6tWmU7DxJR+d8e0=; b=aBQaRxslZWv1kxKyj30WHMTJPJVEHqpEG6R3Wg0EEjzZOk+D1b34lTBwcxbVbj0NAvqc+QT9RTVpWNDl3l7r3RJuqNzSL1YPoeEOFGE+syAa72QynjNZ7BXKnva4D7OWJaG8OTcn5vKUPb8MUA0hTSWdoJ4Rbttu/gtYGMUZ+Li02eZI768c2uD/O5klVHqCibCh7E35mxeum99NENPw/gKhQ4+PdkhSrpHdnI8QxXxZl5RJVROxyNm6xbPIwp6sDkglpojA5iTbf0OTEMbjqKXhS9f/+lGQgiaDgiP34Xa2NxvKoU3ZAxO5ib6h5atgxo0o6i+lfWe8jF9RXKBQ5w== 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=e7o6TiQnaMaRLBaT95lA/r0JnmPt6tWmU7DxJR+d8e0=; b=B+eUyzHo8r9IlsKRDGfWGCrY+Ym6/q3zyxomksAv+Q9+o5AKc1FPCUl7o2EBgKDogzJdrIlUJ0Of4ZukAJEFVCuwJh4Tdpp76a6Um3kf7gEI9rCGa6B7vcr2k8JyNaIrd31GQRZPP3uE1gIzCfG4vBUZj2PHLSXJ+cCSYpP+1bI= 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: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:39:55 +0000 Message-ID: <87sevjyf8l.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 058/113] ASoC: au1x: 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:55 +0000 X-ClientProxiedBy: TY2PR02CA0063.apcprd02.prod.outlook.com (2603:1096:404:e2::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: e9ecd055-0ded-4b08-6948-08dcb4e72068 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: H7TiixdF9Q1PDysj3bRb5kjMM1gn6y8nX6H21LRKlTK8iFf8EJWndc17Id3qVbWKS1txGcTMfrfOQowXBcb/02hSmmYltL+OJcQsNBAr8DMrtsR1aA6pvgqanzTRuXNYAWuvJHlerEVA4aPRNmWHG3glolvEqNjXCnt1UfzBO5ZieN5UDBZcndKi56m12FZqTGfHXSu9CWceAwWOAYvhixsozokIz4jY4Es4EEyPHUdoSfIAufFQAnBHxEAwbGyCvZlJ9gwV38Ci/adPYH1PnSawbpCk57xcCEpQeVWvEtnn71ahkoHh9rr0lOVgJDk+mCxKOl2bVpOmNo80gfuBtFN4AtxfcQkCo2XAh6469i5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am-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: 8C0tjgkLPqglJO3bV1/57eZvZMmQHVvBX6vcpVJu1dgCcMd8rVhR8CJQhCZNu2KvNq59V6JsBgmPkbCbVT5uH1Qx+0koEQySk2UTrIboXC8MUsm8qmvxjzyl+PkIf+HLPiKSFHLe742r0Lou54AjqTdNMaKKVsFJJt35wizF4/X+KVKyL+RU96cmnG2Rvgmr+siGqhD7Kstp4jGAn62f14TXpoUg1ibXoQD+EJjZ0bdu/fw/SpelAY3z0alzlZtWKtzbixPBex+XK1MYJEEnzvxqL7h1e2tl9sSBvAOQIRcnmkNxau3cZ53kOwLtu8fk6wRMPEGw3H9WuD1l4muvDH4p6+ReD2DxS5uHQAaAtZPD2r01maUChDfES3l0D5W+rIQ4brCeNGWCLh6dnCtcIkt7bZHpAQrXjqC0yd1Tpl6m6EZCEbJBeDWgta0jdmMV2p4vuVpkWNj8xlxvPFB8bDosU70pkZAt+njvlvpimG+FJh5Y4d+biqSsijmxKfisGWRxqDv/lmn9Opp2r7ulRY/+fOk9A09FRaTYo6HhNr2WmK7vJPAJd1HjXxjiRzexdeAuCr7S3EicEtOcDD0bdqqaw/XhhVGqdTkT/tgvFCVLuFwxRLi0wC4ryQWS/x2/cb3HXGF94ZOEAXbi4SP78PiNDBV5gNTaZrJCx3l1OSzwB3pho25UoU5G3azMqNYQGqZBrslQIe2LM8k12DJd5d464mBhNUW9SZoVu6qLVB9v1TLX5vmJwATZhreA+ReDIQNSMGcRkxAjVRN9MavfzmTtJFWfR1cHeCNiIJ9+xcJfCO7xkKbhyVxTgs7IUjaol4ASsI1Ezi8gIAXWIGhDC8u8vFyIuvJ4SVdUudKH4NFRtkYXrcVVXGCYGc5c04yuOs9ULT5jMlLq1XohLcHcwrf8mbWI7pTfrSBb3ZglFcKdrGsz+n8vqcE+LcgLzjdtfhp54ACACQhKH/169DkLbwLhEfW55dIODwFr7XLZNkjrkGu+D4Xog8kXv9Zw8M5/vBK07Ghf2PQdFDpSmcF/iW6LV378L/EEzXv6z/ekIKv/oQFoeKSEMZR1NlcgsyRuJk9RFxID0tc+y1bNXlVqLFWyZ/yIBcEUrUeCpnu/0udJPaTQNLzn1I2kKJch5OglnuyNjMwrSkxKFA0IG37JtO4g7q1wG2sDgnkkL6JqXDIucVDcV8HFwOcgCHMatXj6xiqGlG/xuc2yz/P1qB7ruO+Ts22wS+n5PgaGxdi+Y5aTMW+Xyw/ROP7YPH67FKUJgwoA3s+TUC+/42P8+YUn8QsQV8crp/ErVqfUH+14S2irpx3TdnPwDb7a2zv+zV89V205M+RVnnUSrMUwb2asoNCm96gb3sYUO1r/AIzVViHekpQ7XQ7Rfw7cG9QecVfI8eIkAHwHCS5n3e+GOI64jKGn8KQBUcRaOLVuql+4XijP4Gv7gRb/qPE/8SHUJEw77cod0J/miFRuLF07w0UAVQWmYE5T/hi3JfvN/vjVjEQcTjMHEa8hgCKDlHouUCXX1G60PwMGTbhIhI6vSx3517GrxV4lSxWWWcNDoquDyyp8DbgXcD7Z+7xm4ldDKS3ZrbkM/f4HcdMgeQDJZ4UT+OOOF8q1+MF8HR99GvXnX7I= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9ecd055-0ded-4b08-6948-08dcb4e72068 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:55.4782 (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: cTuyk2GDnxH/3ILek6EzTHOh8fpoeDgGDqoUAtvgYBe16qbtFWF4axh2njFS6YaPN5IVIOOVtnoedAEivrS1VfwdpAl4CFpwci++ezOh8weWhrbAQ6nXGdGtLdkggfYL 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/au1x/dbdma2.c | 4 ++-- sound/soc/au1x/dma.c | 2 +- sound/soc/au1x/psc-ac97.c | 10 +++++----- sound/soc/au1x/psc-i2s.c | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c index ea01d6490cec0..307cfbc7f713f 100644 --- a/sound/soc/au1x/dbdma2.c +++ b/sound/soc/au1x/dbdma2.c @@ -158,7 +158,7 @@ static int au1x_pcm_dbdma_realloc(struct au1xpsc_audio_dmadata *pcd, au1x_pcm_dbdma_free(pcd); - if (stype == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stype)) pcd->ddma_chan = au1xxx_dbdma_chan_alloc(pcd->ddma_id, DSCR_CMD0_ALWAYS, au1x_pcm_dmarx_cb, (void *)pcd); @@ -235,7 +235,7 @@ static int au1xpsc_pcm_prepare(struct snd_soc_component *component, au1xxx_dbdma_reset(pcd->ddma_chan); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { au1x_pcm_queue_rx(pcd); au1x_pcm_queue_rx(pcd); } else { diff --git a/sound/soc/au1x/dma.c b/sound/soc/au1x/dma.c index d2fdebd8881bb..7a8ff759ab4b1 100644 --- a/sound/soc/au1x/dma.c +++ b/sound/soc/au1x/dma.c @@ -200,7 +200,7 @@ static int alchemy_pcm_open(struct snd_soc_component *component, return -ENODEV; /* whoa, has ordering changed? */ /* DMA setup */ - name = (s == SNDRV_PCM_STREAM_PLAYBACK) ? "audio-tx" : "audio-rx"; + name = snd_pcm_is_playback(s) ? "audio-tx" : "audio-rx"; ctx->stream[s].dma = request_au1000_dma(dmaids[s], name, au1000_dma_interrupt, 0, &ctx->stream[s]); diff --git a/sound/soc/au1x/psc-ac97.c b/sound/soc/au1x/psc-ac97.c index 1727eeb12b64e..62627ec731063 100644 --- a/sound/soc/au1x/psc-ac97.c +++ b/sound/soc/au1x/psc-ac97.c @@ -37,14 +37,14 @@ (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3BE) #define AC97PCR_START(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97PCR_TS : PSC_AC97PCR_RS) + (snd_pcm_is_playback(stype) ? PSC_AC97PCR_TS : PSC_AC97PCR_RS) #define AC97PCR_STOP(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97PCR_TP : PSC_AC97PCR_RP) + (snd_pcm_is_playback(stype) ? PSC_AC97PCR_TP : PSC_AC97PCR_RP) #define AC97PCR_CLRFIFO(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97PCR_TC : PSC_AC97PCR_RC) + (snd_pcm_is_playback(stype) ? PSC_AC97PCR_TC : PSC_AC97PCR_RC) #define AC97STAT_BUSY(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_AC97STAT_TB : PSC_AC97STAT_RB) + (snd_pcm_is_playback(stype) ? PSC_AC97STAT_TB : PSC_AC97STAT_RB) /* instance data. There can be only one, MacLeod!!!! */ static struct au1xpsc_audio_data *au1xpsc_ac97_workdata; @@ -230,7 +230,7 @@ static int au1xpsc_ac97_hw_params(struct snd_pcm_substream *substream, r |= PSC_AC97CFG_SET_LEN(params->msbits); /* channels: enable slots for front L/R channel */ - if (stype == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stype)) { r &= ~PSC_AC97CFG_TXSLOT_MASK; r |= PSC_AC97CFG_TXSLOT_ENA(3); r |= PSC_AC97CFG_TXSLOT_ENA(4); diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index 52734dec82472..bd4a75fec9822 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c @@ -39,13 +39,13 @@ (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) #define I2SSTAT_BUSY(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SSTAT_TB : PSC_I2SSTAT_RB) + (snd_pcm_is_playback(stype) ? PSC_I2SSTAT_TB : PSC_I2SSTAT_RB) #define I2SPCR_START(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SPCR_TS : PSC_I2SPCR_RS) + (snd_pcm_is_playback(stype) ? PSC_I2SPCR_TS : PSC_I2SPCR_RS) #define I2SPCR_STOP(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SPCR_TP : PSC_I2SPCR_RP) + (snd_pcm_is_playback(stype) ? PSC_I2SPCR_TP : PSC_I2SPCR_RP) #define I2SPCR_CLRFIFO(stype) \ - ((stype) == SNDRV_PCM_STREAM_PLAYBACK ? PSC_I2SPCR_TC : PSC_I2SPCR_RC) + (snd_pcm_is_playback(stype) ? PSC_I2SPCR_TC : PSC_I2SPCR_RC) static int au1xpsc_i2s_set_fmt(struct snd_soc_dai *cpu_dai, 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: 13752877 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+gKFO681hv9iJOvOO8wLVxHS2atkidOBk0SjprlB1zuGFsFJ0Af+y+xfSluH1Lg8HnxUHDp2HWu7pr50Plr7eUgq8kCmPkhVrUzd8lkXGp312bjGH4bCMa1mPXoCY7EbIH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sWftVw25/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:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752878 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010020.outbound.protection.outlook.com [52.101.229.20]) (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 7059D29413 for ; Mon, 5 Aug 2024 00:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.20 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818408; cv=fail; b=V4laiWQocXtSCxYPMfOtCjyz3sZ0wVrgKM2MFzkDlJ9UcspJ5xu4Kn5v6MAzt8TJ4PnTQ1vnqCwPhsM9lC0wmEelzOP0PsbG4WPcAj7BqB4sie5vLVZa+nvul3B3y1z/+g6TsDvHwSu+VHb1Be1L2QXtIKlnW9ABFXn0IgbQc5k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818408; c=relaxed/simple; bh=nYhDtJJxz0GtgSsPqfNC176hRFTxIadSr9V1ydLfELw=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=DyjVuRYcA7gm/+RQzk4DzoSJvqcJPcfmvWvRelyTJBw7EEkjEC1hhwDP0HNRaEwrHqxS9SF6z1FXihGzkj1w5iIRy7EHTKyxKZUTS8jBTSdqF2/n79F6lna9+ZXvxZOKUHzzFhXXBbhNJuxRdowhc51Htn/5n2N3HpU5kLslRQg= 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=pKdgBLdC; arc=fail smtp.client-ip=52.101.229.20 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="pKdgBLdC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PsXwsoE0nWIi7Lt7+tFjBEFRRUEaSJBqbVlUzfkKuC0f2TCrvtARwMtGbWvzkDRaIYNrYF3JHyVcmC/M85HNZmUxiXAOluYkH+H1CGNcoDSlK3RPFbO082fSYW6mpv3VkXE3e3cvy7AkcY2M+gCDd2S7itvHwrWsu/NnfZ0ZFN5D5AdWNbyNlG09b3oSlAm7e1TQcol4Qz0pM/dbkJGhrlwGMvdXBjnSkqSIHvvHzpS0A/Kqnaq76NCJ1HFswo02E9cuFQn+y0lxn6GCJ2ojGur/ETZ6wgeFaSxJ26QCt+f6Q+P8X9/Noy8g7b/KUsyRxOVhh3W94JbzWu06t9wTWw== 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=Jiz4f3PvFB1vAvw15wSKm2E5Q/WtEYRPvjpgw7U1K/c=; b=E8bkTj59n2S+1aGA3dlGfHF4GZduiT7glrkvqBOT799IoGnpT9MHkWbiqWeKGa5lbVstahEzVbzH5/9kSTJDQ7ZeECwunhU6rRzRKxM7Yy5qb4ayw9sjiO+1311CjOZv8Tl3kOaod7m0QDoKd/UMWuyvY/i9Fi/gngSsy75AwWFCAGK6l9b/P8IasqqIOk1qOhYsGH2z9EU8ZwOYRwi/P3kdvX0wYn5S644czqpUg1E9wrtw0cxkUqAm6yQfSboUKuj0J8IL2c/1lo3VaCRWqoL762FAdFg1QpTk7mVLAzg06rdm5gVbcAlQZzfO1FWUuflqUdTrCXmTN5dBaGpT3w== 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=Jiz4f3PvFB1vAvw15wSKm2E5Q/WtEYRPvjpgw7U1K/c=; b=pKdgBLdC7b1fjHsgH0k3AGOxJ1B1juqIRbSjYxzhZ82Gse09zsVRUX9bffHJ9fan/I8H/SKTxnTETYPUqPi9DYhvrgZGNmyHdpZ3yk8PsuoxbZH/FXV6PJJ+u+do8FNXdbqpfXQvVBJLyXt1XyHlvlhEBTbApxQxCBToPE64k+k= 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:04 +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:04 +0000 Message-ID: <87plqnyf8c.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 060/113] ASoC: atmel: 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:04 +0000 X-ClientProxiedBy: TYAPR01CA0081.jpnprd01.prod.outlook.com (2603:1096:404:2c::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: a0411bf7-4a9c-4688-58a8-08dcb4e72596 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: Det2qIaIdfOeBrVGnijpWInVW9N4/mGmDqDd8a+fD0qfr8/BKKUphnie+dGvaSeYGX+oQL6rBTEyadP53GE0Buy1qavmv6y/gAM90JvTVxqBkNbzdSdJzAna11GGga0KU+yXpDm6muLBkyLEkJUvJa4SdMUDF+/uSmM7EnQlu0XwY9V/ZT5HMNfLgkMSmgUQKV0hHCvj1QJdaLc/uNc2DXXoY96cv0vwJPaW8t51QgnxzLFEKN+Ea46iqJcytDK4o68wCIJLZ/FxrfZTejbhr+NgDWj+4Xw4eql91KLzggQ6eFDaNxuYN4CBhszWVIHd17Sk0uaSw00v5npHfrew1ZqOwSVRg6m0w4CUl5N0SmAqw+smju2bZ6SCrUdswayn0OxRSO+ngZdhxoG669yznkgdOzni8iBLoATfzzAvfFkDMs/Yl2T3epvtDP3P3IDpJ7/5lhLUCxuJ0GA8VJ39JpWAfA2/lSuTimVwOUrpmisfbCbvCt87YeakgihPXqEPbJqdkrczUqWUKpFYP3BCYmecNootJPbet9hWfAcv4WqyhlpDPuKEhvCCLWaWZgK+1phe/fCcf4LbA2dEfYmrETRK6SJyfClb9M76GC+t1miTRZzHLqpCKrs6CY0I8elr+lSAZ5cW+TzjwUfoZNiY8062EyHLSZLrI85sHCvOvNfDMGsj0Q5hGk7czuc4k18LZsPQ6jMD7iX5JW4LqOW40JHWuiPr7kDcydXrisV4CWwdo+IKIAn5VWwqghzuPLUrJHR582AnEqFa7pYYsR188sGTUGhqlO1MLiOloZGqdnIKSOK3eLbTIylXFgAC9GnUFltXVy2jG/Evgtr1eS+NepeoQInOy/6LKw3I8TweDSG29ePJE/PhAwCPlhwSnTIw7ZhPx6suFuqtD31jgRph/efdQk/iBbUUF5BUiYGUdVBbKNS8xwE8Tdu27osTRdqEQVxi739LVLHHBIHvHMuFwr3nns/xoz9ys7+w/Du++piAmd9L6yeUjIuKkZbljwSWKOijnaKqWShrfGhUFBEPsyqfYjsamJC0U0av5p+UsNn3kkSHW1lfktKSV9S7diOoOZbQt/NJ8xYTGzPcjukwqttsvBz7yav3UDey06UE9vBLwZpbECE/yrHjjBdW2juFAsPVT21c1F+LgefkSKKSg/RTEANRfdOT5+A+9OkB8eSKypywyPvLV4sGCu4mNz93At3oWUMu38DKnJN8LOeACSVIDt6EFjPdPHmuJT1rfTpMc+c4YywWmWOce5S+a/Oo4eZJf0CETkjjjALV8qvQSgGdR+1jbxobUxi4DBYdhzR8bnlVKCES/5I0n4/MeoBj3yQBxDuFONS3xqIn5DB/JjDLSIjMKRouYWgOj4K03xMcZdRyJwPSzYtOacX+5A3BLF66d/NlL0vIpPml79ERyg== 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: 842GAAM9h5WharxwqJ7k10LuaGeeqfmbHapHBvczClR3EFVrHATKGpJD4ZLutRZ/eqwSq/fE5xdabhqA/mhZqz163ecV75ufBofuU1Og5/GC6M2f1Sx4W12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dYmBgNNC0yMzCofqHYimy1JXz0PLfLreksPdEHb1ZbglVYPYMaktJD0omisve+ZnJ4VD2Z0Colxmx1KY0tXmPNR71tnaivoXrgumWJArYsMPSW+ww/2/Mq0IyvERTWWmKMbv7VQvUnWJhGb//EdQhGmukB1s3+Vf8qo8PKhhoThERb328BDiafQ3AE/shK+SHMhehZuoqPxq4NoNJkFZ4+YZkguVGEXNarkxGX3lwmC7qARI9Qvp3UdNsZ2x01nJgh1A2NrZgmlGAxMy942dHSDQI+HwFGJiu/0yC5/OynL1lsz6vpY5dvIBrV4BIedotqQxd8vOb6gFtyJPKBFliDiTXZcVZ2SHPV+hX+b2jh5PbYeIUnhsnysnGsj/8VrdjBxQxSpsJCNE1G49sbUsZRsJeZXqfqmPzHHlHtfnrYgY8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0411bf7-4a9c-4688-58a8-08dcb4e72596 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:04.1539 (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: P96EwjUOCtBnxKDqrpNvBe9j+8rLNVH7u5D5ihQV7RSy5gqgMrMgCBcAE1kqdgYh01yUJ0NOu35sG86r14TM1o2wyLisMIQs1fXow0EN4a8gqLGBHlwvWU0OBAmHHmSw 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/atmel/atmel-i2s.c | 6 +++--- sound/soc/atmel/atmel-pcm-dma.c | 2 +- sound/soc/atmel/atmel-pcm-pdc.c | 2 +- sound/soc/atmel/atmel_ssc_dai.c | 10 +++++----- sound/soc/atmel/mchp-i2s-mcc.c | 6 +++--- sound/soc/atmel/mchp-spdifrx.c | 2 +- sound/soc/atmel/mchp-spdiftx.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sound/soc/atmel/atmel-i2s.c b/sound/soc/atmel/atmel-i2s.c index 6c20c643f3218..97bf80ba45531 100644 --- a/sound/soc/atmel/atmel-i2s.c +++ b/sound/soc/atmel/atmel-i2s.c @@ -272,7 +272,7 @@ static int atmel_i2s_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct atmel_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); unsigned int rhr, sr = 0; if (is_playback) { @@ -324,7 +324,7 @@ static int atmel_i2s_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct atmel_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); unsigned int mr = 0, mr_mask; int ret; @@ -477,7 +477,7 @@ static int atmel_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct atmel_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); bool is_master, mck_enabled; unsigned int cr, mr; int err; diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index 7306e04da513b..f65c30a5dd4f7 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c @@ -60,7 +60,7 @@ static void atmel_pcm_dma_irq(u32 ssc_sr, if (ssc_sr & prtd->mask->ssc_error) { if (snd_pcm_running(substream)) pr_warn("atmel-pcm: buffer %s on %s (SSC_SR=%#x)\n", - substream->stream == SNDRV_PCM_STREAM_PLAYBACK + snd_pcm_is_playback(substream) ? "underrun" : "overrun", prtd->name, ssc_sr); diff --git a/sound/soc/atmel/atmel-pcm-pdc.c b/sound/soc/atmel/atmel-pcm-pdc.c index 7db8df85c54f3..81ad08d436a34 100644 --- a/sound/soc/atmel/atmel-pcm-pdc.c +++ b/sound/soc/atmel/atmel-pcm-pdc.c @@ -96,7 +96,7 @@ static void atmel_pcm_dma_irq(u32 ssc_sr, if (ssc_sr & params->mask->ssc_endbuf) { pr_warn("atmel-pcm: buffer %s on %s (SSC_SR=%#x, count=%d)\n", - substream->stream == SNDRV_PCM_STREAM_PLAYBACK + snd_pcm_is_playback(substream) ? "underrun" : "overrun", params->name, ssc_sr, count); diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index 3763454436c15..3a8dd39537db8 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -290,7 +290,7 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream, if (!ssc_p->initialized) ssc_writel(ssc_p->ssc->regs, CR, SSC_BIT(CR_SWRST)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { dir = 0; dir_mask = SSC_DIR_MASK_PLAYBACK; } else { @@ -337,7 +337,7 @@ static void atmel_ssc_shutdown(struct snd_pcm_substream *substream, struct atmel_pcm_dma_params *dma_params; int dir, dir_mask; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 0; else dir = 1; @@ -476,7 +476,7 @@ static int atmel_ssc_hw_params(struct snd_pcm_substream *substream, * each direction. If more are added, this code will * have to be changed to select the proper set. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 0; else dir = 1; @@ -717,7 +717,7 @@ static int atmel_ssc_prepare(struct snd_pcm_substream *substream, struct atmel_pcm_dma_params *dma_params; int dir; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 0; else dir = 1; @@ -741,7 +741,7 @@ static int atmel_ssc_trigger(struct snd_pcm_substream *substream, struct atmel_pcm_dma_params *dma_params; int dir; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dir = 0; else dir = 1; diff --git a/sound/soc/atmel/mchp-i2s-mcc.c b/sound/soc/atmel/mchp-i2s-mcc.c index 193dd7acceb08..017f363ed389d 100644 --- a/sound/soc/atmel/mchp-i2s-mcc.c +++ b/sound/soc/atmel/mchp-i2s-mcc.c @@ -517,7 +517,7 @@ static int mchp_i2s_mcc_hw_params(struct snd_pcm_substream *substream, unsigned int bclk_rate; int set_divs = 0; int ret; - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); dev_dbg(dev->dev, "%s() rate=%u format=%#x width=%u channels=%u\n", __func__, params_rate(params), params_format(params), @@ -733,7 +733,7 @@ static int mchp_i2s_mcc_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct mchp_i2s_mcc_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); long err; if (is_playback) { @@ -789,7 +789,7 @@ static int mchp_i2s_mcc_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { struct mchp_i2s_mcc_dev *dev = snd_soc_dai_get_drvdata(dai); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); u32 cr = 0; u32 iera = 0, ierb = 0; u32 sr; diff --git a/sound/soc/atmel/mchp-spdifrx.c b/sound/soc/atmel/mchp-spdifrx.c index 33ce5e54482be..653c575e9a1f6 100644 --- a/sound/soc/atmel/mchp-spdifrx.c +++ b/sound/soc/atmel/mchp-spdifrx.c @@ -436,7 +436,7 @@ static int mchp_spdifrx_hw_params(struct snd_pcm_substream *substream, __func__, params_rate(params), params_format(params), params_width(params), params_channels(params)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { dev_err(dev->dev, "Playback is not supported\n"); return -EINVAL; } diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c index a201a96fa6906..1e73a720ff6bb 100644 --- a/sound/soc/atmel/mchp-spdiftx.c +++ b/sound/soc/atmel/mchp-spdiftx.c @@ -358,7 +358,7 @@ static int mchp_spdiftx_hw_params(struct snd_pcm_substream *substream, __func__, params_rate(params), params_format(params), params_width(params), params_channels(params)); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { dev_err(dev->dev, "Capture is not supported\n"); return -EINVAL; } 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: 13752879 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/qxt2hbSnToX6yAAtGlD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lh/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: Fw14Sqy8LPHJM62fYepnx7qF7QbVUtB7GloxC076fMCY6AdPp9avDdu48ejW4ivv0fN3vzweyxtiTbV6blbr11/EL+qa59vvhfCenbUoIlNSAP/17TZJTqflfxMbU6Ve01q/DWPNd0jqNne6h2o1bT5xz2H7RfjqpIVQK+Z6YG7veGLjILYovS4T16MZQndZTmpdUDaBDqj5hQPab0kulQ6f/mN5qK/noP3vF6UFuBjPBzkS/4vDFrse7B0dKnWp2a50OlDVuh8fciJ9AMybCLjbC1zKWe++kMoZYnjrkNFWCGwhd98w2CXcXzP/rH6Fh/RFYMm296IS1y/ty0KVUOcCMEIIfRrAdkKUG+L3kEDT2RhF0XB4fwJVKCPAjEAhlz7kd8FUfFYakihXn66F90taPwNPMtdwbU6moDjIUs1YhLOGx7D/mnpoPTF/VliV5CbHjLkJ9IPLl58fqJuBfyiGf+HTbCQInQDs4ylXIC3X+fE5ownyJIPlRYky8Ljqq60ELQs31bWJkE4RILQnb3RqTK1A11qb4Gy3cn2dZiF7u4kKLx3sIgfh3WFZ8wuxaqr4QNl+E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S-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: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: 13752880 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010001.outbound.protection.outlook.com [52.101.228.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 5E92D182B9 for ; Mon, 5 Aug 2024 00:40:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.1 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818417; cv=fail; b=GsdtdlhJHWTtGJCAKap3m68+pXHkNkV6494R5RT7S8SHMDktKMaYQ9xdoDcyzZFSiswsN/2XSyaekruCfZ99UEy9TBlLEh5lUavRZ06CT/wufp5J3qh4Hipn6z504qfrfid5/y3quaMGwa6qGdTxCZ+C9qiz95Ajsnj+7paEbQQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818417; c=relaxed/simple; bh=75M3W4tVW9VeOc3MM+rbL8QGy0lIRnEwziVOJroiqOQ=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=du3yHoGgl5lGetEOI0hVFw6+R9Dqx5hRPZ3d6SQe5ZP/oFfOTEzEc/I1isSn8nO6MTnosYYrcNSFOBT1SbhuaND9XPDa2eidpbIaOgKAvKDRMoWb3nN/+cihp/zd6ugLC5IH88B86E9WBtrf0jtU7XIZR6xzoJHJdd2M2CKVNfA= 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=a0gxzLkS; arc=fail smtp.client-ip=52.101.228.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="a0gxzLkS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pXzAnQrxY2LWf0DK86sPZcVr3+Pp2dW8zdPOpLiV2u6oqqL+xFblQfEH0s871sVNh9kKBYk8BnVhm/CcIJErcOtKIL9CHArHL1L6C+VDLFFGhcBMGdZSTlNffRAGN0DFAaremQ2Hkouzu1g4cqeYWIKSNAtjFJokVRmSXt6Wo/mzi9z+yxgM7Yc+2qUfZSxCZ9dQZt7vWwRt6/68zOw4ePeUqEQVVU+ASEvCqYfeyqzUPJWuz+UrvU3kuJ6oA3rjquoutuTYEaJM2PywBBIUSXcuyN60FvztykvVPKV78CeMQA5/zsYTX46rYuUSAQfDCFJmfwfckI7JYOKo9+InKQ== 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=kxRIoimJe05t2bsWKGO+/4Yh3+LXfJPxjHOA16YHuZ8=; b=gaWdf+S7gxq70YXPbHm3sYHVurf9SZ+QF/j0+WUjeH7qniYWm7cxXAOKqGVUZpiKEXPXorgv16GTtWEOmLCtEgWyfmf11PCWO58GxwMlPnhPwkZ8Sp4NKdDVdk17BtpTrExnSP+H5YAIJBWjid6tiwWY8jdWORF9bstaXaR1kD3SNvwNr+WcEmIlhkAptTzAqu3M6kegynplpch/AY+C+Rbs7X5hLrx3OJ+MwYcawoLfEm+buXUhmE2wd6MBiZfCrHuHBtF/GhNOeLa/A3EeGp3yvP382tQUQFrwSuHeQCvigaFoxHFw3XQ5rOhUqCjqklLRgiTqnV1R3gpLmEmw/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=kxRIoimJe05t2bsWKGO+/4Yh3+LXfJPxjHOA16YHuZ8=; b=a0gxzLkSRFBSzJb6cFD7lYfPQdRtbau7Wr3vcmtXC6XV3zz4+1yshIgZXnZ2X+5b0mdPMZvmRDcE+as2+wfWVU0U+62XTf038PoR4w1Y5l0e9KjZAFXaMPjh+oLwANtYVWWo6QGXWBHhPToePMe7UnJMcMA59/Y4XoC8rGfjCxk= 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:12 +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:12 +0000 Message-ID: <87mslryf83.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 062/113] ASoC: 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:40:12 +0000 X-ClientProxiedBy: TYCP286CA0257.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:455::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_|OSZPR01MB9459:EE_ X-MS-Office365-Filtering-Correlation-Id: 944a19d4-bcb0-4bac-c189-08dcb4e72ab3 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: Gvb3nm7ohmvwAan/Fta5CjsNa7NJVnWe0l/kwehd2n7Pphfr3J3c87Wo6GJ+sHMcI+prPxA6dtPpChlnEvuzZG30VVLDvTlC7SzStg0l1CYhyaP0RRmmyvZ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9O62Da1V4vQ8+C3dA+bFEBoGfaoRCvEmKwvNX6KXA31TZ/9poE2O9DtICg/tCwan7sYtc799eM3MQy5W12bT/W5MzyLtXT+K8qY6wWhyodD7Aa8s8YnaIAAPUmf5XnJ/Q/KFsYropMAMsRxZ5Kdd6MqT0mUSjmDIO9xCm0+DP7wj/m+MCCTi7+Kf4miz8vyrElib2LQUv+3wf2GYF3mRvkjo+bEnFItc4boA== 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: lMe25fXS//aO5TPGkigH6QkjIKzwcMvMF59GliZzWtYWJojS2vKkurtflbzoDAtRVLY4MoBrkJKbyGVnG2waFVPBrkPHSXRov0zduTh/oMhF6qsLPk3HoU/UiUoBy9xRH4hVh9VJfW5YcXGqs878lp90DQ6oUZ8IlkmW3Bl63bu5krp09ScwWgW4lW50+twzenGf8bGlB9bSuucCVH7nqZcP5/78BlSj7MbWT129uaWUODtrM++/hs0EQ7OVNdGG8o/CvxOo114EZYOW/kF2nvc7fEDu2N2mFpD9UOajoZ60qQJfhhKSrg4Hq2XjNs1Z7lYbRDzzzbBb2nY4ovveWsVJRak1kJEVs7H6qvE1yU1kq4HketwH5ymnf0pTVcQlCt6Bg1TOoTxCivbH5rcL4WGBTiFxVuNRYQsP1gvmE8wjD7s/u08FmkN36LQ3OZ0WDGVATmBTc029dZUk0Spss3ZWXTmQrxVGR7A0R1WQYosWngdHeByEyarLKJd59zFK265I41pkvYI7c95QVLedg+dd9+rN+B2G2dtMJ/tQ1/1qHTJKq7nvFosXh0JIWQf+z9RCzv4DGYS+QR5+M0j49uRy/R1jY9mcF5OrPOIXyWWe4vgB5u2Gm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cb0-4bac-c189-08dcb4e72ab3 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:12.7454 (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: SQ4vBiGo7hIxn9C5VXriDnMNgruvZL87cAbd22LoEuT8Qpd4C0JAma4vBzx2D0HQT5t3IVQ6Gz4sefDA5NR0ye1OCNa1Wgaf03uADAabTLCO/ZRAyYwyZAaH/rR9KXxJ 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/atom/sst-atom-controls.c | 2 +- sound/soc/intel/atom/sst/sst_drv_interface.c | 2 +- sound/soc/intel/boards/bdw-rt5650.c | 2 +- sound/soc/intel/boards/sof_maxim_common.c | 2 +- sound/soc/intel/boards/sof_sdw.c | 4 +-- sound/soc/intel/catpt/pcm.c | 4 +-- sound/soc/intel/keembay/kmb_platform.c | 28 ++++++++++---------- sound/soc/intel/skylake/skl-pcm.c | 14 +++++----- sound/soc/intel/skylake/skl-topology.c | 18 ++++++------- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index 38116c7587174..0c6ce403148f8 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c @@ -1333,7 +1333,7 @@ int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute) dev_dbg(dai->dev, "enter, dai-name=%s dir=%d\n", dai->name, stream); dev_dbg(dai->dev, "Stream name=%s\n", w->name); - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connected && !p->connected(w, p->sink)) continue; diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c index dc31c2c8f54c8..f02ee7f48a2a4 100644 --- a/sound/soc/intel/atom/sst/sst_drv_interface.c +++ b/sound/soc/intel/atom/sst/sst_drv_interface.c @@ -487,7 +487,7 @@ static inline int sst_calc_tstamp(struct intel_sst_drv *ctx, fw_tstamp->ring_buffer_counter); dev_dbg(ctx->dev, "mrfld hardware_counter %llu in bytes\n", fw_tstamp->hardware_counter); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) delay_bytes = (size_t) (fw_tstamp->ring_buffer_counter - fw_tstamp->hardware_counter); else diff --git a/sound/soc/intel/boards/bdw-rt5650.c b/sound/soc/intel/boards/bdw-rt5650.c index 3c7cee03a02e6..a5df4d3067d71 100644 --- a/sound/soc/intel/boards/bdw-rt5650.c +++ b/sound/soc/intel/boards/bdw-rt5650.c @@ -150,7 +150,7 @@ static int bdw_rt5650_fe_startup(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; /* Board supports stereo and quad configurations for capture */ - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return 0; runtime->hw.channels_max = 4; diff --git a/sound/soc/intel/boards/sof_maxim_common.c b/sound/soc/intel/boards/sof_maxim_common.c index fcc3b95e57a4f..f520442bbb096 100644 --- a/sound/soc/intel/boards/sof_maxim_common.c +++ b/sound/soc/intel/boards/sof_maxim_common.c @@ -196,7 +196,7 @@ static int max_98373_trigger(struct snd_pcm_substream *substream, int cmd) int ret = 0; /* 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/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c index d258728d64cf5..5818c21173032 100644 --- a/sound/soc/intel/boards/sof_sdw.c +++ b/sound/soc/intel/boards/sof_sdw.c @@ -846,8 +846,8 @@ static int create_sdw_dailink(struct snd_soc_card *card, WARN_ON(i != num_cpus || j != num_codecs); - playback = (stream == SNDRV_PCM_STREAM_PLAYBACK); - capture = (stream == SNDRV_PCM_STREAM_CAPTURE); + playback = snd_pcm_is_playback(stream); + capture = snd_pcm_is_capture(stream); asoc_sdw_init_dai_link(dev, *dai_links, be_id, name, playback, capture, cpus, num_cpus, platform_component, diff --git a/sound/soc/intel/catpt/pcm.c b/sound/soc/intel/catpt/pcm.c index 81a2f0339e055..c32c101e65b9c 100644 --- a/sound/soc/intel/catpt/pcm.c +++ b/sound/soc/intel/catpt/pcm.c @@ -83,11 +83,11 @@ catpt_get_stream_template(struct snd_pcm_substream *substream) /* account for capture in bidirectional dais */ switch (type) { case CATPT_STRM_TYPE_SYSTEM: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) type = CATPT_STRM_TYPE_CAPTURE; break; case CATPT_STRM_TYPE_BLUETOOTH_RENDER: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) type = CATPT_STRM_TYPE_BLUETOOTH_CAPTURE; break; default: diff --git a/sound/soc/intel/keembay/kmb_platform.c b/sound/soc/intel/keembay/kmb_platform.c index 37ea2e1d2e922..eab7b8223b51b 100644 --- a/sound/soc/intel/keembay/kmb_platform.c +++ b/sound/soc/intel/keembay/kmb_platform.c @@ -170,7 +170,7 @@ static inline void kmb_i2s_disable_channels(struct kmb_i2s_info *kmb_i2s, u32 i; /* Disable all channels regardless of configuration*/ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < MAX_ISR; i++) writel(0, kmb_i2s->i2s_base + TER(i)); } else { @@ -184,7 +184,7 @@ static inline void kmb_i2s_clear_irqs(struct kmb_i2s_info *kmb_i2s, u32 stream) struct i2s_clk_config_data *config = &kmb_i2s->config; u32 i; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { for (i = 0; i < config->chan_nr / 2; i++) readl(kmb_i2s->i2s_base + TOR(i)); } else { @@ -199,7 +199,7 @@ static inline void kmb_i2s_irq_trigger(struct kmb_i2s_info *kmb_i2s, u32 i, irq; u32 flag; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) flag = TX_INT_FLAG; else flag = RX_INT_FLAG; @@ -270,7 +270,7 @@ static int kmb_pcm_trigger(struct snd_soc_component *component, switch (cmd) { case SNDRV_PCM_TRIGGER_START: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { kmb_i2s->tx_ptr = 0; kmb_i2s->tx_substream = substream; } else { @@ -279,7 +279,7 @@ static int kmb_pcm_trigger(struct snd_soc_component *component, } break; case SNDRV_PCM_TRIGGER_STOP: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) kmb_i2s->tx_substream = NULL; else kmb_i2s->rx_substream = NULL; @@ -378,7 +378,7 @@ static snd_pcm_uframes_t kmb_pcm_pointer(struct snd_soc_component *component, struct kmb_i2s_info *kmb_i2s = runtime->private_data; snd_pcm_uframes_t pos; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) pos = kmb_i2s->tx_ptr; else pos = kmb_i2s->rx_ptr; @@ -419,7 +419,7 @@ static inline void kmb_i2s_enable_dma(struct kmb_i2s_info *kmb_i2s, u32 stream) dma_reg = readl(kmb_i2s->i2s_base + I2S_DMACR); /* Enable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) dma_reg |= I2S_DMAEN_TXBLOCK; else dma_reg |= I2S_DMAEN_RXBLOCK; @@ -433,7 +433,7 @@ static inline void kmb_i2s_disable_dma(struct kmb_i2s_info *kmb_i2s, u32 stream) dma_reg = readl(kmb_i2s->i2s_base + I2S_DMACR); /* Disable DMA handshake for stream */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { dma_reg &= ~I2S_DMAEN_TXBLOCK; writel(1, kmb_i2s->i2s_base + I2S_RTXDMA); } else { @@ -451,7 +451,7 @@ static void kmb_i2s_start(struct kmb_i2s_info *kmb_i2s, /* I2S Programming sequence in Keem_Bay_VPU_DB_v1.1 */ writel(1, kmb_i2s->i2s_base + IER); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(1, kmb_i2s->i2s_base + ITER); else writel(1, kmb_i2s->i2s_base + IRER); @@ -474,7 +474,7 @@ static void kmb_i2s_stop(struct kmb_i2s_info *kmb_i2s, /* I2S Programming sequence in Keem_Bay_VPU_DB_v1.1 */ kmb_i2s_clear_irqs(kmb_i2s, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(0, kmb_i2s->i2s_base + ITER); else writel(0, kmb_i2s->i2s_base + IRER); @@ -556,7 +556,7 @@ static void kmb_i2s_config(struct kmb_i2s_info *kmb_i2s, int stream) kmb_i2s_disable_channels(kmb_i2s, stream); for (ch_reg = 0; ch_reg < config->chan_nr / 2; ch_reg++) { - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { writel(kmb_i2s->xfer_resolution, kmb_i2s->i2s_base + TCR(ch_reg)); @@ -678,7 +678,7 @@ static int kmb_dai_prepare(struct snd_pcm_substream *substream, { struct kmb_i2s_info *kmb_i2s = snd_soc_dai_get_drvdata(cpu_dai); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(1, kmb_i2s->i2s_base + TXFFR); else writel(1, kmb_i2s->i2s_base + RXFFR); @@ -695,7 +695,7 @@ static int kmb_dai_startup(struct snd_pcm_substream *substream, if (kmb_i2s->use_pio) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data = &kmb_i2s->play_dma_data; else dma_data = &kmb_i2s->capture_dma_data; @@ -713,7 +713,7 @@ static int kmb_dai_hw_free(struct snd_pcm_substream *substream, if (kmb_i2s->use_pio) kmb_i2s_clear_irqs(kmb_i2s, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) writel(0, kmb_i2s->i2s_base + ITER); else writel(0, kmb_i2s->i2s_base + IRER); diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c index 613b27b8da134..2ffd511eedfe4 100644 --- a/sound/soc/intel/skylake/skl-pcm.c +++ b/sound/soc/intel/skylake/skl-pcm.c @@ -189,7 +189,7 @@ int skl_pcm_link_dma_prepare(struct device *dev, struct skl_pipe_params *params) snd_hdac_ext_stream_setup(stream, format_val); stream_tag = hstream->stream_tag; - if (stream->hstream.direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream->hstream.direction)) { list_for_each_entry(link, &bus->hlink_list, list) { if (link->index == params->link_index) snd_hdac_ext_bus_link_set_stream_id(link, @@ -225,7 +225,7 @@ static int skl_pcm_open(struct snd_pcm_substream *substream, * disable WALLCLOCK timestamps for capture streams * until we figure out how to handle digital inputs */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_WALL_CLOCK; /* legacy */ runtime->hw.info &= ~SNDRV_PCM_INFO_HAS_LINK_ATIME; } @@ -319,7 +319,7 @@ static int skl_pcm_hw_params(struct snd_pcm_substream *substream, p_params.host_dma_id = dma_id; p_params.stream = substream->stream; p_params.format = params_format(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) p_params.host_bps = dai->driver->playback.sig_bits; else p_params.host_bps = dai->driver->capture.sig_bits; @@ -574,7 +574,7 @@ static int skl_link_hw_params(struct snd_pcm_substream *substream, p_params.link_index = link->index; p_params.format = params_format(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) p_params.link_bps = codec_dai->driver->playback.sig_bits; else p_params.link_bps = codec_dai->driver->capture.sig_bits; @@ -645,7 +645,7 @@ static int skl_link_hw_free(struct snd_pcm_substream *substream, if (!link) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { stream_tag = hdac_stream(link_dev)->stream_tag; snd_hdac_ext_bus_link_clear_stream_id(link, stream_tag); } @@ -1193,7 +1193,7 @@ static snd_pcm_uframes_t skl_platform_soc_pointer( * or greater than period boundary. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { pos = readl(bus->remap_addr + AZX_REG_VS_SDXDPIB_XBASE + (AZX_REG_VS_SDXDPIB_XINTERVAL * hdac_stream(hstream)->index)); @@ -1226,7 +1226,7 @@ static u64 skl_adjust_codec_delay(struct snd_pcm_substream *substream, codec_nsecs = div_u64(codec_frames * 1000000000LL, substream->runtime->rate); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) return nsec + codec_nsecs; return (nsec > codec_nsecs) ? nsec - codec_nsecs : 0; diff --git a/sound/soc/intel/skylake/skl-topology.c b/sound/soc/intel/skylake/skl-topology.c index 602ef43211221..cb51b98b92c9a 100644 --- a/sound/soc/intel/skylake/skl-topology.c +++ b/sound/soc/intel/skylake/skl-topology.c @@ -198,7 +198,7 @@ static void skl_tplg_update_params_fixup(struct skl_module_cfg *m_cfg, in_fmt = &m_cfg->module->formats[m_cfg->fmt_idx].inputs[0].fmt; out_fmt = &m_cfg->module->formats[m_cfg->fmt_idx].outputs[0].fmt; - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(params->stream)) { if (is_fe) { in_fixup = m_cfg->params_fixup; out_fixup = (~m_cfg->converter) & @@ -618,9 +618,9 @@ skl_tplg_get_pipe_config(struct skl_dev *skl, struct skl_module_cfg *mconfig) } if ((pipe->conn_type == SKL_PIPE_CONN_TYPE_FE && - pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) || + snd_pcm_is_playback(pipe->direction)) || (pipe->conn_type == SKL_PIPE_CONN_TYPE_BE && - pipe->direction == SNDRV_PCM_STREAM_CAPTURE)) + snd_pcm_is_capture(pipe->direction))) in_fmt = true; for (i = 0; i < pipe->nr_cfgs; i++) { @@ -1612,7 +1612,7 @@ int skl_tplg_update_pipe_params(struct device *dev, if (skl->nr_modules) return 0; - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(params->stream)) format = &mconfig->module->formats[mconfig->fmt_idx].inputs[0].fmt; else format = &mconfig->module->formats[mconfig->fmt_idx].outputs[0].fmt; @@ -1642,7 +1642,7 @@ int skl_tplg_update_pipe_params(struct device *dev, return -EINVAL; } - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(params->stream)) { res->ibs = (format->s_freq / 1000) * (format->channels) * (format->bit_depth >> 3); @@ -1666,7 +1666,7 @@ skl_tplg_fe_get_cpr_module(struct snd_soc_dai *dai, int stream) struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); struct snd_soc_dapm_path *p = NULL; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { snd_soc_dapm_widget_for_each_sink_path(w, p) { if (p->connect && p->sink->power && !is_skl_dsp_widget_type(p->sink, dai->dev)) @@ -1745,7 +1745,7 @@ skl_tplg_be_get_cpr_module(struct snd_soc_dai *dai, int stream) struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, stream); struct skl_module_cfg *mconfig; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { mconfig = skl_get_mconfig_pb_cpr(dai, w); } else { mconfig = skl_get_mconfig_cap_cpr(dai, w); @@ -1813,7 +1813,7 @@ static int skl_tplg_be_fill_pipe_params(struct snd_soc_dai *dai, goto err; dev_dbg(skl->dev, "%s using pipe config: %d\n", __func__, pipe->cur_config_idx); - if (pipe->direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(pipe->direction)) pipe_fmt = &pipe->configs[pipe->cur_config_idx].out_fmt; else pipe_fmt = &pipe->configs[pipe->cur_config_idx].in_fmt; @@ -1903,7 +1903,7 @@ int skl_tplg_be_update_params(struct snd_soc_dai *dai, { struct snd_soc_dapm_widget *w = snd_soc_dai_get_widget(dai, params->stream); - if (params->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(params->stream)) { return skl_tplg_be_set_src_pipe_params(dai, w, params); } else { return skl_tplg_be_set_sink_pipe_params(dai, w, params); 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: 13752881 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: dwxGdyNr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nOEaAgXpCtPMmLMVNWoYBraGp70n43velWg8+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: PEJWKpj0gUddbFXKdgS5PbcCYY4QRDJzIYs6JfFJ88hycn0FTFZ65DQ1iNmmFF2CipmOx+vOGn9Qh7oV03Ltt6hvcFD+KWVftW87M8MNOnyJLaTmd/vDPrDdS9qGdkh7gDKAiJw6r2pyuMiV/ehUxsCkGtcBlKXudAv10gQl5QzG7d91L5qC+M4RV2IZl5k2xYzlUldrrMKbBz+sXr1xveePoh+TulkSqDy2ZIy3WR3+xJunl88Y8O8IfBubvfYuwb+sIeY6G2XQmtvuHjemDx3YYe6/tJQFj9evOuNcuKDXp62bed3IawGNnIR81/wsaHw1WAnuCHFwWtosnh0WDFCO0/+tcXK9BrERN+1KcX4eMmxJZx0MWySxdWIF9nzMiLoH91OXm8JlOI04sLKGLvAdJ2HVfSn6Cv12oGS0oc9BYGYpbDLclGHIcJvcB6R/PUkZPegEueKU2EQUxH19My+/dEtfxYkk3MH2bjOnQSU95f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EXNDg/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:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752882 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 5DA6F1F956 for ; Mon, 5 Aug 2024 00:40:23 +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=1722818425; cv=fail; b=K83DVqUW0BZ7uMgFXY3ov7JLsSRLSsbWQ74vPahJGX/XI5CtGeBjBZyIFaYgB7zIKGt3tiGcHXM2zA/1cN5neSaO3lvj4OOPnqIc4cY68fuXwNaoQwu11XzogfUFL4pNqhvnTdAYFTL1qV8tsxiAUrVHny7t7mY2ALAiDd3Mx4U= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818425; c=relaxed/simple; bh=8pgZPLzpETYsEjk4S5mKJr/kSvZF0jU8EIjtzsLOq1E=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=HUJUX6ddnQWbX0R0knC2e9uXVAoVPrxBfi2YzyVSWOISGCchZ8vBv4/0VAhL0kcwbr1SYLhvdthgbIwSBS8+M2o8nvR4sjnPTFceYOdkauD5bbWiKoyjMGdYwcBUm2ZpmUDOpDwLlJbQyb9IkfUaQ3KJYh7/ZpIoU2at2JtGtH0= 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=g2g/PsyX; 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="g2g/PsyX" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LeQ7+pi1cAUIJdbMxgXCRanm1tsu7kmkqcjV68kebBrnhsOnvua/KF8rcNI4IrzUSTQbUMgrYBMozQKZTaXFfXncbvrrtxJbs/q/dTJm8zK5bL6viARlbdmud4TzLRQRmzdkr8aot5jd5APlHtFePI9I/BwZtAnf3pMh/bZsQx1FnjllMUZUwfzBqaUIZAJzAEHAxx7Yfh6ZZlLhipdPFBCyU1wV5xK9f8fHeVYV855N1HmXAVl0JiQlfGYW5pLNepx6SeunObM8bwPXS9tGnAEcXWXQkWHW47lAljm7La7wtM+iRHCw/9c4QIRhpWbMpZOu3U2DaOnSRia5sXo/Cg== 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=VQwoA9N2310Uv1b3t9PCch1GoJUUIBOIEb5NAg6nWC0=; b=MUtvX9DgXUIxbAn05M2QDjSPoqLGy/9QD7HOZd7Fl1+OScrjo8Xb12jL/UEgCi+wfJrc0e4ZZNnoNO37Eqa+xms18nTC9JrDX9QbBTrUswOUDVV6oNFO10ByDr19QrRBlt/4KqD+kKtsCHEQptm/G44hAy+Akg3lbdIBPws02EJ8U1FBInPrNefiXDSqP1dnuIZD0L0bE9GEuTBJH8z6u1cueHVnm5F0EgBludZrnKwxbrCXFI1ljzJJNLR00BuBD/Mc4KsVJ0EH+vFoS5kjQ4Cl/nWFl374TXxgX7KbLjvCve7aDjU0akHGkFPGN59HB51aohJpTdcpy5AdEwbDIw== 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=VQwoA9N2310Uv1b3t9PCch1GoJUUIBOIEb5NAg6nWC0=; b=g2g/PsyXEt/vIyPLNJfcyj2sYByi23nx6Y6Jl7h0CbrMUt/AOzOI6iHvCiQ64p6d1+xFVX4OB8PMzgOjNJ6KIVIEbtB4Eg1lJdyXDMktNo9M6jm8yek5lHrS8DP8SIQb/IVcZABWoub4hlj8m9s6H0G2/hRPPelQIE0pMEdAxcM= 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:21 +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:21 +0000 Message-ID: <87jzgvyf7v.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 064/113] ASoC: spear: 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:21 +0000 X-ClientProxiedBy: TY2PR06CA0028.apcprd06.prod.outlook.com (2603:1096:404:2e::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_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: ce77ba9d-ec14-4129-588a-08dcb4e72fd3 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: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rOGjG4llcR1B8zdipND9E5LHQypy5sG4CCrn8nZ8omYaiPj1g2hy66Au1CXJFJ3ptkoHCCVX9/qpReQpkH0Ve7y8ZF0m52gGv7t29yxNIGKs3aZrQIHNFdvhv7xs8lZl8PU8ZxntDHLzWRNYNThnFFGcQhE5kaJTdddWEVP6lHidcpNrfmH8ns14rvKHCUsXKphff5Gwjl5mIFmPGSaqBAn+MpgE7D64+PBvvlk6MCMwENuI/PyXfGr/duZtpomqF5xqNiw+yoqFyWVYlIG/mV83P6GJLt/fMzGbObKpUyAn525TIUdbOFRhc+sc/jlX1/xk01ZOLEkoNr7Yq7leU8fq/b9+VA== 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: N0RDeJD6alQOuCyLOqo1Dzan0uslEYqJjYO+7ksR2hHkmXOOdcnLDe0G+Cuk3Yxtz5I0bIwO4yYLLavWkbBRX/vb1bRwvSg1Dpd/cilXY1trZB12bBI1Gborlgv9BuY0JfErpKvueCLwy4AxhdZggpaWEiQAxOw8xgBWEWosuoyrle98WREsRkJr5Q/UR/XhMR51wWOQ6QdWi2NNW0vIs7k5WMYcoCiYOLyKlKjf+VhoJQtRXEtlErirCiXZ1l8M5SGXvPjf1dZwU+g9Qzt/VQNTTT0RSC6gIN40DmxINTXpbFxJBi/Juu6G/VLgbkyavaUYZF/McTQt78Nf17hIMtCVjDRvZj63o79maLcMy4GR1z5ri+WJsZZPGGFFXaSj/VsiWAO1jMR361O4UekODi8jibzZYq5EgRGyujBcb2Y9QOE3m31vbk7CGC2KxqjTNv9hpxJeBGLszIK9SZGMrwQFmEtUsGuPbUgaiprSuX+GUYwbS7WljcTk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dQpAeXsgvJCQqTNpNq2J+/5txFg/CwU7SmqP1BQVGCxHnBIHZZwEXCOpuUMROza7w= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce77ba9d-ec14-4129-588a-08dcb4e72fd3 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:21.3479 (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: A2QJNUcnwfGIooAZQQg25YCTYEraqJvFdmctY7lY24+RLDgZJ5jeqzI9XiseFYQfe67aCS5mMc353NF9s0a9WQXeNnu0gxiXa+rnEznzgtDE7OFegPcWHMQsyN6i8Tiq 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/spear/spdif_in.c | 6 +++--- sound/soc/spear/spdif_out.c | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c index 4ad8b1fc713a7..fb1b54019194a 100644 --- a/sound/soc/spear/spdif_in.c +++ b/sound/soc/spear/spdif_in.c @@ -68,7 +68,7 @@ static void spdif_in_shutdown(struct snd_pcm_substream *substream, { struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai); - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return; writel(0x0, host->io_base + SPDIF_IN_IRQ_MASK); @@ -98,7 +98,7 @@ static int spdif_in_hw_params(struct snd_pcm_substream *substream, struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai); u32 format; - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; format = params_format(params); @@ -114,7 +114,7 @@ static int spdif_in_trigger(struct snd_pcm_substream *substream, int cmd, u32 ctrl; int ret = 0; - if (substream->stream != SNDRV_PCM_STREAM_CAPTURE) + if (!snd_pcm_is_capture(substream)) return -EINVAL; switch (cmd) { diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 469373d1bb418..a95a9b9e61e3b 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -63,7 +63,7 @@ static int spdif_out_startup(struct snd_pcm_substream *substream, struct spdif_out_dev *host = snd_soc_dai_get_drvdata(cpu_dai); int ret; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; ret = clk_enable(host->clk); @@ -81,7 +81,7 @@ static void spdif_out_shutdown(struct snd_pcm_substream *substream, { struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return; clk_disable(host->clk); @@ -109,7 +109,7 @@ static int spdif_out_hw_params(struct snd_pcm_substream *substream, struct spdif_out_dev *host = snd_soc_dai_get_drvdata(dai); u32 rate, core_freq; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; rate = params_rate(params); @@ -155,7 +155,7 @@ static int spdif_out_trigger(struct snd_pcm_substream *substream, int cmd, u32 ctrl; int ret = 0; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; switch (cmd) { 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: 13752883 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+7htTmprUamEtPV0mjdh3MHXUNRGzTWhyc1Y1CsvIq3PZeL4zGlKpWynlc33UGPvfGn5qL/RlNWe0zR68pcXDNBNe1Y0vRYv6/FkX2fJYbfWAbX6VEjFgEQef1m+clhSdM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MS1jSmsWroSXvek2YJ7P0dxMp3gBKLNoyleA0vNELNOe7PLRWN8/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:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752884 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 AFFBB14A8F for ; Mon, 5 Aug 2024 00:40:32 +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=1722818434; cv=fail; b=Ruwa4aayDCWMDTQ/lnZkJtXg/a/F8HDUNyLrqBR8ONzAke/GOF/evPQzlY09kWFgAHevqjqVfnGQMilaqd3cH2N3jCIPlBpYFqDNHLghVWuqUrVZmc7Rd93e4yq6euW5ZAut2FUApeK8UJw9H0ccbRuT9PIo8a4NxlplD8zTFS0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818434; c=relaxed/simple; bh=jE8KH36tyH1Y57k3yx7h0opIjyUKDJYTLOVnLAJTy6E=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=uSHM+fGpCG7EorjVFMz/BEQG6p2g5I9gT5sugo8QCZYFfzUMnDFxgH6828cXHz0/+aqmD1Ti+uDxh47hxxa+RgJReD1QoswhugYJWrLvn8JB5VzdAa0J5jPtdeDenx8q7E+v/WV3vKpdhhUaIly4izWT4VUTvUL+HKrmsfx+aVw= 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=HL91gG//; 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="HL91gG//" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IcWQwxZHhEpqVtVwm7LRXEFyLYF+wXraeMNxAxR9L/60XkYVByfJ45UjFXEt5XHZ40Ks/h5F6bUx7qPNHPqkvfr6Qgo6RTqUjMq4zuwy2owJ/5s4dvyR19HbRpIPxSe8h4Z30sbnezGtnTeM1WyUATyPymlqqYw+X7VJ4A6LhWXD11UZemme0FxS2yVdIgRy4nhiYyqVEKA+CF5FREuRT2km8SApAn5Qm6StTJJFjNl5E18lnxREqz7HdyG9bL9XpshvqUpmsVL3AGBLuqvfjfyfOsxyKHDyfb5Cakzzt9BEIju9wDTs1bJRHfiNsoQp3VgIjHACApkPS2VgMA67ww== 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=gjbb72CLScHpNKCs8p4LtmKCCE56Zyr3leDrloQbTXY=; b=GilnhDV4eQ99spXBpAPWPAxogNkBPb4trWnY4Thwlgm5t1cS9G+EcyX5trH8UU16cdHmjsBtHeFD9nEJxRVC9XKPFhqqcyz2uLDdV8WU1MYElB1DBKjJsJihUtX0KKRqTMcwWz+/Ldl3K6SUKQb1/rHG2e4SXRSGLClNNUoODWKt3R0RgxDC36qu+rB9g3cRgVl+9UDfYZZ57YZVtaD6CVtk72F0m1GsTbPhiNLaun0l4lu0JYXQFooHoGZKgslgjSX3MjrRZIZxTuHynqiflInDjq/pM2eJN4QE08pNe3lKr89scYRE3jT1Cm+v++p4V6ywleBiFtcuLqDekU05CQ== 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=gjbb72CLScHpNKCs8p4LtmKCCE56Zyr3leDrloQbTXY=; b=HL91gG//cQ9MBhGBxTtjyQH2jWzvmZpaaKHW3nHJsgx6xIAvFr+5Z7CGCvLqphNYsxVxVOFL0A2RajgmZ1CMFChVwJGq3jx/l9IXA8uxKMMq+bUoO9eBoaRJ7+wyAtL1CsLUPQRqhP97DcWBBbRYEWI3Cg4K8gUl0lXegdeYL5s= 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:31 +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:30 +0000 Message-ID: <87h6bzyf7l.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 066/113] ASoC: tegra: 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:30 +0000 X-ClientProxiedBy: TYWPR01CA0005.jpnprd01.prod.outlook.com (2603:1096:400:a9::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_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: 13a555b4-38f3-457a-2fec-08dcb4e7356f 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: uvazzlAzCGZKQhezRb7yL2xAWgii/61/eRtfNJSWplVVmE7SKf0S7eJw77E0z0au1BmC9mu64L5JJi+EFlvWZhCnC3aYe86buMfAFOlSSDLqnLxXhQ4RKCPQfPTBKnouIXDjwJAWSX7laJt1uy2JgooOnW6HQHzQfL5MrWPEf/xx9k6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cuwNUcry3MSxDAJQ7RCCB1PZDN/DyhRfer84/2zRKQuX+gL2huhik6/AzOIuxs1h04ErjOwuy9wnM6WjeDhcOahjgd/pTZaj2MD9mz/zJjjdJj1GzeNW66z6yc30vYOVFQmwUY430oHnZCqNMzs/adJUGcXkQ== 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: fSCZQe2U7T2CO3a/FkekdRnv+T1J9Fb/HgyxF+uRbvvNoTY/pwBuBuXRA8IqzB3N1ar4rA89HtnZmKU6sdyH5vBOnoYNYlg6aHs+6G9ElhrB8vNspSVajbZ+yFrrmfunAnUOZ8+ZQ7nPry12HVOJ14W2StdkX2+RLwzVLd5P4Nz3LJ/WCsm9Rr6NTJp/JCtoMyok15YO8iiuWhcb91uS9655RPj5XLff+wiwoSzd0JcbXtKBTknpTG8TFEDGH/k7u1K5F7hGGZi5VnUreOe7CQiJvp8tJ+QJSITrLsczo9SLe1IpQGL1CsRvuTAcJehMj0g2sjeCHY04RDgWEPa1+TO91KWUirUyAf2LUUPfVPNtHqGGqDPk1AURABAQJtH/lISMLIX2eaw97yq0piy/hCJav/S7DfJ7VekW5F/97SR5CpK//1nhhzyImZJ9Itb5wHEfkKNn1T9Om6s/MlQEQNfd3DOy2kLqANTiAAt562Ds5UJYxxIj903zWcf92GEdt2nP4HulCSVJi24C4GQLNaSWd7EYpQE2qI2wJlhUt2mTBDkUYdgxSluXQtCxxx+dsY9FOt4wU1hp2fLnCk9RIZGBQuvZGQA8WOTXAlpoWBim8eigP16d5IP/riWdfg4xwxHwHZE6cl9Gv4jsl2OtnPa9YgV9TvmbZz/xavFEf/SfkgdFMz+Py+SiPHvqzS2gM+bbVxIMPNVBQ+1s/AoYi0Xl6IBS1jOFdnDb7D/pHh9S5llPkANLcd2XuPlPd3zps/GrFX8PCF87DPNlSMycQGbEUDhK5xyN1Hz48K8RNeLWsouhr0eCzXH1WlohZKjrTmqKx28qrym+1HoLBDxxdyHgibQbhb7/xpIWqXTkCd751Ra0IE8lulQXFQKbi4labIMJCmu+vKgkMsfsgC4kLcuRHV9ivfvKCq0PHCLHtDHIYWB+146zoJMW9JO5N1zm5/ZUwfCYscL+K2FhkSePmn1DLfeC0E17x3YwL1Gk/JueFCIy1R3CftgSEZcIYUdwvwbWxMGKL9KdfVbzzENfyyeKUAJNiaFWg5Gjjd68uQLqmVpCpVqlX0WCIzAIB3NaqWaE2s+RHcxpG8vL3VCWOcufr1jNow39cUowu0j5aBqt3zes8nm8dQlGTuT/ZNg0/X2f/DMnPm+X4tmo1iaQFPnd/YNSUW/JJA60NwfVYBh1U4XiNlTZTuYlvBnapcA7+5pyxDSol7wZkPfJhZbQqoaYqq6h661N5Xu09BHpaGOoR7dpK1oy0TzFrOcnKvpvUjJ1cxsiV6/gifxvUX3lQlJzO4aLtfYVDhoXWcoygR33P1OCDb63kGsOJ8pQdpXv7wexA60a+9w6CGPj9hQAXPybQLWk7n3C+b/tAm/gqnKtOc0MxaCJypLMeKD848pdRlOfe0ciay9IEHnUKhPcAOHnWBgDCapQeQ6HRHTFqmlfKKBwwWoN2iIw2VtX9AAc+YSwJmJTr0oPmlrvTynq67IGnbMw5UDtWECXeujDer6PBW2gsKeCmUI14rNTS6eW6pQXqoAu3Ul0JHoX9eKZkZHmTYV8OuOYNVNyiRPzNx5M0y67BoRlE1ODpFWi/hUrgTXMcVFWyPJs3FuCgOc3gn/kBaWZcM5oXUJVb/CHCQw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13a555b4-38f3-457a-2fec-08dcb4e7356f 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:30.9168 (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: iPD3XUgIk38ShI7tA/LWlYi9PGYI2jBCVDh0/L0uOg5jMpniegPgAaY6eD3E/fk2ba7DcDart+kVJQrgOvV9/EghmG2MvLHoAfnlKEP6TcXds4M3xc3sAwSTDp0XsIBC 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/tegra/tegra20_ac97.c | 4 ++-- sound/soc/tegra/tegra20_i2s.c | 4 ++-- sound/soc/tegra/tegra210_admaif.c | 2 +- sound/soc/tegra/tegra210_i2s.c | 6 +++--- sound/soc/tegra/tegra30_i2s.c | 6 +++--- sound/soc/tegra/tegra_pcm.c | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index 8011afe93c96e..0314402361558 100644 --- a/sound/soc/tegra/tegra20_ac97.c +++ b/sound/soc/tegra/tegra20_ac97.c @@ -182,7 +182,7 @@ static int tegra20_ac97_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)) tegra20_ac97_start_playback(ac97); else tegra20_ac97_start_capture(ac97); @@ -190,7 +190,7 @@ static int tegra20_ac97_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)) tegra20_ac97_stop_playback(ac97); else tegra20_ac97_stop_capture(ac97); diff --git a/sound/soc/tegra/tegra20_i2s.c b/sound/soc/tegra/tegra20_i2s.c index f11618e8f13ee..330400d0e530c 100644 --- a/sound/soc/tegra/tegra20_i2s.c +++ b/sound/soc/tegra/tegra20_i2s.c @@ -232,7 +232,7 @@ static int tegra20_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)) tegra20_i2s_start_playback(i2s); else tegra20_i2s_start_capture(i2s); @@ -240,7 +240,7 @@ static int tegra20_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)) tegra20_i2s_stop_playback(i2s); else tegra20_i2s_stop_capture(i2s); diff --git a/sound/soc/tegra/tegra210_admaif.c b/sound/soc/tegra/tegra210_admaif.c index 9f9334e480490..e79711ea65dc9 100644 --- a/sound/soc/tegra/tegra210_admaif.c +++ b/sound/soc/tegra/tegra210_admaif.c @@ -299,7 +299,7 @@ static int tegra_admaif_hw_params(struct snd_pcm_substream *substream, cif_conf.client_ch = channels; cif_conf.audio_ch = channels; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { path = ADMAIF_TX_PATH; reg = CH_TX_REG(TEGRA_ADMAIF_CH_ACIF_TX_CTRL, dai->id); } else { diff --git a/sound/soc/tegra/tegra210_i2s.c b/sound/soc/tegra/tegra210_i2s.c index e93ceb7afb4c4..74a0ada1e98c7 100644 --- a/sound/soc/tegra/tegra210_i2s.c +++ b/sound/soc/tegra/tegra210_i2s.c @@ -95,7 +95,7 @@ static int tegra210_i2s_sw_reset(struct snd_soc_component *compnt, unsigned int cif_ctrl, stream_ctrl, i2s_ctrl, val; int err; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { reset_reg = TEGRA210_I2S_RX_SOFT_RESET; cif_reg = TEGRA210_I2S_RX_CIF_CTRL; stream_reg = TEGRA210_I2S_RX_CTRL; @@ -673,12 +673,12 @@ static int tegra210_i2s_hw_params(struct snd_pcm_substream *substream, srate = params_rate(params); /* For playback I2S RX-CIF and for capture TX-CIF is used */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) path = I2S_RX_PATH; else path = I2S_TX_PATH; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { unsigned int max_th; /* FIFO threshold in terms of frames */ diff --git a/sound/soc/tegra/tegra30_i2s.c b/sound/soc/tegra/tegra30_i2s.c index a8ff51d12edb5..edcb7095bf0ac 100644 --- a/sound/soc/tegra/tegra30_i2s.c +++ b/sound/soc/tegra/tegra30_i2s.c @@ -188,7 +188,7 @@ static int tegra30_i2s_hw_params(struct snd_pcm_substream *substream, cif_conf.truncate = 0; cif_conf.mono_conv = 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { cif_conf.direction = TEGRA30_AUDIOCIF_DIRECTION_RX; reg = TEGRA30_I2S_CIF_RX_CTRL; } else { @@ -244,7 +244,7 @@ static int tegra30_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)) tegra30_i2s_start_playback(i2s); else tegra30_i2s_start_capture(i2s); @@ -252,7 +252,7 @@ static int tegra30_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)) tegra30_i2s_stop_playback(i2s); else tegra30_i2s_stop_capture(i2s); diff --git a/sound/soc/tegra/tegra_pcm.c b/sound/soc/tegra/tegra_pcm.c index 05d59e03b1c5e..1ed74f6b6431a 100644 --- a/sound/soc/tegra/tegra_pcm.c +++ b/sound/soc/tegra/tegra_pcm.c @@ -164,7 +164,7 @@ int tegra_pcm_hw_params(struct snd_soc_component *component, return ret; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; slave_config.dst_addr = dmap->addr; slave_config.dst_maxburst = 8; From patchwork Mon Aug 5 00:40:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752885 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010003.outbound.protection.outlook.com [52.101.228.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58CB61CD00 for ; Mon, 5 Aug 2024 00:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.3 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818439; cv=fail; b=FJIUo16VeGHvkJYoQ39Y0g3z0P9JOpIz5EU267DWJ+6FN041ezz4e0LBPdys/KflTk/YU0Kkv/DIot7Tf/ftLDRNOPATmcVtBbMwO4Zg4A6ePAePMVwhjZhKLnoNdFCoPGn4EQSyA4pk/2ET8tF6GIZY0qmrrcyyEtYjp+jbA8I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818439; c=relaxed/simple; bh=pZXQkenLZS4PlIyxVPNguTu/bb3Zm46mzqXGzzF6uV8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=IWZ0EHLJRiri9IGXbYDWu6UAr3CwtjFkzNSEg8ukbEdLvOQCsW8Tose1TrY5So+XhzQQpt/3onOqxUw3qCyZl0DRzK/q9GpYImEsx/03Mx6SWIzjQm4B+xMfVGRdNWRagJ3TIqy9wWnbGLTQG+2Rz483+X9Fk2/NgIZW5ufbWbI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=APy78nyO; arc=fail smtp.client-ip=52.101.228.3 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="APy78nyO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VggTISKcacDBxU/USlPW+93fcGuc9fCXoY9F0sIk73vB/qofps0Av1wA1uhknxegrSqZXSomtQwUNfcNDY3yR/Qs3Ie4MQENnhKD23SOBVuKhyI6+QZeDp2ICRK8LWYeHCeom6ugOV2T6Zn+QDdmrI5Lc6C6YJfXSCCeJAtnJjGnm083M9JBZzBN6SxXPP5jzOAmoPGfYLvCctrq5FFYmUHYfW8n9avn+sPvSR4t5dc8xbe618htVij4HKhfSnRPZM84S6RTzMpMt/BoIQQyEGxm0+AkceCYuPH1WocvPV8fodBwTEwuw6k8wD8rYMbUwCgGfRATp925jSU/7GZexQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IBjz2IzpTVLNw/vY+NfoHHqifRx2NXLe/j1yeG+Uw/M=; b=nOl1LckIobEWo1GQYXJraUlxTBU/S3r1aHJUClA4UvJuPtYFnFXw/8vDNhiXmzKAetziE+a/oIrzlQMWGA7x+dpGhsuIEFZBjVtXF8nM1Bj+ijalmlXt4jwashSkUAWj07BfR5z0EzuXzyi633J6mPXwF59qsCND1NQ8fqOw6vEQUIHKZbqBki98Z3QSDAyYKsvDEzcJvxnT/h8rASQxVpcj7RMAvMsRqkAvoCE+J67CR5GLt1MuAOjic1DaJTRcnniB32j7BrzoOZogZ4Vek+wOPQmjCVKLf1TueNzAekDdIVOcrsHErTBM+pKa4g90f4EHzxvQ0ocU9M00aeSC0Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IBjz2IzpTVLNw/vY+NfoHHqifRx2NXLe/j1yeG+Uw/M=; b=APy78nyO8GsjoR8qdj+u2g5AyHaE3Se0mkX0MWyQAxonYtz4WcJQQgDZIihzZSO4+tcscPBGPaXPZheHyQqgO4fsX2mwUXAfazfSwzn1/nTsLtJzUItBM3J9QmRdVvMxxiKuZxjwYGZvHBo4/g6dds3mbHPc9h6OCMiiYPbUZvQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by OS3PR01MB9302.jpnprd01.prod.outlook.com (2603:1096:604:1cf::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug 2024 00:40:35 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 00:40:35 +0000 Message-ID: <87frrjyf7h.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 067/113] ASoC: ux500: use snd_pcm_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-staging@lists.linux.dev, Linux-ALSA In-Reply-To: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> References: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 5 Aug 2024 00:40:35 +0000 X-ClientProxiedBy: TY2PR06CA0007.apcprd06.prod.outlook.com (2603:1096:404:42::19) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d0e7cae-091d-4ba8-674d-08dcb4e7381b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: eBAfGHsuZhUcrgN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5XQifr83ovYVe+6AVEbCONwLXKkGToZWew3LjO0oCdSxo9iJ4F6BEPprvGIFdWsNzQjNy/cDsjemfhmukdhQe4FizL9LlSOqo13ipAU8/GRqoj13HQkoVkWTMEoCawq9Bx76tl7SnK6SLPqeXyZmJGqI4S7z4z2TIk6gSwc907CdDuMdBbfHYtuvSmGP4PYgGIbNMuhQRKqAf7i8v3gK8OWsB1L0wXLt4bsAAAWBxzVnKwZy96ArLn+QrLE7jZ7u+CxBNYH962AhN1javId59Z1pl2l/qNj2loT8DdrDjPFAT3M2mQlrmv9RTwmV3IKwp9DnIkCRvelWPnol7DZrh79oz+145w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DLQFpIj3YsSRvX41o5WiGui0eSwse9xA9opI68dvxBNRsn9TMO+HB5M+DvbkcHI1eBShbSL8BkyVD0qIRJbYu9Hp4NAE08FcAtOU60sUa/N2wpSTKeywhu10aHfbYvDKXY959tynTHdqGybTrpHNbz4pBmsu90nTlZVYrBZyCvKufxRP8LwpOX0SaHwCBvDf30J1Ea/SUH/8zazxEK9Mg0IjOZowmyP4dU7CpS5Ru/A88RbKbf08svTRgS4KE5Wkrcpl8wrhbaXZru5TpOZVsH6l1Dp0gdrEYdSjdsUrbiYwzzwPX340GqVivYpfkedNweTN/Qkq/sI/A7y/rJ7kdt4dHORurvkaM3v0ZjmRmuXGzn8+asRy/ACPH0hAKAVR1rgLiDfbm3YqKZygFYyuKtDJ6GBLc1cyDKUMuyKBN/C5TekSBXHKGK9rbKkos6da1rKf+2sz+fEtAOjP6fAArk3ePIgJg+n6OOt94F6f6MSqoai3fjL8PmKeu6xk3SZ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kgimuTFaBYGwjW+waE5Ccl3jJLuKp9RQo8dqPelSyflElkwCRBUyrseUV0HFY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d0e7cae-091d-4ba8-674d-08dcb4e7381b X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:40:35.2696 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ddMHlX7v8PBhEapwbOwJufqQhnUTBfk0HseGpLamaxYmq8eG1KkQ3cbQCaaYgTjdwX7GYXV98TqxdneNatEkOR0qHhqnzWNUlz/Um0dR56xezHBU3ygdgsyycQcpuq/4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: OS3PR01MB9302 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/ux500/mop500_ab8500.c | 4 ++-- sound/soc/ux500/ux500_msp_dai.c | 6 +++--- sound/soc/ux500/ux500_msp_i2s.c | 4 ++-- sound/soc/ux500/ux500_pcm.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/ux500/mop500_ab8500.c b/sound/soc/ux500/mop500_ab8500.c index 710b6744e0136..102d4922d6e62 100644 --- a/sound/soc/ux500/mop500_ab8500.c +++ b/sound/soc/ux500/mop500_ab8500.c @@ -203,7 +203,7 @@ static void mop500_ab8500_shutdown(struct snd_pcm_substream *substream) dev_dbg(dev, "%s: Enter\n", __func__); /* Reset slots configuration to default(s) */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tx_slots = DEF_TX_SLOTS; else rx_slots = DEF_RX_SLOTS; @@ -291,7 +291,7 @@ static int mop500_ab8500_hw_params(struct snd_pcm_substream *substream, /* Setup TDM-slots */ - is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + is_playback = snd_pcm_is_playback(substream); switch (channels) { case 1: slots = 16; diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index 3fd13e8dd1107..1a02d66d45cd1 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -312,7 +312,7 @@ static int setup_msp_config(struct snd_pcm_substream *substream, msp_config->tx_fifo_config = TX_FIFO_ENABLE; msp_config->rx_fifo_config = RX_FIFO_ENABLE; msp_config->def_elem_len = 1; - msp_config->direction = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + msp_config->direction = snd_pcm_is_playback(substream) ? MSP_DIR_TX : MSP_DIR_RX; msp_config->data_size = MSP_DATA_BITS_32; msp_config->frame_freq = runtime->rate; @@ -423,7 +423,7 @@ static void ux500_msp_dai_shutdown(struct snd_pcm_substream *substream, { int ret; struct ux500_msp_i2s_drvdata *drvdata = dev_get_drvdata(dai->dev); - bool is_playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); + bool is_playback = snd_pcm_is_playback(substream); dev_dbg(dai->dev, "%s: MSP %d (%s): Enter.\n", __func__, dai->id, snd_pcm_stream_str(substream)); @@ -511,7 +511,7 @@ static int ux500_msp_dai_hw_params(struct snd_pcm_substream *substream, case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_DSP_A: - mask = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + mask = snd_pcm_is_playback(substream) ? drvdata->tx_mask : drvdata->rx_mask; diff --git a/sound/soc/ux500/ux500_msp_i2s.c b/sound/soc/ux500/ux500_msp_i2s.c index fbfeefa418ca7..36819fbd66781 100644 --- a/sound/soc/ux500/ux500_msp_i2s.c +++ b/sound/soc/ux500/ux500_msp_i2s.c @@ -565,7 +565,7 @@ int ux500_msp_i2s_trigger(struct ux500_msp *msp, int cmd, int direction) case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) enable_bit = TX_ENABLE; else enable_bit = RX_ENABLE; @@ -576,7 +576,7 @@ int ux500_msp_i2s_trigger(struct ux500_msp *msp, int cmd, int direction) case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) disable_msp_tx(msp); else disable_msp_rx(msp); diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c index b7f38873d2d8a..65a2125e36594 100644 --- a/sound/soc/ux500/ux500_pcm.c +++ b/sound/soc/ux500/ux500_pcm.c @@ -50,7 +50,7 @@ static int ux500_pcm_prepare_slave_config(struct snd_pcm_substream *substream, slave_config->src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; slave_config->dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) slave_config->dst_addr = dma_addr; else slave_config->src_addr = dma_addr; From patchwork Mon Aug 5 00:40:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752886 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010055.outbound.protection.outlook.com [52.101.228.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 3B7E317577 for ; Mon, 5 Aug 2024 00:40:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818443; cv=fail; b=l7EqW64OrP2hKQU5rHLOvJpDXuU/4fE5TOU3ZSUIamgNXB5FrEE5fVy85liU21b/rSF5spuD5aTY4SFkLinrqt/EQCFrxTD/Wwei/JOwOQ1Iyfzimw3JuhFhfm4avcUp3gwewjUBQFWa04Mz+Lfb37IkGtD9oYDMuvLTT9cIMHA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818443; c=relaxed/simple; bh=A2DFeQzgOPJ8fIwuRwR3jWIDQPuwvVLfj0YNcmFVjf0=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=KeeSDHUOJWOH673z8GWnP14SKGhM+9SkY5E937sIpV/KDNxvAOoPGW3GSlErmizfEPvO1JDdwNfowH0yC2Bsn+8x9kpk+FrSTMJUdDwcbX9VenhtYuiMkivkbiz6B4xi7UzRRg/7gQ9uif9x8+Rkm5Pr4Gz758eGsC9RXh1WNB0= 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=YiCqy7x6; arc=fail smtp.client-ip=52.101.228.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="YiCqy7x6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JSEddH9Q0BWumYZ64KIdS28CP/j8cgQZUTqMYE0kxygKMcA/WDeolPgJ7zNk2Suf2JKNTXWMeZ7Q5hwilt2G99ss3SL/9/x/uJraGXBoCLiyGOEZ1gkdwmKYGraxbC4/OumZtJJL/CPmwjSh0/19775sTr3PCiQ/L4Z/X/9YqdT0PUXdBz68uegoMXN5TjnpAGA0a2T2OGbcY2xpL+H9utNYomIP2oegCjtYMFBBldJIF5/UQ9P8QONhiOeIBxiTw4DeJQ/IxFSW+b7p53c4wgylACIRJofR1p4WEuAtXPeahhG0btQap/roypwaqawfCJpJaCPfcwD8KuGQ+WkS0Q== 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=EFmMAJmEu/yqoYFvs64zEs1aRIIgfZmhvAsXUNEJqOs=; b=tnthdQUQVizrwK8nT6V65qKPmd0oyeV0iZ61E8T1OHBon4xQC1ufq3Z9AXNLs1Z5JU01Mfz0BCAa5f/Dt+gzaa7LiiR17/6nRQ+WnpGmb4Wv4tYYVwv+pXIuWAvn2lCUADzG0Q7j65G4O4dwcxl7HcAYkHreuGuTUlV429bNEqlFp44NHPRMBFSdJovbhLXEDPoVz4E7nxwpCyRoBnMubdzk8D+WbV4dqhGu4i4e1XsLxxde8VT/kKsJWmT26FvYg+kQuw7mvp2HSOSgoUULibla4NVRw4SJuoGImuSaspE0SPtsp1hb1LbfcbE7U8Y7XiOoyNoVBXLThWqYJCQqRA== 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=EFmMAJmEu/yqoYFvs64zEs1aRIIgfZmhvAsXUNEJqOs=; b=YiCqy7x6uOGGAJk4qMdGOuJDPBGSKpMpXYgnogwIH1Wx5/+Nl5sMIusYw44EKnShLjo7un52DEXpjMQbag7QZQRaMHXNhQzog8Dwr/2E7KWVXo5ySlACRHt414XzuMiruuNmuyv4xSTUTXcIQ0WVdvS+BZIMwFoZMlxhTcNYzuA= 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:40 +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:40 +0000 Message-ID: <87ed73yf7c.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 068/113] ASoC: cirrus: 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:39 +0000 X-ClientProxiedBy: TY2PR06CA0022.apcprd06.prod.outlook.com (2603:1096:404:42::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_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a9406a4-ebc0-4885-8318-08dcb4e73aff 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: wNTSUpfqXtwL2pcf3Ah6WRtzbSb3n5Ub7ngD0RN+GvP8WaT6RfolzOTkhG2Jrk0ngDzzYckGB2Z170gNbD9LxJuijUrsto03/fpfzrt62OE3RsMxrr0+H+61NlblRWpIDYqBe64qaVfx+6ClU19JFCp/0tTz2AQleI561kCN9HMAQaiXV2Plr20UaODvHgUt+HL6wvOvf/qvZRn4/w5CODNeXiAS0L0wDqh6OcDiy/7oOVRC2HihzioG9ZGYGUhLv69p9CIMGLAuPOUykxpBfdCchyWEsNGMU/FR6YfCwcZE3frndkrtSME+f0r1TBofbU7jeppKMAqXmlWB1pqO/iidAA8IGWIPgNfneUbe1e/slZ7F2Dk3vdprwz5bAH1+js893R2G26zcUOCVs+6PYoJza154UTqxLUfN8pnP0ZR/sUB1ELsuuXEwgFQT3BEfUA2+JZpZYvFbDgCxqbOsW9mcB2lGtDCz/htb3uo73gTgjxaPoXx2AOHrTe4sSnyIH9iAo2fzquOFEZUD0Pgyly8fXIHDVyLOAo+gJwc36r7bWeXLVI7HSEeaaCk9AFw/BxHge0iumatp2oXOQ8HvsqaMyWZArBXRkRUboGncCh9ZOUDBSr675Dd/44otJtlcfEGux4Xuc7GvWNni4Q3N+CSDdWUy0yRYCK5vk7unaGbosmQlDKvdP6UJp5kdWWZh3YpC1WPUnPH3o7FmI/WN6LvTDTwSWbLgSc0dzRnvCQK16Fn0FX68aUEG6hkZRzzZHGW9Bj/WOqkUVY2KF+hzcse/S1MJm9Gumi6itKyIWUYsjYkYDPSodznx7VWzENxv5X12RbMb6wQDaj7ftoT2Ey8Ym/OeEuxvgyijYj5UwfzhYk5STT+ZbilZSewEYV6N70pK1JpWcPpk+ZaS1v29IosbLQ6DXgBaQ5I/vB8wu9A7tGueZdxumuz9mfYzh3xBiHWaOmUOWq9sn6KqOCaLbflrRAdl5Al54r92ZNrqfclQIr91EO8mALci9G1iNTFqaxm2E2qKxrMIH3OAFAS9bR8XAa/rqbLIHHRAIjTEaXVwx7W8QOlSgzAohUvF5MkyztVQglfP533jfuZh7tEX+UKLvsHCIkQcnvF0E/e+HCiKAMyHv8yUtAPdpgw+uAFF6b7tkhpYWHVB40r1Py9H29gxFg+JpKK9KPb6aQaIBO0uUr4P/MNaJdC0CUSDqD7p+8JDO1JFaKUFoGjjacjc0B3pW5/48hmyx13hfq6qm7/eFeCFngWhHrRc/Q7sCLhW65ju07mf6YoKScHBaWKzcfP01nwmLmoU0JK7j8GAGnQOSA9qjcMTGwm4RnGwB0inwpSX2ZON2zOBXXw9vHJ8KZOIZ7AFq9B2TFYl68uRcUwCCUvTyID5gZsqsgZNiorCwkHds215X/yZXh+8qMwhxw== 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: oxF7VMn/5FjRbjs0XLjKKES+5FjzC2b1CmLputF7dIs8rwCTTk3Baq6nVN7wa83OTt9k7wIK8jMbMFDZRtzcPTfvJFqm5IEubRcri57VJ4WDb2G0K6YRNhg7ndXPqI7aOJhe/ormEpKjijLlfEBIAEXwVcNIbZwl7kVkRPKlYcckWkDXHoYMNxseuGDgyuDg8nfI4rsAmAOtMaXp8hfgL+wqwV068vbUFLpWwQvB6Z3WUENrDrCqp8LSxWdK8xYxSXmH3zVH1qpj4Py/2p92dj8cdKbwqSVdRHAvUbTR6PCcH+GFof/n/NqdXbJ115q+aD2yO7h1u7GUEi+N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alFq7dWrsXRMBU0f/OXoe6NM7MkZVCS6H1Z5B/nNfEQvRZcbrUV1i8h8NWfuRPyGpOE4wBJAMor6CMk4ekwBW+7Z9Qj23Vec292QkndNXK6Cllp0PB/cBkB3xlL3ZdlovliZd2ax4G8uaVfl7AyDC1Zt+cyvuhNkiUXngrhQJtrOXCWYMP+ujdfaEI4tJPTGue6fM2X/Tz7H1U6WIUY3c= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a9406a4-ebc0-4885-8318-08dcb4e73aff 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:40.0909 (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: zNw/FD8CNg+2wCHJ4LP326fDqjJbpVxJrPX5Slb+OzdrOcEn3f2V1NtRmKc/r7+EFHS8NVOjL52ZBn3zNGxgfKYQQMHl/WDe+QHzkA5A1ZktgHOD22dEgasKaPw8P7tL 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/cirrus/ep93xx-i2s.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c index 522de4b802939..cb652b273b7e7 100644 --- a/sound/soc/cirrus/ep93xx-i2s.c +++ b/sound/soc/cirrus/ep93xx-i2s.c @@ -121,7 +121,7 @@ static void ep93xx_i2s_enable(struct ep93xx_i2s_info *info, int stream) } /* Enable fifo */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) base_reg = EP93XX_I2S_TX0EN; else base_reg = EP93XX_I2S_RX0EN; @@ -129,7 +129,7 @@ static void ep93xx_i2s_enable(struct ep93xx_i2s_info *info, int stream) /* Enable TX IRQs (FIFO empty or underflow) */ if (IS_ENABLED(CONFIG_SND_EP93XX_SOC_I2S_WATCHDOG) && - stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(stream)) ep93xx_i2s_write_reg(info, EP93XX_I2S_TXCTRL, EP93XX_I2S_TXCTRL_TXEMPTY_LVL | EP93XX_I2S_TXCTRL_TXUFIE); @@ -141,11 +141,11 @@ static void ep93xx_i2s_disable(struct ep93xx_i2s_info *info, int stream) /* Disable IRQs */ if (IS_ENABLED(CONFIG_SND_EP93XX_SOC_I2S_WATCHDOG) && - stream == SNDRV_PCM_STREAM_PLAYBACK) + snd_pcm_is_playback(stream)) ep93xx_i2s_write_reg(info, EP93XX_I2S_TXCTRL, 0); /* Disable fifo */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) base_reg = EP93XX_I2S_TX0EN; else base_reg = EP93XX_I2S_RX0EN; @@ -328,7 +328,7 @@ static int ep93xx_i2s_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ep93xx_i2s_write_reg(info, EP93XX_I2S_TXWRDLEN, word_len); else ep93xx_i2s_write_reg(info, EP93XX_I2S_RXWRDLEN, word_len); 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: 13752887 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+ssogr9BZTFBuXAk48NXbJL5MVaAsMv3JBDG3Qftq2u7IaiYcrjOE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MD49RDkVvSynEcAGV+r6DwmjS6Vx3Q0KR7XOctjv0BojNsUX4Tqlebj86DXXy8joNB8d72y0SyXpbSWjuhoAfODU8PiG3EQjEe+5aFxarBwEPgDp8ZaISnZ3aoFyIIVSZK3ra5t6TAY+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:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752888 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010052.outbound.protection.outlook.com [52.101.229.52]) (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 4961218B14 for ; Mon, 5 Aug 2024 00:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.52 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818452; cv=fail; b=tiah1foajXBX4/y+m68qHkQ4zkrxSWaZKTLQSwDS4Nxxm0UWAcdI13pLAyCBQ7llea5Hl1sAtuvodq6HRD2oC6Lppw4NtPTwYy+rKvspT80mIzeZ+eIhqbNHTWmn7+lSuxTdFd70/4qQjKwo7+yls1lumTTtYLFzbGZ4aQ/Q77Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818452; c=relaxed/simple; bh=tNRvy8crAkB7lULj4Gk/xlC4WPnOpGiIPeXXi5pYxiY=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=nA+oFZnu43ojUzb2s72rjJKZEgUhEdlRoMhneqZN6jMThUzIGxY1muHLxPy2ac8EoCzEJU3Z7DJx5EFahblKHUe0DEue2AYTlwZYtNCh8dtCAhFYahHiMHKVI1CO+m/nW2+ZY8b1fZhYVQ2kuwAwHGpekd6cEuNzbTsQPoeDhec= 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=OoczelTW; arc=fail smtp.client-ip=52.101.229.52 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="OoczelTW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OGg583pEAUj9/xnvKPnLCTvdqtL3SK0WzwunZqnt98Qn/xOjhrUYVxZaR0VSK5JGVN8nyws3XLjf/BcwToysc/9mKd4Ly4wqc3m0ShTWeS9E8gR1aSlk5T16SWipBBkoszO1Q7HmnVV1ycVcCWd/sgZLyqG/otbNns7iH1jExk30cvenJHu9p/UPLHEzDlRiG8d3UF7U/YHMXDiLgSvVjSwOwQDg0lsR4e9BbJxQzcYVmy+66IWaJkvyDlG4cOdTYrnpJjlS5Nk1oosXv2NNbL2ao7TS2loxvb1xXCV7QiJXfkqbjA7Fu+6MEEqynwSWhBK+qsGn8ULlGTe2yBvwBg== 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=1CjmdQtWhok+ZSkCeTchM0puxaRrEMNYnau0SpjJ1VY=; b=Fznsv2TI+Mb/zOux6yOx9kPWsgApyDoAWhZwaX+OIGP1KwHmyRqMl+Rm/h6cDsg73ds7bTm7VGz26QqTMXJkzrV2XR/AZ5v6rG8BDfs32S9kjNb2ldBtC26zlwPNydYw5X6NNeDxSRkKEzhD9R1+OVi2l8Q4GZfUTE5LHIBU+JQ2UIjGmr4ir5aeM6lPjsrvH8oUN+JdsvSRfB2litDylygbGe+F0wFGcI1L6lQQaU0VdM66jDp9uxEkGtd7bKJeHQX74vYLKJEVuxVNoSj5n5X5zM0587fiYWdhW1y1/nee5fBRk+0kfwRPOqdqsRHluz9MQwqLSv7C2z0xnPpNJQ== 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=1CjmdQtWhok+ZSkCeTchM0puxaRrEMNYnau0SpjJ1VY=; b=OoczelTWwSZlQqIEP30s94sS27ErNlZ48Y6wAor1Je5YCfHf+ev9hwXsuprdpn5wsCQmnSPnhAgRMFxwkPC4YSEaXrMHJGxKjck1YOxcfKcACm3C9VWF7h7krxAeZcZ9jdDI6AmXYq6y8XrJ1OP9eo1dr9Bk8/KOdsfLRx6pIH8= 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:49 +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:49 +0000 Message-ID: <87bk27yf73.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 070/113] ASoC: jz4740: 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:48 +0000 X-ClientProxiedBy: TYAPR01CA0054.jpnprd01.prod.outlook.com (2603:1096:404:2b::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_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e26c07c-0995-48a3-2e97-08dcb4e74066 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: 3wagmeUDg7ikJq0Zpd1FqMH+INwVPPHxJyQcUmIu78mBHHU8so7aW/Vz5b0LwnJ+HsTWqFVXuZfBLANB7b7KqxuAZnCcVFgcq6u6CUodlYxpq6F0CF2NzmeoUbWtO94bcsL94TLU/hmEYfFPIRPMuFqZujCcdQPLdcu6CpqHYjYklYjE8IzMNkMLSZF9l3Fq4pngvhP5mAIZVbXfxxCoIxKRDHxdYOzMx1yYVOej8hvkNQkgzIqzeZf+O85c67EbMP9ZeNRU6qivAX3yuRlFtTLIW+9U5F+s6c7dDgD+uiOHFE1bGVOYLUSalWa3sPB2FKxs2XtCpFoVDENU0QgrKM2JMUw+ec4zOw7jwlE0iJIhQQ8YVWOzS60eYB6AwY2/P66G7WKEqbXtpw/IWX38WCS82ERFfWXpJ8C7e6yn8iowljA7+3xibKaKkdZ6pKreJ79SePAp5ycSDEQTTYfVHD1OfT1Sp4mHqlFkMru7B40CQvWDysrCQbOnsLwfPeFuiEvODxuCce9pMIBbIkAZngU5YZPiPeqJ0uiXn733lLHRKToPAK4sjSI9qbmkCZy9E337iMuqzCLHRJQevRhwt/aIS9ODZ7Phyrl5JFs9HOXkIctfm5NzD3uCZwvMKmxZOe7e5GiKWAFlvIhjjqP9mlSg8gWxKJWrKmds0CW9tF5JXIVa5lOU2uzQVbEH9bPfXnoRovGaRks/ER2VaeaQAXiN4lgoX9FV6O0nw8AWDNwOBN0dCGfX8+83GoXQPZn06wuEGZqCe+xyLwYOBw8zNbD8ve4Crd5h7NzGfPROwz2R4vZMG6ZecCLNn+6R9TLA9E5+TBLMCozQ3odwfNUA73U14FNKRuMDBE8+qe1wj3AD4ISaRuMBpOSA4Gatnov6ATxqhTsy4/T0r5WprufOPmUQXjJF7tlbPwmbQ+t56FZqp75Y+qwjmmpH8+eNiuotMo7VAQcGLZEifvDrKVF7YqSmtOiOVSnU8skbNwNuAZyjc7KozKGi1KXVPndM56pFkueVlrqWlAzl4HVFi5Yzc2c7qd0y9sJzSmRuCvrLPKN3iW1JWXf2VG1sfCCeGOSEO/Tgs+oU+x6H1+nBL93Z354RTbsJE1o9y8hlBslewI8VYgao4ji2pEmANAhaH214eD2JQ640DbsT33M1kVGj5zbHECv1CrSEL8qv/I8NLR5tnnVw2xnlxrxS5TYKBiTZ0VOp3Ns7xR+Emza8cBWmGFoFatm+f95almBHZkQMKQMy+HokPZz25Dn1zLf19hVQXmi4Ui3z8rXuWM6AHzZd3+mls8dsQ+jkq58i2U27aYRX4NCFCu8hSGXfjitrrODHkY/YiS7KuwsgW63/s0qjU90+2wYSJbuHRo9Px3XEWnEPh4s/zTmm8cWaBnWJxAQ6hvahNc9QpQx5GMexPfLACA== 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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ZBSOvtZR35i0ttv9V2lsr1u/VSbmT/jfg0XSBEapu5GcQKUgxbEPT9qhzw0LLuZQNustkvj320QcR7Td42XMD+6mEh07GOJ9NahT+/rrcxIFAkFsMc9YCe6Xw/HX9gd8BuT1f9/DjsP6gp6zfd2htT3UZZTwz4rpTwloDSXkFSzT0nR7JdIK2c8yLSZFPuM3zL7EOc5RM3q9PN9slmli4+StdMEq3JTMiuDO7pNANQWfmHC8gG8Cch6wedjWUVdN9PWtTdLXr4UZNc/MxOtlwYjxOJCy9/tgffWx7YpWj+oN+2ekRZZRwaH0ig1bwVfk/qd7DYH1HXDto17uzquvrWvmMPygEQThBlj7/tRqcRS4VLoXoJNPciteaTGLaLwcp5C5qJynZmkQ/hR7GdX1ACsJKl7OD2Jqptjmlis2VP7dZCgs7/MfZ+byvSSlH8OGr+oaPaRwRU+pR+oLY/aMBeyUI63S/RVqwA5qNUrNuz6sSGvpTS//bwdbO65E+5NBTXHqlhb85qVPReiVD+fgw40TQ/4M32ZDZF+qnuEvQh9T0JwQ/vM3JR80LOk0vHhyzF9IgE0HbEBpEf05XhaXWWqb32SbR3rOshiifwWG5EX/I= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e26c07c-0995-48a3-2e97-08dcb4e74066 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:49.1528 (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: fKkMZEWSmq2+Mktg1YNG5ZBYhJ0Y9TctOBOvgzzmtpxlvjmYheC4RmAH9+KEQTAKVAwiCGz1H5iaA8JqSsBLNTZrq18LC3MUIgQhkSTf6FG6slocI2q7NuyeH0bz5H4+ 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/jz4740/jz4740-i2s.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/jz4740/jz4740-i2s.c b/sound/soc/jz4740/jz4740-i2s.c index 5176195316158..6bce5c08ee45d 100644 --- a/sound/soc/jz4740/jz4740-i2s.c +++ b/sound/soc/jz4740/jz4740-i2s.c @@ -103,7 +103,7 @@ static int jz4740_i2s_startup(struct snd_pcm_substream *substream, * because it does not disturb other active substreams. */ if (!i2s->soc_info->shared_fifo_flush) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_set_bits(i2s->regmap, JZ_REG_AIC_CTRL, JZ_AIC_CTRL_TFLUSH); else regmap_set_bits(i2s->regmap, JZ_REG_AIC_CTRL, JZ_AIC_CTRL_RFLUSH); @@ -148,7 +148,7 @@ static int jz4740_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai); uint32_t mask; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) mask = JZ_AIC_CTRL_ENABLE_PLAYBACK | JZ_AIC_CTRL_ENABLE_TX_DMA; else mask = JZ_AIC_CTRL_ENABLE_CAPTURE | JZ_AIC_CTRL_ENABLE_RX_DMA; @@ -278,7 +278,7 @@ static int jz4740_i2s_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ctrl &= ~JZ_AIC_CTRL_OUTPUT_SAMPLE_SIZE; ctrl |= FIELD_PREP(JZ_AIC_CTRL_OUTPUT_SAMPLE_SIZE, sample_size); 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: 13752889 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/G8McFn3AuXTaT8bopUuk4LslTx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LzhnUJWNXQbH7nczS/fgHv55tk3aWZbbHyRY9zcwQAlvJN0IIKDB62iv9+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: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: 13752890 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 32CF017577 for ; Mon, 5 Aug 2024 00:41:09 +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=1722818472; cv=fail; b=olBFk32i9kej0gA03Ra9ZHnpMJKSfPlpkN0dPpIWKIOxGs2WAhHvCZjnPLJ7o68/d01iAqOvG8WHgDjuXEkcgSVuZ7QDY8VU/IJX6zP5IILeLFe/admsl/12CgBj2msyLeNyAtZj7jzkhgzrFp8uJ3RmLylZma3pfDOiJY+7sKU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818472; c=relaxed/simple; bh=VyVN8e/J+InDL1BN1udcFkxW6voAFhtw1Zf4smIpFMg=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=nRDgJF6nshi3Uh0LRv65+A9HuuGljMtMHZ5LgH+YFxjrFpzn9sDbjnFBwyuGruO+U6tvsZyPq+FTOUaB1uV7SjsLCWqjESxkJ+qlVUEAcN104prLOoAjl/F6cBZBf4gY+JwGUkD5/1I5nnG+4GxOQm3QeBVsM2aqGnROrbEg8JM= 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=aMOHBtNx; 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="aMOHBtNx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nCHDDlxo7glN6qctOoVMz5p+mGsINJo141mAAjMpf+TAkZJe6nNR2QFAzsPF+9wW1LswNClU07NU18cyYF2cTPT4D8VkJzmbl0XBgjAXTyYFSQKbmjWwdjtNsn6hbd2Ry1UxEsJm8HhgnF1I8S33fuSFuKtNa7VYXRjkzrzulnpsYzJRO67+ULh/UQVvgnF1lSmj5KuE5l9Eze3OhgchtDxa7RNo7M+MAMSr0Wz/RiRmOs1PZ2fyibLi0kGpKAUqYf3f+UZpzNwHuYJY8V50qyPIYRqmNVjV+tx/I+3g/BrW9l5D2FYldXsqxidE81XFcBJwFJNt5oJ7EPIhbcopVg== 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=J9f4FktZ9yDJZ90Cds6CcXcbZTGo/EnUoXn+Lyjsq8g=; b=QdDpizOSYttwGRPfmOrN+93Pqj1+NxYj93mVcSBfKSHYBuYjIwcAlSZXRK6DTPTZ0UpRoLS+L6cJ5po49abhF2nNb23luFdkYvPGWppF6vVWXckEwrnGHP4xhxEXvVaNrN+i94pq0AHsYdhuGy+uWPTc3HoSQkn0ziUkWLHNpsaAsjgmuVbvWRUK2b8ZFFIYs1ses08SfVWXb6FPFnTXW1gOrX3e5xjWvrY6hD4Zu2fs7tPIpz6t02uJ/yafJScmQErjsTHrLr/WdLwgf8S4x5XgUVv5s5xfyjTdcQ2KI58I7Ty+He+Gp93UmXyNNvovbrdq9lZaJ//UjvqVyrcXJg== 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=J9f4FktZ9yDJZ90Cds6CcXcbZTGo/EnUoXn+Lyjsq8g=; b=aMOHBtNx/u8o9LV6CkLq77ywnYjSnLNOroLkixvWZOzuSdOWVtHovKO7RnCi7p+/Shr9CIQsxJy0Ii4sMQHMCppDfwCw34jGFY7JYNHhfMBl4/kYgyTXE2Vf58tijbPKVFdaXDMOz6MzB5hM0Y/Y8U6sIwewmIhDukyttyPV1RY= 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: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:41:06 +0000 Message-ID: <878qxbyf6m.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 072/113] ASoC: codecs: cs*: 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:06 +0000 X-ClientProxiedBy: TYCP286CA0270.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:455::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_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f2b87e1-e9ff-40f3-bd34-08dcb4e74ab3 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: 18Zf+09K/z356Ur6soTSdcQleIuMEkbt/sz6WC7jG/8bBYDA8ZBmbQ343nJKd9agrU8NjMyKiCQkBq14McYrMABdSRVdyvqnediZdSIxKf0bqr+rq+FeYas3bjcE1i7f6NBidZxkAyeQQjqqJPVtMn1PLlyLgoRnD9u6CT/9MXKHkCAQcwAXEZJT+XZRB2MT+S2r37M6tlr/RB5wdoNej0TKbLEscjAXvoWrOXaCyPW3wAgwFgHAj3z2Lhz+rS9J+ALCNYs9sS0+DUDsRToEPIrSGQKIokOL/qiuZRA+i971oeeo3WrCKZlD46VlV7HgYZh/8bRtZhVFDmr94E+ArRpkI0cd1nBmfwPmrxS7WFtgIwdgUIdhqttiMr0aQ2i9+THQYVJQ53wtsPSVOTiERB0HmF87yo4reYLJ18ggtoC9svnUK0+lzUZFFKVpakICBveOXqegYsa+1xEGAuwB6WR1LN/iiptzHG2awjFj3WU0669684QTsJKPClJYEq5ymxQ9eYfOv+dLLvPn9JlDScCGZAXJ9/s5Jk1lR9TJlRmObS+TyW8MMe3KLYCilezdms/gTlkeUtXmOHVMs0fJjfsTwYzNb1PsJ85hki+SLO52pAfgi6fnrnz2EIU6BiHQxV3Ih76yAuzEeLU4CI0/F/HNnwzlVem16usyI7llrF521/6UDbK6kVnCk2/eWYVxs8SiSCRhyFB49sho3ZXghZjPYvBjp0VJhWdTO5LMMdiN+XczmRRbMA3hBMcgMTwWfzkDhK99AXX0DDkL3eq3+J86FAVYJ9swfPPTdKf3VzRuB0VXtEn/+YUYNPFK3630qO3saLvVba2IHPkD/ETnN431KfBmWxHTAp2AM0RAmFinPSMtstbf4BY/gge0IVJpv23PS/V8cZWq2JBaaCQlbELyNBini+Y+5XsJKW7yrFOkrNL6/6HVVn2pGETpvghJSBfVebVKW17OndJgVa4Utp7KVZ4/SFTpmYESas+umxKFGjkxU5nI31iTQU7Iqq5wpZUjROC8RVqw6hGtyzsPWhDQ9bNhJ6x9e9bUN2lh4mOdKN/AbR69z31hGkLvfx7f6C5RgjPHLX5BWtecHJL+qHPmVzsUk6gQ+CBjmKMQ548Xt4UvnHXzVNCNfrQKXuGSBMj4lvLZ++RlnJ6A/sEMWVwIsdYHK8oQYUD5cTLS6tN0pyZ0LdeOH5pvwBSLHHNNk18lv9iR8u06P4uIt10uIH3M6x3K05gKxwq+dHx7DlILZY+yIv7s9eKHnd9zxiqnKNOE5vMeL7rl2soCi5Ak9niISUEnTccqJ0jeg2tcM7FdIROXJp6Fq5EAWNEwqrsic2oH4TC1Ja9CIlYGjiachKspw2o76VkpuJrSH48v+YOLkwBUxNZF1WfWRBXH9VQnC2HUisdXgaq+jan5sswA1g== 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: z8cwWiTtTFHUnw54/R5gg2ZNUW0Q/XkZTUVi8yqHts0szPtWfge4ZPTdACnnXbePei0J3Mopzk5Ht9SDWYOaksy8pU5oOlNENr918PiIvGQtGeAMR1zQkqJ+POTULqjRJ8WPNiDum+qjsFsGD7H021jgz6b0yanG7EulPMkwec1hjIcAhiACgTfHI7tRMslySA3DOS8hoqaUpT5+f713igwz2DMVBN8y456Js8lY4AVYSIes3IKMKdSODfULQS5+UGUf/XCaIx2mmz+BeXKanqsmPmpgu1Kw096iydhvpzIb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hAf5moz3FSeUytG0XbJVK3G7M70oakyS/9fq7uqMz+HdNoiUvTQmHae5utmnay8zJi60DxswmrtaTRCyQCDpSQWdnc/Gvj+zcOCG9KcxNwB+skoMreR7xyEmz+2p/PjnSojRSDHtkpBsYCayJIrLmWeJksi53mlR4aJxQMSic2SyTOFylPROb6zZjifQru5ngw4SJOP4FPJxa3gVrM3EGNbTgWH7EvDzRgXbb8W1K0120+4HN6NqdjAZ9h/P28dREDc+lPIjlIE= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f2b87e1-e9ff-40f3-bd34-08dcb4e74ab3 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:06.4494 (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: QPn8vzNl9xojkBK/4/5ZDWmKA+4y160R763xy41ZsdRlHCZ34qbZT78JKyEhAHiH9QrTJZ60If/RffNtNGti1/lAUjJkGJ53SaoZ+9v7IVcQrU+b3NUBJZg4xo/jmbtE 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/cs35l35.c | 2 +- sound/soc/codecs/cs35l36.c | 2 +- sound/soc/codecs/cs35l41.c | 2 +- sound/soc/codecs/cs35l45.c | 2 +- sound/soc/codecs/cs35l56.c | 4 ++-- sound/soc/codecs/cs4234.c | 4 ++-- sound/soc/codecs/cs4265.c | 2 +- sound/soc/codecs/cs4271.c | 6 +++--- sound/soc/codecs/cs42l42-sdw.c | 2 +- sound/soc/codecs/cs42l42.c | 4 ++-- sound/soc/codecs/cs42l43.c | 2 +- sound/soc/codecs/cs42xx8.c | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c index 7a01b1d9fc9d7..133b38108ebfe 100644 --- a/sound/soc/codecs/cs35l35.c +++ b/sound/soc/codecs/cs35l35.c @@ -512,7 +512,7 @@ static int cs35l35_hw_params(struct snd_pcm_substream *substream, * You can pull more Monitor data from the SDOUT pin than going to SDIN * Just make sure your SCLK is fast enough to fill the frame */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (params_width(params)) { case 8: audin_format = CS35L35_SDIN_DEPTH_8; diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c index cbea79bd89808..a3c49b5760c2e 100644 --- a/sound/soc/codecs/cs35l36.c +++ b/sound/soc/codecs/cs35l36.c @@ -891,7 +891,7 @@ static int cs35l36_pcm_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(cs35l36->regmap, CS35L36_ASP_FRAME_CTRL, CS35L36_ASP_RX_WIDTH_MASK, asp_width << CS35L36_ASP_RX_WIDTH_SHIFT); diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c index 1688c2c688f06..1ef19481c12d9 100644 --- a/sound/soc/codecs/cs35l41.c +++ b/sound/soc/codecs/cs35l41.c @@ -777,7 +777,7 @@ static int cs35l41_pcm_hw_params(struct snd_pcm_substream *substream, CS35L41_GLOBAL_FS_MASK, cs35l41_fs_rates[i].fs_cfg << CS35L41_GLOBAL_FS_SHIFT); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(cs35l41->regmap, CS35L41_SP_FORMAT, CS35L41_ASP_WIDTH_RX_MASK, asp_wl << CS35L41_ASP_WIDTH_RX_SHIFT); diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index 2392c6effed85..114b4ffbfeede 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -741,7 +741,7 @@ static int cs35l45_asp_hw_params(struct snd_pcm_substream *substream, else asp_width = params_width(params); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(cs35l45->regmap, CS35L45_ASP_CONTROL2, CS35L45_ASP_WIDTH_RX_MASK, asp_width << CS35L45_ASP_WIDTH_RX_SHIFT); diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c index 84c34f5b1a516..5ead5d568d05b 100644 --- a/sound/soc/codecs/cs35l56.c +++ b/sound/soc/codecs/cs35l56.c @@ -468,7 +468,7 @@ static int cs35l56_asp_dai_hw_params(struct snd_pcm_substream *substream, freq_id << CS35L56_ASP_BCLK_FREQ_SHIFT); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(cs35l56->base.regmap, CS35L56_ASP1_CONTROL2, CS35L56_ASP_RX_WIDTH_MASK, asp_width << CS35L56_ASP_RX_WIDTH_SHIFT); @@ -557,7 +557,7 @@ static int cs35l56_sdw_dai_hw_params(struct snd_pcm_substream *substream, sconfig.frame_rate = params_rate(params); sconfig.bps = snd_pcm_format_width(params_format(params)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { sconfig.direction = SDW_DATA_DIR_RX; pconfig.num = CS35L56_SDW1_PLAYBACK_PORT; pconfig.ch_mask = cs35l56->rx_mask; diff --git a/sound/soc/codecs/cs4234.c b/sound/soc/codecs/cs4234.c index 69287ba7e9558..1095cce0ecff3 100644 --- a/sound/soc/codecs/cs4234.c +++ b/sound/soc/codecs/cs4234.c @@ -410,7 +410,7 @@ static int cs4234_dai_hw_params(struct snd_pcm_substream *sub, dev_err(component->dev, "Unsupported sample width\n"); return -EINVAL; } - if (sub->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(sub)) regmap_update_bits(cs4234->regmap, CS4234_SAMPLE_WIDTH, CS4234_SDOUTX_SW_MASK, sample_width << CS4234_SDOUTX_SW_SHIFT); @@ -477,7 +477,7 @@ static int cs4234_dai_startup(struct snd_pcm_substream *sub, struct snd_soc_dai * Note: SNDRV_PCM_HW_PARAM_SAMPLE_BITS constrains the physical * width, which we don't care about, so constrain the format. */ - if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(sub)) { ret = snd_pcm_hw_constraint_mask64( sub->runtime, SNDRV_PCM_HW_PARAM_FORMAT, diff --git a/sound/soc/codecs/cs4265.c b/sound/soc/codecs/cs4265.c index 78ffb7fa7fc5f..2a0121287b753 100644 --- a/sound/soc/codecs/cs4265.c +++ b/sound/soc/codecs/cs4265.c @@ -407,7 +407,7 @@ static int cs4265_pcm_hw_params(struct snd_pcm_substream *substream, struct cs4265_private *cs4265 = snd_soc_component_get_drvdata(component); int index; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && + if (snd_pcm_is_capture(substream) && ((cs4265->format & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_RIGHT_J)) return -EINVAL; diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index e864188ae5eb9..b31d06ddb463b 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c @@ -351,9 +351,9 @@ static int cs4271_hw_params(struct snd_pcm_substream *substream, * registers every time. */ - if ((substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if ((snd_pcm_is_playback(substream) && !snd_soc_dai_stream_active(dai, SNDRV_PCM_STREAM_CAPTURE)) || - (substream->stream == SNDRV_PCM_STREAM_CAPTURE && + (snd_pcm_is_capture(substream) && !snd_soc_dai_stream_active(dai, SNDRV_PCM_STREAM_PLAYBACK))) { ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, CS4271_MODE2_PDN, @@ -408,7 +408,7 @@ static int cs4271_mute_stream(struct snd_soc_dai *dai, int mute, int stream) int val_a = 0; int val_b = 0; - if (stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(stream)) return 0; if (mute) { diff --git a/sound/soc/codecs/cs42l42-sdw.c b/sound/soc/codecs/cs42l42-sdw.c index 29891c1f6bece..92a110a841e13 100644 --- a/sound/soc/codecs/cs42l42-sdw.c +++ b/sound/soc/codecs/cs42l42-sdw.c @@ -78,7 +78,7 @@ static int cs42l42_sdw_dai_hw_params(struct snd_pcm_substream *substream, 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 = CS42L42_SDW_PLAYBACK_PORT; else port_config.num = CS42L42_SDW_CAPTURE_PORT; diff --git a/sound/soc/codecs/cs42l42.c b/sound/soc/codecs/cs42l42.c index 60d366e53526f..a06a0ed8ded49 100644 --- a/sound/soc/codecs/cs42l42.c +++ b/sound/soc/codecs/cs42l42.c @@ -1033,7 +1033,7 @@ int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream) if (mute) { /* Mute the headphone */ - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) snd_soc_component_update_bits(component, CS42L42_HP_CTL, CS42L42_HP_ANA_AMUTE_MASK | CS42L42_HP_ANA_BMUTE_MASK, @@ -1106,7 +1106,7 @@ int cs42l42_mute_stream(struct snd_soc_dai *dai, int mute, int stream) } cs42l42->stream_use |= 1 << stream; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { /* Un-mute the headphone */ snd_soc_component_update_bits(component, CS42L42_HP_CTL, CS42L42_HP_ANA_AMUTE_MASK | diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c index 92674314227c4..e2345e0cfdebc 100644 --- a/sound/soc/codecs/cs42l43.c +++ b/sound/soc/codecs/cs42l43.c @@ -426,7 +426,7 @@ static int cs42l43_asp_hw_params(struct snd_pcm_substream *substream, CS42L43_ASP_NUM_BCLKS_PER_FSYNC_MASK, frame << CS42L43_ASP_NUM_BCLKS_PER_FSYNC_SHIFT); - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { reg = CS42L43_ASP_TX_CH1_CTRL; slots = priv->tx_slots; } else { diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c index 9c44b6283b8f9..7f619ee811836 100644 --- a/sound/soc/codecs/cs42xx8.c +++ b/sound/soc/codecs/cs42xx8.c @@ -262,7 +262,7 @@ static int cs42xx8_hw_params(struct snd_pcm_substream *substream, { struct snd_soc_component *component = dai->component; struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); u32 ratio[2]; u32 rate[2]; u32 fm[2]; @@ -350,7 +350,7 @@ static int cs42xx8_hw_free(struct snd_pcm_substream *substream, { struct snd_soc_component *component = dai->component; struct cs42xx8_priv *cs42xx8 = snd_soc_component_get_drvdata(component); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); /* Clear stored rate */ cs42xx8->rate[tx] = 0; 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: 13752891 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/hB7jfAUmvhT9seIqMU5nkcEoy0ahe7AM0XoU1F4OnIPdCz97rPzwxo7xvpw0JvL48d3kUWEolaXGOaIAI4ncEc5sXoEotvPXfhSCFbdFK9w30eb8Lh3saPz1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1qefOBcPWE+wOfkbvl6HM1nmwgEPPW6YQnhqZynZ6Flr2856BnU61bAm8ZTpYSlOmPpkFxDf8mLDXNPwRqtma8bOlsi+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: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: 13752892 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010070.outbound.protection.outlook.com [52.101.228.70]) (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 3019E17997 for ; Mon, 5 Aug 2024 00:41:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818480; cv=fail; b=GXKkAqA1R7CScFDOO3mQJwHCX5zWZpGKqBapbvnZ054TliaVqYS90ycLOoeTbqeahAtBdxljEQ6kAbOlP1oX/ojXXY62FDLL65aijPH13PrEVyy4N/QH8/0vsm1gKZVTH2HI6IK3/2q1ejKPvQYCMm2tTUGxnWPPO7WPCIk1Eo0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818480; c=relaxed/simple; bh=Hhv81/HSpJVtlW+VhLi/K5ZgCF+j5U2PyI7QPdZmU00=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=IIz1ybc06Y1hvH8IouvVC7ZKYeWBNnlnO4hPS+nSJInBuTidJ7/BbvOg0IN9XXeJhJND+fAV/b7wu6JTHI572YmgGGaUkp0EiXDq1rpJ2tupKDNiS54uOaRA5oJ9fGDPaEg3TgyKmOSOi63J38PX0+6JMPXc5QP90/22qKxa8LE= 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=XFi6oEPo; arc=fail smtp.client-ip=52.101.228.70 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="XFi6oEPo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jZ0xbJWJUf6YsPLbmjiASqdL7uNx0bSzBTkWdYyziLBX7nOyvYv9TfwAHCDExrLwvL5r3h2XvxZOmnZKsoWMTcZqkDY21LZRPuDDR+qVtD6LaioVnDWf7xCHhZB9mgDPby0eoicKYoBMzw4mFQSOKeesghOoAf+EingqmfDGX47F9vTol85y6ZefXzKfDQiRnRJnbR5RIoxYQQ+gS7aoU9Zpz9+2g/BDAW68LuLKoSL5iZVycSV0lasI0z6T7EdHN9ry4WHCRAX2d+gtHCt0knatWPaUlUs/XO1nvyMFhLl2AS3lf3/CE4Mwc0gkJytxXY3niPn7Wd6ewZTux5VTVw== 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=Pl/QKOh2AOi4lo/4J5AJaHKZXHuDTYPachRqMFZMBxQ=; b=GcrzLXFRhFrNtKU8f2V3MwSOySD7LGm+SoEir/7xVNsbWzzCSbsTnbFZSUX9+UVFJf5iem015Q17+jk8Hm8sGSXvBdKCf0PArgR38dBqLSZUemHT86mOeCEPJZ/epTXYKbVuSxNP7KLSrV5DFtXT50u+uzL9xWEVVd70JoPTxbxjzYVkD93Ng+hHSetOhT4T9XTzkXiKp8YHfHDeO9J5H8u2DPqrMC7vcPdO4W0BbvCXxoAT3eu78g8enjPeqgEyNtOOfsJGNfTsn7S7a3jkFNvM4Ef/HKkBdKzj7WUZvwraCZNyk2i4PtBEBiVdfROxK7xEvky0twoDJSVjfNVxDQ== 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=Pl/QKOh2AOi4lo/4J5AJaHKZXHuDTYPachRqMFZMBxQ=; b=XFi6oEPoJOteQYd1WTlY3MEi/MzH+zt9yGe6SDVXC5epOpizxuN8HB8gvsnsdiEDdd86/NwRzfsBGLK7VuU6/eKQgxeF6m3XDz+bkYsGrMAlala7UU5iJ1jt2vwwntmS84g+2o7lRTAlBTgWPO4YthGpCCHbtb5ewMfX7Ke19sk= 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: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:41:15 +0000 Message-ID: <875xsfyf6c.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 074/113] ASoC: codecs: wm*: 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:15 +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: b0075e42-6308-4368-77e3-08dcb4e7502c 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: ycepHoP4yHrYMGl86+hG6uP2Bt0ejDJJKj+zQPAvhCmdW4tjqYWGXf90EQtw0IWGnZN7onSmjqFlufRv/J8CB/D33Qtrw49rTVjKSDIetx2qb27yMOCks2GwqAZcKH51nNf+/X5jgCRDIeXvkvx51avUY2GmBpNaW0dQuC8rQEopqsIFzrBrd09Vllr2o58gSmG5Ed+ePnXDhWzfpdMQaG/scAZIFwQKH0RhJ/ThCDmcV1MUpciVm3VG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eh1lp/ujZ0S1/l0HKIwVAgkBSOeyFR6ly1pg830L4lp6hBwIO9Es20VXcyblIHxDK1LeqPH0PtlwfIiVbLx7Z3uMRYCjDZa+HmewUQQUP01Dwv/0Q== 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: RdzktogsXHh6tVyfQHW+fqvYfv3/mBIGwIkI4KVLA8iNYb9rD5xl4jvHMV58grBywJs2vOhwKJ0XRTM9PK/Yqz80eLGxh3OYE5035EUyxf3za+FaRPERvXZQUJsOS/lU354FL+zmxxBcYdtw/lwQ2vJF6oBx93/h8pFXYEgHHP2NUz/3gFPa9pmHoD6W0mzjDh4u/oH/EaLIRcayFL9i08A8Ur6WY5lfkaG7LttPiwXntCHnXpLwvWJurWGy/fdZhrizRBOCrAnYwkrVfpTBYz9BY1QF9HTG8bKEtuu8ZKhcFS+oAXCmhFEQ4rdptI1jPTg9N1bv6di4dItaNB6JcsFX4fXaiRv/6UWD18UbMf/6YrP+OT2mbJoPVSdweBPF5uWv4+12yGLFGPFEmi+KUThGH3SLjaK56B8aka7WyuEz5D9koxZU+VFOcRqlsSwDDOsTL7CiQG9XEUTpE0EA51TDo+vI9S2vF0MnERosjnHVmQa0FHrNWKqwkqFFwP2RGPADlhzOCG6ZLgEscdnqqGUxne4x9OY5QbOSL54QZ924EjI4WdtPeAH3M12LhHZ330tF7Nw6Wobad0+H/NztDhBqe29RfQ+P3SYGYhuVsCPdMQT0ZndTdH0uS6s55xD9ruNjujaxqfe7PvAOpNDUfT1Q+wufxBbC4hklhtdAEh8TeNdLeq16XQ19lBzpdDygavHhRhSp9XQSzstRkgBDMD0ZlxZvRLm8cSsQG+bwLuf0BH7HkddRagduFQHAlE8bs2TmGDVmxJduARwrCo0U5uVZWIELxtQGrPlJxd1smgUZZFRENd0yA2u4idWpHMPfJNvxxSyjsAbkKFrv0sxc4kl5f+GQNyzuXAt346qHGgfBOB0Yy2qlE7Eq5Djx2VJoZKM+2Sor7xm2bLFNp9KkhZZtzd9ovOi53SBN1woTZXh9AvjUFzQc3mD1+9GjZbugExjXA5fbd4jWA9ek1rrjXYHAV4YgEtMeU8swichb0vPz7fqm4iHJ33+XQolM1c8Lku51tGA5x6VuBspsBItGvuST8az+mA2WigIw3beQK4Man4iU73quaN70gwhFOxllESW1qSsbLdZib0mhVls6/94fiG+DB8poCw+dWU/MJyIzR+j3XwbOX/HyxWiK7rMd5h1Mqh2OQJ+y1vdyLHYTqQNkWf/7xVOk/y5wEvkGrqzcHEzeLdLnxFS+vZ5ayab4onFn4LOQP9culZqaO6AoBJqioJuhJh0aYDDGBr+8KP0+wyNT5kO09D7Dhv75G2JNhR2/zGHPmNR+GKKFBrxNqukqGgPS6NKdGj/PzrOdGSgGrrxpv/HtA0ZgmevSUM5JjrWi0Q/VyLGfLEgwzmgJnGclf/RzQCsfNLMLIkqpjqjoF2UHv8dXQ3+RgfNbV9Vp2O7jmkNdyhpOS45+YIKZYNZmTVb3e8Q+VshEIxOSFg1LykbOL5wq0J++VDC5BD+c7Sx4X2zYjkDbljPkDv3WX9ksrayAEZV0YdIzzIxnAn5Sw3X2GQ2p7gah4L6jF4TDMvErT6e6NuUrm8JNy1ysOnhMj7jE+LsMJSztwCGcy9pioohnc0I1sDN6lltuKG+rkvSNi4rokpOICF4SkVWCn861GtWPj7c+zonbHXucHFA= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: b0075e42-6308-4368-77e3-08dcb4e7502c 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:15.6064 (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: Gj5NoP33qqclX/GfUsCDMg689lAUV26mCemB8DdWxs0yKCnHXF4+8DCPqycC1bjRcaXeCRJcgPz0/bYX6ET41tc9TJbBjW94DbxvArHcKu/z3sCxiWidZEfCUupuunwn 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/wm2200.c | 4 ++-- sound/soc/codecs/wm5100.c | 4 ++-- sound/soc/codecs/wm8350.c | 2 +- sound/soc/codecs/wm8580.c | 2 +- sound/soc/codecs/wm8900.c | 2 +- sound/soc/codecs/wm8940.c | 2 +- sound/soc/codecs/wm8960.c | 4 ++-- sound/soc/codecs/wm8961.c | 4 ++-- sound/soc/codecs/wm8994.c | 6 +++--- sound/soc/codecs/wm8995.c | 4 ++-- sound/soc/codecs/wm8996.c | 4 ++-- sound/soc/codecs/wm9705.c | 2 +- sound/soc/codecs/wm9712.c | 4 ++-- sound/soc/codecs/wm9713.c | 4 ++-- 14 files changed, 24 insertions(+), 24 deletions(-) diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c index 841247173d98e..b755be789c4c7 100644 --- a/sound/soc/codecs/wm2200.c +++ b/sound/soc/codecs/wm2200.c @@ -1749,7 +1749,7 @@ static int wm2200_hw_params(struct snd_pcm_substream *substream, lrclk = bclk_rates[bclk] / params_rate(params); dev_dbg(component->dev, "Setting %dHz LRCLK\n", bclk_rates[bclk] / lrclk); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(substream) || wm2200->symmetric_rates) snd_soc_component_update_bits(component, WM2200_AUDIO_IF_1_7, WM2200_AIF1RX_BCPF_MASK, lrclk); @@ -1758,7 +1758,7 @@ static int wm2200_hw_params(struct snd_pcm_substream *substream, WM2200_AIF1TX_BCPF_MASK, lrclk); i = (wl << WM2200_AIF1TX_WL_SHIFT) | wl; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_soc_component_update_bits(component, WM2200_AUDIO_IF_1_9, WM2200_AIF1RX_WL_MASK | WM2200_AIF1RX_SLOT_LEN_MASK, i); diff --git a/sound/soc/codecs/wm5100.c b/sound/soc/codecs/wm5100.c index 11bbc94a282c7..b55c90f00ac5e 100644 --- a/sound/soc/codecs/wm5100.c +++ b/sound/soc/codecs/wm5100.c @@ -1478,7 +1478,7 @@ static int wm5100_hw_params(struct snd_pcm_substream *substream, lrclk = bclk_rates[bclk] / params_rate(params); dev_dbg(component->dev, "Setting %dHz LRCLK\n", bclk_rates[bclk] / lrclk); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(substream) || wm5100->aif_symmetric[dai->id]) snd_soc_component_update_bits(component, base + 7, WM5100_AIF1RX_BCPF_MASK, lrclk); @@ -1487,7 +1487,7 @@ static int wm5100_hw_params(struct snd_pcm_substream *substream, WM5100_AIF1TX_BCPF_MASK, lrclk); i = (wl << WM5100_AIF1TX_WL_SHIFT) | fl; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_soc_component_update_bits(component, base + 9, WM5100_AIF1RX_WL_MASK | WM5100_AIF1RX_SLOT_LEN_MASK, i); diff --git a/sound/soc/codecs/wm8350.c b/sound/soc/codecs/wm8350.c index 66bd281095e1c..05178509bdfab 100644 --- a/sound/soc/codecs/wm8350.c +++ b/sound/soc/codecs/wm8350.c @@ -931,7 +931,7 @@ static int wm8350_pcm_hw_params(struct snd_pcm_substream *substream, /* The sloping stopband filter is recommended for use with * lower sample rates to improve performance. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (params_rate(params) < 24000) wm8350_set_bits(wm8350, WM8350_DAC_MUTE_VOLUME, WM8350_DAC_SB_FILT); diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index 73a8edc797fb2..f00c3c1e62332 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c @@ -576,7 +576,7 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, dev_dbg(component->dev, "Running at %dfs with %dHz clock\n", wm8580_sysclk_ratios[i], wm8580->sysclk[dai->driver->id]); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (ratio) { case 128: case 192: diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c index e44fdf97796f3..f084143c8171e 100644 --- a/sound/soc/codecs/wm8900.c +++ b/sound/soc/codecs/wm8900.c @@ -649,7 +649,7 @@ static int wm8900_hw_params(struct snd_pcm_substream *substream, snd_soc_component_write(component, WM8900_REG_AUDIO1, reg); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { reg = snd_soc_component_read(component, WM8900_REG_DACCTRL); if (params_rate(params) <= 24000) diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c index 8a532f7d750c8..cda6c4d8e129b 100644 --- a/sound/soc/codecs/wm8940.c +++ b/sound/soc/codecs/wm8940.c @@ -408,7 +408,7 @@ static int wm8940_i2s_hw_params(struct snd_pcm_substream *substream, return ret; /* LoutR control */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE + if (snd_pcm_is_capture(substream) && params_channels(params) == 2) iface |= (1 << 9); diff --git a/sound/soc/codecs/wm8960.c b/sound/soc/codecs/wm8960.c index 00858b9c95686..9ba1edd5ba9a9 100644 --- a/sound/soc/codecs/wm8960.c +++ b/sound/soc/codecs/wm8960.c @@ -833,7 +833,7 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream, struct snd_soc_component *component = dai->component; struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); u16 iface = snd_soc_component_read(component, WM8960_IFACE1) & 0xfff3; - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); int i; wm8960->bclk = snd_soc_params_to_bclk(params); @@ -891,7 +891,7 @@ static int wm8960_hw_free(struct snd_pcm_substream *substream, { struct snd_soc_component *component = dai->component; struct wm8960_priv *wm8960 = snd_soc_component_get_drvdata(component); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); wm8960->is_stream_in_use[tx] = false; diff --git a/sound/soc/codecs/wm8961.c b/sound/soc/codecs/wm8961.c index d1c731e25777b..6b0e1f76358ec 100644 --- a/sound/soc/codecs/wm8961.c +++ b/sound/soc/codecs/wm8961.c @@ -531,12 +531,12 @@ static int wm8961_hw_params(struct snd_pcm_substream *substream, /* Select a CLK_SYS/fs ratio equal to or higher than required */ target = wm8961->sysclk / fs; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && target < 64) { + if (snd_pcm_is_playback(substream) && target < 64) { dev_err(component->dev, "SYSCLK must be at least 64*fs for DAC\n"); return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && target < 256) { + if (snd_pcm_is_capture(substream) && target < 256) { dev_err(component->dev, "SYSCLK must be at least 256*fs for ADC\n"); return -EINVAL; diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index a99908582a50a..d4adbefae32be 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c @@ -2934,7 +2934,7 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, aif2_reg = WM8994_AIF1_CONTROL_2; bclk_reg = WM8994_AIF1_BCLK; rate_reg = WM8994_AIF1_RATE; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(substream) || wm8994->lrclk_shared[0]) { lrclk_reg = WM8994_AIF1DAC_LRCLK; } else { @@ -2947,7 +2947,7 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, aif2_reg = WM8994_AIF2_CONTROL_2; bclk_reg = WM8994_AIF2_BCLK; rate_reg = WM8994_AIF2_RATE; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(substream) || wm8994->lrclk_shared[1]) { lrclk_reg = WM8994_AIF2DAC_LRCLK; } else { @@ -3069,7 +3069,7 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream, snd_soc_component_update_bits(component, rate_reg, WM8994_AIF1_SR_MASK | WM8994_AIF1CLK_RATE_MASK, rate_val); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { switch (dai->id) { case 1: wm8994->dac_rates[0] = params_rate(params); diff --git a/sound/soc/codecs/wm8995.c b/sound/soc/codecs/wm8995.c index 1f9a9b6369350..2c2074b9a6bdf 100644 --- a/sound/soc/codecs/wm8995.c +++ b/sound/soc/codecs/wm8995.c @@ -1563,7 +1563,7 @@ static int wm8995_hw_params(struct snd_pcm_substream *substream, aif1_reg = WM8995_AIF1_CONTROL_1; bclk_reg = WM8995_AIF1_BCLK; rate_reg = WM8995_AIF1_RATE; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK /* || + if (snd_pcm_is_playback(substream) /* || wm8995->lrclk_shared[0] */) { lrclk_reg = WM8995_AIF1DAC_LRCLK; } else { @@ -1575,7 +1575,7 @@ static int wm8995_hw_params(struct snd_pcm_substream *substream, aif1_reg = WM8995_AIF2_CONTROL_1; bclk_reg = WM8995_AIF2_BCLK; rate_reg = WM8995_AIF2_RATE; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK /* || + if (snd_pcm_is_playback(substream) /* || wm8995->lrclk_shared[1] */) { lrclk_reg = WM8995_AIF2DAC_LRCLK; } else { diff --git a/sound/soc/codecs/wm8996.c b/sound/soc/codecs/wm8996.c index 5c06cea09bd18..d9c0bd6b09925 100644 --- a/sound/soc/codecs/wm8996.c +++ b/sound/soc/codecs/wm8996.c @@ -1740,7 +1740,7 @@ static int wm8996_hw_params(struct snd_pcm_substream *substream, switch (dai->id) { case 0: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(substream) || (snd_soc_component_read(component, WM8996_GPIO_1)) & WM8996_GP1_FN_MASK) { aifdata_reg = WM8996_AIF1RX_DATA_CONFIGURATION; lrclk_reg = WM8996_AIF1_RX_LRCLK_1; @@ -1751,7 +1751,7 @@ static int wm8996_hw_params(struct snd_pcm_substream *substream, dsp_shift = 0; break; case 1: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK || + if (snd_pcm_is_playback(substream) || (snd_soc_component_read(component, WM8996_GPIO_2)) & WM8996_GP2_FN_MASK) { aifdata_reg = WM8996_AIF2RX_DATA_CONFIGURATION; lrclk_reg = WM8996_AIF2_RX_LRCLK_1; diff --git a/sound/soc/codecs/wm9705.c b/sound/soc/codecs/wm9705.c index 5c6aebe29cf13..97f3c9c7a4413 100644 --- a/sound/soc/codecs/wm9705.c +++ b/sound/soc/codecs/wm9705.c @@ -236,7 +236,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream, snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x1, 0x1); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) reg = AC97_PCM_FRONT_DAC_RATE; else reg = AC97_PCM_LR_ADC_RATE; diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c index e63921de0c37a..d3a190c06ea9c 100644 --- a/sound/soc/codecs/wm9712.c +++ b/sound/soc/codecs/wm9712.c @@ -529,7 +529,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream, snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x1, 0x1); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) reg = AC97_PCM_FRONT_DAC_RATE; else reg = AC97_PCM_LR_ADC_RATE; @@ -546,7 +546,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream, snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x1, 0x1); snd_soc_component_update_bits(component, AC97_PCI_SID, 0x8000, 0x8000); - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -ENODEV; return snd_soc_component_write(component, AC97_PCM_SURR_DAC_RATE, runtime->rate); diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c index 64b69316e4c70..bf2824be4f0d4 100644 --- a/sound/soc/codecs/wm9713.c +++ b/sound/soc/codecs/wm9713.c @@ -1032,7 +1032,7 @@ static int ac97_hifi_prepare(struct snd_pcm_substream *substream, snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x0001, 0x0001); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) reg = AC97_PCM_FRONT_DAC_RATE; else reg = AC97_PCM_LR_ADC_RATE; @@ -1049,7 +1049,7 @@ static int ac97_aux_prepare(struct snd_pcm_substream *substream, snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x0001, 0x0001); snd_soc_component_update_bits(component, AC97_PCI_SID, 0x8000, 0x8000); - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -ENODEV; return snd_soc_component_write(component, AC97_PCM_SURR_DAC_RATE, runtime->rate); 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: 13752893 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+jIyN1O7D27jRG1cZiowOnsCcEd3QZ93MZ6uI5SdLYC9q8myWtpn8APi6dGZQUVvtiZqLidQNFpkmZVUmiiqBRftL7ITgdPf1X3qRiOYatIBVBd6MsQ6IQeBH81Q8ZhxmTK2lougpZH7tlJTzT8c2SHlcvSldUC574hl0jqucJo6/wDz4Tcc5bGnecgfEHCdTjvceDZ93YpWyjNeBcQO/PdrjeS/IRRvIEF3AaGy/g67+yymEfh8IXuhj9rU336Oh6nkE2lHcjggz+PUdkVTN5Bx9Y9a2WB4cnyeEmpm6UuKjOhwaTRRRdKfUUpgUKtxQuYO8ndDehUWsa0qZlFHyyiljL4ztLrI83ymgxHbq69GXHBuszHx6AjejP7E4zUJsw3AXHEPcHlvrVB1WhQFKqogA6m6+hzY288UMuA+kgyPSmO+a4HJ0Fbs/Bf2IocmoXoj0BcxKV2lud1MY/tRZE8eQ/ZRUgdNzFsfVZmh/6chStJ6qDkvJxvROvhRC3Oecqh8OWxrgYdxrcJbUnpgAIJZMHK2uv1NptZnE4+S9OLRHPpXGXwSV6wT0jR7Hw4/5oyIMI6baFbqQXIksbWyhNk6TOJiOiSAEz7KmqqqGvDxVdWMYONRxszLdirKpnfqwCGT6fheYHUNV5UvVmwk0njvdG0MMndis4ALsFrvUbcPILCcPSQ4kSahtURIBjJ5LKnidN5SMk0rEZwAf9UVOYLEkI7B4q8lMoehWl5PQYqUktq7xfBw2kXXBVP2hHlzVGAbOQ2iOTWnXWfMQ9IUxq3DzVqe2HV9quNF9udAbdvTMYOmHccV2IbcwaZ6nfHXpiMgFSI7z1u5Z450cTV+q8MY5Ey02hlRUHcP2q/Hye4llUUMyVMZcN0Twyh52xS4O3otWWV7PpeLY5Sv+jacGIThLwABnMlGQnSYYzA67kKsITOpKzW9mxRE6vRUiTqjBK465yUDHgD4BVzl+mtc1hpXvhRm5ng1dIQOM2ioOM/Hr86c8wPM6/O2WdUtJyinjlf0n3V8XOUANUsj+MQdlT/1rUfPwlGq9GIeveftWeg0d9GyVCxORchU7OV1aXOMCt+QbiBrk1vVMckxwPhmr3wY0TYjk6PvnAbaVI1zExhd9GfRCNrMK04E7qjNPRffHQvKX1A7X2GkUXsvU6DFCiKZBD46p1dpCb8xmSLQg== 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/g8Sdf9StwifFRT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gfN0X/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:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752894 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011014.outbound.protection.outlook.com [52.101.125.14]) (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 115FB17721 for ; Mon, 5 Aug 2024 00:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.14 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818490; cv=fail; b=jPGnKi7HSdtAUEDUNCqp90cp5iKsaE8ZB/2yF9HaLpw0ZIWr1565+GkMP4tG7u34hjtjTuP+y7/NxzLiNZgOtno7Z0PF9m9XQjCgIRNdC+DefvW1D6963bMVwXPYOiAw9ZVBId3jMZN7MoAYNzLqCfxlmHl8FrEBTupyiR8PJWs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818490; c=relaxed/simple; bh=bevcthK2bi6br+bqsVEf0IiiqV/pJajYz7O+qMhTIl8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=bXyPhKGbz94gyMdNmUBZkdEHYzwRRiKcm29HIjz47vrZUdsHozCrvMhC+9n4ZgWYNnkxzPywsfprUx4Ss1Fktn918jYJWXxYzbL21OOqMFGZwWyqbLg9pPUMbbePelQ4PsbOMZqIfYM3wJvBVLP6S0irb3TqBFt8rEtRxWzzfPA= 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=SmdkfgGS; arc=fail smtp.client-ip=52.101.125.14 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="SmdkfgGS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=syrX0w8BVq+jj4X0V0WpFsdxell21p4anLcLHAdtY5DT3mYCa7OiLitLmGpoE+41/24rHSoS9sHFsDSG6sgX1qTJqnu8KIuzS0wq3omQX6bNFJMabck8HDGEG0mdeTXcUubfYHS+nahiYM17O/sdC43KHJwl75FFSyelcbDU6/yHE1/aCk/UOdIeflwdTPx2uWWxmi663RvIC6WYuVhw0jBDyyfAvgLzGi+Vf/v/sH6yuUgTG+dnKLbg3PxnGt0JJ1BootyQv2B0jxda6fGUgusFToU2keTLtTY96+baZOFb0YhAK1pZK3SQnZQ4c/Ue6xANFWKi2EPs3s+FeimWgA== 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=bpFRCf7W5pU2P4g+EvAIrCXepWMVTDFrfik+o8lt+YY=; b=MqDlPm07vxXL9Qcok1394Tug5/FZfqUFfE7Eaeb30lQh4pn7YK4yBoua+dtS+Q1IBRij+RT/kw51kFTAZJkdj59XN6JqBU0C1ANMK4fgeQO0gOjZKxR6k6iYhX28/zJQ6lO5EZAlg059IESk7gIj8antCdXpVWw17O4OQJ9t09wejEu/zTRzhky/hCzL/5F0mm6t4cO8fcValVW/sRrNjUmzGCOaYZ0LTnfHnX6jvYgpgFzys4nmnglPgQkg6WkYI4lTgXncdiTXTFLqtd5HlAbl37ncZp3xEip7qHfeAbGtUDnop3isIRnAATOO06WrdA0jcvLtDRQ2jtEfjTjmkg== 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=bpFRCf7W5pU2P4g+EvAIrCXepWMVTDFrfik+o8lt+YY=; b=SmdkfgGSst0rCH38vcl2u83DHMGmIYQU6cFQhH1Ek7u3LHpo5Egmcar2hz9B4EH5HT7j37LbT0HwYoF5NkE7VBQy13s00z/uhBxWKH7Y6xq/ys9nDdNkUt1Og0F2bgUd3U7mNO42s/b3Xb/XVm2rmb+ipbXMwqIoAJMd/Gjt5jA= 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: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:41:24 +0000 Message-ID: <8734njyf63.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 076/113] ASoC: codecs: cpcap: 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:24 +0000 X-ClientProxiedBy: TY1PR01CA0199.jpnprd01.prod.outlook.com (2603:1096:403::29) 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: 8ecb517f-49c4-4e1e-aa94-08dcb4e755a0 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: RW1jnDfoFgX1JKKuYajexqhAD9enBJKruw5J8RmCOHvx3A8kcosWW39aVUc1PbkPtAxgHXXYKN61m01w0qGm/uVPk6LnQxkxS7pLWPajskbjH2Rs9iT92YvshJzYtbSK6x15dc8EAybsYF6cxi+IX4z34aqTF2EN9KUV6x+1pUFPlOuTYaOwAZ3uAbjSPrGlcgTbDi35rOKfvsQOpbWOXZMpVPT/7wiucOb7C6PaBrXwqqc/vqsNwOMV8UTnYm1dZnXHsTodxcm8AD+/6MwpS1wk+LFhI3OFxtnCQBqX1+3ZOvtwBGHiYnaQrlfd6xMkvyWSHpZmq52lW4bHWTH5URDfIxUKbvNwKY7XginolxZf1VTtSIXwp96Rcn0W4v31gPIIS7DIPoHaRYIO29+A5Oy3nrz30q/vd3JnviP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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: DhhYkt/1qCycCbU/S7QbQ0mgi2J4Lo6354w+8XsHhHX+qVCcG5tNF1yOYwmdAUtT5+0UbddIT1J2BEW8OeHxx0yj3KF5yi68HIJFruBXdYzJNGSEhJ3KNzIcvcw/HA5ycrn6BdfUtbZnCVRWIfDHVrEJT1QPZYF2CcLDdv2m01V/QeQwM6xk/uOW+Bq/jP2HdH+AvhgNsiZ5sTGgEjBS/1CZP5W/1UJZcMz4mxX5azg9NhVoipcnvIE2x4XaOqE1LmmrZfFDbFTRQIWT4EHOSWlbUZ+gUOgtUF3aWf1kp5FqfTigbPSC/E0D2My027Y9sXvjiYW9dn0JIcnnF+nUbKAtZDXApyhVTtQ4dB8/g9k5WsEMNCRwPbWUqI4hx2pc2fQ1QhZH15mdop9jW+LSXb565h7oSDmfk/iT2joekrq2pgD9V3eOUu5hAsob06P82HBz80uphyqqj+5kTnJ8Lrso6XTvqxD1o3xoiZqbbph5ojGP75espw7SmtOoqnLqGc65MhIzsEkiwmZGWTRIfvwDLehaRcPUbCfeGDMdx2esLNBvael4w+5sn8g+ayeITU34tgEU6rbU5j3tbOTTkK9NZUUZHc3omf1UpDzuidSItOmT6KDLRw+r8Th99lwqo1lYHJYD6WKLJ+ywH/MQKUuCZe6vN4BG2wdCTr5G1PSTqMp4OoDHMtZWvugP2wfMFEUw5+hRqhOMMS3QnjSF/9Obva0IJ1iQ/jB7geuBzfWcuoFuNPtX1JcoL1E3vHlt9JHTBbmrUnFrolF84ORc2B7j3qTlKQylzoRquM2Rn1h6WFzd5lM2qQ0WWUcE2wQku8t5c2fVXWlrF5cPzMYLDMhZqbW1MblutFKX0aPE48wuk2Hg08Zj/Bg2xFYtfJAbEIS/LR9xLGYvxH6cLncP9xIWvvZIxZhmFCJbFzwGr7aLdnXA7OvHipbqGKfxwxmreQamZx2Mnu87li6jTfDx2V8oCYCI8TjBS/m8l8ABGx5Fzv2rCu1khKxQfVkPAKOrvhyJfVVIKr/D+ZoSlPl25NKEUJbyxQ/eu5DSppe03829SnOW8Eq0o/Ibk8XnAvncJrMfZAUCPA0iOI59qyfnWEN1+MDH5x/i9v4H940X2VA/PuhtUzDanD0fajYVPTraF/CYReTUr1LzXwaonenXzWnpirGDnyiGu5//wWHRXF2OnwzHnmLRJEvlfs73cCq9oobqHRHf4zauOwVKjFz3O1E5uvmsiyWcmFgu8paE/n0ZslfCavsWu8On4wvO8EIyn71U2jNWJ9Ff8ZW1XOD6ThwXGxuf5FiT1U4PSXdPTw6th97xUXUfXOQ6SA3EITei/SGjB0981rEwFxf9lOE8QgDSGAMGPXDroE2BntfzLG5GxaKUixYJt2YLVnOYFlz0KjMIB+rfXhQjV6chi7HgAL+yjtlJWKMYA6d8eK1ZMyuf09ClDOihRUFLAgqyGrg7b3pVuWJmtwbaI9todAJ2IrHECUwaTcLQ2wCbE+/EBbojOfcdEmrgh/e5meQim/Tma48kbPZs7FKMWOkFwb6HXI+IY4kq2wsjZYIwu42E+GT4tpuQAiM5kAOJ/KPbCz928pLYDamB3QH8Ct8r5NfjtkAN971GzNE1LeSC7yBrXlI= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ecb517f-49c4-4e1e-aa94-08dcb4e755a0 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:24.7778 (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: VHAMfLUYQuY56SjkV1AASz3dNhkSPNtas1+FcvP5jd00q1mhv7WsItUr0t8JPg4VZ8XdTFKQnUMrumHtEtaCleFMA7Dj7XaTlIT5drjY2AIEhDQkZUcU4iwy9VOhgI4G 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/cpcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/cpcap.c b/sound/soc/codecs/cpcap.c index 4f9dabd9d78a6..e8309458eb86e 100644 --- a/sound/soc/codecs/cpcap.c +++ b/sound/soc/codecs/cpcap.c @@ -1271,7 +1271,7 @@ static int cpcap_voice_hw_params(struct snd_pcm_substream *substream, if (err) return err; - if (direction == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(direction)) { mask = 0x0000; mask |= BIT(CPCAP_BIT_MIC1_RX_TIMESLOT0); mask |= BIT(CPCAP_BIT_MIC1_RX_TIMESLOT1); 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: 13752895 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+nRMzOO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OAQXvJWMb6HkuaRv4K/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+cYmOsla6XI8KxoesPAcwNstu1Bxf26a06ijX0bdRCw3z2j9Va1DQ0M9q4j9omoJOecOl1h7/MaLYX5xOPXSmYleyRqInAulvl/25eIzl4jgZfS2PzV4DPsWB144bA7L5668nrI/IFpO4xpViZMcZV3ZK1TEL/gT+4WgJqNZrXqpP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rT9+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: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: 13752907 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 5A47217BDC for ; Mon, 5 Aug 2024 00:41:37 +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=1722818499; cv=fail; b=j16ojuI0dTPe3fQJoM2FO4cFLyIR/Cury7ZB1K21OXa9z9M6hSvASls29fCmgzk0++eODX0sj1/iFQMXRlU4W8ibwQMrR6wjoUIvUhLxYk7egsIZnjEqdl16Vn1FOdsjozOFqwAZwJLsnoJiheGl9TVc3eHdJ1kFTBiNwFVYlrc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818499; c=relaxed/simple; bh=Yp4xMGekwNxROV+Qe25e4LfJLZJF7rQdfRHuhAHnmo8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=BPJCDInidxb3pxaZdM89Tx8F/M33teYFKo1t21sx/Vk+KvYzVep7ZW5X73IwCBb7PDeYu78972G9+Z1zwpxSODyAYmVtEQRt8lloTZQWufEmaAJpLsuh/9C52oaa+RVZyUekn1A5/lN79F+uN8gsGmD09DrrQtax0/1nyrut+94= 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=PhMivvB/; 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="PhMivvB/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tVj+JklJb0ei0xlX8eAJ4RYfvB7tESuLKniDL3XyrwACUXbE0EMY4rRCxmNHojT8Ut3JKQa+ifk9FCfaNLC0Q2onDrr9eif+/93hiZPvS02i63hGgD8tVn8xh3SBaJ5hkKq328iFldXk6lH5sVNSD1yLCtqruwALhLw4OsDSuxUl2NUoW6C6YBzlJ8boB0rdl8KzZTByVe1MCj8OesPXWD4+hFc9yUocZH9XW02bFfZATb7oQNiD5noO4uq+pJW2wxPAdP5Qk7JEqWoFVTKmpwRD8nAjjp6BT29dSc3gpt34DgCAIJtOYtgBQm0/gvKDaTNGRW8F/qNVT10vwHoMdQ== 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=xkJQcmzUII00v2DqKXCg3TSr4cN/9Yrc9HHtUggOspw=; b=sweA7+48dJ5S9qkBn8nEBfwpL6iMNUApkz90m9CCrMcdMEQnKrbM3Nij0p3qSpn+KRZ0ISWBchMEwzxMAhcarJSYJTSXlF5QYcrBtBt2MBn3rynK80W6DfADQdpYuBTsj6DSRbILXT8DDZeAtn85vEckx/EsKLhuwkaFxk+LMqvn8+Zlf4+yM4HlOBc4Ggc0q4IN7/VUM8Eqi9n12Doz1mXsrFsOOdOZ/N5iPutpYpb3zsAL8+8/ltzXhSRRGJqnDfC0pwt3IKj9uFLsQ4M6iWmPaRPs9wshO+pU+HZdFJny1cQecja2mMa1wgQmp7hlZioxMIayR93b2qdts7BBjw== 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=xkJQcmzUII00v2DqKXCg3TSr4cN/9Yrc9HHtUggOspw=; b=PhMivvB/XCyRiJzQy+uz9pttMpwTpnualYt6Bh7s8dLEuB0XPmwzEe+r2Wkx5oqys7nO6mqbeUo+8HQAxjIXJAY53PV57hUXQBHmi3gxHDkOuDKmIsGkWZq5EGj0bBruDRAWIqN082zEwXg3zA6/cG9EtW0yzFjZc66QUMqaOyU= 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: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:41:35 +0000 Message-ID: <87zfprx0ld.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 078/113] ASoC: codecs: ad193x: 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:34 +0000 X-ClientProxiedBy: TYAPR01CA0142.jpnprd01.prod.outlook.com (2603:1096:404:2d::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: 35bc20cb-8d00-4bfb-ca59-08dcb4e75bba 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: 5Xv+47CLAaztOvC65YrcDvfGrShsWC5sk1+SXsM2EGOKmboVPxRQuL/TIYiShfNTf9HejNrYQwzpw4yCDQTtSD+ipeGVaP9/vsOHN5PVdIsCkuflN1X89Uz0hNtdClZDccN0MPx28vE9/ej4i+JAxnHEqlDzIqC5IocM6BHfc7juSZeYe/Z+YLPCSRyDrT/3HvEcgQT46D0NO7pxftv+eS0R5uwqjd450VdYAsB9I4ZAt0dlKHY7ni6eC7E538YB5zIRFzdkGycKC0muhgLWwBHNIuRZhvNO8p7baNs6N+nHSXNDBxPpDwMR3wWCwxOWeDVKR8X3+ltJh7Qyhech0QBUtLcxl3ZvxmrHG6r3aOhAmN+g8O3LML3agLiYs97eOtRTlLduh6/Xz4z+yjpNKbTjCEVH2Twy2ZDVulrwEwZqaTSjmVeh+Dp2toeSdLtyFPKD9rv2fUF7fyejpllqCJ2mcM5RpZcE4uomGgX1MIiRzObOoOcMyfWPZ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116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VzSbs9X8TDGOOh4F32hi+N646K7EuplMexL2eGmg7IdW1LowhtAaSbnoUycQ5FeBhcyUeZgV8jkxpSN/1KOBUMS8/kevE6eY7CWL2Zuw7LqVwNd4jQCerIiug5TbYqaZ7v3l2Jef5Tq1T7Xs8OETm8ssbQKqU7scXn/WPX60N7VYohWs+xTdUom6c/iu9BnlxhY5geoqxopPXQyk/ZCxciYN3qCLs6BIXchXOFcju6d4Nqpb4gy+DbyIujxQXWHo7z4GAea0bZ6833SCyJ25bUhz3cteEHkwk5cANXQR2NpExbct1+nB2E7loGgQxU+d8xoKmRo4CCvsxSlpbcgdEdrr5k+sDuDdTUcbMFt2+xCoDah6fw/LS9cyBv0IiT1H3aiBMo4NjOKPEtYWbmp94pQ9fui94S5dhieEerM06B1X5S2hNxqWjzGK+BR+OdssQNmwFy9TNfjiwFmjevqDui/OfzxTN/g326zSi6P7a7OAXcf1vyzKDZgh9KanK8hbGQkYTZjLSjEZXi7dn8sLHJaHarFduiy4JYTTstIucqvAE8NM0imhX55/qajuGAk6qKWGU76ri+SVwpoQLkt9KfBZWRox2WxOpDwuWV/GR9vQc3GnR2wv7U0RZCRa3uMCpEg/zkSHDVhtEXCn8HAwGXYb8eJ7436G/x05OgEKBIQoiyc707IRiNSpd5QN1oCm/8LtLhQ/9jgu0rkOyigObYAPzDm/F5IVigVqURPTgFFITtpWG6QiaZajhjIFoCwBxVXIe7N6pJmXmdrodEMJuY3tKBr90ZmKrlFIZech+LYreOlaeMDBcOL6dh/dGqj7EslHFLi7EbmrVknuS1aIE/eiGSUTDv+wy53MLX6yVYciemBy9gVdjHhFfss24GyjqHSIIJJBG7Rv6M6B4jKsXTb5OlhkPlhEB35Lkm3pDpWpwev7PrWG45zykORLuN5m3NlRjQV15xTEyIMI2NR0uCj3rC3Fac8FWFHpE8803Zzvx4w2z4lpR34MI5LN9QXYx13rbWiQXZMexkFDJC6PQpFOuWuWeHOfOuUxMj2HVmdwCnBUlPbPP+WPn8lG5DZ7BMPYyWZRYR0/V0Y6moZm/4KcLA++k3L0qTRBYw7vyQfLeWTy1BCzJ0o9ZOgHz0jjvk3yxMZWkOekZhFrf15sVdY9i+ARf3zhwm9QFJhnASQj2rj3nCNApBVr3J0g5Jp6yGRitXHgd8twyvl7YdiC2o1s4sFyhUAMjI15k7OO9zAAPOEMXMPSip7V3OHqlEIkaqOxc7ZMx9mXF4zshxChSMv7jHtTQNV/YRGyaxsv/W27HPLnQv+MZmLNz73q+40kC6ewGZNU2TO+0cZh/e+Yvzfv0mW5ioxLIFRQQfRcONrJYiL3/1JCuGfaUChAbbo0bp6SmmeYHVp3LZFYNVfbbpjskeWULdswm7HLQuwQ78z+RxA9GrWa5fQ9VjBI47CRPsHNTbzcbXYC9Ix9hhefxKkpiOAJP9Fy55m68XinyW1+nWpigqrvTNd6KwZzMLVM93K61JNbsUyTOHCpzE/tnvEL686rbxlQsAmyeDyqVQ11brlKLbASh2W9Krv9DTtJvckQKqHvkJ87gr5fzEAQ6pwsZW1sDapaTvLcyXDuwjs= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 35bc20cb-8d00-4bfb-ca59-08dcb4e75bba 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:35.0256 (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: 7QM2mQXDp+z89x28zi9Za4XRF7cbN+pbIVL0gBtwcr26t9LPkBxmowavAqBt+eyyCIoY98RKl0BZc9t3ZkYz7ehECc2DoQObjhodCJtOGMC1EU+1VgPWFipfQ0sxyMX/ 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/ad193x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/ad193x.c b/sound/soc/codecs/ad193x.c index 1d3c4d94b4ae9..34c309c0d96ff 100644 --- a/sound/soc/codecs/ad193x.c +++ b/sound/soc/codecs/ad193x.c @@ -316,7 +316,7 @@ static int ad193x_hw_params(struct snd_pcm_substream *substream, int word_len = 0, master_rate = 0; struct snd_soc_component *component = dai->component; struct ad193x_priv *ad193x = snd_soc_component_get_drvdata(component); - bool is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool is_playback = snd_pcm_is_playback(substream); u8 dacc0; dev_dbg(dai->dev, "%s() rate=%u format=%#x width=%u channels=%u\n", 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: 13752908 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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ECFoWOFaFsA7TxO9ephWvxyvME6JtSuS/G2/ccrjhN7Kq3yMUk97Ab8RJAoxtIH3tbIjRFcZLnmg32R3GK69xeT5mSISLDSF9r0CDdax3QoeJeYH03ioY8W2ubaDN+0OCNa6cvpxZepE1jBS00JC3iHER9no8cPJ84/NSoOCVMdzNdL2kgfar8Ai9W0wXqyPIRcbIDZxlY1oBalO9PcqMRJTg4dtFXGv9HITf+BGCvmIZaJLwpJv36FIv9ZK3ICunSztbEMjUlf8J/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+eOM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/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:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752909 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011036.outbound.protection.outlook.com [52.101.125.36]) (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 964E318B14 for ; Mon, 5 Aug 2024 00:42:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.36 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818531; cv=fail; b=F3wtgvn52WG4EIgod0DWtVt12y+y7+livq6SVk5/n4OgJ5vx1DDXUP1fSZLBMJIp5rHw10kp4y/gmFrmjPyyzarUwas+XXzK4ZXx6t2ht46+pGkuTHZmM242aqqJRluxY5Na32jMMiLq9MAhuOvzcWAgmUeSMQIcazftIz2896I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818531; c=relaxed/simple; bh=eHc0IA89H5dGyNCld9zIKcIGc5kTMyrh/c8uZmblVL8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=mR3vPAmLkqYts+HxcFaaLmHqRB0vkWRsPLqAbZZ6ZryivvIkN8XJGf3A7s0MIBrMElyb9iYhXuphsi5xM7YWhTXka2zrEJb5WCEzAo2nIDicEadMXQroYoDERzg6yBrP0gFwUy6qYWE9M2NRa6eVFhYMLNx5/oKkA7XnF2VgKj0= 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=VfHqBBxE; arc=fail smtp.client-ip=52.101.125.36 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="VfHqBBxE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BPNR6ENAUiAJDXzwZR4rrHVPTptDD6L/CxJLqi/2ROYQ2n16Uabt5VtK3AoXrSMnRq0RIp4oAt0iICQd365baZgam6BwmB1a0pH4x4qmvtTcme4Ye5EbEC73wr9LMphyYhR/JiKif+vZdWvxkpuNUlMSQBIxdGyxSsqcR0sFfq90yeh6iWDS/SH+j7P8UCO/WpXOF/LUqoYMbpKaul7IDdVdbWuCHe7g5YroJNbctlptDUDwTlNRsBFMgDeNrTjXGsrJpzL1ZAFGUflNBZi98h6JzDKrdn2rHq5qyZ+1jvta/VB5wX9QR2iShcEg7V2PqcPkKneW1wvcqldno1GDOg== 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=tRUozKlejGwEKAtGbBxAHzFkFIpBOaNQqY5DlT+OePs=; b=Dcl4WuNLX/YScZOg4IJRIDmruBu4qfL9chDZNEzpVHaRmePxettQxkU8BuIDwVbbGtezOJjYxRWUpWY6NfRZnagsAfgrRung38WbfhQrlFWwVA9dLq1xdMbW0W4aejGMQBjOQiV9UYS659mEakobfaE0d7PIontQVG7C85qfV5KXCwUcY7KoKIS7je/XpYdtaTC/2cDTstQiaT7DUQUUCdhPTb620Ozv4E6jp9iD6RaNnkPICogtvt5sVNF7EOfad46Ps6NbluutFIEvdN90ESzC1nLt54sZ15gAeI/XdpZ6JmzaHFFnhOWKlvtB3bohDFp4ZLtQIw23GX5SGXfJNg== 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=tRUozKlejGwEKAtGbBxAHzFkFIpBOaNQqY5DlT+OePs=; b=VfHqBBxEMpcM2e7u4PCZPI53WetEyffS5NJTrvNMtl83RksHom9O3WGSC/LceDn0y82oVQRLAVdGVyRDNt4Zf/J+rtTu4oIZPLLWq4mXObOnNPlygpaDLA4zPaswE06CC5oTjDZRzR3fZcRxvyrZd78bgyz3Wmhq+TlnOQ6dtWo= 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:07 +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:07 +0000 Message-ID: <87wmkvx0kj.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 080/113] ASoC: codecs: jz47xx: 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:05 +0000 X-ClientProxiedBy: TY2PR06CA0028.apcprd06.prod.outlook.com (2603:1096:404:2e::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_|TYCPR01MB8678:EE_ X-MS-Office365-Filtering-Correlation-Id: 99b6ec1a-9c38-4959-3d62-08dcb4e76dc1 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: ygmmRPUVIv/nMf40UaGIYEGTMDqx/6anaDuVvMeE0qmtpky6XnFAMKBe4ZAlLyOa9A5yWpVzt/ec+kSKkq7OhMQzv3FFitofmoOwLEyOqub9Cp9Avgwb+ysP25Kds/VoPQDSUrMhvB5PbOT9VlXgaKXndMk6i8Zh9lz0SG31iacYV3gr1pnmq29SPKGUYMTdXYyTvKnQPiKCHKJWiQzW6GG/Xp4Yf3Y2ALfT9qB6VnaQ9e1Pcwmw4uBtlHy1O0kyxHte73I3T3dDa/7fBuvONkGckmIWFgmZ67rjvbRux96XNrOSvcT9Rm7zyR2XcVg8lMADfqxwZU0mY3s+sK3xYKStkZTQFiXX90OKBZq2iXDrCPW2f4CWGXjIWmlO6kM19z8qfch5KtNwWQZIsYPHbgoplHM+4kJBT9KQPXB4pAXTwEIXqIuc9aBVI1X9GsEwYdXXmtaDZcvznkqfIF750yX2MBPh6LhUisBdrtKOdkI9bE4QUOTX0Oeuotn8lHje9GTpEWpLDYIeKX6U0xZ10qYK1nknOfIZQ4uVo7BZbMsH36FgrR9ftNBczXp/GS3ymqxhckwY8lQJzh5hZCiIPf0pnykoCpQwniwny12Oj55OX+6Fm9wD7znXjxIfhfIJoxiPeTiPk+DlnASTjeuuNFHtD/+SFsGJ62KCFXiZtYmclJp4hIvUu89j5IVTIMifYXmKLAIpTs6A0kFOIvoTE2w6Ov6upTRNHKUV/JwO08lVRJX81LQuROYU8Tv2cXrOo4Ub30zJabXyVgn5wAyRrV9R37r9SyD1XzGOOAT948SxKfpSqObzoXyiThVt+F9MumQnABTP5dVVqBchV4x7gi22j15D9ZCKzAoUmhidVDPgsEXs251j+1CWUjNbpPW84FqDtA/l5D6Dsi/7EpI5/b3oU99cVkx/lVCOHtFRlydXahpNpgMRTuyuWjSxvCsgV32nDsBtHFsnNyzXAhBJYbuP7iTFNidWETlFLBhGYGyzGPPC9GLHemmz07O4CB72zD+g55S7CrC1qQrU63XFDsGohIgnwcR46OFyphUtXnTfd3PQxAv/kf3X04/VhhQRxQtz1Pf0MaC0TqE0F9NwI/cQURWiPIWsyzOyXeOlY18yT0wlc1IpPgDG3xbxGrruyb3XU3nGQUBNmmU0Er38Tw/g4VbhtoFTujRmGa7uC8j8FHJLAc37oUycNjoDFxe5BP8CO4JUO+AdgylLxLdbKOxKMogPza6ZrG0cZShWoPUCdk8O8GMrDLmGv+mTuevxeKTpfwEc9jgjgcJvYlNWlKcKyeFJ+t2wsse4MYHYZgMXgFsFRGAonYAEgV18e1Ase3DVhSBuNHPfQGR2/eBUuDj3Nu9EOmmBxmB0wJd9VkU1CAtDwEjglucr6ZebEpU8RgsQSkgDZHcS4P0ilRdZtw== 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: KQmBvdZGI0RuxF8p552d3QfvRZgnq183lNrGJFj1KJUnpLngn9gjkbSbHoapxmbvGAnzzGqxwI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DQHw9ljPkAy1mTlp5tJ9I+3tvUSLjFY06EGkKzl/mmh4AFwlkfB5MwbHe6MmfA+H6Pl+Q5d3kCubgambv58NxD5pdBACks91hkjGufuutGYuv7uSOo23SCjmsa5g7dv3H0EfdItApebTLGPWjdVytkfRTLDxrcItQjB3Zn5OYs+lOw3xJ4k8B+gBsgJPLvwnDIOpRyovzqNGA256ju4KZqyr1cc8phGBcuANZZYgXWXnMqgZUF3AabuHbLu75ty2mEOIWE7t7B3BtrEJCykrnufkt5Y6oxqBb7W7cC14IKu/VCKeJuwaEJJdUSSZX3+CZvs4UMQnNjidwS0P0sXCf4ytYXjTlaN1tqTw66aWMahzYqtPtS9uLuIO98e077hwKm4erkneHYCKvi70BlHt+h4xMEqj7dSzxjcYM+4KwNzu9dEF5GfO/SkeBMBPqxapwp7lFVKhbyf8jHq5UsQ9ctb3hASNhDdRbHKw7D8GHncC3pBAhbMQ8o= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99b6ec1a-9c38-4959-3d62-08dcb4e76dc1 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:06.4884 (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: M9YpIXzEX/410y3gNnXlI9xJy76qU2WxDvepLbKEuT9FAmr0p8M5ivAasL5Q+CgSbHCFuOC681AKFzMFDUYrTxtgCuIblryd5tVJHd6WcgD6MBgGEYmgIkhr1XnMLNRs 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/jz4725b.c | 2 +- sound/soc/codecs/jz4760.c | 8 ++++---- sound/soc/codecs/jz4770.c | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sound/soc/codecs/jz4725b.c b/sound/soc/codecs/jz4725b.c index 39cebaa167beb..7add57e5c4bac 100644 --- a/sound/soc/codecs/jz4725b.c +++ b/sound/soc/codecs/jz4725b.c @@ -476,7 +476,7 @@ static int jz4725b_codec_hw_params(struct snd_pcm_substream *substream, if (rate == ARRAY_SIZE(jz4725b_codec_sample_rates)) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(icdc->regmap, JZ4725B_CODEC_REG_CR2, REG_CR2_DAC_ADWL_MASK, diff --git a/sound/soc/codecs/jz4760.c b/sound/soc/codecs/jz4760.c index 6217e611259fe..f39bb0dc93e02 100644 --- a/sound/soc/codecs/jz4760.c +++ b/sound/soc/codecs/jz4760.c @@ -205,7 +205,7 @@ static int jz4760_codec_startup(struct snd_pcm_substream *substream, * DMA transfer going during playback when all audible outputs have * been disabled. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = snd_soc_dapm_force_enable_pin(dapm, "SYSCLK"); return ret; } @@ -216,7 +216,7 @@ static void jz4760_codec_shutdown(struct snd_pcm_substream *substream, struct snd_soc_component *codec = dai->component; struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_soc_dapm_disable_pin(dapm, "SYSCLK"); } @@ -231,7 +231,7 @@ static int jz4760_codec_pcm_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_PLAYBACK) + if (!snd_pcm_is_playback(substream)) snd_soc_component_force_bias_level(codec, SND_SOC_BIAS_ON); break; case SNDRV_PCM_TRIGGER_STOP: @@ -693,7 +693,7 @@ static int jz4760_codec_hw_params(struct snd_pcm_substream *substream, if (rate == ARRAY_SIZE(jz4760_codec_sample_rates)) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(codec->regmap, JZ4760_CODEC_REG_AICR, REG_AICR_DAC_ADWL_MASK, FIELD_PREP(REG_AICR_DAC_ADWL_MASK, bit_width)); diff --git a/sound/soc/codecs/jz4770.c b/sound/soc/codecs/jz4770.c index acb9eaa7ea1c5..740b4e926c76c 100644 --- a/sound/soc/codecs/jz4770.c +++ b/sound/soc/codecs/jz4770.c @@ -224,7 +224,7 @@ static int jz4770_codec_startup(struct snd_pcm_substream *substream, * DMA transfer going during playback when all audible outputs have * been disabled. */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_soc_dapm_force_enable_pin(dapm, "SYSCLK"); return 0; @@ -236,7 +236,7 @@ static void jz4770_codec_shutdown(struct snd_pcm_substream *substream, struct snd_soc_component *codec = dai->component; struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) snd_soc_dapm_disable_pin(dapm, "SYSCLK"); } @@ -251,7 +251,7 @@ static int jz4770_codec_pcm_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_PLAYBACK) + if (!snd_pcm_is_playback(substream)) snd_soc_component_force_bias_level(codec, SND_SOC_BIAS_ON); break; @@ -730,7 +730,7 @@ static int jz4770_codec_hw_params(struct snd_pcm_substream *substream, if (rate == ARRAY_SIZE(jz4770_codec_sample_rates)) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { regmap_update_bits(codec->regmap, JZ4770_CODEC_REG_AICR_DAC, REG_AICR_DAC_ADWL_MASK, bit_width << REG_AICR_DAC_ADWL_OFFSET); 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: 13752910 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)(38350700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3KRoIbKoS5fFTS8e9ioXevBD/gcWGJO3Rz2oIbWs9DYIUJrtF5pLcj8dKsJe2vRKywLyAzldRu9Vjk8jDUB8KZrM5mDLkn/cKiVG8eZ4YoUOdk+n7PRrsF+S3IDqlX5ojY4TNUxCsd++ZEv11FmkdbuKABKve3QM+VOVdabHLfUqGzSak51MqSakXKIkgOZ3NjoqtPOUu9w3IOL7GeaZoos1cPM3wygQhHjKOWnhf97X7pBYsHnFL1uGH9tbMtHp2YYLs4K6QhHY0PVsEre7fcUyBy2IP3DG2xD/euM2EPKe6h8Vkf64qcefcmeaaPxGLKyw4YigEM3ySGVVBwEwzPWn0c96ycw7OPpHcxuV2VsTWMVboGMLdo/rfOE8MCjFSMBfpdejgdoXaLrnVjsawnY+cCad3Y6LglZniB/BYerNVZQbIV6xVP+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:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752911 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010013.outbound.protection.outlook.com [52.101.229.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 436B71BDD0 for ; Mon, 5 Aug 2024 00:42:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818543; cv=fail; b=aT3XVG7Dexuv2y+zkJXJ41rRnuVVYH0SUTgUtVOcAauqElUCULMXPxFVTvFzaMd3zpzj3zrDl2kJxx73oSKUYGCwdgQfEEvwpZNzVl4eKsjML024mMx0+/41vmjRNuLfCLT+cwsKMga3B79IZZYbFTShkBBjvYQuDzsQVzxANf0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818543; c=relaxed/simple; bh=sUbSlC4pHZ0eRcGv5SyBGJKHaXXcIaAFVvJDkgdORp0=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=fNR9lwdCJNu+8XnvsGb6o8lOCkT5irlPM4eSUQyU2XOF4kvLx0zWaxNRH5Mx8hkrAD68DUtHs0kyAQc/2eZsa+dkIRPRMEZgPUPRgnnw2DIXzcXAUn1PZak7K9KqUARZ+LniA1kEwIb4oPwtjwem58FyJHXZ/+NR6QJzuIYXnyg= 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=OgzEbG5q; arc=fail smtp.client-ip=52.101.229.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="OgzEbG5q" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QpID/ipf9jaFDFldrHS2Ee2cS0eTCpXzQsOpxelJFWkq1YvaSGTAAhbDa9V9xm02hA+I2vKdB8Ohr8M7iS//KwW0s+hIVpK5mYdrQ9XHDUlsH8yu5QpK+DHbmKg+mlwXAHf/cv07Mvf4l96es2SOWlQDw7ixLw45QvlvhghVv6fibZ2/6wPRS+ASgEMOeBvO2I20+jfrc/bNE9THli8MCLFU1VtbYBA/XX5cTZxW3oPnTRjpVr4oITjI+mOnO8dZUeCOepyaF6jN60VksGbTfFvaOlARxGp4v6DEam2MArGcU+qbQebletNMCnj8IQtezYNCoZ99HapA7eFjk8wF6w== 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=h9pYEbXBKX+zEsHuOMvJ/fveRF72+JbVt3093IImBGM=; b=fVdP9a3cR1woRXxkMiBt+xRsQrZl7QirUF35jeR2BWwfaYm7RxoUR5e65dvBFsAnCnTQzKkQLEzXB/Ifj4//XHJLKgm5GQ2etYsfbRpEzwbtC/+m76pUUU0Pc+lXzPo3iM+L6oVkvmRaQJfeKQV3Lay6fVduqNiH1WmZXXe/A7SS2See7LSRpAom3uery1YFU3LRWpHs9Yz4rYVlaKNOZW/fy0Wx6K3Rx+3C4K7LLHt+ioMWtBmqqtlblNlPNHowG1V+BkWm2IeKyCjyh8uwt2MpDHlBiVjzROqQya08xs9avXAYbfMBxS906H0vHffuputva3aUhVWip7dY5A1BBg== 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=h9pYEbXBKX+zEsHuOMvJ/fveRF72+JbVt3093IImBGM=; b=OgzEbG5q8IB3V+/zBdwiMCald5p0WrgqMWHMvCxpbw4upy1YYP3OdBv7W8qnAz0d3ViydmxzWqTCrtX0CKVJ2Wedxf8Axq7yassFVuiC4VqV3NNcv7IHQc/JGKUMWisGfF+WFE2h4PcRjsZthoONOEbrJjIpc8RXOamG8zHvR6c= 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: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:42:19 +0000 Message-ID: <87ttfzx0k6.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 082/113] ASoC: codecs: sta529: 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:17 +0000 X-ClientProxiedBy: TYAPR01CA0144.jpnprd01.prod.outlook.com (2603:1096:404:2d::36) 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: 4c85843f-1481-4be2-714a-08dcb4e77533 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: k524mGlAo6u+5cPpMyn9HNRleZw7fhZZc7fI3Wc0QHC9k5SdbwtCd3z9zRO/kzmiOqDrn7BUV5Torx+1OmcwbVqOmnip0BJOOOYmrSqvUqWuRYqvcilm6BdQrNeB0lNdOkNSmruqdy3eWf3pByNmO6hhM6xrnrV5GpNoe0UvTaU4bhIi6eUhKE3ldR6hD80DmldzNdwkYlk8A7WOuFOiWzxdcXFdSstVicctJ6Fh4GtihR1Svhvoey6VtbXjuKqu48Tf0dQ3rJ0cu/fA1oxJJQ8qwJLEGoZ0w9KVzF1f2+Pid3XvpMjzgwxNWe9f6b6i81D2b3dz5PlC8ao/0FrxQNDpSqguqOurmFD7jo6CPAVnfkUalzPJpSiCrRa1pTLw+9ASNy6iuOr7ekoKoK9aQST2RvjEdnS/ywEDbwv0ZqeuTYXy7Qk7OIv0CA/PPG78BYIbl5ps7ZGrBTO5zlWzJYG7qweuqRT+3yLswZknSwxjplrzHHBcglzBYAO5sGBtwQYCDpv7Whh2mqmqtuO3kw2d3BO2KBJNkb3EsnbnE3B3tkfx3ylnR7lf768C/Su8kW28Kszxa4tQfyMi07zUdNvQPi3nQpllzunnBRLpNvcpa29PY67UOSoN9NUWSLp3TvciCdk2/wNH9Epv3+OLrb4sUwd5itha2mCFDgDzqKl4A3w4KBvXCTjrmLl1dxAMVHGP1wz7YissHC8hdNpBuNGZkCxBnji/teMEp5JAf5LrnHP52LUbi+aFJpRNyQZRUHaVnkO77kwFcer10aETKaQV3EfLP1OZ1GQ7EZkbIiUeeUV/piK2wB94wz/0QYQKdtlDIrXD3GprAzKIsqHQ6D8dP0uONF99SmR6mjhPXjjnogaonUzib34e83QrSRjDgvqo8oNeU88ifkBpAPPNdgiCbSKd2AXvA92AtVZoHrHONyjES3vTkyZS1bjZpokuJ/QN4xsGA/ETSuWS7lgvcxbSUonSBBZP/E9rzIMDaDZ/elWpa6xw87s/F5E4AxUnzLa+DC19olGz6dd1vQBhYuGocoNMb4uQinvD3fh24V6KHJXWi5REwzX0uD53ivCKxk8nN8PhUw5v2PXKaKLBcESvsL3EP2EWtGb7nF/Hn9ERVdd5kTNusBAEqP+LM+BZ0MxA7lb+/D6PD9pFz9YNzaOIxZRWmhm9vNsAAkBLymPXNjYQYLwFoZHdv9OF5lkUHAYQssDtmUfD6FNp0QJlV+EcyI+rzVzl+RpmRAjJPk24PHPXPzeyxoD151LDqjjyBmbW3ic77Vl45NK/+I+GP0c076tIe/kzsXuYlzyfKslsFjkwTDQr6bj6x+8DGm5btcuiyFTdYLtmmsGy8mK9Vnw6i0V9S1ukq+kKkY5SkCvKTNWGoRDJrNT3Q8ZvLYKgKON8tNOAp/4cINVp9u86FA== 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: dZNOdN7p5jK2LKICA78TKqwC2HC9t6rxmjVWT+/RErEe8m/ofi/wo4NSVxfv3QuO18pxJADK9S51RaNnut73lP7NLyXJ1er+38dyj9DdupMobA9kgw65ccQJdIvw4K2oGfZZ70qK7wIYO4JK+i847Uf8wTngpSF4Lvan9WwPFqf20Ksl3AS8mY6hZtNFB0UlXS8L7M2lP9ZeD9BRQF1ig98bQ14iXSIBLQ7xxFuW2mb29RnG+U+FqB/ah71xOP1X4qgjkbCAw7l2iGWXcWS8l/QU3anKbWCyvXcH+LHnSj0guyjJprFI97kZQqTDFIZlxx7bT4J1oZoTIjRMX4UXkQNVuJaTv+vwoRfF/o2CS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xNAttQ0Y1MDct9TWQ/w3Z5ekOLhuJJbvOkEQ3metMlqjEA/7K14QIzqpdVeIZfgFQpi46gRz9HC7GBmBbsrAQARuvbK+iJl9BY4XUndWyI1Ja9lrIMoVEXvKrDztXZLJZVViIjITtowRC4I7+7nDELw92HSEyLK2eNFmcLkqKzzUPJ46Bl2LxOAAVDBHCwYLbdOGTL99N2eKXFADrOk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c85843f-1481-4be2-714a-08dcb4e77533 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:18.8483 (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: zxtmeDGH9n3Q5j3c+wuxTxIdKDn41N4S0R1IT5vgdQtUAlazeunmVQB9fL0KJ8j31NNW9Wumklrh7TOmIgoSkfLzy1gxnifH23vvfC6TlYYn75EK+z+1b2hqyHjhzG+g 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/sta529.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/sta529.c b/sound/soc/codecs/sta529.c index f7718491c8996..e750536b1f740 100644 --- a/sound/soc/codecs/sta529.c +++ b/sound/soc/codecs/sta529.c @@ -232,7 +232,7 @@ static int sta529_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, STA529_S2PCFG1, PDATA_LEN_MSK, pdata << 6); snd_soc_component_update_bits(component, STA529_S2PCFG1, BCLK_TO_FS_MSK, 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: 13752912 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+vrv8XsIeIbxLsiEv3X0cMno7kWm2FbwRkTW5OUsXyZxyl44IOLmn5Nd3GXrz3qY7hWcZ3WQqOYCkbhWFJ50DzZEfmhji6siZRoTnAXE7tgOK85XsZJAMRq1JNlNyM9g7nL+O0w117hMFAYSFBa0apaJKLK/GBe1KwH4OF1HQWr/TzfH5HBvRcnCMZLHeKd/g//+5yFAD7lqGOlSfjR8IxytTPVG9H9zuXemxFwUchRFU9OA0dnxl/izTR3kdNsMI7e59EEzJ582a2tM3B2MwrmR7E1l/cbvkFd2YIOBdLbhrIut7snlQz7tz7T2AVcJRy248PIpBph28HHX/mhqoudMsXIVlB7aasLn4kcYxvfJ/ZsD8ymfBWek4k3Ya8NkljDIMKK+fq/VFEftU4lJ1+axXa+7HFGemLoGorKZxvb2Jye5IMyuEkJaOjvawYQnGqaJ0Ty/RFjehKTAFP+WrFHZ4vo2EqMjW8H7HIvx6oSllsi2qwDc2kd5P4mMCpPZAlQY0FYG/xoCtc00n4SdwMV1F6HZPaSb8COk6FQz54hNQiOvUlNeVnHgCSMEeYQKyq0aMv1ImYY8FIiVVtUkU7mloC/3xMM6ZtsAcm5PzXE4W9mV+JjJ+YN6aZdHT5Oe1lZ6ajH8pS4+hC1gU4xKOHM+kn00j9IQtWR2bXEojYrKq1eWOgo4MHemheX3UyrHeWxnCY6GNb8ocD63jPxKUaJYAiFqiywftxJ99vnAJih8tkk0Q2yR/vyFsSqq3/H+VSNbzpuXOZZtd9FxINQXkfovx4fSzGQSgjT13NiZcIHavdj8b0SC3Y/rZOVJN3r+pqP6HKwO2PFgO23iwXrorvSYmxGONUTbX+tkpMUzKaE3XP89WSlre1DLT92jeCf6dgW9b5htvOxUNHgaxsALG6mXsEeAuwD89FioAQwIm77V9fSOuPq5+bUcU81CLmrHPbVrICMFJ9CDHsLezvuk5x7BuBlNpGBVFqiUPGbDf/v5Q3KkCbov7HXuCypbKyjD6/1H6Na3+fokT4r0e1NCzZOHGfrAyr9jUhzAbfoybWvYwgcSL7exiGLukQY+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-Ant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SGqVCBkRbt7X2IoP5lRHq7TGtp8lpw7c072N8HxdkHKcQNdhvwRwwUY3c99a/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: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: 13752913 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010019.outbound.protection.outlook.com [52.101.228.19]) (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 BFB7F1CD00 for ; Mon, 5 Aug 2024 00:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.19 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818553; cv=fail; b=epbMW0PTg+8XMuXrjABOmUvPHTSowrn/UkKRj2bUMjwoKk9Mtv7Tc0NFJY67dckXb/Yknm1VmchQ6d3t8Q5GxzXNgwQug2P6oEEEEo4gujGHPU6ruwbAPyxvubqPIuDfP9DBSjFQEEO2HnHaXMkWwWpUFqwLWmsTnhQcozMvHXE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818553; c=relaxed/simple; bh=1iJwTlDuoNnHR56qO2pl4s2uUPPLG7A151lRy/95UDo=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=tGZgxTBzUeCf2MI5FWqJuKL4t/89Gm/PcroO/baNm5t+07QTJLLOeBvvC24YKj/Znq6gC6PIvhp0+aNvcCd9FIHtiXETcPru0a0k9xRoYUFZUhTbaagAJWNRgGRxldTLycp0FvR5fF/la54s8Ffu9TB28p7JRRbpdN47mm0KZgk= 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=A6xGEXsg; arc=fail smtp.client-ip=52.101.228.19 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="A6xGEXsg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PJy8oNjawMtxBJhe2GtA2luA32rLdCFPNSpSytabMVhCPEofbAHOxk+oMY99BbzSFmmi7ZQWBATjpsSh5BMzlciSH0i7h6xIbZKCC+A6klXPF7QQzapFlc/jOhOCUi3UdhLVwj9q4g/cD24k44pa73t52ovZwRTOw1wEzDl9U2B4e7cIg1Pc8L4gPWsaDrqcnFKJy6KFQyL46NQbuFi1E9jyRsJeEawuJccg80Y2Mf07e4DMZ35Dtl3OnWnWqFyg4qDIgF+fQH+Uk6KqC/W3KGGdVkps6P6vAtyRVZLXXdaBkW3VbcnkXWZkEk+cAy7BsQxUWXTedyvsEoW1NH+YdA== 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=ySU1RJo/vXUmmy68/9s9Q1TsOLxdKsxJuG7unNhgLps=; b=xyODEZ4llP+y4lDHQ0IyMO9Q5ec2dcMqAgPhD1lDhhf3YYv/b+A+TAFfBHhj65/nz02STxRFxv9WEGM5K8Jmd496R6aE5PjqySMNuMHNpm+6RAYpmFtCzRxFb7msbrhAzftxFemNVf3UJxqExP4/xbFDzvihNHxX/Rjs23pifkFcm1BnKMm4ZDU3TNCFZIDSovv0u3jR6qOaE2WMYBBXs9CeZAh8QXsPCjQSLtYKB0pI9EYJDATTOywDJqP2IEXONdc+ZAia70KjthyTfv5KnM5pnG8CnoH88DixU29n1FvjsRntqF9U34QeGI4GX7AISv5ossEzpcbfncoS77qcuQ== 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=ySU1RJo/vXUmmy68/9s9Q1TsOLxdKsxJuG7unNhgLps=; b=A6xGEXsgzLrgdrFUXWNNSE9RffROaJ+tJTrDLWA6/J2tjanpcLdUf4MxQVMb2nPdBI7pwSbPOUB9rv2/xUtIZrjdRDMNTcszf/1L0DHD1blw9YEFeZIM9Ko19ku7ZkBQwCd/BhX0YnMDqJdhZe6p2/skk/sZSaqb2OJNU4m8Evs= 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: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:42:28 +0000 Message-ID: <87r0b3x0jv.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 084/113] ASoC: codecs: wl1273: 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:28 +0000 X-ClientProxiedBy: TYCP286CA0148.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:31b::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_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: cee9efcb-8ad3-4fac-8be0-08dcb4e77bbe 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: B1mBWL1eXhrodxWmY0JivuVw3LrWlWHtxSToIkCXMcVcaDHcKdj4ZA9rQ7QPb3DAztXS3pDsloAHLqM+bd5Xf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skw9/LZWRaC0Ws3v8iXYU6ixy78c0hT/Qtl4OPwf6l7Z8AR7NeZXv2DufVtwAWqxRuvGsCqKgETgIsQy3gseQnu7kai5z238/b4RRwqTghyBF7/lffhZDv1sdJdsmHvvl6NHWoVd8G/osmoOwfV+0bbPY09YfWoKCSsxSyTAQCfP4xPT0Cm5m+r3xHIlrs5GZ4kuDURpxDeE5C8ABpaLLXs1qOFP1fioTeq0mMfiIdDBvrJK3olQ3g== 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: oE2le49RxxOEnVgMqu+7zzBtn2SvkTpNg8kx8irOo8QenRTh1nZp2izm73NakHvYx/u4RKkcUQplp00K0FXjyrj0dAuZQiW8BnM8apUaRg9ZBcEPrrNIvIYbpAfG5NZSwG6XTddTiU85ZKvoggjnm14NUB4/5QhXcl9l9TpGRbsA5sg8o7SlVYjqHlZQm1oAgEOhTmbKIPAEZyqH8KzuPXz4AE3/SVdLTWQSnIRxZ+GVD/7R2jM0K85ZO7NeRWvpPgB7xGg6lIeeqrSO4vWY/TIgeOnjhPCL8WPGh56v1rofbnhCgWlNYIje3Dux/pnJQw4wTksH/WWXMDmxZJysMcM4n1thTIPqkEIWJlQa0O5h8oYTek12PCmJXlcYbg88dg9aIk4wE3tCKEQaYn3wdBE8+aigUdrXdfldnku93vIkIdT31/fsKt1EBcxCLoGCtKqS1nt4xz8iIfIrjL6XUr9zg57I/j7nMN/cfVaIk12bMcEHR/BTt9RhMEUFzOnZ1gDsarM0bzYim/mCI0lvs4e2pLIIx2tEd4SRClXktM/z8Gl8GtL6pCiACBSL1hqfNvZaQ7Etw/S6diIWMXgHOU+SgU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ant-Network-Message-Id: cee9efcb-8ad3-4fac-8be0-08dcb4e77bbe 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:28.7782 (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: yIC2uXeRPM8qXThYCPciLJ09ZjdHZKmoQrhV7/Ma/ncWz6ZTQFUYHxykgSxz1JXUT6/hXHFYp4cCVsbccjHKfSA0LWk5CG+569hWZX7DTZaI/LadhPMYZ9n/l6QPpKd5 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/wl1273.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c index 737ca82cf9764..2ea7264a18d43 100644 --- a/sound/soc/codecs/wl1273.c +++ b/sound/soc/codecs/wl1273.c @@ -298,13 +298,13 @@ static int wl1273_startup(struct snd_pcm_substream *substream, SNDRV_PCM_HW_PARAM_CHANNELS, 1); break; case WL1273_MODE_FM_RX: - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { pr_err("Cannot play in RX mode.\n"); return -EINVAL; } break; case WL1273_MODE_FM_TX: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { pr_err("Cannot capture in TX mode.\n"); return -EINVAL; } @@ -348,13 +348,13 @@ static int wl1273_hw_params(struct snd_pcm_substream *substream, } if (wl1273->mode == WL1273_MODE_FM_TX && - substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + snd_pcm_is_capture(substream)) { pr_err("Only playback supported with TX.\n"); return -EINVAL; } if (wl1273->mode == WL1273_MODE_FM_RX && - substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + snd_pcm_is_playback(substream)) { pr_err("Only capture supported with RX.\n"); return -EINVAL; } 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: 13752914 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+PH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M;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+zUghmcTeQgTsL6fLV9FmHr0A4pvdhNplSiTGxBIqebMZgOB64uLJjKxCjHGge7Uv7EJVp1dOYdLXvQl0obcN9cP6Nwd7SC0+SXozkpcGNpR5xsIUxVUAwduCfwFOB5iQ5Ew2ZVmyH3FXjTZ1qG3qsrNqhkrRx5/qy5EfEDp5XXjKYEIHtlbG75oUwm+9+kxyMgT4NCOntmnHsnpRnpTlMuN7snO3wCd1fJFnQR4XufsAI3pJRd5V7d2sZ8tKuGVnFHgxO9hiEyXhhE7xwXs6rLtJ3XIQ3aiyHw6YxVyn9YXubtU038cpRHTfwMGzXIrIenxDTr14EZPtC98ckXB5GMoGYqJV/iJ/89yvubCmxXd3DBTXuTGUGFjNRoiuZq6MF1wtTPSlej4Atlay36WKjOU2IjVi/oVON2xZF7aEkgHhUAsoBVIbdbmopIqTSnVIjZ8TKkphm2zQaDh8R3vBveVST7nIWtXYlFR8MKwVVoHWaozZsqMqFW/zp3bq0KLUyaFkcFBYSGXWmAISf+Lcaub4GiuPSlF9VGp6RAzsAkbOOiQmCx95NX+Ra1wxmyqsGyIZdiC+M+1XU6qwm+8anOSGZY8kuLDTjWT6fQLk7uibrUynk0QmsVnmIwHy09Gi5AUwl1BJpoGq9QQuInnk9PaqferLBAqvKk0wwP7nIpH8wWht6+jzCEwZZrqKdB3OmjvaU/e578fVEUJouCCfppXBoY3XgIpVu0peVYJN1Fi3R6s3sQ60d5HXhDjWamCOoLNYMJJ2k3qFW8I5ePBldqC+E8C0FuwqO5/HRINJgzUwkoH5OWYHQRkQyAkMZs0DWzTpExzv27Xe9bZx+sjRoKByu8KEXRjQvYJwdK9lZC2EfiyxKfbVrqWx1xSk3Qbu5oXRyxF4Dhku/UfUx/xWQNmU3zp9dPuysR0TB7gt/joF1tRl3OaMtO6EWsxyJJMf19VNAGW3J1X4nzNXnDlhIYRJRPPPagIpiH2iLBMJ5SMOCFL67VKAeJXJ30FdTS3AfmsjwHXSrHFD3XKoinotxTpa5XxNs2LJV9umf4cg1ubmGklVtQSTGTcfIUiiFwmrW/nmS48CB0nfz5YIW4rTj4bONM2DJNHDBQASTAkN8aO3SjUtMcxPFQIo/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: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: 13752915 Received: from OS0P286CU011.outbound.protection.outlook.com (mail-japanwestazon11010031.outbound.protection.outlook.com [52.101.228.31]) (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 D0CF51B974 for ; Mon, 5 Aug 2024 00:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.228.31 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818561; cv=fail; b=hRZzXV8sJkPvFb1BwZhJZxk3mJCwTDWmrSVcvLZDac/3AyQIeKm0NApIYWFWvnyBrXsZ5iHdW/yrvqwPRKxcreUwR7UnDEwisEA0qA5FWu9fWGtTvKDax9+i6mHvNeRDCllpuJ+0VOQFxVkPbYz8H1WVBID3MRN09XBxUq79vuc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818561; c=relaxed/simple; bh=MBwS714mAGBlLfd9PSUcrW08HRMlcirt0EmtU7lhdK8=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=EqsPbjRZne93tLuU4EO5kbez51AVOyg1DhIe7h2c0Hb3X0yqs3AhEy9vX1jtFtkQj9MVC+Z2klnQfBBR5T+GBAAjRMD/nSGo3b/pxOLMDxlF3vSalo9Xng6jMR9uPY9FXHziRDDQumsz4yJtbUxqu28hS0MSlEozDvBGabYqIzc= 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=DThb64te; arc=fail smtp.client-ip=52.101.228.31 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="DThb64te" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LH4DL2JZyJ4794coFv1N+vnVRiHZ4eO2GasIUosOJMZGyesjRK6EuP7ZGqzanvKKSZexQim635D0nrnHQPVu/NxPwdIOZah/6uOUNa8WZgSthJL8RCuAqYnnSk6D3wcJdlRuoiKChoiPsrJpIca6Sio2NHJXEbuHIhL/YVa8LmP1/JLFta1fgeNB80WwsxRtrVPaGe1x7QpdPiRx/5PiPF0ma2y97qa3Z7rZ6iRZ0itjSkefkla/oACO0njr/WO4/yWZY+FRTqW4xwrhG9p65FGzlQIbwEJJon1sa9hVc0W3FyrAy4J0NehDCuRLp2u5hPx2CTxWAV+Azqz3426SzQ== 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=Y8mDYYCu/00Qp2W39bd+KlQwRIQcOzol7h9V+y4bRqk=; b=jA879qjb8a5sl+bNVNAmozrSkvLKPJCszcE3qcUE6GrbUcdXPhFxX1WE1Z0w75cMZjwTyP6Qre7kkZLCmw/nBmnPe1g21i8NYXQ4L/g4e57vkYUxaPxg94jcFtWMm1l/6ZOxmdI4kFhmMxn+e1/KbEgVZIqbDaHJk7hcKWxyreEHunnRqf35cSY0azrbk60YCss7Q1MXHCuGYSqZo5lGk4KCJSw+c9y8i8uNKj8Jk1vPypcBLcybAGzIlNy+67IwQBXaqyJQRqrfAD36dizC4gGE4E9fr/n9IvqeaiJQ/01S48b0nXejdFUib8bCnha96ZsePVlKK1iJuPhthEhIJw== 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=Y8mDYYCu/00Qp2W39bd+KlQwRIQcOzol7h9V+y4bRqk=; b=DThb64teJ5Xt1WD8XfYfza641lXWnrhn8b8py2E71OpWeu00z6jvhmOeDWRQrtdv3vwKUqUs3iuMG2uCJ8GSlm9P5Gvtmc/ORtN+Iq2tTieaRrYaxq+xEp6EeXA6V9PvrySlqSgwPDSYQntmdLesW2h1Z1bKwFymj+KUAdAamZ8= 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: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:42:37 +0000 Message-ID: <87o767x0jm.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 086/113] ASoC: codecs: nau882x: 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:37 +0000 X-ClientProxiedBy: TYCPR01CA0145.jpnprd01.prod.outlook.com (2603:1096:400:2b7::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_|OS3PR01MB9302:EE_ X-MS-Office365-Filtering-Correlation-Id: dcc896a1-acab-40fb-295a-08dcb4e7811d 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: D4OnEnn7LwWy/JQx6fZgwjZNQ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tQtgxk0XYHQtBowAVq4bMWt1qL9Sf/ysWTaCbXQdWbyzZdWtIa27MHobs5ynPDO7AGZX2Eo26f+vqHedFR3q9PxPBgfPPkIJbrzcC428gS1Em7tUh2ZlVtcmkw3fVaboZol61Nc7PJ/Lzv/lS4Aq5REaWoGRIY1VEK0qrXUPkH39d/+LYFMZBMZt0pJAcpnQ3lCtpuCR1TmccM3Z4kinfsdh/vLvb1YRMXtTOsMn7Uo2+r3HB0B1CsMpN6Ic+ejQSllnuCS6i+vmDORWmjjaijyq1B4LX4+shvsa0hi9nRHznmptxBaFg7FsBX3b6/FH9TOM+6ipQ== 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: DfIPn21IPfN/EHFAMJzz2D99wwn8ZLyGNSIFThdnNiBvZmpscrZfwKnygeY6AuPl0cSgkDv2EuaAwHKTtQ8o0UdOeUdOlDwEy2wVlwm9k0TjT4FXU9VR7OTWlN6MFyWkJZHOTpRCSpWf5hI+GU/O1i9qbMF1r/xzmR2bXGt4o4IW6/jXpcdRdU5M6Ocj8ieq+ntri7R2Edj6SP+3N5wmYv4CRIQfsmbJemHaqncmYxiLZUNlqiEfPddW65suK3s5a/96ZRW/zEVg+RBrw3FHcY2rdVzqTSgRHvkJ4aT3Mszcoq2QKG0CCPWv4KoJfAHx3t4LHS8zs3fM/9eCQh4duiZqBNdfHVTOUkwLUhFzOTJqtPk9m83z4eVpHRaa7KyTP+9RgffRl1FkIjR52pWm2hfxUNNDlzSNOlPzjsHl51Ckgs05Df8JVLWSXmgF0kNkgsYXZViPEx9nR8Nt2HcYm8GpGZYn10VuycKPDuGLF4BZ6F3woPIzxH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Ingtqu11g/rOChmIbj2jyO5Yql7/l1a2AO2eqNjRR6I2fjJck1pKETra5NaLU8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcc896a1-acab-40fb-295a-08dcb4e7811d 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:37.7861 (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: PiRP6en9CWpqjPRvMpBSHtqdkOy+B2qIayrzGB+Vr5UUAFSNJQvgTZhl9Th60FyrpOQSYAagJti3Tt7UdkKp0J8nbDoQdzd6NmGmA4GRjGnk8ZGQe2iK5q6K2n52k/dd 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/nau8821.c | 4 ++-- sound/soc/codecs/nau8824.c | 4 ++-- sound/soc/codecs/nau8825.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/nau8821.c b/sound/soc/codecs/nau8821.c index de5c4db05c8f8..f887c192b87cf 100644 --- a/sound/soc/codecs/nau8821.c +++ b/sound/soc/codecs/nau8821.c @@ -803,7 +803,7 @@ nau8821_get_osr(struct nau8821 *nau8821, int stream) { unsigned int osr; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { regmap_read(nau8821->regmap, NAU8821_R2C_DAC_CTRL1, &osr); osr &= NAU8821_DAC_OVERSAMPLE_MASK; if (osr >= ARRAY_SIZE(osr_dac_sel)) @@ -854,7 +854,7 @@ static int nau8821_hw_params(struct snd_pcm_substream *substream, return -EINVAL; if (nau8821->fs * osr->osr > CLK_DA_AD_MAX) return -EINVAL; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_update_bits(nau8821->regmap, NAU8821_R03_CLK_DIVIDER, NAU8821_CLK_DAC_SRC_MASK, osr->clk_src << NAU8821_CLK_DAC_SRC_SFT); diff --git a/sound/soc/codecs/nau8824.c b/sound/soc/codecs/nau8824.c index 12540397fd4d5..21cda3b473bad 100644 --- a/sound/soc/codecs/nau8824.c +++ b/sound/soc/codecs/nau8824.c @@ -1038,7 +1038,7 @@ nau8824_get_osr(struct nau8824 *nau8824, int stream) { unsigned int osr; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { regmap_read(nau8824->regmap, NAU8824_REG_DAC_FILTER_CTRL_1, &osr); osr &= NAU8824_DAC_OVERSAMPLE_MASK; @@ -1094,7 +1094,7 @@ static int nau8824_hw_params(struct snd_pcm_substream *substream, goto error; if (nau8824->fs * osr->osr > CLK_DA_AD_MAX) goto error; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_update_bits(nau8824->regmap, NAU8824_REG_CLK_DIVIDER, NAU8824_CLK_DAC_SRC_MASK, osr->clk_src << NAU8824_CLK_DAC_SRC_SFT); diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c index bde25bc6909d5..951406fa5d32f 100644 --- a/sound/soc/codecs/nau8825.c +++ b/sound/soc/codecs/nau8825.c @@ -1238,7 +1238,7 @@ nau8825_get_osr(struct nau8825 *nau8825, int stream) { unsigned int osr; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream)) { regmap_read(nau8825->regmap, NAU8825_REG_DAC_CTRL1, &osr); osr &= NAU8825_DAC_OVERSAMPLE_MASK; @@ -1294,7 +1294,7 @@ static int nau8825_hw_params(struct snd_pcm_substream *substream, goto error; if (params_rate(params) * osr->osr > CLK_DA_AD_MAX) goto error; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) regmap_update_bits(nau8825->regmap, NAU8825_REG_CLK_DIVIDER, NAU8825_CLK_DAC_SRC_MASK, osr->clk_src << NAU8825_CLK_DAC_SRC_SFT); 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: 13752916 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/ya2XgbwYBUw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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: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: 13752917 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 D9C1A1B974 for ; Mon, 5 Aug 2024 00:42:48 +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=1722818570; cv=fail; b=DrppqqQ6WrwwhC0oIBFiGK+AhGCJhrqwMT+SfBUqxlDV93/KyYRD9CGhvD+XCnJ9MWI3/NNWbNNm7n1nTMzGsZk6Pfbpf7eNOhIA8nK1z8vif33PCQEjGC38VgrEf9r3wBVpwK5PyPnwp/ndBxrIuAYLAHZUUQbGxG9yJKBli/g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818570; c=relaxed/simple; bh=6rdcYnuY0bGVLBKs+kUhLnWK/315W4nTizK0dpx1Sic=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=CiLgOO3ggKdRkBacbxYkGoW0Q7mxFn6XpNM2P0BzGUC7MTE9rKKJI148JS8TzWhh1IfYM+nBEEiLaRJvNq55HvExrTuXB+1JngZIS0NMg++a4gfV6JOpyb+Ya662bZdyEboCbm09JIZnQ0ANCF80hHKUtKBybt4TtGZ8muRrU7E= 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=bW+iltDs; 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="bW+iltDs" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X0Xsa/NqZnbCXj47F480udIpS39wD81GYuV4cPNACfbkR2egjfivVTKalepW3tUcmVxwPjy1wPfy0wMLK94o90zexFx/vqM65Yf99uo+PfSRFqQv3LfKmHSal5TQ730TX9cAMfU6hLJx8M5fuAXG4Nx/67hLaWbcAlHzg96t+SFe8AkaTYT+PJyytQZRvpW4KbG8/2anRUwuIydcOkeuJYkwm9u3cTdI1fMN2x2jPgaAo4FVkkqwzS1so1x4bW02KjLKVkF2pkge0bYhY5AsSd1Zp1eUZW8gR7E0fsdjIZAfMCaRhBsCOmOLdHJ+ik2RsN0wdOxs9DLxVYhqrZfl7Q== 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=hDJXe/9zg8fO4KEhqRvLKCtYhFFcnAsHTPvjuYoZwIg=; b=YT0fZwpA0gvZ48l9ibpAF/iu1JICNllwO3ZMUK6F0Bq/B+lAN/WkRDIoNEiDsrg8hPQMb+lUCSOpVc16I1h6WUmvCqGrnpe2S+L5UzL4IogZVYYJMnkL09nzs5TQlhhO9TzOJe6B5yizhc7UYYi6uaE7M4K98yVzK/AvtGpDJawvGdwSuEygIQREZBLWGCRrVyLI0HaYduUcVJxmKUX6Lui4PSEvKidBJrYsdUvLfyMJaBkA4mqks33R6hqtF3vKmVvvwPSDfRa7QTt5uedbswgSCd3UBzhDOoesbpuZaIBPw2sAI5cD9mK0/+p6qIicwyzPYIVX8l08Qs6W2U1aGQ== 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=hDJXe/9zg8fO4KEhqRvLKCtYhFFcnAsHTPvjuYoZwIg=; b=bW+iltDsYPMSQ64dRFC8wKVr6HJ7QX5+/DHUmAe9NqUWMHxGU1j7viNtB0pzEdamErCKY6c3ELCoCw5ydXkj8uR/xZuFBJkrcoSvnevLgQDuwPmdLyHFN33fTXh9PAdrD0rzi485QfJFh8+7tPdA3E5iMro9NHNvOG0yUEfY1f4= 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: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:42:46 +0000 Message-ID: <87le1bx0jd.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 088/113] ASoC: codecs: sma1303: 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:46 +0000 X-ClientProxiedBy: TY2PR0101CA0024.apcprd01.prod.exchangelabs.com (2603:1096:404:92::36) 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: d5e4c84b-efe9-40a0-6c23-08dcb4e7868e 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: KM/cAQF9ECnOwr9LmvmqKZxzu4UHCnXZwrzi3+XQ8RGZJjYiLXTjjTDD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zXZxpcd3kqdVhBfDJ5dM2DwazC2BDGxLthIqqOu8rQy/GC6iTJY64bCNfsTitTGv7M9MN1fiVX/YIP+WkQwQ1eaTHwZ23URtHELPP1/IHIqRUXMyEKaw72X858QCzq5DdIi8qCqWi6Ckcy3xqCeWwrhN5g5orQlmo6S7ORHGIyBLjChIz43TNqxF8pfZug1m4V1dJKvRRnNykJg96cghpd4dSrKATrlyyOSw2rrLK66QYG+1X7e+qhiO8zyL9S+j3BhSLzI6LzDL8Fk5rtYOh5ORfGzTznEo/iJZFZg+YQ== 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: A851NFGDAfnBApOtv5npuKOxEG3yvf9HyNyGX/nllglS78OXaDIpwfq72iwElDMLuIqfyADshy8mzncd2Gj7JYErCMDodNx+Eib4lrSOlxLJnRnveU+LgWvMkrEYaX67uBjGZIeFpQdW2dVivj3cHFvaEBWLZ9Bf5fQdt2Yx1vW9LSK1mvlVB7FUcYH37SG3iTLDX3a7Kcvf22wulk2I/3behEG8KXEae3nr/jlw7zuY0dV8z7z/MmXQvGB9CmuHv+5PS5JGHolo43OPqMPt6CwnGwmtvc2bi49FqZcS6EV1ORHkw3JdHLMwKpzWJ2eKYPS6kBHm/urcdC3e7ZAGWSaf4gTQ24/XkE54ifgEB9gnU9LeTdc/iD7KEFI0GONvj77EzONKCRipP3wiEZn2nhnUhEI9EMcXngwjBxrOvYBsYJwdFoL+EmWzTEncb6XyVTAIuU6+545lTUFYDme+wUNHBZxaPPiL7uigyIBswnT13R01Pnb9XWC2OERGqbgE0XaXMJUeGZGjh0HQ9umFvZdUqow99VnldAiSNCQ3ZtsQeHdJ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Org: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5e4c84b-efe9-40a0-6c23-08dcb4e7868e 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:46.8787 (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: BFcv+yfizsqPvtE87+6oGSIQcsIB/W/pkgl9FmHu+efAvb1RcgzY2rMZW5aiEhuHnChJPongAuHizjMe4uvGJcUhPL3/nyi1jNIIZffc25x36B1x5Zl+nv2UAwcBunSm 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/sma1303.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/sma1303.c b/sound/soc/codecs/sma1303.c index 980c48cbc3482..4da80cbab7946 100644 --- a/sound/soc/codecs/sma1303.c +++ b/sound/soc/codecs/sma1303.c @@ -997,7 +997,7 @@ static int sma1303_dai_hw_params_amp(struct snd_pcm_substream *substream, __func__, params_rate(params), params_width(params), params_channels(params)); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (sma1303->sys_clk_id == SMA1303_PLL_CLKIN_BCLK) { if (sma1303->last_bclk != bclk) { sma1303_setup_pll(component, bclk); @@ -1195,7 +1195,7 @@ static int sma1303_dai_mute(struct snd_soc_dai *dai, int mute, int stream) struct sma1303_priv *sma1303 = snd_soc_component_get_drvdata(component); int ret = 0; - if (stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(stream)) return ret; if (mute) { 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: 13752918 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/mSSgqPxkvzVrc2aUgKxumlnacUYEpNtVa9NZCgqew0DTzcEIIL3Ywa2Sm4RFnr8K26sOx15xRu5iRcsivzOcDsSq7Ihfy5JD4bihkHsrXbhoaQMImOy6cLWqTFrs9m4QRg1ZBD6CWj9PaKyUbJHKMkGClQI89q+TR7NM1dPoDIcXoT4HWbhfu9AShvGh2qSL/hWIVAOqrgV8H8MgKeguPDEMp9fAfAOVkhydaILWtLyq1G5AM1O2cNDtjdJ0stSN0YxFZLunPhbRz6Xeo85CRRZeM9CeTBYu7WnMvFhnLbMHUbmTwKr6PRauXzGs3u0EO94Ss/e3h/NR1UkLoT2F74cTQI+qdOatmtZ2gQ+iO2vZvgHkbs8Wgk/Y8ZbHF6emJ7uegxeGOciW+gc8d/K8zpL0ncPacRweYrDZ8WfeFBB5MwR5DYEyO8VLzol9EXrZUXtKw9IPnfVnW64ktzrWwmQseUazimLCFwv9qnLpDu5xyFyMEbQ1JysnRLxFw7maxYAlMNCzkaBHkgdLJBQYpa69j0gCAjt7L+Un5ToicnMDNpjSs7uGdVF9xyDJ38WGdUL7PR/oR9InPM9TGUbgSSxq1T+g+LKObsyhb2QTi0twR7vpN0zEgw4I2BdpQ/weumLoo7NaaS70OgYsYz40Ik617ifnFH8MqD9kTTRbDyVuTGJwX1/eODkfmvhMlHoxD5fvBwSsT7QrTEPi7PfqQYAbvWwQGc8+wbD/jN6dV6P1uj1gzzvxsUU6rmSTX+Xgefk+A0lZIl0IR7zd0coyntOABezbZg1cdmfm7G7tQb3h35stvc8mJqcdwjpyTGRjS43eogg8623aGh7xn0BP9gwy9Q+HtYEli63/9VQ+85g3NRjODC2V4wGKH2FNyPFWF6elpWstYu0grtPqrsK38j3MJ9Z/RTxqZ14W5weDXXjqSSOu81UBGTfgeZm+0bw9LKFnoOaw+hwsGvxVPpeHdl0KCAz9cK7uuKICdXGStDK/y8lkHkTpFazJr0LnLByEFujKo0zLi3X1XRvd80kUqzV29XjXAqyOUGlKn66CiEL566V7M7qBU5zRZ2+asaebcOA66t0c7nY3gwfczOHaPTf5Tw6yEEtME3Dvscx3G8tLu44Isw3FJO92GEti1O3gyfMuV1uPqflYTBy/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+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iX6H0SZlr2TpIQRvlM1CJZ4Vxe/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:42:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752919 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010011.outbound.protection.outlook.com [52.101.229.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92B591CF90 for ; Mon, 5 Aug 2024 00:42:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.11 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818580; cv=fail; b=WkadfiSurzOUzNlPH8Djfxc05ty7xwppKzZKkrl/si+XXBfh1LdpeRWfFI/oThPO2hiitU9pSsRgvifKa0RwUKWxOCwSlVeT1hiIphM3JCSQfS+DGNVUWXcoiBw9dSM5jMZXTdhWrziBqkIlFBFfz6HOIBRxBctSdPBIXG3mhQM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818580; c=relaxed/simple; bh=/rURcLGM8cZs2nsyC17JmnNTDfD0uvvMl1RDmBXFNZI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=ne3zVMX6SXm9IlE1JsFMwihpjwV91W4iE9uEjboQ0cQMHM78PauZB/vE29pmzD9EZ1Hq0wi64JEFiQxLDQRXQkfuRHu61aDwE0qwJS68Iw2MCS1HSHeuI1Y+RypbA/y5dhpP8IPNVB2u1aCNRKDxw2A/UI9PyyBqS2cqjhcneVo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=BnPVmFLh; arc=fail smtp.client-ip=52.101.229.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="BnPVmFLh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cd1fJDFkWpOZZek5xkg+PD4oDTjoytQnHHa+oh5IpepAB5cXpHLi0gJBXFKFCb72vz6jPeboBetNdLAqqt1an9pD0vH/n+FYqWTsNhMslAF80WPVVU30uYC9HJylEFmr4DNdt5tsRnpzJy3G/ne27/I83Oy57jaGx4uBcFf1ImHDoC7xSS/nKQiVl4KbgzEOGaiQgSTWf5Ts4vEJ4OcpHmstiaIX1KWXbqHkAGM1Rk2omWzJiMyX7qGtVrbD8dLA6ZooFYqWwm1aQ8zPA1aL24+Ad6BcLOLcHj9hLF0xzIpnBSnrJ3ehuOwhjAq5FdvaAR74CPNE8ujgBitkl4w8IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KgbnxrzOCQMQR+GjFfsDvLRjQTXnzso56052Q1xUsF8=; b=B+xPQv41a/G3vuumlVr+zIH1sXofJBDHtPwC3EyPkaKer8/PJsWfCMi+s21GodQRrgrc2TEDDWQ4E5pBDY8a7n7y83p/h5WF6Kf/za6lGhfFOATvNX1Hjd8EUeImMOYiwa6+8oqL0uz2hIJ+gqzaKR1MLThjYN8zbYkAaOK4fZSGiM7UBnwwwvBt9DUFGTlx6F5Tf359JIEDtC8x4Bq62lnDi+TATUX8OtfgFzYBPm64hN3gJ2pbSivktWLtB4fLgYdrmGfTRyXywE2RZFUPuOUOMnn7cpd+Lq4fId5QE6vlbc5Y4VvYjppvlG7KYbBrYn4n8I1xXstDyab5TLTZew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KgbnxrzOCQMQR+GjFfsDvLRjQTXnzso56052Q1xUsF8=; b=BnPVmFLhkwWgFzN26aaFboRgC4YHTG+KwljQcoNOtVl1ibRzm3rDrqYdzXdGvb7XciSfaReSw1G4H4EGFDlrf9z5Pm34ijYaue9mXawXBd4zNFNJw7FOEvEmHMYIr+x9VgAIDFekGmuToDwNJX06g48BDW0G+OZUQ7w5Tq3Htj0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug 2024 00:42:56 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 00:42:55 +0000 Message-ID: <87ikwfx0j4.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 090/113] ASoC: codecs: twl4030: use snd_pcm_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-staging@lists.linux.dev, Linux-ALSA In-Reply-To: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> References: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 5 Aug 2024 00:42:55 +0000 X-ClientProxiedBy: TYWP286CA0029.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::17) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c4c8b47-2d8a-4c98-18c5-08dcb4e78bf5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: DOTcnkj4Ng5UOmHPIyOwwahY+sCHQJgpgvZcVP10lbwF0CLAuyx+wS53n/DQ+mQi9WMCQ/2EMNZa8TLhCAVmktDHrDN1D7b98grpbEB5YHN+hYsj31yV+IcIVSzbuqtC7Xq5vaw/Xez8gLKxYXuiE8ME1L002sIdBP3KdIHRj+R5/SdYCR+JsefJH5AX1cuPLPm1VqJBlyrOZHt7Pk48NWAIq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ZCKGBuNFNDjBI8os33lLFZFsNUiy8iiN21iSI7FjhMZuvD1czh7lR4BTDPVmyWDnhG1IrDyFe8sC10C5vmtu4zkDWKZxjlHQRBAYxj3KiHrMo64q/i10RI7t1/NPvhVwYhQ/OmDg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYCPR01MB10914.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(1800799024)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yW/Z7JBZ2Cqv1BbmQZNCTazFIfFABUHIe6GLLkarAB1yeKPE8dOBWGGn5Vdkrnhfv+UrawHI4ahMBTcpzTe9U+e/RQBDAaK3hwjb0VRPBfLxDoLwIk4HsIjjZ7lawxgVJxVGEEQzT7DhmXkvGGKGSWuJ+sIsLfNuyddanrGH1K6la7AYfEtk5DOA4C5OyFFp/vJ5IV9e13Faf/iuRHPaUSc8lSUGBEWSyfw+6JATcOR1SGBf8Ptx4D2PiNzCrwU0xWsMhRGFh3jBhFzVMcI1m9SvznWBaDBJdm1HqfMOcgNvM7O8D/uYb5cfarBs9UvuoZHxNK/yBst2oaPmT13B5J84VdWX+i3tzMtQ0DmSLzOjOWzs7J38XllIObb9YasYXyNiyVfuiDnY6Ld9qvOau9AqrRMYyKPuiEsuB5U2VM11R62wit327+fPdD2l0bMWEie+Z2uV3639xJJcQKu6g4hEAFMYYrkjYQaeHYKC9WR1F41okRulSjEhJgAktuCLn5AbjevLDR/krrgnO8/GvsmZBrv36YLE9KzawDRA62w4RL0hrc8fTe9/XCnH1mqZMabODpQLiu6qFW8A48l55iaiFAAQyeWoeDxqkOQ5KYVC9XhBBypT4MoujR17Fco8iaxzfvswGpVERR0uxHAYoJp8Mr3T9zmiHfIZVtiPLOfT31/acvDlpPAfih12Fy4YSQVcZ4T2KJXwgaAYRGKS1hCj/ny/DjtJhqykMQMraSfbQtp7lTCDQB8Ohh2WxPpbU4VKVxsTRxWkkSu4+0fxos0sf2ate83FMP9BjgSRTRF4Jb6ZwQJpagz8qnPNQZU30/adcY/3m22Nqe+s9v5GdMSbEbGczzNX4ztaOg0rYg0t4fg4fv0Sk7hgvFu5edZ8vCBtG85gnvVhW5Vykoiu0msQuXGki9KkcJYGIqzk/0qY2jzYStxzid0XBuHtrTw+JBMqbG2PJaTLtL99gdGYfzSwB2HdWhL4FciyJ+kDMHPIwyy3OYLWLB2OzOLArDi3NXXMIdGUSJt9IVc6WdES5Z30Za92hpdXrGtsoNS4aMdQbEyXphIbWs5Loi+2cU/8Z2DdX+xl/P7Xp+nSojNhRSA/3LqF7ZcblovTZ2HYbPwJnsnRyTX8puJ7TRTuad6+E3YALFutr2l0wsxdAWKqKCmTyJb/vnljWU3HPPQmzctvRwNGpsozA+jXH2L9EmhoIBMXTv4kfE2eZjuCjPPgmFpMLXrc0xOvC4410SUN+FEOGN5hT55mMfpuua4Ci9T9bmONufW+e3h8PNgYo23ORbibP+qEOskHxrmF3b/K0yYVsPnSWGR6F2T4LO14DFyas4C4sSK9UPgrIfSe8bDk2yGBCqt/5zO2qRpbXK5kTfYAQv1XIWEGWxrVz2T5Kl8b/Ls5SX24xoB26h0NSRkSOa0ZZi7OjWk+06k0SzdIkaxFo24Jo58wyrdk+pyWRGVCcp5LYBBaI20gYwKGYMVO9Lj3KZxmRGCtG/RMhm/6FIrPyHtIdbBgoVq0h98lFK8hTFc8rjzzDnAeqgbLXpgX8iMGpoxet6kBjzjAMhPJUmX1IBpi3kHvN8hdMdZuMxUGMyRvMGE4j9bcVgWwzi44kJJgFUZV8cenh1i6JnOuxw4= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c4c8b47-2d8a-4c98-18c5-08dcb4e78bf5 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:42:55.9132 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: T3EBh0gHdXmyCMQyYRNpUd1WyFUsL8FM67a0i8i9Ntc8Dv9CEpvV8RFN47NqIcjx9rafGFb1fM7jyko1+MI/gDfO9dytIlCQlo1qNXjT61WgBKhItLqJcRPIYxt+N07U X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB9685 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/twl4030.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 9c50ac356c895..a36b34b92adab 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -1629,7 +1629,7 @@ static void twl4030_tdm_enable(struct snd_soc_component *component, int directio reg = twl4030_read(component, TWL4030_REG_OPTION); - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) mask = TWL4030_ARXL1_VRX_EN | TWL4030_ARXR1_EN; else mask = TWL4030_ATXL2_VTXL_EN | TWL4030_ATXR2_VTXR_EN; @@ -1913,7 +1913,7 @@ static void twl4030_voice_enable(struct snd_soc_component *component, int direct reg = twl4030_read(component, TWL4030_REG_OPTION); - if (direction == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(direction)) mask = TWL4030_ARXL1_VRX_EN; else mask = TWL4030_ATXL2_VTXL_EN | TWL4030_ATXR2_VTXR_EN; 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: 13752920 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/loYEul3F4luPDofnJN6a25RVNY2Sr4EGpAS6jC65wCyUXx3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CZBnxUX4yiSrJm1ayf9rMjqY9R67lLmkRNmWRtJwC48HUTxTeuQcE6UCZUtfwb8h+3LAjRYF2KdAYb1kLHVxB5gcc++8gwxVQXYDuLZhqYE/IHkcqWONBu+VWuRKQQKlGRkGS4zNYrms2x0+ivXCb2FPn7T5/37su688IqMUZlyYvLE+HSvdtYnSSWrB4h+wHHRMMr9U0ZjKZUXb7074P/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:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752921 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011023.outbound.protection.outlook.com [52.101.125.23]) (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 82F691B974 for ; Mon, 5 Aug 2024 00:43:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.23 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818588; cv=fail; b=H/wvub+hYJWLuIqCGBYrRC+gT3AhQxptyFxguyUlYaOycbJCr1Ea4WktifdOFyqeM6uHvkwY+a9OoJNxCRKkqTORZtD1TtdIN4E7ZO/swwvZ8HZN9jRKSeD/sJsp5gyOIl+EDlFoOBc/oBZfWIc9vj14y+oKJf/mPWJA5W/Jo1M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818588; c=relaxed/simple; bh=/9LcLBmHtWn7j2ve678PWR2asGaCetqzDCwbgl2TwFc=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=hYfKgwPQjGvmrpBHh7focdNsklrm00erSr7L7a47m2vIIuuP0/1sq0x629OVPBoGw824LY3aG6CkZrrJXraxp3b3CP8RCCF/ybw/3T89TffLrbVFk/Y1/wYknup3GNEWiN2uvub5DxAlSWZRpbBSmn/SGlSWHnZdfRDo6wtfLoY= 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=GN2UVmMt; arc=fail smtp.client-ip=52.101.125.23 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="GN2UVmMt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ylgb/UgSKD/wtmT8ZQQs1+bw+nBgl4GVs0GdGbRTMIVGEkWm7izWAUK4lDjvzKIcLoli4i8OZu/CsyoW66XWNdaVtGFn5ToYvEx9b3XrIBYddIE+WdDOI2ziwhss4y2B+rA+a3Az08I2QX49AQ3RSEOx5wvkSSxC8ZSlEnVmMtiqndBhh1vGhp0GKSnnD1YYF8UzaNy1KQ95fBjvU4uzwWOciyQ0pfsdJ9PxWglBOGxXQ6l4f0kJTWFFni6wgO1BK1c5Jk455jVobHA6Oyq2fhrWWAtP3yI4fo63N6EmTruLZ1JXee6oC1bMmhzmcXyKdVhB7FNNy82vx00USkJbCw== 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=TKWGReVMNves31USvccMyKWFks/GhepFZiGPLmgy/Jw=; b=e7ku2sVOrgpwP/g9YcFV3PsVoibAw2UjoVaLKtnZZ8Ntl0lxLdX1pzJGGFWAlWJ6oWB0oz4DI2r3jGAZ4Mwcpstwd5pUf+450NMF8A4en65ZBKYE78QSiG0yNgc2OrVdp93Gtxh4oqPf8EVcmbDSvEfEHwtlqW3nEOISKbGs419dpNAC/Uq6mzMVePOSXFwek352t3Pzkj5/TA3IOfCJpVf9s9smVOMoeVYmBavYrDxyPPoaJ0YMo1yJA6T4gDBmcJOcP184C1c/0m9jAR+5S429DXm5QZBLYME0n+yR2zF2ne3bmT52+mHR3lAyj/ERMMKB/XRNw54awQuGZpLfVQ== 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=TKWGReVMNves31USvccMyKWFks/GhepFZiGPLmgy/Jw=; b=GN2UVmMtMtaxg6hmy+F5zCecEa012uExPbgfFoF9zspd3rEO2eeH/CRBKD7pVlAdpcf0KOdRukVog+JbBVYDmu2Vhf+GHm1Q9nACSNGPuRDXx+MOP6juIsGOxJRAA60hRog3qByKd/qYpHaejgE24f/+YTZvSSWusLHbTn2vl7A= 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:04 +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:04 +0000 Message-ID: <87frrjx0iw.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 092/113] ASoC: codecs: wcd93xx: 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:04 +0000 X-ClientProxiedBy: TYCP286CA0348.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e92ec3f-6794-4e00-5f78-08dcb4e790fd 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: tksn6VCsuowGg3pwRBTy3m8817ToR9c/m2SphbE6gPzFsntmI3xoq3y8jeAqzj11wEeEu+xljtCQ+idmh6YJTeeX+DDU7159f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OiJOX4aWohtttQlCPfmmGwZSZ5hzvTDnClCXQpICbtHbNHHCzmF+2Mz5ZNwssb0c3kcD4d5GTkaiGeZH4iuv/PvW8thjEgwtEkcJsl1Uy0YzAXCHv5bixneRpP5GOGdX6rvk/2xGNac8hLznzCpDc/7CUaOVsqUw4CzlMRqEMHBAZqnwsFUVnERJItX1rYeTvPBlfCQ1oPiafFK5Z3j6J003GaCj4iMN4sVmWU72N1FHfmyyVgEfZ91K/Fyw== 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: xlIVekzeVOfTI0a7vew7/GlsZAVYY7yziPTE2zulknVXAhTUUaJyr8AOL5n/QSEFhlarq2OBHaLtryijyfdPAaYO2rtocZGddc3pbLPS2Q6Rh5OmCMQCG1ahIQGxOTFoD3g4hzOQv14IvBd6BphW6IHA2jwQw60y8GwzOG5k0Gmn9RS9npRrsMZ/+gCZpvQl94jNgXZJrpTJ0S8P6hsjVsn++4uctmjPzdD6BI12H5kZPADZwGV/u/JP6XCCjyjr+5igG+5FV1Xr1DX1f/+F4e56QydnCe7gy1Zt6jp2YHuScVL+6l7Q4UklR1O69X4iqvsOrOsftpJQNr4tnRrp1MOMkZSkqYDwgykPFClvzM+7Xb9rg395Q2NYNKOa+pc/OeqNmxdXUZNS4XEQgHUrQ+opJObicWUW75jYXFbxrpCHuwhmDWQX/irBraKIPPDjR70JMQgDmLUSsW/x06r0sn/RAHEJPFZU4Bl/CN0bcv/DiJGTRPzEP4tQt+rRclHrr78bl41jyZFeLOH7wJergTfLw8YwQPGxfVx9JORSxRV02+zOFyAhx9sra1v0w6bAdZtMKlZaa9fcxbWx7l4VQym+p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 5e92ec3f-6794-4e00-5f78-08dcb4e790fd 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:04.3540 (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: PVvACph/pQX9Zsg8soWUZvkYQyJGqssdj8vu4+y/AQYerVmAHjlL6KgHgppptjwxb0Y5j5VsQZNidpAaut5bAhZh+RWXWm5WhZ0G6UM/9iSnYX+QSManT/NJTVyzJVcV 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/wcd9335.c | 2 +- sound/soc/codecs/wcd934x.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index 373a31ddccb2d..f66f4134af8f1 100644 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -1732,7 +1732,7 @@ static int wcd9335_slim_set_hw_params(struct wcd9335_codec *wcd, i = 0; list_for_each_entry(ch, slim_ch_list, list) { cfg->chs[i++] = ch->ch_num; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { /* write to interface device */ ret = regmap_write(wcd->if_regmap, WCD9335_SLIM_PGD_RX_PORT_MULTI_CHNL_0(ch->port), diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c index 291d0c80a6fcf..82894ec51a53a 100644 --- a/sound/soc/codecs/wcd934x.c +++ b/sound/soc/codecs/wcd934x.c @@ -1732,7 +1732,7 @@ static int wcd934x_slim_set_hw_params(struct wcd934x_codec *wcd, i = 0; list_for_each_entry(ch, slim_ch_list, list) { cfg->chs[i++] = ch->ch_num; - if (direction == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(direction)) { /* write to interface device */ ret = regmap_write(wcd->if_regmap, WCD934X_SLIM_PGD_RX_PORT_MULTI_CHNL_0(ch->port), 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: 13752922 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/EWxJXiMnjiS3GAvYJvPmJTSCtfRXP7NB4nLPO9bwd25VvNl34mx2LK3uITtyukDvFrg17Q3FYGcwm18GNMwqG4WgeafuvOJkRbjts8zxSOzob4/XfWBec4AizkcQa2dlZv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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: 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: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: 13752923 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010031.outbound.protection.outlook.com [52.101.229.31]) (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 B193422625 for ; Mon, 5 Aug 2024 00:43:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.31 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818598; cv=fail; b=Ok0PcKwzXWDEQ2Uxhlr+JS1oHd4YJNC96sjVWI5DyKRl0nL0qUOixxL8g2ZPOYD5Kuv9RzFlSZM4u9vGfxstPHcnipIBw4tT5bgvJvc6gML3jWUlTbpV74SWtu0lcvswSkS7E746ZfYR63Wf0CpoNT3HXyd6nd++dvKUtzh3LlQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818598; c=relaxed/simple; bh=i2U9w65LhtArzASVM+yMcThBQrxVWXZ7vPwjGr4nGFQ=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=co59dx+RfZJ/QNrySFIsfL9LNCD9WAM1HqO5BJiZU7uc7AP4w8/jX/rvQ5AD2VItd6fRCUPQvpVg/ZG8mao3qbYxmViYIf8VEqE2/6O23jorj2scyfSmzEACkd8zZCbxdyHsr5tNDeiguy91RYb34sYa6B/+Q6zre5Pj1tRRq2Q= 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=F0Y93lIq; arc=fail smtp.client-ip=52.101.229.31 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="F0Y93lIq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=o6ECpTxyhfgULFoSIvaWoZ+Bc5lK7+ipHlDln8+SGMa6QjR4nc0xt41KkJoFNTZpVWYWNSlAk1b5As8A1gAa2ZaiMtC3G7m0GifDhG/3VheUraRj4LRyxhVJnn7YrQfk0KD85ylTswARjQ0m2UVIa92CNTRt99up5WKPxJdr38fhRMnEPM+dnKvum2EROwgG8fLE+YezcSfrymL68CTJBAAqI5EPVLR9GxHqEmOvpIh67807cbBVf1jv6KMISKYQY/jytQjLxB+4ALRIWR84o+A9Bg+yiOPDKs3ESXaXXM5DECJsuSjibKY6SrwZzc24Ioywj01Xee9FgERBqpbV7w== 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=b+RYNOHpzaLEIH7VZlHGx5RNIY/hvoiK6DzZMUbxu6U=; b=frY/Y+7AuSapB6LWxQYCKJh/K86TZNntqvd/tTI1rSVWxmSbe+L3Zs1j2R4ZXiiIsj7JzFG0ZRkuw2Ua7Jtuj7m6zoxXBqZCfZq/WVpKxU0Ipxjam8GgAnKmLqpekfPiXvmwreW0Wy0dVF/HOJOwDhJwpTsYXXsGAwSeiz8hjTYU+HEEAa+YZem/chIzAtGvNR9PysONfXCjWvvGhJMak+wEOFzDAYuoUI4agdstWxhO0EJ7XPMUqg2a9CCKpdjEzgk4b8riKUEQdaIrcUX7Yvay6nDX7OIJ2NJ8L7DMVin5LEnikUSmgfK7SLCZz+YzlvqTt6mIacUM/0qYnrYwPg== 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=b+RYNOHpzaLEIH7VZlHGx5RNIY/hvoiK6DzZMUbxu6U=; b=F0Y93lIqy4QN2hOJw3ZBlw8nyf/Rgl2jjOlgZx2TqAlfUWc0uwdu6LSct4rgN8+7QgXYK6Bqa30AY4yfLNzZOOUQg9yIIsVNwTkhlCR4pUciaVnB4RrRoDmlk6ASdY3uUG65u7TwyydpYw1ZD8S3wc/XaOHEgbF4XTxRKGBZ2oY= 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:14 +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:14 +0000 Message-ID: <87cymnx0il.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 094/113] ASoC: codecs: adau17xx: 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:14 +0000 X-ClientProxiedBy: TYCP301CA0010.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:386::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 9189a749-ff02-476a-0b07-08dcb4e79711 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: 3txhkqFJos+HgTPOZ+/O+s91CzGFHqG5mnYxYYH2dWrQ1YcoZ0D5qxgbw/1oPhFDQq/1uHLIbBfYYOOG7xbfp1AilZsX2dbzT3eauITuW9YYvX6u34d8t4JaqhbrLW04QqnRd1p4eAsfxUIZ4ewhlODOcoa0md5MleHK7L8WjUDT6aG+zy0lIRXpXm1PCJ4eoQ/ca3Dible2fBo1rgn477AzRvbw02GM7eI3fWIII0l7dF0Sxa1c/OzvEf9uC+EVjHYFTr6VzInCOIEo/vSRzivAD1f0lI6mFz81FZwh8SXlVUbClMEnf29tPro7YfDFKqpsqPsW0dB8ZgVFpa/2MnYL+Em+4X1P7f8qjYBkMPMXV4qnL2cSq8K7CUtnzPdwvUT5z+ANYdK9TDsXEMe675ipsZEn8e3LKGDoe1lvneV2Ev68DVhFs9MHno9iY34ZnRxQXw998dL9LPj+MnPdPaZCcxVPZcgpuAboOTXgVlzbSiHyJJw8zMfyizJ+zaWZS1THZPa+b3tBCW/H8JLeKxG0XSuzjssYX1fXB1LQkwOzQymvFkk8iIPxkCEdbiX16tljJqpKFRq+XrhaEnBZlBHR0YUnaE9SfZMsNw7k+K2549dwpIALUuZxkufo9c0VVGWCiKbOqHCWz8/R3vdsDhSf3tiez/R1OMJFN0ke72qTjhzkny4oaYOv00QotXXNYy/kHj85j/1pTiVmxQvEwmghxcNg0evzuC2MmNMvgwwx20BRKTV0iF05/Z50LMhVmh6OHvZzjtl+6T7D8ju55A6qap8ohiWgHHT/alEg4EXkDtXKK6vwWejDzUsXkHwIbIENZk5qwoBTtodzBEKH8RrC5HD41xKp6bdi4cClLo0eAygeUMICUECf6Ip3oVIz+G4aMuKpvY7RBGgJQJX2Z/G2oE5TpUHJqgp8vY+qd5Eq58S7K1o/yc+jlW598P8s2002MTlbmnkv8FGZRqbomb5s30U7Y4TgFRD2ACZl5kF59b7Vx+N2tFbSQDO44wbikUbndgm8DbYdjOV7i6YevsfCsIP7sec1WZevH7NLkyAJfWVzGFRtOjvj4QT7wW0+m8wHS0y6dSFEtgd2DvT4Lwt/bVOtM05Wn4DJQ3rGRjHDI0aRiI7CmCm39RBzToIL/S2fAwSWypF0xUm1324cvbAGNhyzcRmDVvA4YKs3/1hv3Yut8OkuoPs+wad4dlwVWNUsriz9BJLGTM0Mw6jiv+44+EpcceJezCi+0mid+4zGFB8aWdiuXyVy0b9RkeGDryrABNDbQ/KRhTTtpjHwSrzwqpg+NzuZF6m4lmQF8u3k9oOK6N7jX2XpIHZWI6/4Ln11vf2CqZznQd0coFcrt8dp9ufrxuWqmgj2DVTWGiXApb7lteKwz036nIuUUJpQnwUV7M+T3D0HgCh+81WMVA== 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: 6LMEjUbpzXO1UD9aK9OAC2R94xTB3/2pIn5H/08juFxPnXy4Yon0aZk+xQQgK/oICSKer+/K4M9LEhCkRbzyGR6p/nJ1DO1/8EcxxQCS/G5XvtiYnyEsysxWLsJkXtlNs0LRN8h3nyqCPSAw+hpevW0Zs2K/7eHLtVGbHpHLYwNHRvFDjOxCE7RdaJMK6T8CC3jssWV08/Yzcc4M/8ml5oox11sIwt34T76bpAxOkxLA/niuGA9zWBWN1KLhBqNvXNMvzbDccgthDIxHP3/ygq06bf5UuGQ5yLL2F9jKTfx3MGV1EWdm6Z0EuCKm49yETxSFvy/KRIP44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lZMyfnAN5BGiNYlpBAGF1bQ61ERXBl7N3KvhTO6fm2E+2xWAVfR2kyo7rq6fh5VzcW6UT8xgq5Xs5Av4UsxtQYSt97sU9Mu2kI+Bp73+LPOAcptn4O9BL22Zo6aM2QYvjfrPDTq4QgroDrjOPvCYIapCIiqsHUshHhum65/QUdT0RIDdkqnKc8iShCV3aEzIl2bGSoU9NKWgIaMcYotx2yybSdHgrQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9189a749-ff02-476a-0b07-08dcb4e79711 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:14.5404 (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: eJeCjvB5ZSm7C53ZVXwvVzD4YuBwokFSKoTsENYVZVqNdnComqAjHjUCR2ZVihC4+98Nt9jpAj4s88Shixw86Wn3cdX+9xZBaxXF9797IAe3PmUygnBKCQx51FCVb+bc 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/adau1701.c | 2 +- sound/soc/codecs/adau17x1.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/adau1701.c b/sound/soc/codecs/adau1701.c index 8bd6067df7f75..8f97eaca0be59 100644 --- a/sound/soc/codecs/adau1701.c +++ b/sound/soc/codecs/adau1701.c @@ -469,7 +469,7 @@ static int adau1701_hw_params(struct snd_pcm_substream *substream, regmap_update_bits(adau1701->regmap, ADAU1701_DSPCTRL, ADAU1701_DSPCTRL_SR_MASK, val); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return adau1701_set_playback_pcm_format(component, params); else return adau1701_set_capture_pcm_format(component, params); diff --git a/sound/soc/codecs/adau17x1.c b/sound/soc/codecs/adau17x1.c index f2932713b4de9..2d3579bdc91d1 100644 --- a/sound/soc/codecs/adau17x1.c +++ b/sound/soc/codecs/adau17x1.c @@ -208,7 +208,7 @@ static int adau17x1_dsp_mux_enum_put(struct snd_kcontrol *kcontrol, break; } - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) reg = ADAU17X1_SERIAL_INPUT_ROUTE; else reg = ADAU17X1_SERIAL_OUTPUT_ROUTE; @@ -237,7 +237,7 @@ static int adau17x1_dsp_mux_enum_get(struct snd_kcontrol *kcontrol, unsigned int reg, val; int ret; - if (stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream)) reg = ADAU17X1_SERIAL_INPUT_ROUTE; else reg = ADAU17X1_SERIAL_OUTPUT_ROUTE; 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: 13752924 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: 7FbEV7a0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5IoDN2gl5md7H5q/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+LhR4zUPO3hSaRde8XcJUc2GtIHbhdoPwIioSwLPy6k2eH/4kWIZLff+fuuFFWcQUtuhIpfwNSKq0okhkZvAobekimolgShbzYg18qgpYa11saLQK+A571u5+mJGBg3cAoxJ5N3bTyDwQILAGRzeAbYYEI5rA+64Z4O09d0w/Ivcj0Fyb9q0ysEiTYrQFCK92h+EFZx1M0EZYj2Wc8rbbG1FHeFH+k0nFnWLv6RRP+43mf9B4PzOh+d+a0OgABVlHNUXeMv6sF5rd2fcW4xpKGqgHotRtJMPlJahb6M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xaCVJfm/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:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752925 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011066.outbound.protection.outlook.com [52.101.125.66]) (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 E5A1F1D540 for ; Mon, 5 Aug 2024 00:43:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818608; cv=fail; b=HqM5qGTtpeHqKoRC80a05KpqOTgW+xMFpq9tbTl+G1bVxRVNGSYlJxRRvOhRwNVXNkp/0FU+0i5kYgEQJLEyW3c96gHol8lBvOuJ8vg0umjtx8MMVdg7rGOS3QBNkTIPvjJxJSg1gAvSGIk9eu1ovPYMsOHQB9737VZddSx4tTI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818608; c=relaxed/simple; bh=CfKC7ucYZUgmhH9qqQ7MrhL0Yz+WS3M7gXpn3TRIyL0=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=TNs22w71jlWrCQ1mWJ+R59ippQaIRJJz1JlNVeDLGfcczuArUAVLMFf5Zu7iyaU9LG56XhlBZgJRzF8CG328QZkNTSXqGH8AgCScqkiul9IoLjzdYCU0ASA+pe8TwFHUKHim0F1Rn6xqLtIz+DdF6nHkyDtpWCAv811pyfItinY= 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=SAmxFpIW; arc=fail smtp.client-ip=52.101.125.66 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="SAmxFpIW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RpKuET4/u/j4GSvENMSHpMmR0epsGZFcW1DuYbywuhHcVMdJOk109EjUch/Qhnj2QxCtGPw6jNVUYgQBtCzLYKhIPPi2+h2gK4t1pQ0YoS2fW3w/Y6JmqerWrDhgN50i3PdSwUXWR34upqCQHSsUFnXKzqpTNTO4RTiZndDNzePyyGWVnuBidg703HP6Z1JYy+7t0V31yJqItUWlv7pcV1Mxu/bEWZ3ncYgZ2mwHJf6snsT1e2Y5IpMsdLeo5KjRUpaYwXqNbCxyXy9Rbqx0o2X5QBqmj9dNpfFBN23dauW4x2ijCP40svljuEH7I5twUK/zQTQxGiTmexz2iovvYA== 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=+AUjMNrMae3oBTS1wVIBv0t49HWKpOSxadA4q1tB/jU=; b=ypGFVuP2jzwu0LHzDWA7HF4ydVJGHu9nOvYy+RTioeXX8FqNvg2kJp7m2waxFlkesC6CAco/gBzudn0K1iQUfNNJo7X7qq4ubDZnSQbI13DJO4g4i0kGxmVNirpX6/8qSBWzDnUghvzCGrq7B8ZkvPcvRuJuT9Sl5pxCItC5N9+0oZlpR1cuzJOkyi+LBqpodDg7VLTXEhctICJJkhR9KxPKo02kZoyjvvIr1g+YZ7cmLwSGUwvHWv8tZcH2XRHM6P8ZYu7atMO1CmoW3WsDvaFDF0E6OX11tH95fC0HqqNFSP+K301SCAw9QDGIkieQ9UB3oMPpPRcok/gOgWQ0sw== 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=+AUjMNrMae3oBTS1wVIBv0t49HWKpOSxadA4q1tB/jU=; b=SAmxFpIWff9x4TTOefu3cDzqzzsSxhz9AbiGW1T+2fl7NiJYXaam2VjuEaMAtCo+hiPZoM/Rm4Xo38d62zlJ3Muhnn2GSZPbTkWJ6IiEdz+3IatXE3qIMDTh6uAn5J4Tr8cu2N2l4agCM7Aii5OATJe1MJWQPa+m/eFBgruyLSU= 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: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:43:24 +0000 Message-ID: <87a5hrx0ib.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 096/113] ASoC: codecs: max983xx: 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:24 +0000 X-ClientProxiedBy: TYCPR01CA0088.jpnprd01.prod.outlook.com (2603:1096:405:3::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_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: ccd502e7-b2c4-4936-2618-08dcb4e79d27 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: vgBj08hobTSgj+X1898VIXsag/bbmX43fLfkzw6q6nMKZHexlfcKlf2VvsPyLPbXVVJnhqv0PbOBh/ugWfYR1LJ18y9l/tyKaX3xu1O3N9gc+V01SNthpZLiADv4vo0zx2uMogMQoj0t2qsEwXxmqFzprwcBij8F34EdNaHth/bVf8rlpkSJqyqUqJM10FXQzQMfqJCEmGO3tIdBAQtf8EmUn4KdN0VL8YKDKH/pEqJ5eI7G98V6DyoDO/wn/1onzd1u61fcPhiQXt6SfPw5pwMIT8YJ2XpNASPfrHwAi3NInCW+whTWg30pfoQk1lLtsxJR4YK2lnqWGRNMtA7K4Gt5G7gAb6P5CkWpJdJqarYdCV/IH07On3UN0mkwLE/K22wejtI9JGMBV4GCyPvoeh5axAjuHhPKxJhx0FCu38m3dquoXIA1AsrthZInloAeXAod7XfdyPG3nMmqNjDaEUqIWF33RMvtThp0ne+0rdHto/PFcx6rKVf9Odql+FM4hE/2T2PUTYeoiv16m+39AqZ5sv4/ljN/HryO8CTCLhAemHXfbj5FeXs578Mx8VZH0xFggXhz9LQwh16U6UnbnoD6NYxRA9K6vhj0CksyKmNdnX0wPV0nKvP2DrIvX13A40YPrXK0Ep3k+FhAf60l/kSneaAKifSl9Wpd8/OeZonhI+N9Chh9mIVIf3FHcX47f1AndocGzvST9GeaV5QVU/gSiwfpvbQKaoQ5ckXUDo5x6U5p2GgfR8N/zXwmWOq2w27ypm7/bilaOiu8tbWCB0mIjum9FSHTnEwI4wF1kGTIixAWyOMST4/C3GLGLCHb4S37FHqQzYHW00Q6WEgx7NgG6Ps/JbiMyucvmvzra0lM3cH+MrjsRBAZZ56mGNoQflGDq0GjsCE/jqjeJGWUfdMZlEJqtb9hY1DcCTcXCZYNKFYFgZ/f+RM1ETiL5rrpQr6XP+AY7aa+sRbPXyO3rFh2h/R/0QOiYhYqJBo0zIHQDUe6Ps7WR4Il9M1aDb9uyus6ds+r3270gdwQx87+OAJl/Sh9Bf2xMIqpXeossLB4nDJMvipsoeZcapjPztHwcsJj92TDUnmGDiANZn+wo2kGs3WOKsDvG8viNprNdkHsJ+tW3ArKrEHTZr2lH1IT1+ZOGja/hJeIL4YylQIkSsBtX/xRyNVwgXsJRKzXHIsF8x+4M0r/gHU/GheOGZDV8UCsgoCNS9Cp8RCLn0Bp2IVqay+b/EyPn23VMXJEcJ0QsUJySVJAHn68JrBMwRnrivfZsEt1xLt+9ybzj3yGPxZsMOq7K6qS1Jpj5IA5DJYtbTakYfzzgVVS5VjWs1rrAk8OiZoDgR8rcAKFKDm0JQbEFY9VBpXN5UV9rDF2oelbKxlquvSLCu1Zb9nv7GlhEdD+TJt61I1mAtu9cd+B/w== 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: hLUw9oJf2t1bhfiUt2VOHin8d5yO4QyO8Wc/ojp6DD0bzAWj32UcdQOvkagrxxvyYmI1uBUTCSZTyHs7QlbVOw67wFSK6DU5N382I8u6e+/F99Ng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FrjV8iEcUGqO4dN1OICDJlC6fKV47WIHKyKsehaDMjpeWfDuKHrRfyM6+NCsWZMWj6eUxK4HVSQEOIES5KhA6JkDQ9ZboxO2hzVeZk/3T+z0hYiiK+VYy71wyIMxCH3KsQtzC/n/mpnOeYHfXfvXDga7LjREt3StbtAjSYSQkkEakZLieya1MVvgrS2TRpfhpl3bSF/3I31UiwM3RoTDHaEDvM8xSHw3RgRoPe0rR/5OJv2eznFR2x33qfE9fOHUGJL3RsCdf75cYHk+hi13gPjKdnJonNMwZW0XaGQ1a/4diZrz+yskhAronlwmYbq+UunOKVLuB5AXPlotR8vKtGxB8nT1i78YobnWEWmcjogD8eGKLoUgaQi45LUH8FYDvpAM72A8uYhHMfGEpCs3X6ghyh+9NlZmCgpKjNa+rdpjLOA4wGgj6CRKRGdeLDTpfM= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccd502e7-b2c4-4936-2618-08dcb4e79d27 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:24.7408 (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: Tg1/mGSuuj2EH8e8ZwBuUL96lxY6zO7xtZomb6+8jj38KUTo+d5fUZouAacHgbkPx9JXZcC6QLDFguTpWmPK54LXUN41ORJGZEj+bMgo3PFtfKirQtzw099wnWEJIeHh 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/max98363.c | 2 +- sound/soc/codecs/max98373-sdw.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/max98363.c b/sound/soc/codecs/max98363.c index 950105e5bffdc..5ea6b36941355 100644 --- a/sound/soc/codecs/max98363.c +++ b/sound/soc/codecs/max98363.c @@ -221,7 +221,7 @@ static int max98363_sdw_dai_hw_params(struct snd_pcm_substream *substream, if (!max98363->slave) return -EINVAL; - if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) + if (!snd_pcm_is_playback(substream)) return -EINVAL; direction = SDW_DATA_DIR_RX; diff --git a/sound/soc/codecs/max98373-sdw.c b/sound/soc/codecs/max98373-sdw.c index 26860882fd91a..531c67023f922 100644 --- a/sound/soc/codecs/max98373-sdw.c +++ b/sound/soc/codecs/max98373-sdw.c @@ -534,7 +534,7 @@ static int max98373_sdw_dai_hw_params(struct snd_pcm_substream *substream, 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; if (max98373->slot) { 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: 13752926 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+bGVSuRffUO7g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+kh1ycOJkmaky98tPuyd1cpC/ED1ZIZDS5jOO4qsYEpPTcxhF0vAGpTKDEy8covSd92XOU85/wXn/RX1CnObVAWN8OSV1s8IliDcBqVZPIgsOXr+hGhKy1w7eRWmk8HJLbihIwLHLGcsFAs1QjBnlQWzw+zi6QllzkFr5tpPxE+QU9IfYuwGLF+gWZTZe5z8SH7xcP4F3JBFA7JWOFTJ+XH7fD9Q202zLOGd+guoqcSC/uA1sFX5J+Rh3POcpuLfDIzJrhTccbtAPsWXLBeljx+y9O97CMBJtKajiIArcNS5dtB/F4BuX4TAptagUymj8wEKASKSqXTRw== 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: rFdOQLpTTyoEDaAoeCgTS28VDp7AtwMIzym0RFq7YNz4Xyc/IdgpnwYLAQAIqQXvezqQvTsuxNWntaiwWAUXlb+P8jWLciabGCf97PXslEULds1FMaFcVgiCqISNaaNhGczUGsgq62E/Jia93NFV2fcdzgcQ8MrIblr8cUxwQiyn2IPG1N6j/CYDUhwd73TVuiQ45YU7kvF6G3d7VUI6JUgJUtZUqyv4nHjdiypP+K2BA4dnInIUfBvMRS5Y1tTWIonA7tFnMHu3NGlVLUPRwT6d9E2EmGhSHw2QUfLSE31MMLCwijfTIfkN+sH4xZTIYeLxJLFkiPhBS1P6Y89QKwb4/Osdg/k0mD5MFpRvS3kDosxG+u+hA6kiEOx2s90hDHKz+uupl+l23q4oCcWN8G11xHq7xr+7vFwou8OWiqok0KKyIgwtdT0VuJpGWCSNv4fnOjMyfLU92KdVZn5rOAjdpMdeUZVHFcUbFaBee+z346iUa/N+8OcDjOTpauqRkH/jbiazbGC2mD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ir8TBVVUtyPCoGDjg= 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: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: 13752927 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011034.outbound.protection.outlook.com [52.101.125.34]) (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 CFA0B30358 for ; Mon, 5 Aug 2024 00:43:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.34 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818617; cv=fail; b=EnpSGbep9WBikp/kmqcLL47x8ycmQ1ILZAbAOiElccLSvUuz7fSBtZZ25qppPDgpvVO5gcSF9xJyd/LIXG8Aqrgdm9jMA63pjRpZ6Q+Yra9Y2ifqKjfiY5XvgZ+NSTPbUqah8uDlwcUta5aMA5VBKAoibHkErqSsYqpzY+fzvW8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818617; c=relaxed/simple; bh=tPxPpdkxEvRSKwZnevgdaOiedUh4ldu+gIn3XeTuiVM=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=GKeI59t4wO2Clh+j/3FHr7Qhn3nO41BvSDxLPPdZWmDhVggUywquSrFzgQ7UurPLiB250WTLqDswtD881dyP7ULX0OZ5aYWGZ4Ily3RXPuvR0EKyalb6uZFCFKVknexFcTsjVWc5x9dGK75i/N0qJMKGLZEaamjzCB58CP16650= 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=Bw/tRg/p; arc=fail smtp.client-ip=52.101.125.34 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="Bw/tRg/p" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Yh5sCb/lC4fJtNQhBgnaf4mZe6mW2KczimctPz+TZhKTVl02jJ84rPkeL8cs8boBiJ0TnoZEDzLt0mzowzZBayORyEfMeeQp8XkN7D7dgb0+i1SYe6L2gKN4D/RgApFXh5QXZFdmEbATjbPBDC6ZACu0Eh/IrsaVtmpZ8n5bOWmTtR7lH3zWVi1Y+el/2nOy2hL3c00Twwx5Xk5SH8Y5M/FnwaOVp7GDgsfwnq7+ofyR0y7neQnRJ+e9yEsAkLZAPJt86DsjCrST5XxdOH0sE5rjBUQefL+5tdq+HZtRUYkqGFYfo2v6rzW9to/tXRvO0YSTxFa4Ev9iUpyRDe8JGw== 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=esJxPO1JSV0CKFI9/GzSvyuUaId3bzbjJaY5+XQfPl0=; b=h0qY4Tw0APEQvcEXHx9y4241lo1L5UCxwpfNIqjBetqIzWFvWT6TLw/oLrIDE9Mpf62VBvxrv03bbyN3cj+51iAIfeqmiOeMPfvZmgfhej7HPtFyVHpn4Cf2hc+DrF4YpM59MbJCqNEtLC/d0TS2QUAevvsyIOn6Du+y2wNcSYalLlCHgiXTel0O8ZGUt9rSWmIpBw2jCutWnXoykeKxmlqXDouGehAkdlqED94+Q6kadXQPZqPTjastwG2+VsXU4UiOo3ZXOYhsRWuyrOTxWJ5rxi1aDAScJMHi7SwZyZ7aGOAPp8i2Uyo7NSk4St56WuB/KyOb9qai+xmsOTDaLg== 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=esJxPO1JSV0CKFI9/GzSvyuUaId3bzbjJaY5+XQfPl0=; b=Bw/tRg/pELEpaxIjRuX/oeLpWIlFlVXr67XfmyQpEJ/OfyrwHNskkS0UWvPyD3IMW15uLmxEAZYJsOgLAgKxI1i4iaAerqJKmaFsuh8/5NfbvKBzjgDptGqAmt6olFIRBMilPLZxml5E6AvcxPgkuNm8yjXEmoqt8M65WyLRHfM= 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: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:43:33 +0000 Message-ID: <877ccvx0i3.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 098/113] ASoC: codecs: stac9766: 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:33 +0000 X-ClientProxiedBy: TYWPR01CA0020.jpnprd01.prod.outlook.com (2603:1096:400:aa::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: aa0a4f52-a6e3-4cae-5a17-08dcb4e7a239 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: 8sU8QyXjK0MwHvm/2hrbykPGOqiQ1QjgTPwv79mahEdsz0J+LW25LAhyStwW03Qlzud+BAbrBaSIXqRaysE9AVMPzZFmN3pUrFDt0tiIk4tbImoy0kUe1+jJZ3XzihvI1DLr6UJkL1jQB/47CQh8SkarjpWlS8tJAbBIxYwwBVf2HRudQGFF8T1SWhA7vkakcOyNBJNawJ/RFvOVfdHo6vHyHdC4tYS65xl+ATex3/INTO593pUFvRfdaGJWVulsmuaD/5Aqi4GYeBp8G15qTBzpxsA3xDCY9MGOdWbrszgZBfIFhJNLXOE4vVf1oa2FPsJVmcC2hsrKbQfmYXuRslgnaU8+46AQ4cZpaSshYfsS/wglp2cfNTKyb7MO/gRejmpZFiQmMkkFtCMWNwhzEak7BMFHzh1x43e5txErTY2y6GayBZIDloJRIbBs90zmKPYhGJyYkO3f7L+BcjZY3zSNvRNLugycPQyhN7uL7c0YdZLPse3Qq3Bx04cHIcfrJbut7Mn+cB1+TQ16RkXSIPKGS7pW1VP+RVGpwiA83R7FBvoWmD5K+zG5eWLSldIrL7oReeacFhIvJPXk1Mp4qW1RHiDKG6VJgE3Uu4VGvm852NL0SOQ4ZL7af2+Iv3t63loB6cIpum4WeBzR86kJhD9yFBc59CZT7MCoj9kIeZ6b++HyiE7io/y8Jrrx3eaWZcUmP8A4LOyuySjF5qgsZBHT8RPOu5hgRFau7A1gRqHnY4wZ3zwZdS8EiGj/XLt7NHocag2KghKdSv4KkwRtR1g002gUGRUmoJ+Nbj/G0I14Qo/ZJftyU0K15aJrv3LxATbK+CrIDsxc5od48nEZwWNcXHMG817u2bHvMVnUqzQr3U8legTw6Pqsbc4yKhJr75Ad0ZPnvSFzg6zxB9hWLzqtolg9av4w12TdqfUDp+PZmrWvg+FRE5YQ1/zPGJBYiAloCpxyB0pneVmtuHWn1yszPK4XSwMx78rE+y/AtiwfZ98LvU3I3moO3IUqLl5dCcdULEP7cwxpeLa3zuceNGeIKWr5aI03v+sez8Jf8NdxO4Tq89Bw1dCYb80R9TXgoPv4ZGXt/XooUwp7slDxGzpsS3RliIslcE6L2Z9f4pIOm8yiUWFJlsKJmsdGPmfNJG32FIr4Ct+ZTCKyweh1DTP3simYDRP6drXQkirtPJ/t2c43RT+ltGM2S60pDP6/65LD2I+DGtPZ2xlLWB0I0zrZENpuWkMlyJ1SGk6XhjqrwGT9Y88qR6WMC9OJwK/iYf0yapttK0LAgTyu4z3Q7aXgwcrptiqCrwVGEF7hI8ft1kOAcKt3mzaD/DOB4kwUe0+Cq2FX2UB91wkqw8Y3IZ93yuuQJ+y1N299ZTOJGvp2Nw9XENu+4lcYOHtVpWOhDt2Yz7faonlDEosMqQNsrA== 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: Vp0ZUpoSAzb9iuZQOuSBFUZ966hvayMxpaUYOeU7oez7UqYafidYW1NSGqVsE7ry9qxp+tS5TK76nDkqROfJ7nW+Ge4Yk20Pzbd26nqwjS1LKgAhLd3hO0avLkJVkepu2PXHPKJ589Xddpe1/gcI29GMSsw8gtsTN9mb2j5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/+TYWZQfZL+mnYw4BwUUr+bwew8zV9Q1xKNrQ8hWrBGZScblQdISo8yW1cjleUn2RqYyFIWmRfU8EB5aL8SdUEFbkQjA5u+n382MeHmIg3wjfH0TVsVb7kfrXmqAmWu4VHtdTygyHmoLFwL9q9aZBu8i3n9w6ov3QZaY1d4UMX6/S06DJsVc/+ZAM5UTLy9fyR3Tukk14h26t8FlHWZ9oZlmdnN+y36gKsAID90IvdZJ9m8urN+BThRz6FLhxE57fld+amM0zlB8Va3ovWRAAr0WwGbvh9Ccc/UJM7cXkfdKYNpomqOmPe0afMaWY1Px4pGo7ayfMGrUNPby777q/fN/FHbSwHkKvaZMUJLe0VfOgaf3horFYam2/QuQBOGN9ns13AbGaHOBk= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: aa0a4f52-a6e3-4cae-5a17-08dcb4e7a239 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:33.2613 (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: jTD3tlFItDTOSV0AKoknALXoqEBhyA5K7FgtODdtWd39AvE63RwasYkRGK3Qb1crhcxicZAk8ZM5ZOa5J5vanCXOHSuvqtpBQJ/OrWFTfsr4v38Ld6jvXnxz3SgD2C4i 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/stac9766.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/stac9766.c b/sound/soc/codecs/stac9766.c index 2f9f10a4dfed9..3511776af8f95 100644 --- a/sound/soc/codecs/stac9766.c +++ b/sound/soc/codecs/stac9766.c @@ -171,7 +171,7 @@ static int ac97_analog_prepare(struct snd_pcm_substream *substream, /* enable variable rate audio, disable SPDIF output */ snd_soc_component_update_bits(component, AC97_EXTENDED_STATUS, 0x5, 0x1); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) reg = AC97_PCM_FRONT_DAC_RATE; else reg = AC97_PCM_LR_ADC_RATE; 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: 13752928 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+St9kj+m8hm98VB/95vHwAL83jPdrOAkyw/U2KqKtacjvQ/QtC4kgClxGRVEBFwMmov9X6jGN+BiW3Q24oUgpBiGoxdLKPUR0Txu2JWrh2QoVzWchK6LzuQLnFK4U+nhe96Gxsy7S+1jviGStZu9GTb+YYC3lLud7YRuLVS7O9RTD4oLHdcX8kJsk0MfUjxf/fMHatZEdXcbd+aPXpv2xr06fcwcEVY7FOINeJ7CyO5Ux5INg9XoZ5JR2QUYsf9uiBkaa8frZu789pO2zkH4sHKT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tRXm+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/fSbzL7bMaVMSKyZFXr01NWRY4pC8zzwZQNN3wgSUQjEwnYnGKXO0vXdiF2zus2QIyQCqFCw1EVfst/tIi137/ZV5+VuiQ271Aa/qB8/drezMKxtR2mhga+VFfIiQ1RV4TYcqyG2WOeYujpXIx5vAvEAMO0wvnaSJ0JNALAsR3Sd4Pi7ZnDgaSzGATFynIlz4Ut9FiHkYe5xHoaADuxRUwF7pWlg7ej5VLVxYZoUvqOd60E8YU32GQ9MBRDeiU4vjOoGXWN62VZYEwWl3vPg9w0lfTZXU+AxTsfhd+6ZPbln9U9MRqXkAHDGsD+Smssk2pbmUC2i3JKromI1gTQCQ3Il3d6dQfa31Is49mRqhBx/GeszsyaSGHb1t8jQOhME/l+gGyheCrIsdRqCeW20epPvkw7OkTTK03//XK6gu1Z8kmY08+TumKX7XIezuX0dZd0UMl1zffuy7/D0p1lmc8Q0VJfOOuRjdbOh/u/ZtyUNoxdR70b1KvGkeb05bzpH2DLa4IqVoopkBjY2iNm4tC4O9zhRy+vhQZNXsbjG1XTQaqlikcO40t4PqbgknWGg4CKSYec0SZiPBlP7V50mSLbiEcckmO/xPuOF0NkwasGWTRlH+nD7B65yjC/0F3+7H8oC6DUoYkKRHeL2WFcJ/ATq9Odjwa9cTPsUE4YeNGuV7WrlBDRVuo91vFQ78LYr2ltwGk49RGmNmITIkTxjenjG0Z1W+ERFIIP+xTld9T3qBFU2mrTH5uwzOhQcu56KetJOIiCN5/lDqcJqMBzOslGglZyKVT6qi+4fqfjW15tSIo0tY7M+mklxCItN5l3vL8Z4wQjYu/8IQOBHTN3plRW0GFecHIqGP70DNyw+R54KU4oa/DN1eUW8jkXWgTqo+04N002o/dEdMzYUQWPPxt1b43Csh8PN+tT210S9vLEas65pXfqauYt/8OCYk595S421mzYT5fLghYonGYgT5iY821rKLeSNhF5cNsvVCUw6t/kI9W25DhBoyj3ExFzSWyOMOhuPrOiwFVd7LNhchn3UblFmLo4YVXGwy9s5a1mJeo0862KdGR/kE5/lPHZXSoo6/6idWdyJoXDRL2CQULRc= X-OriginatorOrg: 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: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: 13752929 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 0ABB12940F for ; Mon, 5 Aug 2024 00:43:43 +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=1722818627; cv=fail; b=glDgF5bJmI51pSNTelKTV6oZsSP/5Z6IXK0/pH3Xtyfib7iJexxtQaye1csM6Wua6QehKzSbab2ZbNZXkfKtFzCaGORRr424sCHRgqCAmNPbAWEiz6HpOX0BKkc5mqyeXILmcVSorIrf+zpP1MsyDOx7eDFg8rspefcuz7RbHqc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818627; c=relaxed/simple; bh=1Vbhs1VUiJBtvZpso8EE95MI4LS1eaL6mVxvIF4MrgI=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=LJaqKlAilXgRyR0MIVGDmVxLtF51UMjk/5TlzvRUw112U7MYcqfOVaAMtlZH8rK1RRtykIbkW3pqCk3MTqbSW+xVZPW07CYcdIGom6dAQSMyV5Q3Ap1cmIE7Ji9QVEKI91RwChm2USwGOgy+NuN3Fqsjx/rD2c7LtLcp0D01Cvk= 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=ZJ9bQtHg; 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="ZJ9bQtHg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w75MLp4hG6eaRH8uMaYgZiZwW+KIjqQkAe/Bi86gXCGSyZlDTOjVbY/jFpPsHMR/xQ6/PC2ZzhqsgUPdTZVYpE5QOh3nR+f1JNvEsWYMEgQHU8l6D5pfOe/bfu8qOQttzUKtAyzfM7x47SOkrpIHw8pbW6XosvDel8/oxzQnd6SaObHBbee1YkLGdEguiZp8xcBcwpCSUF+dBaPHt9elx/M+YlmWqZTdSiXxl1iL5MtWYcjsWCWncL8fUj17Yfa759tHfVQbxPh9pgKeuTzGN9fvy1E/8soCCTmYNDDqRRYr+WvkFGd02TV61TpV+RkWYRtgrj/W7N13qShCif8rUw== 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=2NjoCoI0+7+11KCV+4XdKT1h70YPw4J5Kqd8iXUS32I=; b=C7MUrvlAeWFhBy+j8hePl0sa2w4O0SBM4SFos5IbgByPfGqSGCqcGpY9uOiCCKXaGZf0+3eafvaZItCj3mNfhtmZ0+/bvOYv2cYgP6qoJu1Y/2XfLPBAGoV11H+/WVSbz6yYwHBFG81XgPCbpVJZbdVcji97PWUiZiMjc4nHrVJxOx9kUB9O7O+to2w4LiGk+CvFQ81ZKaIot6njsAVStcw12sGupFdN48eX0Sk51ckxyKc+EOCdEsR0+zycpihNldqXyHvFx8Hp5JfxVzTuNtRIq9wPbXdUkwajuQKlZkq/qrtpD1fxh/jmQtNQKqIE6ZAx0ELAw4eVsXbM4rZh1A== 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=2NjoCoI0+7+11KCV+4XdKT1h70YPw4J5Kqd8iXUS32I=; b=ZJ9bQtHgsz4Af/OY6v62zYXDdV8dUnYrPYW+dP+xu1Wyxa/nKhJCVwwDUuu4w0wycG4G67zU9LfOpWz612hjVD9yMhlx5F+RrB/c3AXCm1M89Mx/3LHZKj9CDWo94pcApy8joN1aENYVN7C4Jjmw78couxwsyhvHIvOGRqMkFiI= 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: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:43:41 +0000 Message-ID: <874j7zx0hu.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 100/113] ASoC: codecs: idt821034: 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:41 +0000 X-ClientProxiedBy: TYWPR01CA0021.jpnprd01.prod.outlook.com (2603:1096:400:aa::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: 4314ee1f-e0fc-4d94-e0ff-08dcb4e7a73f 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: 1OhSoWlmwz/qNIWd65xhSnCalZTTFmjoXb06YLLs8y2GNMl9s4UiTYZG28wR5LjdYQsnelvkVJ+Xqf+e1Bn4vjojdW4r8uYxngeIyXIN7Q0PiqTbDZt6Qxy6LwBnRvuWSmJ5FgzscnoMUDF+mnLESQte/+tuaNMQIO6OsCVEyMHXWhw8oLI8FCrJwDXj7uuP1X3K449oZBkNzjdvDHBvwRu6iPKO/CSIvT4nULlbjgqSok66MMDtsIj374HE2K3G5nVof428Pv7xv/H58tlu2ZUOqGN/MYfQV7mrJrL8b8PDUPO67Ux1Bb8Y+UeOu2D3eQ1hP4+oYRk65SPBLVCjhz4pe0YZpNkI8YLehKe7b52JJY6XY60i6iY6YA2e03dZW1cD1Q9wLSKg5V388T4eNUDZZSmYc9GH5VB4aGk+Rttmw+nYeCClFrqYPUCG4Huat8LLBKocdc4VSHUgYPXJY5WNDjmgmUhLSMWX5XWvNuBWaKdTcRXupOL7EZQaCujgZa6YRH186/GsxI2N22AhmDU3ZsH9kRiyap0XFmJuRObtXKJe/irhhvxYmztA8/SLFUV9zMIySqCjYIb5YF3VXHu2MMerfqd2saj+ihAb0715KjGLcfJ0IqrPoEtLXk2DxK1RNkeFL8/tCNBWc3TqpL3e43EWGdSyabGFY4Y/G2c4ZRmkouhlXABtXbySD4VBm/oFDZEeMAClwfHL0fyw9UHV38L1OQH0KXRXAYRfM5d9pRGvk8T2i0F26xq88KCh7BHD1+C+pzfBoV+gGQh4Or6ARQjk3WmHusyauVNxBeg0p+YlkpePe9V3Xfo3Q/N/kaOvvNc27G5u0Ne1HEIa5lNPRlr54BP53qoz2Z2sU7EjNiPcVhx7iYJJRo26TYRS/y4rF++e51bYKpU1WS76da+Exz29GNacgX05GRF0N1VWJ0E9LGEu3ocbWEvHnvQyooWKs0hjxKzAAOdx3O+MGPqo/UysItZYGHhhk17JFUUseZsfOuMQow6llkaSjl8UsVnJwuIo81PC0WhfeFK4uDSUqiEQnqq3y5PyqrzyV8qpbov6nBC1/SOh9ZCbDSqTqTon6lui17knSLd5B0xG4VV3EuW7Pm4DriuFVSOmQ3ffWVElxHrx4mGSgcgX9IHACnSXLeaHBSFsMfd12poeTZUZKAvZbUz/U3HgSlvuOLa+sRF2gxn4VVHBjnYr6nQvX5Cj5nwmx341QFmBn7VeP/jOPrcsrjPdgwJWW3030f6ELeheIGfvy8gJBJEa4Qb2Yc1QnxSBRK2CBdgYw9AdpxJG8Fv29+363V0zIH4jOWnO6+dMDSd7WUIRN3YUqnFEXDGn6iUs/jAc0VbYMoGv7gvpFPSIAzX8crLAy7fUH9BNKGxN8EuoA8ocoPlcay2bxMIusApAjGOq1zUdYJPjzQ== 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);D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N5TkI5epGMI0ocXbRKrnpAk0RRfeuOgBfZTkgad52EwTAyLB05z8V4/tMa/HMs8GoD3y46LqJlauZBtF9o+kTAIsuuPcSatNxOrrSwSfiELeZiFEeEt9GauOFo4qiPriDkmWGw/YzlPaHVhviHshw8YkH90GAzRAK20/ZB3a9+IalomhCv+HgygWYPRNbvv6wf3QtxInJSwO3O1+lL7Y/tJrYtLGFoKjC4w/umLeTgEc+vq38B3koi31G+CzUW4zLNRlMIO83ROPSm3QDK77wf1fOkdb9oI2vWqAlVZM6eKr1Ghgv+1DztrHATItSAFSiKdIHyJuKPzaFjtxCmoUJX+xLRjqH6R1AiKWlGpEYGo2OmBDQbbV3uFBx7HAcx/l3VIN/YL4x0fyaqUTo6+uvHP1kNiuNqLrqU2D4srGHWKGVyh/2Ee60Mg2cLwPTV0KfaYo0JxuZxGlS/OFkChl5zjIKR0aXMWmI809LuuCm7Raz8ejRKM3Q9x2C4IVU2TrfXOweEfXUZE3IZ73faamZs+ApfAXYdzfEyIRmqPWIr9XwrJAR6hz/2Dy2Ksl6keEr5DYRWzf+x8yzcoi/SbDXt5mahBTvokfV3R6CnDEhcaFdPSS6PMAJJld3Ey8QJ9JQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4314ee1f-e0fc-4d94-e0ff-08dcb4e7a73f 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:41.6987 (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: 10ld5bBqcxL6CnKeD6jksC+tnepojankNyWgrpvqf+3h71BGC04wjdP0LP83DE9j992eNowhYGUnboOdU/hu+qzbJRw8DH25QsWzzf7Nburo7r3giB+0kHyJh7BLvM+b 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/idt821034.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/idt821034.c b/sound/soc/codecs/idt821034.c index cb7a68c799f8f..82279f6d3ce84 100644 --- a/sound/soc/codecs/idt821034.c +++ b/sound/soc/codecs/idt821034.c @@ -839,7 +839,7 @@ static int idt821034_dai_startup(struct snd_pcm_substream *substream, unsigned int max_ch = 0; int ret; - max_ch = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + max_ch = snd_pcm_is_playback(substream) ? idt821034->max_ch_playback : idt821034->max_ch_capture; /* 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: 13752930 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+sjidg1rdIw3e8ckep7ZTzJEVkmmgPL0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hHfkrqu1tHd32LMy0HaRFD7UsPotlfJPEi47eG+s5fQQxqa7O1wfBhraPNQPRlM71xingJRBRDn6G0YxZgoZCfK67X+acQKPSpvLgJxgVYIYyEaQVntskRiF0Tc8wq0caZ3oy4NVhsVjRkDtQE/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/03NeE9w3lTdxLfTuu7DbvKmXpqAuKVF2qC0rfD0Qgn3CT1wC0HWdif8UdiCPBYuqoPNy9SdMHpKofGiiY0Am5UmZbf4yrKYCndXlOlBe4jInb5K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7a99b 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: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: 13752931 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010067.outbound.protection.outlook.com [52.101.229.67]) (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 DD13F2C6BD for ; Mon, 5 Aug 2024 00:43:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818633; cv=fail; b=ronFlUmV7iOkMeoF0frRtMp45IWGhmFZYrkFunfNI5TqdDPxqfaXOOUwXMDcKTWnJp92OB1/l/A/xYJ+lZwZz5G3VqIEiQp1LKrLF2T2VkFYrzOk10LgIf8yfwD+ZmQr+dq4pFvonaH4jj18wCH3PVu46uHxWrZM4dzEJssAF7E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818633; c=relaxed/simple; bh=Q81pCqUO4aa7U8lgHwBBj5fc+S+dicndBm3xS5CcBh0=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=eThVjYy+Yys+IFBQZQw4Knvbzkr33Xf9RicCMLxGoBq1mzPdDtrpR7QgmkyY0twmj0x3pcZMcV94LzDYDHa1pnNkg6g99hD3WZTkIVgkMyZxFR1ofOkPhj/WcZCUE7I9SVBTrwhQd9tOIV9xmRsP/mqkYmM6iBk7eRVHhtTzKHQ= 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=lfikx99S; arc=fail smtp.client-ip=52.101.229.67 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="lfikx99S" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ngxFxpcuntWFVltYF5WQ3sGBoeWi7TUexSqaUdf7Q+pcFWslKRWoqRwsqgOHxOL0H6zjmPXwn1B+G7NvRGvw8iwgAGPHRzuH68aDxTFUbiec8nnqPVrHyJGc1jBZw/aBA2PxcwaQVYJhw34ZAnN3+HowCZ5QQfu+9O8RYUCbCLbEgtsCZTJ0vPK5CFFkyo6kMgPO2MwgaOEtYLA4ZR5nYyPGx5LiP3AX9osP0Ih9IhviPmZFsv8D3O0adet/xansWdK8LpXMndpWQ33sUrL3PHsTYk/XrNlc9Vbe1ww3FHVu2S/bx90pHLfU7qEP8LeHpVZmpLeeb7743dJQo0kx5w== 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=NHufUcx/MhWFy0eEyzpe2knYlbDXhXmEVUBykvY6yOI=; b=aAyC7agyvO7bSBUkKr5dZkcppFscW9XkWMsdTCpmm/mBKmpKWQ+6w+wRR2muJG6yHUk1mDkBA+HFPrimj6gc7Q15Yh63J4iTKE//Ma0niz/1SW0+HlgwSt0AaxAGULbwBxpRS3Ohku1X3ukkjP/LUZIsaOiIrfBw/gkiLmLifeA4+8pFNnO3zxlsZUK/gn8nJE0SsEzPb0wFdFOhM2ga2B14sQN9siD7aDhMc7gNsHNVGAZZepLl8O03FIF6kh2IfmIhhMK2pyfx5BBx0lrnirDxilnd4vpwxGTMVoa/SaTVLgoutdanMN4sgWgrsbRU0ayI1cighhzZw5hjfThzoA== 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=NHufUcx/MhWFy0eEyzpe2knYlbDXhXmEVUBykvY6yOI=; b=lfikx99SvUNra1K+o5sQlBqeDXUWFrJee6nSyTAgl4+CQSRwvo3ycxQp6bkSAjgQbhaTVtNkn1PBiDNHO4d9ANdfJHWWgm7wvbmVbUlbj9+dk1uRGOVgndumN3jVuBIwRCsxtbeyE7XGnpfYhRQq7/ZwqMdEE2TFG9TIPZTdcB8= 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:49 +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:49 +0000 Message-ID: <871q33x0hm.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 102/113] ASoC: codecs: hdmi-codec: 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:49 +0000 X-ClientProxiedBy: TYWP286CA0030.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::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: c8d6bb71-35f1-40d4-d20d-08dcb4e7abfd 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: Kh9wCFFH/UBjXHgWXbPFEPc8o91mPwQPRG9kejfBkiyShpPl04TYsdhFghgojIc+NAgKu6qA/OHhPTHkJYh05iwEGNrFX7Sba7W+N1c9+VFOHLOCZHdo3SUpxnBp1h79lWQKZ5y1S+a0kxLKrMYp+ACLP7HoFmPr5l5QuZ2sY1FnSBahydq7/g0bOaaDJhsTOdv8TaElDQP858RAs3CWy/vZV6BQXEUeCno3cAOlkRjwvgprGhHtlDQ+Dk0ScHO0Y8eiIfgrWmNqNyq3C86TsR+YAwhGUSNAOF/RZ/ihsCtqEvCwAWEGJN55XsUfU0Fo/ZNqJCk/yuJ+f7W8EMkBuJv2eEox54epdMeMQcH64AVKwRsIMZsTxoODet3XeJ6EEsV23K6uWqQ0pRJa1hNhyndwS9PsFldlWsQk9emDU6ddh3/N2URYwWkQ5q7NmCHXFQhiXCR5pW0XHUpLakT9NvtiY92I0rumo3fjUmMFOa/Fqr1nORogymvYuS/6MhGeQk6HRCc6zreZYN//81eFnZrczOZwyeefaue21/NHqA/1r0riGxwUSLDJaHG8NymRaPUly0h+x2ulsSnka7DYHG40QLsbCMu9UYzmukAdyU6ZuK1YRLy7QWL8ehmQTISG0oJzzfWH3sXGTB1gRi1a1DqqeJtZY6YuQBE0v2y7JpyNF/aSPm122u0CYhd0HAvEnhgiv9j0xNSVnsGpsYmQ86s95iiU8UbQ41WWOoo99/j9U4tbrHyARBycR2sg+NtDiXVhNSJwuSJgbWMuJyyhvI9Mfkyul5pkbaq/LS0YrNt2JJT/+GbEu0vlb1vOG/Th32gOrWzBq1BZDpl/t8d+DIYIRaqQEMnblVfEGbCo/MvPK3/q7igy4CjvTSSgS9uZHtagNc0CikIrObpoB2bTdkqCjjWpVR/xu0vOe1QYndnal1mvxp5pNTwi1OItKj77ceqNi7ug1r99Ttfx3wcBPTCa8HOv8sxcdSSVoDurko55i9bJIycOo2vZ9EibFRZWrVcXXZbi8C5MfenPYPrhZ7dQHyk2kpmzSeMZ7p8d/85gxCTBPeH/wZ6gqp4Mv6WVHva2P2byugCxnc14NTlfQoKEsNiibkTaV36VTWXV770xXWpDknVzDtLWfgrlcdnOi87VzVKpBM/yznQNjm75qFEdXhVetbEmuccAA3ZXb/jsBaNqRHFLTJ9oY2ZA49AkUcR+chvhEdopnuXXjC/xizsRehXc0eTtVU4gCLcQmPQ4q1HN8WkFg8XJAVsgVRQzBWr7ARQ0eIEwTDyX+kmUyZyXdQxd3q6IrVbdqJFrmw9lQ8HOTs5j/tH2aQv+y2H4NJOCJw/FP+4qIQNEYGTuu+f/U4QjHh+qQwLIUgfDvhHCMz+NhTwDO9YayeP7fzbCN+PDuGl93a7u5mGvfGLQ1g== 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: 6/zAFN21kODBimZwV3YQQbUCldaWCODHJr6x60KVfbT1hWQaE0XyN8+r8YZPAmXy+G+0SzAvcZiIjmxZWsL+kACfyWhUakxk17hjKDPRJ9U7hz1emPjwD9hBEHazyeicVhEqNvuisWOyeE25pw3CbCJbUYJmcEpXT4Fj+EZWAshsNFlVBTQ+Knb5yOJsIJ/8dyyhnn99tGlfhU+vJxgEOR43zooMH21HALhBRnuVERxdq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taj+2MCJLHhw+BROKEhpbSdT3eQA+FyhnUWfcpBIoLgiGbcQHrxdQUa24bKjwg33KBSemq8UkSH89N8cwaLFAbpH0ZNMuKLM3agPQzpDIAfvWPrkbUFnH6w7PcM1tJR2oLjgPpwDfS1490vHhiwOdT7yGZKwCXoWY4H7mLAzayHhKveLaTe0Xef1Fww5GCjMWWZnWo/osgqRPeNBXOo5PnLYTkc8Zq10R226DRTMsekMBgyqEKfxsieyrX+PwQ7aRifUPe82SKna7SOqKbWSpRlEVupTdbfxuebOc6le/Mtf8CRH8L2zDWYS1b013KxU0+CyTwc+w= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8d6bb71-35f1-40d4-d20d-08dcb4e7abfd 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:49.6463 (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: OKl/Sa4txoC7bC/nRQ9i96+mfeKfnVogolgRA+NVyo7Plw7f5S9JhFwZzXzhfQyDimM81hnfbnnOibu1dKVcfrYCoc1GNkcZFVrmp1mTQrqgcz0gtRuL/Kj8gazZJHEk 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/hdmi-codec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 74caae52e1273..f8a4a1b62698e 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -428,7 +428,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); bool has_capture = !hcp->hcd.no_i2s_capture; bool has_playback = !hcp->hcd.no_i2s_playback; int ret = 0; @@ -474,7 +474,7 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct hdmi_codec_priv *hcp = snd_soc_dai_get_drvdata(dai); - bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; + bool tx = snd_pcm_is_playback(substream); bool has_capture = !hcp->hcd.no_i2s_capture; bool has_playback = !hcp->hcd.no_i2s_playback; @@ -699,7 +699,7 @@ static int hdmi_codec_mute(struct snd_soc_dai *dai, int mute, int direction) * snd_soc_dai_digital_mute() */ if (hcp->hcd.ops->mute_stream && - (direction == SNDRV_PCM_STREAM_PLAYBACK || + (snd_pcm_is_playback(direction) || !hcp->hcd.ops->no_capture_mute)) return hcp->hcd.ops->mute_stream(dai->dev->parent, hcp->hcd.data, 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: 13752932 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+XvRiqoK49O8o7NOCZkHHf8eP5K3YPTpFfAwDclpTKwNPnJ6qNd2LhkRhX3STbwbYBCuBoBUFj7mDPqTHN2YJ1E2YMBv+MY4ZRz8uYQdonzuIPYmUqgkZM3FxpuPbqFq4I2LnUcj0ogG8n0tHznt8V0HPVazv6qWqKYVi+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/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:43:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 13752933 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011030.outbound.protection.outlook.com [52.101.125.30]) (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 79DC82943F for ; Mon, 5 Aug 2024 00:44:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.30 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818643; cv=fail; b=hMxThjid2jf/VpEmLGYNZTFO+GOJRn+YacSP/Wk/u0afxAxmZKNNJm3kXJa2pauI3SeDxMlBykDyZCeE1w/UT/qKyTdPBB7HY7Zf96axLZwVUPs63Sql2Q1AmoA4jzh0LjGebNqG3h7BNzxgI5WVvHbbYJwcvak+CkL6QcBBC10= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818643; c=relaxed/simple; bh=qn1y+bRPVFaRQn0PoeVFEpDQb7fD/Q05gcVSGm6gl2c=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=CVxnv/5NzAM1y3yESKD72ygM34inS6aWSD1oF9X/ZPkKdQlRMkcARkNq2RnMhQCOw/P8qTJdgTH/KG6vmz3kgYj6QEve1W/44ptdKWLYw36hVcT9WG4Dw2z9TdbgY3xMZhDdOa3QApOB6nbFbEMlsLGQAFw5Tg0lp1tf54D/YSE= 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=Wz7hKFIk; arc=fail smtp.client-ip=52.101.125.30 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="Wz7hKFIk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=iFE6N2uqrYOy3E/dqQwq5zCPCgszgw/bgNFIqWy9ESOD8+W41SzT+MhWMU//W5gFOXFUyFYGIsdWey37gfU1497Pq2zWuvH/ahYsGE080WjsLZfZHDDaCmzxo4etmjZoJHkSWw+5H2b7K10z3JgrBC3RJpcQkXHx6kJiDXtlT9U0HeVfSlWnsDWGsb8bC0sxtxnSYHm1BbKYquoNQIyHZgs9MuDLhM5eDM6WAG97OkHXLYXsCm9/jTnGEHB20NKaUbtHtbCgsOH2/fe2iQqpbXlZC1oZzLnLp841FYTk3LUKyfw4eAwPxCk9aH5B5ppIbkyyhjNCVEgJvQwHOF3fQQ== 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=GT2EO3v4sy6MyUuQ+iNF1x4dP7l3YqiVxHZXWFPqdNY=; b=sW5RKfpHgh9DsG07AP76pc5g3omuep+ZhZGPXsFAeA3HxC5zGDH+ai3WeZyUPDICnHs8LYGQbzc15UU/qvuFUXR/EM50uiuxuUf+abMyEW8ST/I8qHRofqFfP0swmWytcLgQWdjhdwCzoWlUksSd7Ord8FtVxM0wP+UXBCGGa0lV7vsFQhBQWLVkxRTGL0MQaJwGPCiTDUt+rg7/DLk/36+0l52CydVnlHdOL23ELjRAerEteH5FZSwOYk/kNVehyeq8KyLm19ORC5eRJaLdaViTiTsr7Jhdom9ZpPpOzOruaM5DLld+VTlX3tjn9wsREdhQWav+C8ZPUPONOPy8Ug== 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=GT2EO3v4sy6MyUuQ+iNF1x4dP7l3YqiVxHZXWFPqdNY=; b=Wz7hKFIkIpf4nZS1fbpZQLiJAIn5ldEcsCRmSljqK1WRTERTMxnJrMDuPavZov6DWcDuY6jKvvJHqkbRE++vOk+odTAZgGtwzqO+rvpEWV9M8tEu18MO9cQzM+MkNn8a8p+fQdE7IH+C914TMB/MUQjsyrZzvg1cFjTB9eEZnb4= 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:43: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:43:58 +0000 Message-ID: <87y15bvlwy.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 104/113] ASoC: codecs: framer-codec: 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:57 +0000 X-ClientProxiedBy: TYCP286CA0279.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:3c9::6) 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: 4518b8ab-4b2e-4cfd-a971-08dcb4e7b106 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: eha+Iosw7melA0prwlyV6h+s2j5GrJLl/kcv1+Ijq1tydbui7iWPbvP48+W1NDnwaSdXan7ryIEScWXhbmsnyWlveyeyrtNCfDuThaSKDP/7gH62S/NwmT09znFTlPIZwgSiPkPI1Qm/FSr9fpQ99HMZbR51X/eQpFEP/yr1jtebkcSxla1k9dkcwY9N8u/t2OCt89g1OlRejMIGeBciM4+R33jqxGozwYDi5Vowc4x5OvR3WJVK8PxHRf5q5NmoPz7yH+WT2XZnOL7rwxDgpzyeW47Trzh4+cTOFG0yQ9WxaThrwsY2sOFJGdR55taOSrwT4MYqTgPHKE3Zlf8qjewmbIBSUpc1kldWbJJHxn3juxdv1CBtQbJCgU3HcLoauKIoltMaWr4LV9FHfb1sEZM0GOa7NkjkCqCukW/2OHoEF8rGg1paQ1TRh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prd01.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: Jp6syObF5id1/Ro10cBYNtoPHimqZiKsyMMICo4XGTttK0aUveEPeuV1rk+Khj+Hgf9IB9nYlkaMS5TglfqJDBiuLu2NOZf+QIbOydjBELX56KAoYjKX+8gqkcMd2uDGn2ir8V/WWGO/TYAZfWyoypnemXi0Tv2v92riTmY3QGv/N+7hFnPN93LNf/yKMzOWgQEZ9/QBZOys3OdVnmYprI1fw137XcYcpwxbOkmJxA/GYPklQ16jT8ak/RyFbPfZmCs04zg/96n8Xij2LlYvUmsOXWfVMkrKT5zsjbDdaAcDPrEXIaImCsKHdJ5pV24NlnMrn9dYFuQ33nawDTSFdhBTpNLiCIbrPkitEzmyZNhP1F4e9qXGbXOu+Koh41D930/OZQlBJ2nQ1VZzdlHMnQkj4utoNm/14keSeU9wDmz/I7aNcRZ69mqjew3e9PYskf2/YwHG73gTzJUgo6917BQcVzt+roZupDzCI9jFSY+Bqj2rLY322F6D3XAHs8T3ijLDSDAHPpX0se3ku71v6jLU3YV2mojHPCBCzrcbMth0yzv6czUUqWXTJLdI5k15zLILHuI6SxKy/Nj+2oYZfs1tHCpC7a79RxQx9EU6oP5PpmZuouOx9wJ9gRsm29lL1t9plzGzxvsVaVtRmaKkCUY4hEgmTiqNsnr5QhkeYI7/xPDAfgnVGQSHsew+T+/H0wC6qFX+nYBSlb5OEV78kMyZvn3rYQxKyt0d4R2zHKna2/G6IeJqkZy7a3Tmb6EeTR+KCU+1UXZjK9niuMBTyCFBCzRgANjfYmCb6jaj2F700ZaDgxk+3bv/iQBoMFX3kcZAXj4iiyQp7lchGi2DrDrRSx+Zaibqi0ysRVdqlTtnhonfGwnTSi0SzXJdYtnrt7PMVawJA2yUeRujnyU0pBYJ97IcgERkcvv3rU/3zrra5tgv9EQmSQP1gQitrZSt17NDY8aWYvLOG6/O9RgP/vMkVr4Sj/ZWEC2IzT0XwCxkKBkKVqpD6aBIMLzJ012l7kgDV2E6+EEWW6kTbrjpDoibge7D/95oLB9O9+5iVtkbyXYlbTVwS+xYh+sIVi4XG+rprcWDbnpKYj/ysY5tPN7IizsAA8B9CxIEQ0Rfh9bK19ULyBq4W0DuMqcdKfBXxO3NklD6wcsAyTxwOGBcCvpf8jZNrgkh+n1NvKFgYy86jgklFyvJTgmOVPqLsEtC5aku7UylKRgSM8Dg+rX4npyR7Oo+2g5j5BsZt7gNO02O5LnaOKY9qSgHanvS4baDeZdg095sBPg8beJ4nRHu65hbQ8XND9olhh2tDwUSpuMSC30dmhRIoEcmxdkwI+xXnbxE+pVk2pN3cEJu224hDFV0yScXuattlbGR0Dc25H8YU/yfFAohdSFE/pAcyrFkfVe7Jj4+BEx7lGK36Lq8OHfVh4A8HIgxlm6QKpNQPXuyNqmfTXmMLqXrcQzRC268aBGpmQ1kEzTPrPYWrbb4bb1Od2dQWMumivWmJKUI/H4u4yDMTRaWy3ZBJyAU7dw0q2S9ybLdY0vyRDIUAjxKxIujBrCjOHofjsVpMxpio69nWN7Lhcz13jR9vZdhzhNml+FhWQRbJWJzzb+edcuzeDYXx+LyYylpl0wcqBR1Gfw= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4518b8ab-4b2e-4cfd-a971-08dcb4e7b106 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:58.1055 (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: 7OnAgHKtsWbuksOICrUIxsts4UJnccQTVX3GOEMXDxeKNc/sKxfI1vWK4UjOM3TCmMCCzR/inPMy4slzPHp60js/5nlTh8AaBZ3woGz98NTyxTC/errM7IWszqzIp9KF 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/codecs/framer-codec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/framer-codec.c b/sound/soc/codecs/framer-codec.c index 6f57a3aeecc89..10ad78e87a7cd 100644 --- a/sound/soc/codecs/framer-codec.c +++ b/sound/soc/codecs/framer-codec.c @@ -192,7 +192,7 @@ static int framer_dai_startup(struct snd_pcm_substream *substream, u64 format; int ret; - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { format = framer_formats(framer->max_chan_capture); hw_rule_channels_by_format = framer_dai_hw_rule_capture_channels_by_format; hw_rule_format_by_channels = framer_dai_hw_rule_capture_format_by_channels; 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: 13752934 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+MLPOsxbQa1ah1KmxVTf78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La3qLaMn5BJJFbci+aIBjiFDLKWaX+RdbjlbkZzhY+M77dULPWvlJhv7fqqRk6naybvsMBuLLGE7hajbU+shr4kkToTqiCLe4xwlUAOr6aEywbtT5dHTHD2ZoV4HEbkeDKJhrETDdeDMSNmohY83YzqYMA9xGhqTKvI+gzq4d7LMMyn7vXksjBdBRM95NvSYdTM0+F2DadK4LEfI9nDytIrlsYOVHQBcXg+V6B0LxIa4ZI/Yxu62Qw13sTO2DKo9RC7E2ohwyZCt58egg1Casg/x6KFyMlhqG3UsP1Wo7LNXQX3wdN4dAJIRg== 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/Q0VVCV0PlEBSrqi1taZijOwqFMKi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DGyU3V9/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: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: 13752935 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010002.outbound.protection.outlook.com [52.101.229.2]) (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 995902B9DA for ; Mon, 5 Aug 2024 00:44:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.2 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818650; cv=fail; b=KowPMsdZ1C4lpzecDmn9dVq5U9JBWBT0pNnzQgpy3wh87Xf3uDImWZogsIkTgyFs+YxRSVV2UdfQ103dq09igpFXOk0OH80G54Y+dUynNVjz4Cf4yiHYRGymVDadvPTl6IsmQV9xoyKOJOjgHT3vRg+x4aOlVmqNZwui0xd0Fqk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818650; c=relaxed/simple; bh=D8BpZn3x8VRsEcVVXQrMjzMFl2E1oOXNqsu0aFfDGXA=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=a0sIomTd4q9aTAe0bsA1jfCLcF9vv3NxFSiJwgfFIXhZ2wZdy5bKWB+pjjQGUFJKQOwcWU1QyeHRDTNGqFdnSmWANM8iJKIrri/yD/fasBZmteaIU+lggOpikUYKwBhUFQumneMptukrOUgZKL7d56HPh7ZpFyWtRt/x3WUtAF8= 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=B3jJqSBV; arc=fail smtp.client-ip=52.101.229.2 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="B3jJqSBV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xibJcTNciPaN9ULQx0x22gY1iC3PWud5zKHkviQ4hCQYuKVIihlmvZm9VNlBLqZQz0LekR2g56Q0y3sHV81XXcjSie/fNHvvWnUCl2AT11dHpwHCODtngx1g5nCKXKyq6DmOfI5YFvZLC04sz8byW8fv5dMuU8v24sgAObqtZQCa55NHmRiItqfFB5uFcVHZAHrzTMe8fCRBLlw5Aw/F7AJKMyJdsOZ8A9m1NsnDyiZnCACuq0ZrXiztsn2zcl38W6gaVuTufTQ1QzT676Pu4eNGVVGg9vhGEeui7Hj1pGGWlNuNCUJE13NCW5A7cJtl2Za9oDC6qnUz5Q1l1JCfeg== 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=eHw1WLibZN/L50QnInpxqE7BExor7mE9XBYyT4WZzPI=; b=qSBqHmcB+9OidArbQFObKnkzqoCvi0E70MzEgVxQOvVn8a2rivCormBX3Xv+svOaRTujqNC0wirS8ATFGgh8XAXVQbu82iFsTu9kRivOLYL5oHEFfL+A5NKltq+Q54WKw57h8zGiWauDrHq5Jk4qA3mgYRjH0mHiUmSEJITNM1xbCW6FjhUz3ESaYoZE49+clhdMo4YXDHyeknZRiY3CeLR6+pbJvpDrUOfDQcRUuAbV1Mfoa4Cz/Q3ytOktpVPotPAsS25Qi4A3gjC9aIgyPb74K/xVoMrS22cr4zHjyQBUTZvmk3Vo9cfr6UimEuTey1NIHhxujxlV4cTOm8Qbnw== 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=eHw1WLibZN/L50QnInpxqE7BExor7mE9XBYyT4WZzPI=; b=B3jJqSBVIK6z3hHcsXGf5KbYCNVu4RFnXWz5E920kCLPz2LyESO8yzFglieds9AkX3W3uMvOE0T7sWt6VDhpbc6LLCvDWUfJeV4vzI92bm45lVWIVaSL7E4KWl3qWAElmApUjkcgZtqVYY8Y8mesXqeKBH2uK1nq0B7Q5Bqt8nI= 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: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:44:06 +0000 Message-ID: <87v80fvlwq.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 106/113] ASoC: kirkwood: 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:06 +0000 X-ClientProxiedBy: TYCPR01CA0097.jpnprd01.prod.outlook.com (2603:1096:405:4::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_|TYWPR01MB11466:EE_ X-MS-Office365-Filtering-Correlation-Id: 27809676-bba0-47da-8ae5-08dcb4e7b5ea 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: Mfzt7vEu3n+aMRvJ5BQu3avaNeZUzaBJhu9iJ8hCd7XPlN+FBFS67KS3xJ5LI50GqZo6nL68038ikfFcvcNH1kybWMARFOjw/hlYc4Rv77ijnU5OCwI5hla30Gv0RV8zgQmDCDyDc2H2aecW5R2580wOYOdypX01l3cf+69pfGYT6h9ssCaPpQ6WDSUbbjWa7z9NaFstxiLSx9WZVZfxMbVYsUpTmqkIuX9KwJXtFdM0H0Q2FZK4twtsL2Ohn5qmBH4KZaUTgJbTpXb6u4ChT2QYeNc1GkjojDCbCVMN2ncc1jU8qDjeyWBj6SYQ8VfT8US2Y542dS2azo/tiGLxyHRp7eZpqVSm7lLgbhHOTjGguKqo2iiQ/ldp9ktw32lRI0jmxiB5xhpwxhq0LamFLOIQMGqNHC2A6fcWX6Ifeh15jX/2XeA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prd01.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: 2y4nwKv+QoPT5OY1pcJdrNLrMqiaulPHQY1CtW+mpLsqnGiWdQLY4vgpRgdPTPEJWxygLeo2XbTYvmVrwawG29k9c/X3B5rdT5ga85rI5RVsuvA5E5cAzS0Iu7Q86iBoCEKX9ovacobkuXQKPA0KRfHJX0eX4EKlJo1V6DsnnBrovu+twRxTfB01Q1J3BATfUYu8k+ba6nnK5hcrp/thC3L8MaSkdzVH2Z+0oNos+2+lUR9Vaih2a/t+hjJnwj8IU2oJIPVjnETGwEiTxIWTdV+0cMKvKgPizXmPqY/mdFAOuvEcUB+r49ojjXQkvZyr1TTBhPT6cidKK3xbWDK1KyW1MTzSRE1AhZTitnXsQu5caLt7pboS2oNuAdGnPJA+4keW72Bor03zTDsG+jUYPE/QBs8vRETLSzxWaTf5HZ1NBmKk7ybMa2PM2/t+pPbVFAT8iBg5DKdQGOSoIuKZPRKe2Cx9KCDJbkowlwyxUsHk/XTcShSC61bis4MAWEzOeDgDT+WJ+iYXrhadG7Erl/8FXh8XtiGOJVW0fqTiww8tlewMOiiS3pksayH2HzWb7+80JiJae1gwk93gphiaoFOmhGAdKadsJYBuJxSO0M4jnwNP5kUKeoS024vkgy1bGvPpgnvxOxlDmBoamj57/9EyGMUZo9B8MhvYmBnrQiGPazQM6Tl2fG2J7r81wOlT0AzhG4FrbW2QlFTTUCPERKKoVCLFDAnKkeNziK5gRAZihEmQIvvx4kgirknRrFwid1biCkiVnO1h4VHqRgUYZxSCWmfsB509i+E9mi14sqAaqxGB/YnUUxe0bHJgjY0IaeY4oKmMqFX67goljWm1n2PAxSDNRDbHgSPlxQofPzHjA0CDMpTz1fnVvbpE1+uDqbfOF5I/xabAKzBaOtitEkPzrprzSHbO4+KMacEA5JI7EFRX0/0Z6aX0KWCRJwYJjoxBDvVFlm4U7dqSsDT6Ymvp0othdh8NsYkpzhPcsynXrlnOqlGax+YgaiSfQ0YFiyZjVBsBrA4ds0xIF6voz0qQ1RXsGjqEAC2HEwxgoXbXMs8HQADMviGkpLBur9EfLLH7KZqaVa7HMBOKx004cVEoYkQzF3RV1rtINHmZW7wXsMEI91TzHwYTaP/JsakDR9AsQpEWBQU9goU06CDaXlKwrtWPyBPIlo5BbiUtha9R0zUpKv+OdYI95UqOl5YSp6APZO+fH4awp+xz08Ry0yRGEo2d0fWQHXTBTK7/DcaK6xsXKyS9LcvvIN7pQAcxLnfBtZ9uqhRoIiK+jBte3NhZv4sZ7XLQdTHgqSzPP1fC2PoogS9c2NRK3BF6m3eu7KFNDk1+ib63u1OeubD/JYnq933aaFfbZVb8E0N+qkeRyyXeDH26NvJffciEggIybumDndoc4DdgaKHk3nVRXCz1+k5Lg5OKbBSdi3oYoTW3qBYTTw3qQLzPnhMThLKJ9Ih8ejGAU6T8HxywikrWwmK8LW5Fhb6jOjPHOca1IVcmcPyc1FTXUt/PxrHiNCt/j2zJhiuPPprUGjxPVrJf0U2lyOw2euw5Ualax7sFjQDU072yiNxGvkJvCsAPXGvX8W+dmmlhVMWn8CJ4LX7NewPc6762zkVmDyzinExt4ag= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27809676-bba0-47da-8ae5-08dcb4e7b5ea 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:06.3034 (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: Ov4GVVYB+9mK5edwXt0hr3DVHJyILjOcMuI4854pQD/sFPYSPYtSMjXsCHvmk00Pslt/GLvITfZq1VKO/Lr6sxO8jEARQgm7j7Cbc2c1YlOuCvIKasobOZabHXZwK+sP 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/kirkwood/kirkwood-dma.c | 10 +++++----- sound/soc/kirkwood/kirkwood-i2s.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c index 036b42058272f..1a3749b50d0be 100644 --- a/sound/soc/kirkwood/kirkwood-dma.c +++ b/sound/soc/kirkwood/kirkwood-dma.c @@ -140,7 +140,7 @@ static int kirkwood_dma_open(struct snd_soc_component *component, writel((unsigned int)-1, priv->io + KIRKWOOD_ERR_MASK); } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (priv->substream_play) return -EBUSY; priv->substream_play = substream; @@ -161,7 +161,7 @@ static int kirkwood_dma_close(struct snd_soc_component *component, if (!priv) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) priv->substream_play = NULL; else priv->substream_rec = NULL; @@ -185,7 +185,7 @@ static int kirkwood_dma_hw_params(struct snd_soc_component *component, if (!dram) return 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) kirkwood_dma_conf_mbus_windows(priv->io, KIRKWOOD_PLAYBACK_WIN, addr, dram); else @@ -206,7 +206,7 @@ static int kirkwood_dma_prepare(struct snd_soc_component *component, size = (size>>2)-1; count = snd_pcm_lib_period_bytes(substream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { writel(count, priv->io + KIRKWOOD_PLAY_BYTE_INT_COUNT); writel(runtime->dma_addr, priv->io + KIRKWOOD_PLAY_BUF_ADDR); writel(size, priv->io + KIRKWOOD_PLAY_BUF_SIZE); @@ -227,7 +227,7 @@ static snd_pcm_uframes_t kirkwood_dma_pointer( struct kirkwood_dma_data *priv = kirkwood_priv(substream); snd_pcm_uframes_t count; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) count = bytes_to_frames(substream->runtime, readl(priv->io + KIRKWOOD_PLAY_BYTE_COUNT)); else diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c index d1eb90310afa2..5d43924bc1caf 100644 --- a/sound/soc/kirkwood/kirkwood-i2s.c +++ b/sound/soc/kirkwood/kirkwood-i2s.c @@ -258,7 +258,7 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream, unsigned int i2s_reg; unsigned long i2s_value; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { i2s_reg = KIRKWOOD_I2S_PLAYCTL; } else { i2s_reg = KIRKWOOD_I2S_RECCTL; @@ -314,7 +314,7 @@ static int kirkwood_i2s_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (params_channels(params) == 1) ctl_play |= KIRKWOOD_PLAYCTL_MONO_BOTH; else @@ -501,7 +501,7 @@ static int kirkwood_i2s_rec_trigger(struct snd_pcm_substream *substream, static int kirkwood_i2s_trigger(struct snd_pcm_substream *substream, int cmd, struct snd_soc_dai *dai) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return kirkwood_i2s_play_trigger(substream, cmd, dai); else return kirkwood_i2s_rec_trigger(substream, cmd, dai); 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: 13752936 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/2Pt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5HmfvQmqasZbnpm31MegjXe7TVstrfgb9wfdxOYL27erq0Eo6JUCyINzpyyTXJZb97vx5OL9MPMpAWv/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: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: 13752937 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010054.outbound.protection.outlook.com [52.101.229.54]) (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 19B6A29413 for ; Mon, 5 Aug 2024 00:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818659; cv=fail; b=rcsgwgPznYrOBhcuHn23Swhh53nAdTHS7HzxaALneH6/pRK5LixGM0n3Nrq1d8s5s0xeY+LwiSzCjujicBC+TjIjrP+LcNm/vkYeJx6wSt/T7lHCU/QvhHF1Uuqho50oTMirQao+pzryswtvde1HYhe0pSa/Yd3jwgatqfxmUIo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818659; c=relaxed/simple; bh=XjMBVqNlTUOWpw7Gb/9gkhR2CUqEbHUVWn+CdgGZ30k=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=QI5c4URfqcFouHLxunHbmPO+yETVjvqMHVtKOfnzWf5NB2eHaYO6geH6ZcucZgLKOBvZz+ljPfmObIdnyTHP+mI/WiwFz+EMfnrGwWRJOzAXQtRTKTi0GUH8omQSWmFUncjJDj+7XD6Y7Abp6qS25+IAUO0Xrss5qOu8862SZvE= 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=dmijOjPd; arc=fail smtp.client-ip=52.101.229.54 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="dmijOjPd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MRkf1QS04NxjfFB6ytmbhnVjg3r0jADS7hjiQnvX53MICbo7ny6r9CrmN/lw9URP1TzN8KEWEyJN4YdWt73mBtqOXE+ayajeYA1GdKpuoX14Pltz5ZN2se5DU6cXEFInTh2isjl3SScmqqXht9tqt8uTxjDEl/P/gp6ShXmxLbnKawSjK7cG0++jzUfFams315qZWvPi9nE+sJ1UnNfOjl5b67EcS2nLgvNl/5Ov3uwg34QgSRRB/HjCk4l6iGaSt9zVnw9vsW6mphD8bf+H8MDKgtNT3cErx4yot74fWQ422JJvnm7YnD2U83T/P5bWFNi5h664xs/jY0TIJHti8w== 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=V1uSGCvxZ03WSJ8CNiRMGJ39LJB+PUIOfv/6+QH/kDE=; b=ih1NIMuQL+zf1clwtP0LqMWnJYbXrpKrQ2EGVssW8pHHITlW+j38UX3cnvXJQgzfPoU1WCoFoEk1TD+nayA0mXJq3EAjl8ObN9yasH3UEf0V8701PhDvDBsjXdS5uy8kl3yEKstQKna3Z6NR8qEGkYJ2qmh3PGIk9EZ2SR52MHviPwgsaRtGzZud1t+nKPJa5i+t78RpRdQ2zMFgJ66eVGKOHOO818R9BBHeuEgZbMkeHzwIoEGLg6cFBWJ8rRqM4g0VBrDv0B1/vtrOhOZRxCmx25IdBcEfEL6NGaTHDw/37ZqJIGxYdWiYNoAySz/ji6AF7BxErbGMVTc/1RVmgw== 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=V1uSGCvxZ03WSJ8CNiRMGJ39LJB+PUIOfv/6+QH/kDE=; b=dmijOjPdGccdE1s/7uG21ixP82V8Rou/iOIUfxG85cFjuI/MR9eaTxOE/QWjnfZdvKs7OMP94m8jN3jRe6Y3vpbdCr/961NbA4HKxRXMxxO5R5LOm1zTOjBNEgcbT7HzkJ5wuJBbF54TVgVbV7OX2NkhNMneGY1U5TYfDk96Elg= 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:14 +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:14 +0000 Message-ID: <87sevjvlwh.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 108/113] ASoC: mediatek: 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:14 +0000 X-ClientProxiedBy: TYAPR01CA0058.jpnprd01.prod.outlook.com (2603:1096:404:2b::22) 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: 18b5560e-9aa9-4fca-a186-08dcb4e7baeb 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: 8hVWq472DHZkiLbK4G6Drbk8ya0zKQApdfzeEJfwRZ5qRhBRt2nnTP0JV6seoZrofVuPlk3aT25Hr9nlhGx/gjqU6dXt0IIRqCXQghrcZtS40TPx5UTwg8n2Dbgt/Gg386/yw5dBV0s3TkffIRylwd2HNFycc7WMVD81Tfu3F4zuggto6SK0wH4FS2FksPx3ImNQxfE2DEjgZECAChfxzwiZFgX5k+cr0lqI67gPoFcb4pss7I4OiYbqvKpSIbqTkpTLCZK+ypIn/Ll5CNMJHIoDhsEA9IuxXX73pbBWyFiE/vd570JX+HvnSX+zRjjITmMxDjXVYEQ9ULadG94wmkeMNGZujIPySQ896D7f2ngbtTV4tVa8Nh7dXcl8Z+nBVyS9/WUif42RgTr6oAO197bJ3dSxHZc/3Je6diEwqjfTwpEPIv3x2cbcxy9ZfW0nlKkczifXmTMTrV1A/0+gywoNrPQZh2WnTkLTnTrhgkmrx/HvmMVStZEI/a2gwC866Qg0I7krtofQDKaFPTn3n39IkIqYVsFgTf3fg0guRc7ofXfdOPyp6kb1URI5iwvd61wA/S/8+cTekcLZuDbOwe95QOuiADx1KAVdDsZTS1szrRPSybajkGQm9m5iKgW/HU++eMlVE4Nep7juYw9nD7GtijgaesVrWo8b2w/CAaL+DSwp3uffe7OX5nj5tS+rfOHgFf4JvnLjYhx6mNwNUkFDXNcG8nS2yDf7k+hUWqDrfMl2K97/medjJCaEUBknInI+v8JaMkZ5CdtxbC46qqgfxXV7LsN83aKSUJolWmheAjMvGGQ48wXSnZN6COo/PRvkjMsW0rwBsO0XQRh58yUQhxDjn1ZOvJfVZU2OogKt81OqHuC9+yUDIHa468SU0eNtqXeHDPPfBmoo6ZrMYiBqIOanhHbP8XSCKDnz7B+Uy9/KoDh/WDX+McfpEiEsKh6NPQ/VmPj9cWFxsptQ1KSU0SfCUihdvYagOpK7sy9gOnGWaXql8Gas8IfGaCB2LkoiXuk2Atq6nu+780Kw0jZ/VsUUvR4Xqj1Ugxjj+4INqYVS0QDCHGsp45YLnPLeZjANH8DsOOShNQn24T2k1Qmivx6dl1TFDuGMKlhLyXYf4FGBsqhTPQhEC30C5mr2Gm0zVYW9FVhnJ/zMBK7DZAEAHHDxCVLVdE/NnglUKpgskgEOyDu8WMWEr3P0RuedI69b6CYE61wprNH6z+9tf8fhkYl0lYLDAxOusVIQUSOyweEchb5VAj3g2oToDdbO5xLZbiBzeZ0uL9pZOFpdRRQhOy3Y0MuRxGTMEaruPupygbsyGL0kwKqxLrzRfHVJv9m1V305G5QAtc05b7/szu1KLGehE7G/FOrOVSdH8oHpuZmu//xpRRwi7tJsiC8FEgs1DwfiwTF7/aq8kNxRgw== 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-Anti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NbQixUcCC+IanEmj1CwicoPIFQE42ZYBd4aGVBAjn6LSN1OuOoyekxWCyymhxU8iAm9FnwyLOxF7XCeblI+Dm18FrzUNakBUXyQutTpbmtBeQu01LU8E+fLK9w49ede/8MMx2dHLML8QVsS9tn3PF59Xq7wFVMzUa2V1eLn9NYC8i18l18Ip1SrNP+Uh3EQLxHkLm8iLlBA8faENIUnBUU7TpdHcMRGImbxv39XWf5map3zwwH0IqWVVbqt0MgkfZrKi/9fqn/NAPikzuqbzTL9NLhRcNEuWWv8BMIJs/7jTEHYofxvI8EylZOqxZy++GAQZAh0c53h4wNVX22vzF+zULJj0YRIV1GxXsFKCVIC/2lQpIRoXo8kqumVWgjSLLYaLn71oVv7yjeOh7AaJB/V1D4PnK/Q0jNuKkgQMY04d35lBxJAEWja2bKxqqL1cA0rB1xgaq5Ht4uS1nXqDG80ZGkMLuLB3z6ns03FLTNopW6dvi7iHf5Hvcpkyum2uEJNsHCAJKdEM2EfxfMWauOfJcdNvHPONT/TkcGBJLrkiXMvJIzA2IIrnYxI9ASD2eue9jTRqYx8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18b5560e-9aa9-4fca-a186-08dcb4e7baeb 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:14.7049 (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: bDejFYYgUayUKKFLyp5bX0ipcr16+rN86FB/IACXI6Fp2WFdpvJzjwFMxc8GhFQfA+/CztTK0kQ9OpIagdQwFTFDf9Cgz6PLfVtDPhoRX2MwPxauGcD50PGcRVsevo8s 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/mediatek/common/mtk-afe-fe-dai.c | 4 ++-- sound/soc/mediatek/common/mtk-btcvsd.c | 18 +++++++++--------- sound/soc/mediatek/common/mtk-dsp-sof-common.c | 4 ++-- sound/soc/mediatek/mt2701/mt2701-afe-pcm.c | 10 +++++----- sound/soc/mediatek/mt6797/mt6797-dai-adda.c | 2 +- sound/soc/mediatek/mt8183/mt8183-dai-adda.c | 2 +- sound/soc/mediatek/mt8186/mt8186-afe-pcm.c | 4 ++-- sound/soc/mediatek/mt8186/mt8186-dai-adda.c | 2 +- sound/soc/mediatek/mt8186/mt8186-dai-src.c | 4 ++-- sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 2 +- sound/soc/mediatek/mt8188/mt8188-dai-adda.c | 2 +- sound/soc/mediatek/mt8192/mt8192-dai-adda.c | 2 +- sound/soc/mediatek/mt8195/mt8195-dai-adda.c | 2 +- 13 files changed, 29 insertions(+), 29 deletions(-) diff --git a/sound/soc/mediatek/common/mtk-afe-fe-dai.c b/sound/soc/mediatek/common/mtk-afe-fe-dai.c index 3044d9ab3d4d9..71223feefa1af 100644 --- a/sound/soc/mediatek/common/mtk-afe-fe-dai.c +++ b/sound/soc/mediatek/common/mtk-afe-fe-dai.c @@ -61,7 +61,7 @@ int mtk_afe_fe_startup(struct snd_pcm_substream *substream, * This easily leads to overrun when avail_min is period_size. * One more period can hold the possible unread buffer. */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { int periods_max = mtk_afe_hardware->periods_max; ret = snd_pcm_hw_constraint_minmax(runtime, @@ -268,7 +268,7 @@ int mtk_afe_fe_prepare(struct snd_pcm_substream *substream, int id = snd_soc_rtd_to_cpu(rtd, 0)->id; int pbuf_size; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { if (afe->get_memif_pbuf_size) { pbuf_size = afe->get_memif_pbuf_size(substream); mtk_memif_set_pbuf_size(afe, id, pbuf_size); diff --git a/sound/soc/mediatek/common/mtk-btcvsd.c b/sound/soc/mediatek/common/mtk-btcvsd.c index c12d170fa1de6..a896f0c01e600 100644 --- a/sound/soc/mediatek/common/mtk-btcvsd.c +++ b/sound/soc/mediatek/common/mtk-btcvsd.c @@ -647,7 +647,7 @@ static int wait_for_bt_irq(struct mtk_btcvsd_snd *bt, while (max_timeout_trial && !bt_stream->wait_flag) { t1 = sched_clock(); - if (bt_stream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(bt_stream->stream)) { ret = wait_event_interruptible_timeout(bt->tx_wait, bt_stream->wait_flag, nsecs_to_jiffies(timeout_limit)); @@ -850,7 +850,7 @@ static ssize_t mtk_btcvsd_snd_write(struct mtk_btcvsd_snd *bt, static struct mtk_btcvsd_snd_stream *get_bt_stream (struct mtk_btcvsd_snd *bt, struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return bt->tx; else return bt->rx; @@ -879,7 +879,7 @@ static int mtk_pcm_btcvsd_open(struct snd_soc_component *component, snd_soc_set_runtime_hwparams(substream, &mtk_btcvsd_hardware); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { ret = mtk_btcvsd_snd_tx_init(bt); bt->tx->substream = substream; } else { @@ -909,7 +909,7 @@ static int mtk_pcm_btcvsd_hw_params(struct snd_soc_component *component, { struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(component); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK && + if (snd_pcm_is_playback(substream) && params_buffer_bytes(hw_params) % bt->tx->packet_size != 0) { dev_warn(bt->dev, "%s(), error, buffer size %d not valid\n", __func__, @@ -926,7 +926,7 @@ static int mtk_pcm_btcvsd_hw_free(struct snd_soc_component *component, { struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(component); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) btcvsd_tx_clean_buffer(bt); return 0; @@ -958,7 +958,7 @@ static int mtk_pcm_btcvsd_trigger(struct snd_soc_component *component, switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_RESUME: - hw_packet_ptr = stream == SNDRV_PCM_STREAM_PLAYBACK ? + hw_packet_ptr = snd_pcm_is_playback(stream) ? bt_stream->packet_r : bt_stream->packet_w; bt_stream->prev_packet_idx = hw_packet_ptr; bt_stream->prev_frame = 0; @@ -987,7 +987,7 @@ static snd_pcm_uframes_t mtk_pcm_btcvsd_pointer( spinlock_t *lock; /* spinlock for bt stream control */ unsigned long flags; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { lock = &bt->tx_lock; bt_stream = bt->tx; } else { @@ -996,7 +996,7 @@ static snd_pcm_uframes_t mtk_pcm_btcvsd_pointer( } spin_lock_irqsave(lock, flags); - hw_packet_ptr = substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? + hw_packet_ptr = snd_pcm_is_playback(substream) ? bt->tx->packet_r : bt->rx->packet_w; /* get packet diff from last time */ @@ -1030,7 +1030,7 @@ static int mtk_pcm_btcvsd_copy(struct snd_soc_component *component, { struct mtk_btcvsd_snd *bt = snd_soc_component_get_drvdata(component); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) return mtk_btcvsd_snd_write(bt, buf, count); else return mtk_btcvsd_snd_read(bt, buf, count); diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.c b/sound/soc/mediatek/common/mtk-dsp-sof-common.c index bca758dca2c9a..050a72b5fc21e 100644 --- a/sound/soc/mediatek/common/mtk-dsp-sof-common.c +++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.c @@ -200,13 +200,13 @@ int mtk_sof_card_late_probe(struct snd_soc_card *card) struct snd_soc_dapm_widget *widget = snd_soc_dai_get_widget(cpu_dai, conn->stream_dir); memset(&route, 0, sizeof(route)); - if (conn->stream_dir == SNDRV_PCM_STREAM_CAPTURE && widget) { + if (snd_pcm_is_capture(conn->stream_dir) && widget) { snd_soc_dapm_widget_for_each_sink_path(widget, p) { route.source = conn->sof_dma; route.sink = p->sink->name; snd_soc_dapm_add_routes(&card->dapm, &route, 1); } - } else if (conn->stream_dir == SNDRV_PCM_STREAM_PLAYBACK && widget) { + } else if (snd_pcm_is_playback(conn->stream_dir) && widget) { snd_soc_dapm_widget_for_each_source_path(widget, p) { route.source = p->source->name; route.sink = conn->sof_dma; diff --git a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c index 6a17deb874df7..6bad411dcf243 100644 --- a/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +++ b/sound/soc/mediatek/mt2701/mt2701-afe-pcm.c @@ -160,7 +160,7 @@ static void mt2701_afe_i2s_shutdown(struct snd_pcm_substream *substream, mt2701_afe_i2s_path_disable(afe, i2s_path, substream->stream); /* need to disable i2s-out path when disable i2s-in */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mt2701_afe_i2s_path_disable(afe, i2s_path, !substream->stream); exit: @@ -192,7 +192,7 @@ static int mt2701_i2s_path_enable(struct mtk_base_afe *afe, ASYS_I2S_CON_I2S_MODE | ASYS_I2S_CON_WIDE_MODE_SET(w_len); - if (stream_dir == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(stream_dir)) { mask |= ASYS_I2S_IN_PHASE_FIX; val |= ASYS_I2S_IN_PHASE_FIX; reg = ASMI_TIMING_CON1; @@ -250,7 +250,7 @@ static int mt2701_afe_i2s_prepare(struct snd_pcm_substream *substream, i2s_path->occupied[substream->stream] = 1; /* need to enable i2s-out path when enable i2s-in */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) mt2701_i2s_path_enable(afe, i2s_path, !substream->stream, substream->runtime->rate); @@ -368,7 +368,7 @@ static int mt2701_simple_fe_startup(struct snd_pcm_substream *substream, int stream_dir = substream->stream; /* can't run single DL & DLM at the same time */ - if (stream_dir == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(stream_dir)) { memif_tmp = &afe->memif[MT2701_MEMIF_DLM]; if (memif_tmp->substream) { dev_warn(afe->dev, "memif is not available"); @@ -387,7 +387,7 @@ static int mt2701_simple_fe_hw_params(struct snd_pcm_substream *substream, int stream_dir = substream->stream; /* single DL use PAIR_INTERLEAVE */ - if (stream_dir == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(stream_dir)) regmap_update_bits(afe->regmap, AFE_MEMIF_PBUF_SIZE, AFE_MEMIF_PBUF_SIZE_DLM_MASK, diff --git a/sound/soc/mediatek/mt6797/mt6797-dai-adda.c b/sound/soc/mediatek/mt6797/mt6797-dai-adda.c index 78f3ad758c120..baf5a46781071 100644 --- a/sound/soc/mediatek/mt6797/mt6797-dai-adda.c +++ b/sound/soc/mediatek/mt6797/mt6797-dai-adda.c @@ -158,7 +158,7 @@ static int mtk_dai_adda_hw_params(struct snd_pcm_substream *substream, dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %d\n", __func__, dai->id, substream->stream, rate); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { unsigned int dl_src2_con0 = 0; unsigned int dl_src2_con1 = 0; diff --git a/sound/soc/mediatek/mt8183/mt8183-dai-adda.c b/sound/soc/mediatek/mt8183/mt8183-dai-adda.c index be69bcea2a786..8317fc1cc5e25 100644 --- a/sound/soc/mediatek/mt8183/mt8183-dai-adda.c +++ b/sound/soc/mediatek/mt8183/mt8183-dai-adda.c @@ -276,7 +276,7 @@ static int mtk_dai_adda_hw_params(struct snd_pcm_substream *substream, dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %d\n", __func__, dai->id, substream->stream, rate); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { unsigned int dl_src2_con0 = 0; unsigned int dl_src2_con1 = 0; diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c b/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c index bafbef96a42da..08776982e44ff 100644 --- a/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c +++ b/sound/soc/mediatek/mt8186/mt8186-afe-pcm.c @@ -184,7 +184,7 @@ static int mt8186_fe_trigger(struct snd_pcm_substream *substream, int cmd, * for small latency record * ul memif need read some data before irq enable */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE && + if (snd_pcm_is_capture(substream) && ((runtime->period_size * 1000) / rate <= 10)) udelay(300); @@ -219,7 +219,7 @@ static int mt8186_fe_trigger(struct snd_pcm_substream *substream, int cmd, case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_SUSPEND: if (afe_priv->xrun_assert[id] > 0) { - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { int avail = snd_pcm_capture_avail(runtime); /* alsa can trigger stop/start when occur xrun */ if (avail >= runtime->buffer_size) diff --git a/sound/soc/mediatek/mt8186/mt8186-dai-adda.c b/sound/soc/mediatek/mt8186/mt8186-dai-adda.c index dbd157d1a1ea2..5243e263c105d 100644 --- a/sound/soc/mediatek/mt8186/mt8186-dai-adda.c +++ b/sound/soc/mediatek/mt8186/mt8186-dai-adda.c @@ -565,7 +565,7 @@ static int mtk_dai_adda_hw_params(struct snd_pcm_substream *substream, dev_dbg(afe->dev, "%s(), id %d, stream %d, rate %d\n", __func__, id, substream->stream, rate); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { unsigned int dl_src2_con0; unsigned int dl_src2_con1; diff --git a/sound/soc/mediatek/mt8186/mt8186-dai-src.c b/sound/soc/mediatek/mt8186/mt8186-dai-src.c index e475f4591aef5..5071fd69281c7 100644 --- a/sound/soc/mediatek/mt8186/mt8186-dai-src.c +++ b/sound/soc/mediatek/mt8186/mt8186-dai-src.c @@ -560,7 +560,7 @@ static int mtk_dai_src_hw_params(struct snd_pcm_substream *substream, __func__, id, substream->stream, rate); /* rate */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { src_priv->dl_rate = rate; if (id == MT8186_DAI_SRC_1) { sft = GENERAL1_ASRCIN_MODE_SFT; @@ -596,7 +596,7 @@ static int mtk_dai_src_hw_free(struct snd_pcm_substream *substream, dev_dbg(afe->dev, "%s(), id %d, stream %d\n", __func__, id, substream->stream); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) src_priv->dl_rate = 0; else src_priv->ul_rate = 0; diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c index ccb6c1f3adc7d..2058e0aa63993 100644 --- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c +++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c @@ -397,7 +397,7 @@ static int mt8188_afe_fe_trigger(struct snd_pcm_substream *substream, int cmd, fs << irq_data->irq_fs_shift); /* delay for uplink */ - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) { + if (snd_pcm_is_capture(substream)) { u32 sample_delay; sample_delay = ((MEMIF_AXI_MINLEN + 1) * 64 + diff --git a/sound/soc/mediatek/mt8188/mt8188-dai-adda.c b/sound/soc/mediatek/mt8188/mt8188-dai-adda.c index 8a17d1935c48f..58e1795bfad92 100644 --- a/sound/soc/mediatek/mt8188/mt8188-dai-adda.c +++ b/sound/soc/mediatek/mt8188/mt8188-dai-adda.c @@ -414,7 +414,7 @@ static int mtk_dai_adda_hw_params(struct snd_pcm_substream *substream, adda_priv->hires_required = (rate > ADDA_HIRES_THRES); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = mtk_dai_da_configure(afe, rate, id); else ret = mtk_dai_ad_configure(afe, rate, id); diff --git a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c index 99de85b876435..5fae5e877d449 100644 --- a/sound/soc/mediatek/mt8192/mt8192-dai-adda.c +++ b/sound/soc/mediatek/mt8192/mt8192-dai-adda.c @@ -1067,7 +1067,7 @@ static int mtk_dai_adda_hw_params(struct snd_pcm_substream *substream, unsigned int rate = params_rate(params); int id = dai->id; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { unsigned int dl_src2_con0 = 0; unsigned int dl_src2_con1 = 0; diff --git a/sound/soc/mediatek/mt8195/mt8195-dai-adda.c b/sound/soc/mediatek/mt8195/mt8195-dai-adda.c index 8da1587128ccf..18c63f7fc5407 100644 --- a/sound/soc/mediatek/mt8195/mt8195-dai-adda.c +++ b/sound/soc/mediatek/mt8195/mt8195-dai-adda.c @@ -638,7 +638,7 @@ static int mtk_dai_adda_hw_params(struct snd_pcm_substream *substream, else adda_priv->hires_required = 0; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) ret = mtk_dai_da_configure(afe, rate, dai->id); else ret = mtk_dai_ad_configure(afe, rate, dai->id); 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: 13752938 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-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: y3naQlVNn0RIj1HSSIf3UY0fgEk/bq1d72h1YMxD0UfNhHz3Ly+OaGepgGWNi3MXvQbHfwHezve9CfHl2vZ3/nbbumYlfEF8SNHDhux2zEaIrwhX+7KsEfnU05ZzwvWJkd4MXbQU/aSPPREuG4d1ET2ZrjSuHwq3CKgiavHSe4L2C09F2ZonSOsbdrBSxV33hTlQcjXdV7DXj+Ak2vsj2eIUWR7qmH3+e8/BG8bt+BNxi31dst/cLwCvep9ayYfe51G4kxNHq9+nwhWuzvUfhqgj+jwP2TCNGOfYILEHyFQD3mvFu5fFGfa+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+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: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: 13752939 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010021.outbound.protection.outlook.com [52.101.229.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 001522BAF3 for ; Mon, 5 Aug 2024 00:44:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.21 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818667; cv=fail; b=lWakJYe6Ai0MlscFXuFeMZXQhD47JOquXQB20lrb8erJz353mH3KDWGj/MCYPGRf1MRZHkUY5zfH9mVFuRtl5RjDnzzU1Aw092NEH6eKhi6nt9c8cBbREMefBabUCRYtYnGVKKPLKSnT1r/CTMJycBk86BId9mn+91y2GRQXJF8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818667; c=relaxed/simple; bh=jDmfkdTmVa2mfEAclGFkpGjLr7nnpEUowyIYFxatrIw=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=AUL1DEA+BYJH3xwhibFHs1PwTFHcPUJLM4pOXR766bfTKtO7PpunU5eg1ktj4od5yvjeEhaXXkFhbSbOB6R3ML0leKM4mDyzZYDD5/RJ4WlYT/joL5fYK9YhOnQuzmXSEXWPAx1XhnEW+Ww/n2/EzJk7b/SGB+Oilex0Athbghw= 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=k27PkGT4; arc=fail smtp.client-ip=52.101.229.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="k27PkGT4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=k0vCCO6DpLaue5n45K2F/Wt96iSRWQ3J2kNW4UZGLsaWe77n9wz6cnVXznwnODFLePVr7JJzCQtGFQ11oxs/AXeOFwucVjohjhlG39Xwjy1vGuGJgp9fA86RzLaM9iBlCa/MtYWuZrOD8sUoiWkx99+qc2sYanMrU5ZLEhAMcMHkhUwLMq6+xSxAgcUCd42YTLiCxGWjxubf3l+I+woHgosN7CHFOqcQWerYvn58Wwk7leiV6kR7MvPMvPjqTBPNVmiJCOzt39zBcSUCEesKNOQpC0J+I/sYoqTf/8xPv+D/32CHqThQjbIuTSUaenGPGA5wIeZubmAa1TCo4zrN/w== 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=PnaN7Y45blHwpUNFxGbqERz7xmucY20FdxE3eLug914=; b=zI6XbXqidkJMbBaxJQkb7G8D/zoT62D6WI11kvHsGSX3qF9b9FSkK1XTLDkzjmxvQdS5uYahYsDa/XQkb4K/U3O33I9tg8r4V6hao67Ip4X+PPky19/hA+0pfiL2xX0k9aqUM3vPvj8ZmDz5SXYBv3M7F9QKavigqcwZNCNT7Ty9yZSvOSYX+KaiAbKfw3PqyJgMnIaEpSH94i4wo/+VDb9kYaLa5rMMKWnX43wEXkZfA6oMbmcGRsPgfRWgXg3sGx5/kkbSSEcn2MWmECnJHH39+gSQMiMfXo5/IvlrYLDnBX9U2lfk44AjRcdrwVjLLIPuIhO5Tl1fQziTl8Y/qQ== 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=PnaN7Y45blHwpUNFxGbqERz7xmucY20FdxE3eLug914=; b=k27PkGT4hCM4BxPdMWYA4dtS7EZXvbsuPUmB+Ub46Onamc3gp2aSkSvdayGa3spw9WI39pPUwesO9NVmbLHp8CUkPmKTiUysHzVDEiu3k4uroGBD4QgiTgCvT0D+p2lvjnjtA2jmIyjqYoSpbRFV1LJTQ1Gak9UhiFVnTwRbuC0= 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: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:44:23 +0000 Message-ID: <87plqnvlw9.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 110/113] ASoC: starfive: 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:22 +0000 X-ClientProxiedBy: TYAPR01CA0151.jpnprd01.prod.outlook.com (2603:1096:404:7e::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_|TYWPR01MB11466:EE_ X-MS-Office365-Filtering-Correlation-Id: 121f423f-26bb-4e5b-5b44-08dcb4e7bfd0 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: 9oDE+a0AIYLEMOKglhYyLpWrbr1HTCYgBXLghCCIn8IC2WbNRFIM5TQ0EdExEVIsR0NVxjhq0raK2UI8oBePexJiB2pPM5gIzN1ZsdDNvW479uOlyIYhDjLyvoSBXdbFE+panb1R6tw+8n1ToArI5eVKmOXu4H5simnssYksqeP473IThYrAWjf7oUIPcoYAAQ2s5QfcUT7txAMLUUal39kxRKaBXQOim0xrgXae1+0q4R5RorkysDoCxtWSmjZ2NfHRpc9X2BqfIeR/hxgzsC4Y2LlbIr70cQf9p2BdS/QEyHWQIiF8jubeyalMxVt9MqMjTjZR8ROS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u0VYbSROESq1T1m8hIEprA== 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: KY9aUeCzju2IqNfYrGge2zU1AUkjWGuSX8nE6EU44IsQy1hzKb+rs2pGJ0r6mmhXCqSO3iuKXVIjJGDfIn+uXYkJcF0c6wPQDz9eaDPoYA/PqeHzqqUWMKfzm75YbvdYqw7+SXgu6KxOjwSxytpRJasLvgg84cz2kHZ4yXnvVSdKUbBqwvPUFv8a5LPhDJbYSjfA7MOCKn6lVB2MVxtpflCJkqaBi7I7+8Pkn2qx3+h+T51OVk4ox1Vtpz8JPi+ZAqYGb1DFDYZYPS2wsNRioT0GGDNTa54mY4gj2JNmkUDwypmZILq67fEChC/8M1hyzw+tHiT75D8Q9NcbtE2l8dcdC3hQRMyk2+arFkxYvnzaZECpFSeanu7//IpV8tlZ4uc6RkMl2OIuv6aOSJqD819BQM9L9Iatas7cvEq0U/buGTIiFPkGu8UvdLEA1yOK8Zf75Bf84YtuKP+Fhx4tUDAwesOr4zcDGAhb/uo5V0Js0w2iTyaW83+j6xpMBxMNxAgiyoPDtn1AWpPToyteWz6T2rfPlKStj4QcfdKzvmRTqvQpU0JuWYa7TJFYY9cxMCiRNHHWcjWpo1oTe843gBdUdc99vPvFBgtQLK8Q9tPKVkq8+wpo6vWLXb0/AR3J/u6pdr+S5hG5DM00EF7ZhHYiF12IODd+Ey+l8/7QpLs9wDusU/jWtTHD+NqA/xEW0gsJm/gGvqW/Eb1xZgQimsCs4eX02Jwgp/jxa1gRsLL+5+WZglVqy6e9Zdd3jSpdSQhFlmJuXxCk7QcG+iqSODIGjWEforG/hOnb2hAp12+Z+q2JUelxuIIm0Rs5NIACjZ15yFhEJA5M9T73B1t4T7SpzGVDdT0TBiv8V4S1XyTo8sfe9fj+nto7f/TTpn6AL0Cl9K8jy094kwEDR7kdv5JMCY0tc9h04TsIVFmrAbKlhc+AvZtGaDwaspnQj9ORRniLIKgWzM9C3zxABm5z33I7SHXPotwOjoP8dGQK8/OYiuoHnd5SgumaLoeXuq2BHUnmp+qGqX5h7fF0beScaAUWLViuFnKZH0qf50sGa63U/u51IsHytzRESQLO08K0zsl1sHx3v7aaX3dGp9EOMRjVCzuWBsYEyPgNv9Q71QwjN1b4pllsliKhslFNEKuae1A5/ULl6nVLYkrBTubeKGOSDtLJfoWr73ek3gCKWUMowoOvPWJR20KI7yHx61ZC6YZigvhK6bZmLPAwHnCYltqzpz77hwRzVEUmnTIxE3LGOq0IBCzAtwLHT3VNKkX9aQRMTYtwZyvSfx/MNmR7ryIUl2vCgEH7Hp7GPRqIjVsL7nb0dXZtph44EahfSPPSHBLUAqnqvYwi/Y9FTumKc/r170LmxaG/1+SYQ5f4UbV5jQxKCva3EVgzz+TKkiz2BYzltSUa9QIkOt6i69Xm0K4d5nzVnzyMKIULQA024/McHBr619XN8r1FqyHj1OrILfzKmcq4TvK5gHf5qs8sRzSCrvADr/votwai9Qt1TQ7SjhCj2LbvdDa66QOgaDlKDu/JmR9djO5F42yVp8Ofl5MveIXktmL0Z7zPk44vhDyRhr7N/DzkD2SXLcRROO+vkQc547I5kAG4ocH8GdnEilbgYkXsBw3JI3wP/1/jaOY= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 121f423f-26bb-4e5b-5b44-08dcb4e7bfd0 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:22.9210 (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: Kjo0K9jELy7TsUtNhadeO7DjXpaljkXM5sm5f7hGENJgy1fJn7p/RyxrEUrgjlW+H5dAx22+SAYbx0uJprQfIMGCxRWenNNWohyrTS6dX2jY7cKsJAcMyD77ywMKH/i/ 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/starfive/jh7110_tdm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sound/soc/starfive/jh7110_tdm.c b/sound/soc/starfive/jh7110_tdm.c index 1e0ff67207471..c2b307558bfb5 100644 --- a/sound/soc/starfive/jh7110_tdm.c +++ b/sound/soc/starfive/jh7110_tdm.c @@ -146,7 +146,7 @@ static inline void jh7110_tdm_writel(struct jh7110_tdm_dev *tdm, u16 reg, u32 va static void jh7110_tdm_save_context(struct jh7110_tdm_dev *tdm, struct snd_pcm_substream *substream) { - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) tdm->saved_pcmtxcr = jh7110_tdm_readl(tdm, TDM_PCMTXCR); else tdm->saved_pcmrxcr = jh7110_tdm_readl(tdm, TDM_PCMRXCR); @@ -161,7 +161,7 @@ static void jh7110_tdm_start(struct jh7110_tdm_dev *tdm, jh7110_tdm_writel(tdm, TDM_PCMGBCR, data | PCMGBCR_ENABLE); /* restore context */ - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) jh7110_tdm_writel(tdm, TDM_PCMTXCR, tdm->saved_pcmtxcr | PCMTXCR_TXEN); else jh7110_tdm_writel(tdm, TDM_PCMRXCR, tdm->saved_pcmrxcr | PCMRXCR_RXEN); @@ -172,7 +172,7 @@ static void jh7110_tdm_stop(struct jh7110_tdm_dev *tdm, { unsigned int val; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { val = jh7110_tdm_readl(tdm, TDM_PCMTXCR); val &= ~PCMTXCR_TXEN; jh7110_tdm_writel(tdm, TDM_PCMTXCR, val); @@ -237,7 +237,7 @@ static int jh7110_tdm_config(struct jh7110_tdm_dev *tdm, (tdm->tx.sl << SL_BIT) | (tdm->tx.lrj << LRJ_BIT); - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) jh7110_tdm_writel(tdm, TDM_PCMTXCR, datatx); else jh7110_tdm_writel(tdm, TDM_PCMRXCR, datarx); @@ -380,7 +380,7 @@ static int jh7110_tdm_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_pcm_is_playback(substream)) { tdm->tx.wl = chan_wl; tdm->tx.sl = chan_sl; tdm->tx.sscale = chan_nr; 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: 13752940 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: BCL:0;ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: ecy4WtwZp3Cb3j8yDnPtnB/yyWpfqEfcHwtt/UvIuYN4YDKH1WMydGxHjcacK9J1J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N+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/Gl28DMhstkXjbuIv+Ct+H1kDybrs+8T5KIY8Dsr8ctpQmC4wbHh+H/6QNq98GRM3ZYZQl261TYDLvXfS8k2zgHKV6MbqsUsbGS9RGIhKtgvlQUMvOmYNtnnq2Mx3t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xK4i1Kxgh0N3ML0GQqE= 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: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: 13752941 Received: from TY3P286CU002.outbound.protection.outlook.com (mail-japaneastazon11010030.outbound.protection.outlook.com [52.101.229.30]) (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 3348C22625 for ; Mon, 5 Aug 2024 00:44:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.229.30 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818674; cv=fail; b=DxEd2O2ZYPz/mkunuZifhu1IrQB/zVDmpMYWHvd4SrGEptf85UlHGoKI6NxF2z3mpD/7NsGWFNCevLJLoHnqKMXYjyyj5yOdxsWBgYXbuB94fBj4nAF4OnlV9+NduU1IIQFa5qW68go97q0cEwolJpZjaGYFAfi1HZtuWsZanIE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818674; c=relaxed/simple; bh=oqAZo2jNs3ZSGL9laaVmjn/iHxf2kyqpUv2k8OAzn08=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=RQTEwd++lh6A3GlxDOCrSvTUghAYeEChz0KtCLhWw/9Sa+Z9e+kOR8g0Z7rIe+SGJHwVyq5U5pvKyhYB8q8WAYpBgHhrPiU1GLX4BW776q+doeLjwFXTXZ2isbaBZ96uWcGfCjrJpWJuC5EtVu0VGZ/sG9KAKvs3SZ2bVnB60Q8= 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=iCTnlZ8d; arc=fail smtp.client-ip=52.101.229.30 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="iCTnlZ8d" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jrJmDTCFMWybkV1F9vZ/56TC3PkLwo+Ro0PDJtdvB+gh9QAZ6HbjBzTkWH8QmiHdnm+dTyBA1Ht3uxcdUyFEFVFjQcHtlW+RiIAQ1UHi8eCzAfYZhNehyH69dKc78KevN3evQkWVhdeu1Zi22gq8KN+GcUjUQYBuEWOClgZN/2vgcgt0x4DF4P/vYwWgazW1/0ONoNf3aq6KyS7DtvTPcr/iYuMSzGKprpgeHLrXX31m4MPqV4U+3/5YKFUT2gn6/WPsWrh5ayKvgfKen1bL23riEYvfzWIWRkm4s/RpW2zWcu1JJ0iBmSVGyZWF6yagqi/dkISnMlTUmfNQuABVWw== 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=+FDt0zQg654JzDyXUZ5gDWAJp/otcxnDwet1mgZwM+0=; b=Pxy16Ytrf2W41L3LQZOzzSqWXu94AtuJMXwU5exPRavpoBGxdMuYgXLpqxXIkSoC4ZV22Tea2WTTGgOVe08hA0gYMMF4K9R6/WJPn4oOYPhYjZZEWG6tJQpVBJgm4q29O9wh52oBagOpD7CKyoZkEEsGTm56pi6uCAnFGwzgihpG3/KqYb/KMSJq6ny63VjPlUL2ZFmPgaBt7MOnxCV6wFB087OY5RPVFbCplVyqjTZurlgtFjBFBxTObx2JNp7Pu/lQ7RHWbuLFdvjLANn2XBS4vCqC4XyKLAKu8iF+osCOebil5blLHzyEHj2Kbzmov015x+MaqK4klxyii9I9oA== 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=+FDt0zQg654JzDyXUZ5gDWAJp/otcxnDwet1mgZwM+0=; b=iCTnlZ8dcfjiYTgi0c7zePTn/MjyIJzJv87nu08hQoH27dmO/PRBWN/cKeAGa3JGdVVX/weWiMmBTVpg1doUYvhnGPMwOjhegPXFVPh6OT2IfWAhoiWM8bNJsjQiE9oHZ5E/c/p5UZN2lIIDr+wXaLPN3HI3lS1eqTLsY3+Vnrg= 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:31 +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:31 +0000 Message-ID: <87mslrvlw1.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 112/113] ASoC: hisilicon: 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:31 +0000 X-ClientProxiedBy: TYCPR01CA0053.jpnprd01.prod.outlook.com (2603:1096:405:2::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_|TYWPR01MB11466:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d2d503b-60d5-44b8-210e-08dcb4e7c4ba 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: OM7sXm9UGrBXmm2gkYntzZvu/T7JIHQB5t0g4hXCTGCUpSWxnWarUqM6ozxtf5kiP1hf+ib95Oih7dJ5UgQPbRBQS/M8zgqM3if11nR6pMLcGWfnjY2q1o1GFX2YLQ7Mrls9hec2w++6Vwma71h5q62C7NxJqYU5I8t7KNawTPgzAnRnkbbx5QX5xhulS6A0EynrM70reaYRgPBb/Z5V0R+5MwFDbOBja2G1Vn8VktzS/9CYdN8hxmPi8j0LQkYgPUkwVpP7D1aFBuDSQhkrFoEY3fAZcWQz1x8Pr8PUbkSq3d/r5QAUX/7cn0Z9DN5/nbSGre76xL2MxtCaQAbq2ihS1Fw0FsFRCq/J3Nnxw4RtaDtXHpeK4McYx8T4++oKmp7qfKWKAMT8fvw8yG5VVvMtSDUIllcUqutyc7MlWQlw+Ti+vZj5pW23dG6klPV1tg8RxVzDMFvb5zQnrUMVuxvVQCG8dOqjhTWEvdpz5qp60X6l0CY0KZcdQXtUSWe+4huClQ1ZEn8o1HmOzgYuGOe0KohNLGXEX7dikp4ZsoKHLozR8+/sIqEVJawboM8OUF5Ox9THArKUzX/RyO4/HqKUpSMD74n2N58Ihl2B98PkBL70MQGNnMUdzDIT9AJiJtf+Ku/UdTfp7CF7iX5u/Qi3Q/VDgdSSh2NDGzF2ova6gL7CY5xwPSItxecbQ/xyF35NSm+JwPr+5hwEGF0BxNFIjESFFNnxP0vGj9COmoDahkqbuxHd4wDdgjiGuhmbfuEIVcMa8TbFI/ezhazc35Ai2Vo8qBClEtA+PWYZY3LF5VYkMnJPgoF80bJZNRGlnnItLYgY1P6jHVyFKdW7kGQ1RTnuG8y/KDI0TyAenMKMlJxdVCu0MvCzuRtoO6BiKMOt07ystQLzyVMbw75nzkP5GlMpr3cjVXrKgJzFmEiCQXPPit1nj54VuQs+u13BMZpYEP5c5XMC1JcC7T4lSKRoH/tY0vDU9jvAnlfDy5JXRnxUnY7evZOmV+A3buHmfpTG+7IaYVas87mB195e/CkF7+IzZrvLzE4AllEZiRK87IuYp8EdMWhhtVR2ptfYqc8ua3NUMXqCRBgVE1B6lX47ZETaYPpk3P8LczZcTsNB0aXozylEu2EkxyRu+B0PMckSpnQQ9gV5mBr8XwffyQ1jBZ207kbx/jvc/i3Oaie1h7LwkHD7mVj+g3FGv58mthCYfouDbjSf0y6sQNOuBWdolWzn8sS/B8KNC0m5hupjrj3Zz/BJ6seHzV23w1J+pDk44CfO/1NI/Qi05kx5UsYWZmtbsM+nMK08X6nos/QA+GRY11gCUIfbcelOxDh0ZjNT0cQO+minOdD3mSEhkhX8+8PNGZTDhPitltV6UbKZdJqFTuQGXbISwyOTkEgFK8NdITMMgHRVzjPlFuHIbw== 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: ZbgSi9t6gLnEqzMNUUTMd8LJRn/uzBbhIOQOXd7rDBXOqKSR5VX8uJAyD7fLtlm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7hwtVmdrw/8fZLWkm+SP090NPk16Qx6PkPy9xRVjQzAqO15fng4t/g3jimKh4OBcJ4fzpGM3nyJ5+0JRwhxIqnaDdUbh+bJmR69iaptLr7rI1qxaGNLs52MCtW82d/hlVCR8tZ+d+tPhuNhiL9o4Al3lAL2uGSYqAap4aef0dRtkjlL6W5fXuBP9KDKZS+lIqPGh+qsAc8FjobiKonMIbufWF6FjwW03bLoi6h75zkYNW2zzbILCbcLnCfC7sr+e3sLCBa89DLE0K2LVaH5iuWycDfRh1vY/JtY2VOhsh1S/qgNURO9Z9VyZm7cxwxAgsSHUpaaw03BgKNqG+8h8NYInDHGC/MrmRceMEpN2+pTNv9mzS7TSCcQQZgLESQaKjGAsMAW4XaVSfQ5squl+FUH2H/h2F4ihxT76D7EfKlgFFvTIpEKkXRuF+3mBMN+9amp3aPtMmZqk/ub8aJB7gqqPN4wC1celWzXRXIau8= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7d2d503b-60d5-44b8-210e-08dcb4e7c4ba 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:31.1521 (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: CDZ0XpQPLwsZsT9HgsMCJDCVTaRV/yflatXDovVnvDVNIN3nb0zVW9WoUV8feJtjTuS2eoppvo9CtQauqwS+1acbUyNu4svqzTVDwcMSJnMIfLPabOL1O0WDz8GlqtCn 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/hisilicon/hi6210-i2s.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/hisilicon/hi6210-i2s.c b/sound/soc/hisilicon/hi6210-i2s.c index 250ae3781d140..37ffec8ff721f 100644 --- a/sound/soc/hisilicon/hi6210-i2s.c +++ b/sound/soc/hisilicon/hi6210-i2s.c @@ -421,7 +421,7 @@ static int hi6210_i2s_hw_params(struct snd_pcm_substream *substream, dma_data->maxburst = 2; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) + if (snd_pcm_is_playback(substream)) dma_data->addr = i2s->base_phys + HII2S_ST_DL_CHANNEL; else dma_data->addr = i2s->base_phys + HII2S_STEREO_UPLINK_CHANNEL; @@ -478,14 +478,14 @@ static int hi6210_i2s_trigger(struct snd_pcm_substream *substream, int cmd, switch (cmd) { case SNDRV_PCM_TRIGGER_START: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) hi6210_i2s_rxctrl(cpu_dai, 1); else hi6210_i2s_txctrl(cpu_dai, 1); break; case SNDRV_PCM_TRIGGER_STOP: case SNDRV_PCM_TRIGGER_PAUSE_PUSH: - if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) + if (snd_pcm_is_capture(substream)) hi6210_i2s_rxctrl(cpu_dai, 0); else hi6210_i2s_txctrl(cpu_dai, 0); 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: 13752942 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-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wrR/JPOAT1OMa6DTecG+O4mbND0T2niAMxJi3kVE8Ml9oxzOcOO8lgBOI3t1WlDMqHb51yv+AporJTbnpaaq1Cn3grpWS9Ff4KlTwie1EeY+w/xKkaVbKSQiHqOuvgQGg1Utw1g9HC/U5O9TtzHsg2DIyn9vHT9uxGHtNG68L1GMg1YjwvL5uur4f6lmL9AU0GF9MvsCq5bvDH7Nz4FqJlh9rlkUbq2rz4GIsI1hD4pvppQDd8vseC2W58cAe/2ErEgCHl7J4egw+Z2fkGQIY2I8TS1rYw5Z88LGMFXw0JDEijSZYb6c44e/gDV2Yqy10bQA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Bbp3OC0lXJyX3UtVtUQ22a05v8xIMNNkqTG0hDiGaMtTvhl4oXYLBX7bTMYXw/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 {