From patchwork Tue Nov 24 07:03:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 7687871 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0E0309F1D3 for ; Tue, 24 Nov 2015 07:06:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AC05205F3 for ; Tue, 24 Nov 2015 07:06:04 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 99D6C2056D for ; Tue, 24 Nov 2015 07:06:02 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 489BE265B58; Tue, 24 Nov 2015 08:05:56 +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, NO_DNS_FOR_FROM, 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 93779265AB0; Tue, 24 Nov 2015 08:04:23 +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 0BD3D265B5F; Tue, 24 Nov 2015 08:04:22 +0100 (CET) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0106.outbound.protection.outlook.com [207.46.100.106]) by alsa0.perex.cz (Postfix) with ESMTP id 4FB63265A1A for ; Tue, 24 Nov 2015 08:03:38 +0100 (CET) Received: from BN3PR0301CA0053.namprd03.prod.outlook.com (10.160.152.149) by BLUPR03MB551.namprd03.prod.outlook.com (10.141.77.14) with Microsoft SMTP Server (TLS) id 15.1.331.20; Tue, 24 Nov 2015 07:03:28 +0000 Received: from BL2FFO11FD020.protection.gbl (2a01:111:f400:7c09::111) by BN3PR0301CA0053.outlook.office365.com (2a01:111:e400:401e::21) with Microsoft SMTP Server (TLS) id 15.1.331.20 via Frontend Transport; Tue, 24 Nov 2015 07:03:28 +0000 Authentication-Results: spf=permerror (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; 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 az84smr01.freescale.net (192.88.158.2) by BL2FFO11FD020.mail.protection.outlook.com (10.173.161.38) with Microsoft SMTP Server (TLS) id 15.1.331.11 via Frontend Transport; Tue, 24 Nov 2015 07:03:27 +0000 Received: from audiosh1.ap.freescale.net (audiosh1.ap.freescale.net [10.192.241.212]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id tAO73G44029188; Tue, 24 Nov 2015 00:03:22 -0700 From: Shengjiu Wang To: , , , , , , , , , , , , Date: Tue, 24 Nov 2015 15:03:28 +0800 Message-ID: <37808c01df126622c41c2d413fddf838dc2aa71d.1448348336.git.shengjiu.wang@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD020; 1:nWEQ9QQQ5XvwhXSw9rrga4IWPYwaK4kIY3SU+Y3Xhg4zGu3mkp45VJ+patF5ZAtRCMkfXbayhqWRwY94rJ4v46ES1V7HBjOQKDFlS8WuXXuPzJ0JoD3sBN21BT2uO6Uk2bg7/K1evyJsQTqIvFj8l5dXlvXkbAzpkx4/Y/5zhWfTZzBxQqdB4eq7xpDSlHCTkK0jSriIECeCePRBIREnsDZBT06s9pMeBF7v6hzFEMu7lp8/YGZ/ui2bmOnwy+/3s3CL4s2Kyotan/whqJ+E5Lza87U42RTkE89NkjI+P5Nr+HVcrFJr6sMZCyo2pP9qR6d+Reo11X3IjuYfqXtNaGIZszjPp2KY7+Qu5fXO9RBniAQ0cfe+Wo6HhhphFLcblU+ReOm7UMLcldTP3okVTg== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(92566002)(85326001)(50986999)(76176999)(81156007)(5007970100001)(104016004)(5001770100001)(6806005)(106466001)(97736004)(33646002)(36756003)(118296001)(19580405001)(2201001)(50466002)(47776003)(19580395003)(77096005)(86362001)(48376002)(87936001)(189998001)(2950100001)(5001960100002)(5003940100001)(586003)(5008740100001)(11100500001)(229853001)(69596002)(50226001)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR03MB551; H:az84smr01.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB551; 2:N6QQmQA3t3C9XnDFrOW5qkOLoXzBnCuz5EL0rK+X/5U1JAomgq/wYsTkaApV5uj9vSwgmHe34A8APlkGjrNtBHOM5CRU2ZaNTCtOICaIM+x6qa/UxyfyS/U9XOFh/aj7FRMiOaMsqW/PlqWAUB1NjQ==; 3:l6QOjrT6LL+82qUbLPlFzCyaHrXcaCQjUw7EN4I5hVro52xA+grUi+TcNa7zN0r2323DUmgC8Xe0f/0yg3/evasAkwM1vI6kZQfEh749SqPoQM0nECwULVRDP4f49hXe3s5Z/PJrUnTCSrul01u1SVtr8vJbhEASxhaa/z8CO55dskHtI1CZJozgBlztAdCCyM+i0wAWOFQqtPrIXd07rqInXmUsd2a+18b2SK3JX9o=; 25:t/4ts0p39odGVedaMmccnU7fQ6TJQRYN1xM5KhKEk3eN0a1+qVmVKpeVR4ymkO01FAT+/aoQ3RID1SbUwfySv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8bFTeSbTFl4UgQqFhdOQJB0N7odLVLV/Ow+ 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:BLUPR03MB551; BCL:0; PCL:0; RULEID:; SRVR:BLUPR03MB551; X-Forefront-PRVS: 0770F75EA9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR03MB551; 23:iA/uueAG1vxtT29cycu9vsvmIcQT0zIc4xVbfMvObq?= =?us-ascii?Q?PQSEdr3mM98ORIphegnfQntIQGig44WBidGj6AVe22Uzq3opH0GweZVLLOow?= =?us-ascii?Q?Bq3ChYb+hOMJZTMvO1mtWZHA38Y9HR27QaUL9gria+DdzJGtXwlnc3DI41dJ?= =?us-ascii?Q?l2repGtlfM7q8vqOyJYdlq6+dAPwXyq+OIrLjm8eWZWgQgFvE5Fwp13N4td8?= =?us-ascii?Q?P4NIdR4XYkV4m1KzbohXLkyY0y2BFtWrBRI7K0Lhjdpwe+k5OlAPEtapv9QP?= =?us-ascii?Q?bIm/tqPk81j6XXVwrguUp2iZ6QNLSHIR1Sw0nVsTshNK1W8uYxHDD+nxqBBU?= =?us-ascii?Q?VWh6W5TLddtrZ+Lb66ukz0+JR7YP3ftNOxuHGd7dXw2/8IkwcTPePORmSE4Q?= =?us-ascii?Q?J2wgCuGrOXIq1JrE4J6VEv3XAO/F/Tz8PNHU1MIM648QQV40jbZQWCT/Ns77?= =?us-ascii?Q?v53mOuQ1SMrGHUiDvGxMqMAoqBvzf87oFJf008cuypwcmlBbOB6mX1+mn8JH?= =?us-ascii?Q?EN6GxHkftAifNqO2vb+CafnpqJ5zj0/+sdHW4yJaHHyzYJaUiQ0OE0xbpOzv?= =?us-ascii?Q?6grVgrQFLi9iKezsRY6b9Fj9ReHAK6cXHckR+D4HLcWUm+RMrEQHujrlv7jW?= =?us-ascii?Q?ElEk9ZjO9Rrqc3qDCE/a0wG+zLQTnzNGDLSSZXe+i0eQTaej/Dis9z40NDfr?= =?us-ascii?Q?3uZNs7OxoPDHo8Mi1g5qFc4vKp9xlcfguBUrY/ys5QGvftcQTLQ+vcUEyv25?= =?us-ascii?Q?2FzDb3xxuTK2YSb9H8NZKDUxfG0Ti45dawTF5x5p2zrNXFxirLGZIPr6k2+y?= =?us-ascii?Q?Cza5XT/75NwUbUHw4fwcUay7jCu/ERZ8Eu+1EFhM/9oz05x9myVbfZojJFYx?= =?us-ascii?Q?Y2EkZ2mUbxyGEZBfRwTzBxguXnimw5K09JnyxcFDjvdGOdH7biNrcytFIw6Y?= =?us-ascii?Q?f7YNe66imdsBh+mg2hnWb2OpL2XvwrZd0FYquuFD345+U7poDo7hrudaf/x2?= =?us-ascii?Q?y51wzCDn9f7lS+TmGGimOphBc6G6L800YcOwf0T2n5p8SMehVwPtMzmOLTYR?= =?us-ascii?Q?V1Fy8Oqw0oAVn8PoHIKlzr2aTB?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR03MB551; 5:ZerJmwqmdjARbhI/d2e91Xy13HmWhpGZZQvaef9idhMAlZtGTewyQhsbJ9uZQPNfku4m62itu3kzDbX73sanCNmjr/5toQx9v96MlqPaKXhGNrwJjEb2KMuVuXV8d9pKuz0W0xCPFO/grhHKDXkKhg==; 24:KsFCZeEFd3s1dgOiwJZODDXloWx9yU8zodjrbFU15Jv3vcBZCopPfUraGyoqydSLPdEBP8p/qXfbov50ikRupfWbQvL8mBz7xK5AvrKWEHk= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2015 07:03:27.8275 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB551 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH V3 1/3] ASoC: fsl_esai: spba clock is needed by esai device 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 ESAI need to enable the spba clock, when sdma is using share peripheral script. In this case, there is two spba master port is used, if don't enable the clock, the spba bus will have arbitration issue, which may cause read/write wrong data from/to ESAI registers. Signed-off-by: Shengjiu Wang Acked-by: Rob Herring --- Documentation/devicetree/bindings/sound/fsl,esai.txt | 5 +++++ sound/soc/fsl/fsl_esai.c | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/fsl,esai.txt b/Documentation/devicetree/bindings/sound/fsl,esai.txt index d3b6b5f..cd3ee5d 100644 --- a/Documentation/devicetree/bindings/sound/fsl,esai.txt +++ b/Documentation/devicetree/bindings/sound/fsl,esai.txt @@ -27,6 +27,11 @@ Required properties: derive HCK, SCK and FS. "fsys" The system clock derived from ahb clock used to derive HCK, SCK and FS. + "spba" The spba clock is required when ESAI is placed as a + bus slave of the Shared Peripheral Bus and when two + or more bus masters (CPU, DMA or DSP) try to access + it. This property is optional depending on the SoC + design. - fsl,fifo-depth : The number of elements in the transmit and receive FIFOs. This number is the maximum allowed value for diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index 504e731..4d7589c 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -35,6 +35,7 @@ * @coreclk: clock source to access register * @extalclk: esai clock source to derive HCK, SCK and FS * @fsysclk: system clock source to derive HCK, SCK and FS + * @spbaclk: SPBA clock (optional, depending on SoC design) * @fifo_depth: depth of tx/rx FIFO * @slot_width: width of each DAI slot * @slots: number of slots @@ -54,6 +55,7 @@ struct fsl_esai { struct clk *coreclk; struct clk *extalclk; struct clk *fsysclk; + struct clk *spbaclk; u32 fifo_depth; u32 slot_width; u32 slots; @@ -469,6 +471,9 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream, ret = clk_prepare_enable(esai_priv->coreclk); if (ret) return ret; + ret = clk_prepare_enable(esai_priv->spbaclk); + if (ret) + goto err_spbaclk; if (!IS_ERR(esai_priv->extalclk)) { ret = clk_prepare_enable(esai_priv->extalclk); if (ret) @@ -499,6 +504,8 @@ err_fsysclk: if (!IS_ERR(esai_priv->extalclk)) clk_disable_unprepare(esai_priv->extalclk); err_extalck: + clk_disable_unprepare(esai_priv->spbaclk); +err_spbaclk: clk_disable_unprepare(esai_priv->coreclk); return ret; @@ -564,6 +571,7 @@ static void fsl_esai_shutdown(struct snd_pcm_substream *substream, clk_disable_unprepare(esai_priv->fsysclk); if (!IS_ERR(esai_priv->extalclk)) clk_disable_unprepare(esai_priv->extalclk); + clk_disable_unprepare(esai_priv->spbaclk); clk_disable_unprepare(esai_priv->coreclk); } @@ -819,6 +827,11 @@ static int fsl_esai_probe(struct platform_device *pdev) dev_warn(&pdev->dev, "failed to get fsys clock: %ld\n", PTR_ERR(esai_priv->fsysclk)); + esai_priv->spbaclk = devm_clk_get(&pdev->dev, "spba"); + if (IS_ERR(esai_priv->spbaclk)) + dev_warn(&pdev->dev, "failed to get spba clock: %ld\n", + PTR_ERR(esai_priv->spbaclk)); + irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(&pdev->dev, "no irq for node %s\n", pdev->name);