From patchwork Mon Aug 5 00:43:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 816947 Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazon11011061.outbound.protection.outlook.com [52.101.125.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36FE71E529 for ; Mon, 5 Aug 2024 00:43:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.125.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818583; cv=fail; b=P1EbWr3zTsVTsZ5kT+CGodUAS0Udx0fqhqPIrDiU1EnkSuy77L/KsVjameqDCYZp/4bCit+1hfAOvDLpdENRsVoADCwWLOqEThKbfjJYDd0x+VCXPnFuDJqOkPwd301DU+ULIXCr8BaGKs0pRDnNKTAFbUhIW/pHORjoJgfqcdE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722818583; c=relaxed/simple; bh=XG+mauert9qR1cl6Lexl4P0vpEAtkno0k3vkaY97nWQ=; h=Message-ID:From:Subject:To:Cc:In-Reply-To:References:Content-Type: Date:MIME-Version; b=PHyaVga9lmlyQu6VE7xpC7m9VYT+ezDgMl9DETtucTtXTq1VDFJng6fuK8dePXvjImrYSE1r5iZ5jOWiPbhkwTOPAYe2kqEyZ4f8RAp4EXatWNI3DSqvIgeW+02vJrRe1uNk8VX0B2/fxFQjfkkFsHe0+auvGHNHL7wLm5dQiz4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b=mvpqpAKd; arc=fail smtp.client-ip=52.101.125.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=renesas.com header.i=@renesas.com header.b="mvpqpAKd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TSEm+FwvQBc6FmSwliW9fHc2bG9Fl8RDNLwFbe8sdSuCIKXTD+sdrwuzQjcvPxB/BTU181leBCg88rFhwrhCkbdbXD3hOsDzZfe7Dv+vdlkEj+IpyL4tV3ray6z+jSNFuILcex5pGU+P7Id22j0TKCCylBwlIYDDiFblcKXLXAfXuJXow2eMYKG90X417D7vdbgfvBxA0/ljlvL9h5EIuI45Dlq+DIiDNvnBO+soX8/Tp9beAoJbHRxEqMA7q3uWLFCQbfLCbpUbZyhzW0qJz9tVGW00HtIu7NtW/Onoe4lZ4WAQzSvjOoo6gmX3lzfJATWOCoBG/nsZCQ4uqKYoLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bSWCqUqwVb+Pyr6/igVvjr8UZy1QKXLV5RPw07whWx0=; b=WtfJVvNUwdzvHpE9KIPUUoOLsKb+Tr7/9Y3q0Fjq21SZ42C0JcwZgXHaRT1nxU4CK25IvUsiGyqkoQk6JBSCsUqiHR1HfRnN2euOhDBV+8YbBnZN9Brc6uoAZoHHggRfLUvg+x51yDvY2NVIEtGRD8DJwXlv7A5qz1EjMBF+Tj3k2w8IFTWstQcCtHXQxilAdVcRYRM7TzV1It+/r5qaUcmgqPMqYr9i+QKFM9VfPO1Y5qqVcmDH99XbmJ+VBYSdjlmnmDTwAUuKjhYh9uoAWaxk6v/JRWgaXWvzpkPOUhhc7BbSrTwOurYZQjEsdFnSze5q0mED5tbhnKeKHrtXYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=renesas.com; dmarc=pass action=none header.from=renesas.com; dkim=pass header.d=renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bSWCqUqwVb+Pyr6/igVvjr8UZy1QKXLV5RPw07whWx0=; b=mvpqpAKdp0ypl+XDQ8Rx3HkO1gaWtWQKCAoPGlcOcJUhQVSkhRRFfgdXmrWY1YKUD49sfWNqV+4lJ//E2r54j1q6Ni58vMJpeGIiFLqKbOXapNxPi4IWbL+lbZH4TNY2BuIymJTWQ7SKIf/fK9/QELomKyhFdj3WrALwtkWDYBE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=renesas.com; Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) by TYCPR01MB9685.jpnprd01.prod.outlook.com (2603:1096:400:221::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.25; Mon, 5 Aug 2024 00:43:00 +0000 Received: from TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11]) by TYCPR01MB10914.jpnprd01.prod.outlook.com ([fe80::c568:1028:2fd1:6e11%5]) with mapi id 15.20.7828.023; Mon, 5 Aug 2024 00:43:00 +0000 Message-ID: <87h6bzx0j0.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 091/113] ASoC: codecs: uda1380: use snd_pcm_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Mark Brown Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-staging@lists.linux.dev, Linux-ALSA In-Reply-To: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> References: <874j7z3j1a.wl-kuninori.morimoto.gx@renesas.com> Date: Mon, 5 Aug 2024 00:43:00 +0000 X-ClientProxiedBy: TYCP301CA0056.JPNP301.PROD.OUTLOOK.COM (2603:1096:400:384::18) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYCPR01MB9685:EE_ X-MS-Office365-Filtering-Correlation-Id: 28218baa-df38-43c4-14fb-08dcb4e78e7f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|52116014|38350700014; X-Microsoft-Antispam-Message-Info: vC5XClmp60OCZaun0emTmCBs+QZBKieG6+gZKBaxg0vpcPyhBQTZxsO1R3ApASFqb24p42sodvwvLMNdEKKhWIAcwpVRcRO46qYhf7iJJii+mruTNyOVHMGxhsLiRO1K7MZUeL0CQbO1U6vjPr4oNiwmzaunKcLlCKEN8Ep5LR1Y0VgeR5OqMJdX5X0Q0GgOplQaZNLbEFMN70VDcVgyyBd1HQng4r8OyHZ+moEkQK9lpN3/VT00CUIzFNnykIlpsUe9qos5azhrz9vBbYoQVQl8Crnm+UqZ35m3XsLmgqzVrZct6UJPasww65xXFXxuHtpsjQ2EOYUZz5sRTnZIJQLZBo0g3o/wDMSfiiBsmfFqKSsmJrsqGR9hCeiZWN7mR+YOegimYmCn0TKzQ9OjsbvmClrCpkMDYL+Fl9BR9Hn2SUj88FffpOv8NueOYhSmB4QJR+sJRJj7yUUmpeZep6V9V33c0NOruCKsycNuqVz9VeMhSwSQ3SU5HEkCai6zcPDA1N4Vyk8g7O5vVKqVXvhW1h3p5JutZsi3a56SksZICn1vjaag8jefCB9H6yvlLuJkADqjjPgBryatA97bcBRWlS33uSAgZ+kwSR6DGPprKmGSvPThIOEC5odoSzEmf1gC8X+OJq6AYuLma6q7Otb+zy6FU0hlWWhTK6Dm6uNd/RdRi4AaspJr++sRrobqhhAvZWLvMJVOcc0GosJC6ImixNKVJmcBsCNw/DccUNsCvshieGAAJi8oqmpzr7kT3B7d3kHGCrI+a3BR+FzYVF5ALoNdfETovl2WflT5Sm77O0nvDAu0tLTIYBgwe0aE+Ww2Jnzyn+HaC9TzG6YNq2lIoc8/uuiVVUKRiVgWz33M4/uIjeF7185Sy1nqjWmXl2jSfJGeD5O9yZuRjcz9uSfz/GsAuXM6KAXIakW4mwrBVHOVU7Mf47XyuXcZBnHqmNxNCSgY4TuJS1/ZMKtAyml5WXKFt+smWRjrlY2eHnuRssEJvpfbcfcDphm/DjBNSZxEj/092OV3YL+E5xxkWXS4z5H0mm99LvS5xUPNUPrNyLn0V3rVBBnLIXaUd7M4ai+EZEqKQOlSBHNE2M6WDgGOphFQ7OLpAsxqzQUTQTyC7ZgIWlq+w6aC0KmMEc4E17xZl1QQHlp89qPCDJy3LI57zgmlZVsg3ggSpJ8WGwP4trN9ulshBJHn4oshMMPgOFhGtvE9g3uveeqbguQwz324KI9VpKsN84BmHq6qe/XqzE5fkrjsjHLfX6dx5zRtuUP/W8FqP1fNik4UHu6mkbKf3OVV4rLQJ0p63XEoF6I3j6hhK7LpkAUnyN4WEGbpZfMB5UpelYCF0nBRare/X2bmWgG9J5KpUGiah5iZ/6beFI7esamhCZvYt2Eawq1YfH0yV4Rq9cKnpX3gtJ1H8g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:TYCPR01MB10914.jpnprd01.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-M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DO0xzA+gCimFxGH0ot8gPLaGe7P49tA81i6UJDN6HPV980aPvMEVDSwJgmUFZHpz9VTUSye49QYWibFpCZBnxUX4yiSrJm1ayf9rMjqY9R67lLmkRNmWRtJwC48HUTxTeuQcE6UCZUtfwb8h+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);