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: ko6ROMSw4zU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hniI80DAr/wKNGjZ7HHJqjVSQ7dqYVg4fhYPzBD7Q3WBiCW7nvSWDNHn+eEj3U763KuOqzCTE2puClbMdAj4zedudRBYitJ+QSyYNZDDsMezdqkIE8thFokqW3yuoXhs5AVXeSUYHnvH9l1RG7JYu5+Z/w36cUlqljH0WlqtcyCb2rz+qtwRJvZhEkiEZ5TPjPdi7sqbNPdxUUV3VNa987HC5tYQhBoBz3SHvSLNEQPkZcTgfN0X/4Puldc0NPAMDkxKUqPodnsvHhJ/USMkxeOFS+b54QFMX8yUpO6ks16T/7qZMbZQmYPm9ETmbZ+M+qDmhSjTNWyElAZ9N2+Gnn8Xbr8QogsLiJR1z6ZsnD/V9e2kwIHB9X2heBTEuLYFJPS2vkXESTc46HYXq+T1pMCxuxYae7domUxoV/MtMDNlLcwnDdGFXA3hMQwzh6/GNMfm21yelp6f2Np7NM2f3TTYgmsxGJt1CoNGAB5N1Jz1cYascTLU25Ry2le3bmZdDxLh8kDiTq51XjN7IMhM0j/34k5VeKn42PjUhHzXoOEQ= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7bd44945-9c3b-4285-662b-08dcb4e752d2 X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2024 00:41:20.0893 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 682UdjjKku0jnmUC/GxKI91G7eVI78aOZAM1MjEanN8MgNFY6DQfkP9f81kjKsPDynRlMq//4A1zF6HTNMSoifA/r9am8v7I/IL4Og/v7C27adA2rOCuwLJ1NNnJPOgy X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCPR01MB8678 We can use snd_pcm_is_playback/capture(). Let's use it. Signed-off-by: Kuninori Morimoto --- sound/soc/codecs/ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c index 0e013edfe63d7..aceeeae518d29 100644 --- a/sound/soc/codecs/ac97.c +++ b/sound/soc/codecs/ac97.c @@ -35,7 +35,7 @@ static int ac97_prepare(struct snd_pcm_substream *substream, struct snd_soc_component *component = dai->component; struct snd_ac97 *ac97 = snd_soc_component_get_drvdata(component); - int reg = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ? + int reg = snd_pcm_is_playback(substream) ? AC97_PCM_FRONT_DAC_RATE : AC97_PCM_LR_ADC_RATE; return snd_ac97_set_rate(ac97, reg, substream->runtime->rate); }