From patchwork Thu Jul 18 23:35: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: 813216 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A52CC3DA61 for ; Thu, 18 Jul 2024 23:44:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id C3535E67; Fri, 19 Jul 2024 01:44:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz C3535E67 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1721346250; bh=WL/gkx+Qm/CkOfljEM3l/NEpbmKFL+D9AMm8VgTqu3o=; h=From:Subject:To:Cc:In-Reply-To:References:Date:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=go/vUEpPciicxiAulhaWsg5lL/473qaxtt2KIAXOJzvsoRe4eBrV4PAIx6+q906tA O1Ysz2Nsb6Xqe8pE4m1rlNynGddF4n85V5z0VF5DH2av7IHSVl7yHtXFj1afKY0RSO 0rjRPJf2b1akaImOpTiHMyOqYD6BtXkKUGZVNrM8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C5DB2F80617; Fri, 19 Jul 2024 01:42:55 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 58308F80617; Fri, 19 Jul 2024 01:42:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id F0FDEF80508; Fri, 19 Jul 2024 01:36:31 +0200 (CEST) Received: from TYVP286CU001.outbound.protection.outlook.com (mail-japaneastazlp170110002.outbound.protection.outlook.com [IPv6:2a01:111:f403:c405::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 0D628F80518 for ; Fri, 19 Jul 2024 01:35:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0D628F80518 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=renesas.com header.i=@renesas.com header.a=rsa-sha256 header.s=selector1 header.b=g7b6KIR8 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=erHZzfh07N4r3aBb+er33hFu4FwnilTt82Zxh90LkdklukarhsIDVzpB03qr+1La7uOuxq/8wUF7+n0e1hyZ7uC1qdgGcb1OkjRAsDUqPXz62DIlNUscpU1xe6KyI+4MG+otOz0pbznyq08nySA2bHbRjN9cXpaJ9QGjpXZUjqICAYKQArLHsZWwOIj2B23FDg5OkkOVW9cttHcmqhK1VfQhWkiOGL770vxjbuHKND8w81kqqRfXBojVedAJpmTljKJn2gC+yCmIaE/8yRaIM0EZ2b5Nb7CNrWhVegcz05U8r8fpsiiWy/Kpkr8KBGrppIxz/S3bbHob38Ehw1/8jQ== 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=ntBprF3LwC5EHwsq6OhRzYcu8raU13qrLvWh9P40y3c=; b=UJwXgMkE9Klw5VJBEK7ocZtvsnaqS84+EzN0/KViUkeVNHKC2m2QgS4Q8pocDP3RijzY+RCAE3oyM5Lr7tOFtEIr3nXaw5CebxheRicvO/lePrN4VDECpXueZ3llI50yJgFLN+1S2cj3UFx9R0HjyKaL64Hb/fQsIPqxdcuGd9ZW/q3+6UFQqWKJfLWuny11xxiEFQ5A44g4XLwTrAHP9lUgupo4JMDAm8LTg/RciH7DDXxEiGKLgSZzf6pyRaoz19s7GedvkeZDqFkM4yRNpvCO0dp1QqyLjnzL/0su0DOXaMj2STrEOu6zaQ+ucd27vb85wDh4hSpkv5o4t2rcAw== 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=ntBprF3LwC5EHwsq6OhRzYcu8raU13qrLvWh9P40y3c=; b=g7b6KIR8DhxiX25PoqXkT2OlXKQO+0wQRkerOpEeGra3tKjXe2ZsetoVZ4KSjDLczgrfpDC+0E0ly5qQAiUkZdCK4CvLlyWKbOZJNiIrDSDLjNQ132TU3CghBEfr3A+iJWCPNTAaAqpeNGRxogMMli8D5KXPfwvF7vQOOiBMyEU= 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 TYYPR01MB12448.jpnprd01.prod.outlook.com (2603:1096:405:fa::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7784.18; Thu, 18 Jul 2024 23:35: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.7784.017; Thu, 18 Jul 2024 23:35:35 +0000 Message-ID: <87ttgml1dl.wl-kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [RFC 04/xx] ASoC: tegra: use snd_[sub]stream_is_playback/capture() User-Agent: Wanderlust/2.15.9 Emacs/29.3 Mule/6.0 To: Takashi Iwai , Mark Brown Cc: Linux-ALSA In-Reply-To: <87zfqel1g7.wl-kuninori.morimoto.gx@renesas.com> References: <87zfqel1g7.wl-kuninori.morimoto.gx@renesas.com> Date: Thu, 18 Jul 2024 23:35:35 +0000 X-ClientProxiedBy: TYCP301CA0084.JPNP301.PROD.OUTLOOK.COM (2603:1096:405:7b::8) To TYCPR01MB10914.jpnprd01.prod.outlook.com (2603:1096:400:3a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYCPR01MB10914:EE_|TYYPR01MB12448:EE_ X-MS-Office365-Filtering-Correlation-Id: c3ad0f91-1c69-40d3-7428-08dca782528d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: Y6+H1z9+YaJmoXSY4+nrAs1HkwfeloySorO2FhAVUxMkYW6kKMBrOn/pZ+jY72VGpGlTsC2GL83525Ms3uYUDvDzZE+cage+MisHLzPqh69y9yiGG8mC+rt+dQodGwl2huW2srMA8CVnRir9RbYLhYlNWLsFlJq/efaynV95ltQ9hkMO+G4opE7WU9DPjoCG+iKSKxTGrMrQlwQJmFVk7O/l2MwzvKW1d4xc6aMr2VqvfFppvYoL1dPOM6TYqwltnHbyGDLsyA8hK2CRwE0pmBMRAMqGghTsb5eyyr1GeXKQaGdqgFGiP0clqpwB2c1Ap0Eu/oZmc5DeGMUWeLbqlCC9kVOy4jy01D7RiW7bpiAf5uiev4ncoWO5oYlMaVuMUdzsmpS6oSq6p5ppSFxXErUObCUDNJ8efWwCxe6laQZJg78V/ykFEMhX7BU557DLNfFMGpx7tLYmUWlVuvZn692VC91P3xYUa8HlAUkFa4QjsbG25X8VYOp9BggRfAlfcN+6Ggy8qyk6kZZ0NEPbSd2R0Gbc5Na9GN/XV7W3pD8xE1aWccXvalimhUz2IBNyga2jI7X/Opvy0qTsl7x7UWySFAu1o6x1wH9ce0idlGEoJBSR687nI0+J0s5qGDeWAaH007y7aHNRIfhq/G37j/thb/qMOA8I30zZC0tyiyRHfOECWbfUjLocXyHzQDp3jBXQkMsYr0HHiqrbsa2cxgX9P7dWQTCd7nxX1L6wuayJVDXz1pnuEK7CEXdjslBhxeOt6uyslESO4+MQzEWldbYYrz8n1GjcddET9davGNSPRAVVlZ1fuSvytJhphnZxiSpUQHi7HoNUdWs+ruqyRQF3bL73BsTLwHyOzDr8G6aPTtnb1jNQ2npvF4dsGp7RZuEkvFNiYcZXMYIpXmR2c6z4OVygA0QiiVzBPkV6s950AGZ+8Dmj1AhXanMvIwocRB6/u8hH+dVKUuJvwCPspXll/j+ZN6jb+2Xyh0fEH9u2X38s6Dzw8xlFE8oK3wzrWb109fZtyxorJxcRPegdVjAMgkHZ08yFgpI2h8rrde0KBPAl082YKZhJPBukeNsnCAYA+B6olMrq0uBDlEoBkFzq1VWhEpE3khrxDKTFOO5bMobuh7BxLUC9+Y2RzaLBOjWblxGOFx6QwObrAoUJeT6ORt2Sg/tbZf29PViXZGY/uGV1HhlICLPWVSH8qiQULfyc2vAXBIPbp0r3FAVqjxjaxlSu6ZOT4mYSXHABK0EKc9c+0cKXxztj5lbwcViSGbDafBT0bgTFg578vXTZLtna4rKF1haYDM0PUEYAXm3SFSyWerzG6mD2beIJUq2GthvIB/kSh4vjVusJB4aG+nG3yawPduR2wg8NyczfRmh00YovTi/y9imOx4xweeG+59lHUfQFRjD3YASlBfT7Mw== 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)(52116014)(366016)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8fwr7iglm6e0Z7pe6boXtThv93VhLCojmgrZ+NEjh6gRuay1JHrCqlo+vYfaw7kVLOdas7JOcmb3ZXW/7ZGsjRMIkUTKvwxRHQfhsrWLw5TlWpFyiDlXw5yKFnBYAANbxZXKwMR0R3vceVMOsSqj8dBaK29HXFz2Y1PBbaXPsnw63IUuHXjhD0B2z4Z22OSvjvPzUAyfl5qgytSu563EK/Tc26z2Xjh6dWtO50Q4dLOa6lhX8MJShwD4Thg4S8QAo9M4oex8YpLfW340LoRglFJhgtyI4LS8fhI6UXxjM7mWBzEyqS821E8Ru94a/lV+wzplz+2AyD5+VOr3aTwHNL4UfKhlC6gRymwUPDOTbaOAb9uGNZS7ViBerKAgCD9e3mpLN1w5PKHlOiEysXjTD0vheHmdSoXxNRdvJsH+pp339bu/fxL7clITxC/lBcFY3HYBOshSOH4QOsRhB4OmhUrZm4XPKrVIRuR+RZUTjoVeUI8feoI9cTvl86xFQhB9hJa3YgNYzhsLLBwNfVJQeP7a2rrR0hNeHexEjA9AezXodwaCuw2DqLCYKIavn6lE/C/aPfK4UL5N2EpUKsSqkQjt6BLsAIaTYyzsljeBO4D2TRosEsW2axCw1sl7x57OVKZV63hqy+uOd7mLKMW7UXk5LxZsKLZhFw6CrT7DNctUjCEj0foR8QWdB6G/c8e8ahxV+HdDlhqyk66ggh1JNQj15vk3ZE+g8uNd+oX2ATDEHlwZBHrvttefuKjrX1+Z4RzGzjBtdaqrAD7N6NSUWWW76MsjUSaf2Ff6rb1i1kUoB/4zqUcUGULUuaietH1tNdycZ9o/qZ7oZnrVYpF8F54bkICbMGgLA7C05Iqhk/i+teQkItLvyJ/NtP12f+80FBwR/1WqLNpOlgNy5IF/zlw4HXbCkCsy2tBoVfyclAGcr/CgKg9V0bxWjbQd/j7EAe9+ENedO+916VTVPEQQyjzxOD1IZHWv6A7G/0tL36DEandCyO3xYd5/USe0O0tvmaiOdY+QoMKzkO1d3+8oSGmSkiCR/nvXhFk++hVS6IherC8bjFGuT4uNVhiCYLc93DSHR1a6aEgq1kSys+Ch0zV0rr/Ho7zKmB6ZYiZa6APUXiAlZZk58oM9WTYnjWnDlCOyZZoszyKKmmfeRlTjxGq3R+3hbv0rvxSUO5N8OLkDi5GJ7RqEcdKzZquSDndxj4neUm498iHDgoA3/6YU21nCApTJogi7kaImo66KQM2p+vboIG4c7Qx6Owbyw4ZORli1BQ0HPpChPrW2N4OZcgEMDJ+4vbiAM6PQ7m/cZeIMREmTShHjL901tLVanTg3mk0gtdus3SLHxR3VM43qoyqEr4cvouV8Lp9cMXi8sB2b4K5i1IxDC6DH2/wx++W1qQSBgYLUMItx4tK1rUP+TTpk1+UXrsKqnQXORwHGMX1sRDFFkrwbRBPFErew9BDvGBLENlYT87GgOV8S5kRFkfLwSTrPQpXINZHATmX+9P0DMgSYNDUIvY2SR3wdga5gIIGatonAa0NsBpMzyff9v5ycUh2NWXlWWkfhph20xYLnO2aWf38Fyj9S7iO7vqZLg6fRjQbqyuiPLcZk0VridK/8OlTFliodhpPDEiwWLac= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3ad0f91-1c69-40d3-7428-08dca782528d X-MS-Exchange-CrossTenant-AuthSource: TYCPR01MB10914.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2024 23:35:35.3078 (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: GoHuZUP9No90Kyz1bQAxVk6VQItOxzqI5rp8ifzkQSJlN/sudQJwifkx7X3GqMaFZ60M4rJUzJ3Kpm/CfRJs9+ARTHRcArzujzH/xiWSLxJdgWKj9SbI9f1DA8zSfisI X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYYPR01MB12448 Message-ID-Hash: VDELMW4JRD7YYOMHGI2K56C6SFWBJWR2 X-Message-ID-Hash: VDELMW4JRD7YYOMHGI2K56C6SFWBJWR2 X-MailFrom: kuninori.morimoto.gx@renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We can use snd_[sub]stream_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 | 4 ++-- sound/soc/tegra/tegra30_i2s.c | 6 +++--- sound/soc/tegra/tegra_pcm.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/sound/soc/tegra/tegra20_ac97.c b/sound/soc/tegra/tegra20_ac97.c index 8011afe93c96e..c688d86966228 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_substream_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_substream_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..55bbddcf46516 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_substream_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_substream_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..0e6a2e1cbc2f3 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_substream_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 fe4fde844d861..886528d81e985 100644 --- a/sound/soc/tegra/tegra210_i2s.c +++ b/sound/soc/tegra/tegra210_i2s.c @@ -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_substream_is_playback(substream)) path = I2S_RX_PATH; else path = I2S_TX_PATH; - if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { + if (snd_substream_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..6b1e1468ec806 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_substream_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_substream_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_substream_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 4bdbcd2635ef5..996c0c6797516 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_substream_is_playback(substream)) { slave_config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; slave_config.dst_addr = dmap->addr; slave_config.dst_maxburst = 8;