From patchwork Tue Nov 24 07:32:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zidan Wang X-Patchwork-Id: 7687961 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E9FF3BF90C for ; Tue, 24 Nov 2015 07:30:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 11CEE20763 for ; Tue, 24 Nov 2015 07:30:52 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id CD3D620603 for ; Tue, 24 Nov 2015 07:30:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id D9B4E265AA0; Tue, 24 Nov 2015 08:30:49 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 83C74265B52; Tue, 24 Nov 2015 08:30:26 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 0B133265B52; Tue, 24 Nov 2015 08:30:25 +0100 (CET) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0117.outbound.protection.outlook.com [207.46.100.117]) by alsa0.perex.cz (Postfix) with ESMTP id 42D6A265ABD for ; Tue, 24 Nov 2015 08:29:58 +0100 (CET) Received: from BY2PR03CA003.namprd03.prod.outlook.com (10.255.93.20) by CY1PR0301MB1257.namprd03.prod.outlook.com (10.161.212.155) with Microsoft SMTP Server (TLS) id 15.1.331.20; Tue, 24 Nov 2015 07:29:55 +0000 Received: from BN1AFFO11FD021.protection.gbl (10.255.93.4) by BY2PR03CA003.outlook.office365.com (10.255.93.20) with Microsoft SMTP Server (TLS) id 15.1.331.20 via Frontend Transport; Tue, 24 Nov 2015 07:29:55 +0000 Authentication-Results: spf=permerror (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; Received-SPF: PermError (protection.outlook.com: domain of freescale.com used an invalid SPF mechanism) Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD021.mail.protection.outlook.com (10.58.52.81) with Microsoft SMTP Server (TLS) id 15.1.331.11 via Frontend Transport; Tue, 24 Nov 2015 07:29:55 +0000 Received: from b50113.ap.freescale.net (b50113.ap.freescale.net [10.192.241.29]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id tAO7TpZF018329; Tue, 24 Nov 2015 00:29:52 -0700 From: Zidan Wang To: Date: Tue, 24 Nov 2015 15:32:09 +0800 Message-ID: <61c4bd3dd82c40b59d1d2570a400321027ae6abc.1448350220.git.zidan.wang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD021; 1:8SS/HVGhqGoouxHn8Tc0RZ/uNpGt7kbKFbJ1dqeklaQ6drG6BpGr2ehC9JZbNUfT5oqy527W243LfuSOKpmc09pwmexwKw+//vy2hu/javMoqEb8kDVahO5ccPl3Exdi093ijph1uktlFRUkZHUrjlL6tX6TSudzAf5JC2R2En0uWfWV6jlRJOHZHMCeYYDWz8+RkM7EQJDYSEwaD6kOXr4NgRI2UevsjYRQ0F32N4vJEsXMhuvrPbuiro0W2zONZha2rSSPZpvuig5Ay07Zqaa+TGa+DGLE/9vP7Ie25qkvNIKiRqc2Nvr+AilMOGkW5Yv6n4a1LkgxPaaqJkQbbSTXeXwUvYORXAhzxpLI2mNt1qn38oDywrjHtdCRN6PXyD6SoozYglr2n8WNIg6Pg0dTMF8RhZaVp1l/10bhJtw= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(77096005)(97736004)(92566002)(19580405001)(50226001)(33646002)(106466001)(586003)(85326001)(229853001)(118296001)(2950100001)(189998001)(81156007)(87936001)(5007970100001)(2351001)(19580395003)(47776003)(5003940100001)(6806005)(5001920100001)(50986999)(5001960100002)(86362001)(4001430100002)(11100500001)(48376002)(36756003)(107886002)(110136002)(5008740100001)(76176999)(50466002)(104016004); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1257; H:tx30smr01.am.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1257; 2:JhZybSC1AWDNB3SYHhVJFWozJgnluHiA1s5RrLcO0YpajkzKdKutuONUj4yNrOCxjcjzkZ6Xfy6GF4aCkUPvT2ch4nF5qjpcIjq+0t3O+U0R44zjXNe8j6ePlCVIQIPzLrwmj3noo4gC+gei6od8Yw==; 3:9BHCn6G54DC+0RFWX3gs89irZewzq2myoR5zLJECccDAV3SMFn4k6M57U0jsFrd+d/heiWPJc0cQlW3PvyLecP2gAKwoFGS+9Qfui3PCtkMjgvYLX8LEdxl75nwqaxNxzM5klvVbyUBDOHorNppsMqv5zHXaIL+Oh7VtayQD0x3tcDsUAUOc42I/IRMCpzlzYZe1Nn2GLaQ3rW3LJyIMZm5JWs0qRm5ZsXNNK2AC6lQ=; 25:LDUM5bFQO7/Qbla5dvBmgyQCMOqVdBgt7mbDmx22HOldueH+hRe4z2Z3VHhrZf+ozEQjCeBbb3jUGg4BSgMbJweRJnoCpM/Ttjs4R1GsS+v3Rycx+lDeoofiRj/vMVgEcunk8zXJxOEehvCXolA023NsGX/EiCm5ELvcsvTU2hJtWZzVLW1tpwkOYkvzyY8z2Njtava9ZdPCQGGhhjgUzYMewCXHqOs209XnI40mA+kuADuY8uWzUjl+3sNul8ixty/4mEvMqo0NNxZ/mmYlcw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1257; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1257; 20:X03XJ7bu4qj6Ul/FbJWBYJg24ZrjZNqQ8FkM2+u2XnjxaU8QvHRNikdyhgHOs8zFJ2hti++mh3441HDEzzfo1XOXzMxN94cSufzu+A2fpR5w8aIsbSkuKD31fCZ6CU8jbkaNDUobqJUlP2UgWyW8gBA/BCioqD537JknicZvKzdPfdPfgjQwbjVhFdYE+Yo1mgmVnZUf7lSW3LRAKXnq+2UShqcMzhW2g940LG861p4mafv3GohoFcl+Fznu3o47III42U3E579YpWt9xjTg687JN6a+mLMHqNRM1wysQgjbU0geUsux8d1lEThHfXBaZiU5b4c9M33QRAr5sl8tYuqXQTzbemE4heB8sRru3I0=; 4:evQhDZos7tcvU5yjXFM7Ihh3rAMb9o0uBg260KsWKpqHokuolN9J62FNIlWQsq/73rOKVOZfHTB3kcAGqVOh69xzTjAJCGYJOPYGW608d1+pW164DtonbuC5aMf3l3XkbG0xAz7Nr77qv9rd7zO1e3bgk9uOI9rAUWZ7MvBgbxdxfn1YRwPQVlM3LTLYoAdz0Zrlqkn/XZLZtxmEsXsq8X044Vzs5ERUxqfVtYcaclFQYkDzMcLr53H0pyEPtjxMelfc5L2GensRBIYo6OXPtWVpuM8JuFDESiB230+VH6UG5IPXkTnVS9gIZuQo4MIxLMsbLVkXXYjbVXfoYgCsnZlEDx3sVYyndWMMiIrPGToIJ8ard6VtqJqv9prGwKf4QRpG1QdYxrmzW3lxax6mzUY53xOL9egEKcldyUMDzynbH6HSY0f/+ZR64VAhUH+v X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046); SRVR:CY1PR0301MB1257; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1257; X-Forefront-PRVS: 0770F75EA9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1257; 23:lS4/pBp0+R9wqn++Q/2l8y9RUjhXwY9bcUDV9Wk?= =?us-ascii?Q?duZEGFg0/Y6zL4PscuxMRm+81to4PlcyF6kyT2Fm1esp4UzefAXAYQxwqOvP?= =?us-ascii?Q?5oDxtk5xTfKKfQTiofbP0PbHAzlfPRi5Ug2+ORvdf939oMnu25sEuWrNU/h1?= =?us-ascii?Q?pEhA4B24Bl93PX6cqlAwmwTpHd58RvHYUMf5+pamOwM7hNZDdu08u+5AKtDg?= =?us-ascii?Q?MtUEDa85hkgiwdrRVLw0m0HuqWEzlTyITbIxna821nExNsS+mIYyjC0b279N?= =?us-ascii?Q?AgPH0Zd7odAgMVO6GYB8vGRLJaJEe/rhwSYq9W8FEams1MOm2q3iNfHH9hNH?= =?us-ascii?Q?MAxvZvHJF9AlDLGsS2WL0NMgCjczanBgSSi9ifTRkWbfED1knF7OoHOrkJrl?= =?us-ascii?Q?u7JxNBMtQyeFSlFUFAlLX6dru4HChNPGJae2xVdNtHt6NzEiW7ElWglDGP3R?= =?us-ascii?Q?lysvP4lddpOgw4NHngaZ7Xs7MPxPK7/UJeK2FVIPMbD9Zbgw1zXHWJKhzQ5V?= =?us-ascii?Q?wTWpbEJzMbdvYFV5w+gp//SutIf63H39AbkzZWRD3MEkdUAa9/dQ95+2i0vU?= =?us-ascii?Q?OY9XFS4NkMeYa/DWmbBNd84Xq47JcKKZuqi6/4GxTgBBK80AC/Oo2fYYlKax?= =?us-ascii?Q?87kfadU1Nnj8mMW5WGC6QAQyk60xTMzFYopw8s082PAgdIEvecDq1VImH3aV?= =?us-ascii?Q?M3ZfQfjA65qj3e7U73Z94nldgGwDwrGs1gMRE7KWUlK7571GAAHbYhAj58RM?= =?us-ascii?Q?lBwK0r7WHbxrqcyzIFNeOJOZI65kW56mdgnGRsIEWC0Ddg5U1uVWKU9nf6TA?= =?us-ascii?Q?OhK+Nh9FtaZuTGaS6t6uXI25mpNsgVPaiACdpWLHAIfP+KoJNtziZjhjbf/A?= =?us-ascii?Q?wxXBZJw+ZSOQJ2S5fAPzjEPVKTM5pdhbopQo0IWUVsYdydCxN4A5yy4TlFqg?= =?us-ascii?Q?bLI9aznpz+P8PM+fz2AMBJE343htLsZnyB3Vckf03Kt6nHPklxlCbZUVXsIm?= =?us-ascii?Q?ta92j51ujG/GPGStpmHOXMkhPJ+O7O8FcZkSvcffMOgI+0m+CV9qAmk0b3HU?= =?us-ascii?Q?1MuNSvCeUxoTV42me4G2AVUZRB2Q16lsgiZSZ+9OFuBkFR3LrFA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1257; 5:/G4YAkRcUBXcSvHFVhE3pt4XRvG2jshBZMfMwITjFkqX2eWJeiIzwrGvhaxTA803qic/JocVf9YEZJC4zG7hD8LD+gQ0B64kG28mFyNGSPRW99BBgB1CJsdV15xSQ71H; 24:NtFnQ/kXpzB4FaoRAOOWll2VVftcSSZBylPBZauUjgcm8VK51WIGFI6eFjsBaRi2h9v961i/5ZNDuJr6AqZxeVXhV7DwCuRNs+vQJ9JaeXc= X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2015 07:29:55.1812 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1257 Cc: alsa-devel@alsa-project.org, broonie@kernel.org, timur@tabi.org, Zidan Wang , Xiubo.Lee@gmail.com Subject: [alsa-devel] [PATCH 2/2] ASoC: fsl: using params_width function to simplify code X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP using params_width function to simplify code. Signed-off-by: Zidan Wang Acked-by: Nicolin Chen --- sound/soc/fsl/fsl_asrc.c | 2 +- sound/soc/fsl/fsl_esai.c | 2 +- sound/soc/fsl/fsl_sai.c | 2 +- sound/soc/fsl/fsl_ssi.c | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 9f087d4..6d06366 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -447,7 +447,7 @@ static int fsl_asrc_dai_hw_params(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct fsl_asrc *asrc_priv = snd_soc_dai_get_drvdata(dai); - int width = snd_pcm_format_width(params_format(params)); + int width = params_width(params); struct snd_pcm_runtime *runtime = substream->runtime; struct fsl_asrc_pair *pair = runtime->private_data; unsigned int channels = params_channels(params); diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index 504e731..45d4319 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -510,7 +510,7 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream, { struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai); bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; - u32 width = snd_pcm_format_width(params_format(params)); + u32 width = params_width(params); u32 channels = params_channels(params); u32 pins = DIV_ROUND_UP(channels, esai_priv->slots); u32 slot_width = width; diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index c01322c..8832901 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c @@ -404,7 +404,7 @@ static int fsl_sai_hw_params(struct snd_pcm_substream *substream, struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; unsigned int channels = params_channels(params); - u32 word_width = snd_pcm_format_width(params_format(params)); + u32 word_width = params_width(params); u32 val_cr4 = 0, val_cr5 = 0; u32 slots = (channels == 1) ? 2 : channels; u32 slot_width = word_width; diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 674abf7..e3abad5 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -767,8 +767,7 @@ static int fsl_ssi_hw_params(struct snd_pcm_substream *substream, struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(cpu_dai); struct regmap *regs = ssi_private->regs; unsigned int channels = params_channels(hw_params); - unsigned int sample_size = - snd_pcm_format_width(params_format(hw_params)); + unsigned int sample_size = params_width(hw_params); u32 wl = CCSR_SSI_SxCCR_WL(sample_size); int ret; u32 scr_val;