From patchwork Fri Nov 20 06:17:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 7664611 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 66C9BBF90C for ; Fri, 20 Nov 2015 06:20:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8748020494 for ; Fri, 20 Nov 2015 06:20:42 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 16A5A2045B for ; Fri, 20 Nov 2015 06:20:41 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 481C32665D0; Fri, 20 Nov 2015 07:20:40 +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 E95C526664B; Fri, 20 Nov 2015 07:19:20 +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 0CAF126664D; Fri, 20 Nov 2015 07:19:20 +0100 (CET) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0138.outbound.protection.outlook.com [157.56.110.138]) by alsa0.perex.cz (Postfix) with ESMTP id E6816261583 for ; Fri, 20 Nov 2015 07:18:14 +0100 (CET) Received: from BLUPR03CA011.namprd03.prod.outlook.com (10.255.124.28) by DM2PR03MB560.namprd03.prod.outlook.com (10.141.83.19) with Microsoft SMTP Server (TLS) id 15.1.325.17; Fri, 20 Nov 2015 06:18:13 +0000 Received: from BN1AFFO11FD006.protection.gbl (10.255.124.4) by BLUPR03CA011.outlook.office365.com (10.255.124.28) with Microsoft SMTP Server (TLS) id 15.1.331.20 via Frontend Transport; Fri, 20 Nov 2015 06:18:12 +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 BN1AFFO11FD006.mail.protection.outlook.com (10.58.52.66) with Microsoft SMTP Server (TLS) id 15.1.331.11 via Frontend Transport; Fri, 20 Nov 2015 06:18:11 +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 tAK6HoR5006053; Thu, 19 Nov 2015 23:18:06 -0700 From: Shengjiu Wang To: , , , , , , , , , , , , Date: Fri, 20 Nov 2015 14:17:53 +0800 Message-ID: <7b40da78c965d4152c15794ec527c75198c9e2f9.1447997800.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; BN1AFFO11FD006; 1:lsxs9lBZ6F4Qwftf1DXmqUzl4DTljufHnwqCBD7nnsvzgJL7FpyDPo3sgnamLpXODOwVWYaqhl48MinRc1HsR7pG0QgGkOyYgojomqYkm1jxfGf+bQ1I6vphkcvt9eI6yE67opKmeVdArKmzDiDx7JCOFI8rt5PPbMO4ftLGQKXf/9te5UqFVpodlBcdJJEohIzjO2GNrEsEQU91q8D1B3EFQW1JnuirF1Y97ybN8iTN6lQ5AZDlTfH4dQ1UpiA6GIOgZ0NOEXi0jLxrp/0DXq2cgis6RrYcIdBdT+TpkWQ4JaXF19u7SLcrmFraoScBirE+E/Fg29CtYStThWGbmltDNTKZtRgDB5XyRHe3vbMpA9lc3hefp2nwbeCsq0uKPxO1kadOsHa41r5RGEy7bw== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(448002)(189002)(199003)(76176999)(86362001)(2950100001)(50986999)(104016004)(5008740100001)(50226001)(92566002)(77096005)(5007970100001)(50466002)(36756003)(48376002)(189998001)(229853001)(5003940100001)(106466001)(5001770100001)(19580405001)(6806005)(85326001)(33646002)(118296001)(87936001)(81156007)(47776003)(2201001)(19580395003)(97736004)(69596002)(5001920100001)(5001960100002)(586003)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR03MB560; H:az84smr01.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB560; 2:OENLN6faQrDjPAG1xicThpstPANei4o93Y4ghelnMK8s6IV57qE/E34/1Hg0g2RHV81bRjfo6jbMdQ+Nf1xlY8A4J3ev+BtTaFE/yFzNKKM4b1tLtvu5yBipuOyE61NzDMMrRTDC4+RH119xv/pV9ZtUy5BKqa9sT/L5tRvLV1Q=; 3:vg86UgQhH6juHdzd+rIhnIvpErFO6Crt8/ACQsiSFj3NmYVsLA4M1MrhIPQQtGN8fJcIFOpdE3OkXjLbqMpjHLGCrmdX4ijfd8g7YEsZ4n2aJXC9yd0J4rvxT+zs5QxRmOJG1BZ/42p87END+W6ZIJf8UhN2PdMNFjAXmw2wJQDnG3is2CJq8oikFw1pK8fDFb/87tJ+2VSrj0U9Ax1qr6uPVZzHvZDLjl+YJuNcaZQ=; 25:+osyTeGNC8q8e1oTFKYWJr/k82fuDL1nnuLrNvxCTka+RzD79ywYZ0LRQeeXbeSq3CNDaBpqBjvl2jluDlYCMaxnJ/hbsU8RYOW0VSEnL04xlS7l83ccQmSwOPWfpexOEIKnEm8P4sRU0unlJLx1woIeCLM8ug0Yk25E9fCli2+MI/7G/rOKLUE5iXH4q0/SUfmTweYJDmtloKir5inpZASfNUgl8I2jygMBY9H5H6PcKqL+xHU6pfIskntK4iBg X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB560; X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB560; 20:AWnFyHs4jFlNLr9c3ysDczAWY0lffeCQLZSe7wbcYyK17KbttsnMvF6CfNLw/y5+RigVz/mWaAaB/H/44zQgAg5skfaBj4gGMoHSu8wMetTmagdQdEEQKqtUobyGAF9+9vm0mCLnsyhTsXwuvf5iQz/WqwUcOh56jRnX0SagH7eHWGwn3Y/RJn1kF4NdVE8+RWjDL20hqwRlFgbabO0zCQER68omJqesvRUS5MWXlRhZLQQyh+UxFMxqndbcZZ81p6QNG9NLzSyay+EoeM238/UlC0towt2gQP2O0+xdFQgAx09CRGzYnFDY4SP2v+NbW3A7hZd2EcIwlCE8l3w7tOhZKGk2U1ma+apKhfeqyaw=; 4:Qj8/PmRvcEBwCXAbEw/wB8LEj6KnGuQKUh/jwgy682/sw1toObeAoNSvli0K6FnuzrLrDnd3qDWYJWMGAi3beiitrKE7RP214eFce8WzFewgTdNil+BH5qcYPkKhAmFbMSGsrx1KusccyvccLy8qbjkaneXpY2XhwMyDdE+E4vmjGwXTrD6pMntUToau82wEIXPYuCD+IqxUuEvGCJq3Q/4Pz21M/bh+dVFtQGiH1o9uJBnxMl2MIGP/sf7UxY8d905TCyz8F/sJBTw21N1Zeoq8ahkIUR2q1vAIiUF6SvHRB0nbLUwlrvwPOSz6A+pRMTF+3HvINDA83urLfoSpxNiYto3NX/6xpffIyt47IsE4qb4y8PlUG94YfUGTO/B7 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)(10201501046)(3002001); SRVR:DM2PR03MB560; BCL:0; PCL:0; RULEID:; SRVR:DM2PR03MB560; X-Forefront-PRVS: 07665BE9D1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR03MB560; 23:gEp3OjQZiEL9x+XlyJhG3TCXbrNr5UbdNqFFXwIOxb?= =?us-ascii?Q?zxe/wNfTTxByf+RPhWdNNU9DqyXGWeaFSorJ0QkeZ+BoPYUIeSkke5mgKYqv?= =?us-ascii?Q?l+lGcDA1hyBnsTJ44YGPjwPXq+Sm4ORqZvSmfj9MYjJkm46W5GlJGrw3lrqO?= =?us-ascii?Q?lbMEVpcTulMEoqxbnlsV/htbw2AfCsbyRt7QlirfAxtMC2oHqKe7YUMzWudh?= =?us-ascii?Q?2/sryxa542fVHaQJ11FV4hfQNgX+UdYcFh/s45q7O7Lhkxvuvq52FT21D2+z?= =?us-ascii?Q?WATzWKccATX8vFrqSwuLxImZvWrH6AFce7C03j1UHoh2xbVDI1X9C/fQ288d?= =?us-ascii?Q?LRif7Nb4LN+01UHm8ORSW3F7QsA2OMUNuo42B5jtvtS3K4VUfaQ2HvWsD22Y?= =?us-ascii?Q?xmVhvrye8J3ENiAyvoqX5JvMuTXu8YuTnXUAUpY21Yd4jeUEhOJ64L+7s1O/?= =?us-ascii?Q?VW9DUV7XrlgYPoLT7si/Np2F8i9KJp/k7RXr3o0MOJ/Y/tXptQ7p6Fl0iw6D?= =?us-ascii?Q?0yteM+RseS3s4yTF1sYSstrz1dA4ThILqtAGYoxnqhyQeo9raVXYQh1UV0RR?= =?us-ascii?Q?UcQfqu7i9k8+KyfHQzjQDpACapJsfGPa2vAHnNwKEvhRd/w4KO8kbOx+9fXU?= =?us-ascii?Q?zauPd4ENW/KKX4hNxGimqVhnh3FBms2dkx3gU/jRZqLTQ5/NlWlcxP73h5Pg?= =?us-ascii?Q?qACJFag2oAew/d5wRvhmFxPdBWYo2fzcxH8651BCzQsDRICjzq5FAGTSnIyJ?= =?us-ascii?Q?X+WlTGBlHAXx8Vxj9oJ1Ov400rwckKfFAUDZBXAY6HX4nqtCruN0VNtdmWvv?= =?us-ascii?Q?3dZTWJ3atDs+m356j6H+lYT89gN4iLuhoONzNrpsHPtJMoyem58k5IvaAIce?= =?us-ascii?Q?O0ubCDv6m7F7qFR+QHyYuAR4W3RDuMsQ38uvSq6UDBfLrLHAKS5tUAUW7NLa?= =?us-ascii?Q?n1yceJUgaZ6lXssw/0z7NWwHyviQbc9qEuoL/IZeRmvgJltM/tVRlIcJmiLZ?= =?us-ascii?Q?tMiLxULztva/0LHsYUdyQ6bj+nWlpM7/nFBg+JxxSmQ8OreA8g+A3tfXFx6P?= =?us-ascii?Q?R/SmYVYSiJ4Mq79xGnnWZazQ/9?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB560; 5:CPfJZ9VP0EiFpSw3Qg1k92gMUUE6URw5b5OYnY7pfvF9MmrxMoiJD7hJzSaZ+ooT2J6FCEDYN7Chzk7ENsUQH9FgkMAe8xSpJf4jl9V4iv7I3C4uobsIH7FqGx/4kt2LL4NgGfRkVCV+CBfVM2o1lA==; 24:yVRX87yNaFwlp5gSlbdLNRJIfPSqa/ymVbDie/mPLHrXYrXdCIA8CMFEfk6EcXte5oHV/jzX6/dGhifAowvJxnbwAYxJg7U90VXkgkbva+8=; 20:rto9twpcQdaYccNpddBpyQq2wwt7S/3KZzf3BGh8883XkFHC2+UFR2yGG0mG3GwXH+sCIRWuE41RlD32r9PIDg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2015 06:18:11.8747 (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: DM2PR03MB560 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH V2 3/3] ASoC: fsl_asrc: spba clock is needed by asrc 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 ASRC 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 ASRC registers Signed-off-by: Shengjiu Wang --- Documentation/devicetree/bindings/sound/fsl,asrc.txt | 2 ++ sound/soc/fsl/fsl_asrc.c | 10 ++++++++++ sound/soc/fsl/fsl_asrc.h | 1 + 3 files changed, 13 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/fsl,asrc.txt b/Documentation/devicetree/bindings/sound/fsl,asrc.txt index b93362a..d8eeee3 100644 --- a/Documentation/devicetree/bindings/sound/fsl,asrc.txt +++ b/Documentation/devicetree/bindings/sound/fsl,asrc.txt @@ -25,6 +25,8 @@ Required properties: "mem" Peripheral access clock to access registers. "ipg" Peripheral clock to driver module. "asrck_<0-f>" Clock sources for input and output clock. + "spba" The spba clock is needed when two spba master port + is used. - big-endian : If this property is absent, the little endian mode will be in use as default. Otherwise, the big endian diff --git a/sound/soc/fsl/fsl_asrc.c b/sound/soc/fsl/fsl_asrc.c index 9f087d4..800828e 100644 --- a/sound/soc/fsl/fsl_asrc.c +++ b/sound/soc/fsl/fsl_asrc.c @@ -859,6 +859,10 @@ static int fsl_asrc_probe(struct platform_device *pdev) return PTR_ERR(asrc_priv->ipg_clk); } + asrc_priv->spba_clk = devm_clk_get(&pdev->dev, "spba"); + if (IS_ERR(asrc_priv->spba_clk)) + dev_warn(&pdev->dev, "failed to get spba clock\n"); + for (i = 0; i < ASRC_CLK_MAX_NUM; i++) { sprintf(tmp, "asrck_%x", i); asrc_priv->asrck_clk[i] = devm_clk_get(&pdev->dev, tmp); @@ -939,6 +943,9 @@ static int fsl_asrc_runtime_resume(struct device *dev) ret = clk_prepare_enable(asrc_priv->ipg_clk); if (ret) goto disable_mem_clk; + ret = clk_prepare_enable(asrc_priv->spba_clk); + if (ret) + goto disable_ipg_clk; for (i = 0; i < ASRC_CLK_MAX_NUM; i++) { ret = clk_prepare_enable(asrc_priv->asrck_clk[i]); if (ret) @@ -950,6 +957,8 @@ static int fsl_asrc_runtime_resume(struct device *dev) disable_asrck_clk: for (i--; i >= 0; i--) clk_disable_unprepare(asrc_priv->asrck_clk[i]); + clk_disable_unprepare(asrc_priv->spba_clk); +disable_ipg_clk: clk_disable_unprepare(asrc_priv->ipg_clk); disable_mem_clk: clk_disable_unprepare(asrc_priv->mem_clk); @@ -963,6 +972,7 @@ static int fsl_asrc_runtime_suspend(struct device *dev) for (i = 0; i < ASRC_CLK_MAX_NUM; i++) clk_disable_unprepare(asrc_priv->asrck_clk[i]); + clk_disable_unprepare(asrc_priv->spba_clk); clk_disable_unprepare(asrc_priv->ipg_clk); clk_disable_unprepare(asrc_priv->mem_clk); diff --git a/sound/soc/fsl/fsl_asrc.h b/sound/soc/fsl/fsl_asrc.h index 4aed63c..889080e 100644 --- a/sound/soc/fsl/fsl_asrc.h +++ b/sound/soc/fsl/fsl_asrc.h @@ -442,6 +442,7 @@ struct fsl_asrc { unsigned long paddr; struct clk *mem_clk; struct clk *ipg_clk; + struct clk *spba_clk; struct clk *asrck_clk[ASRC_CLK_MAX_NUM]; spinlock_t lock;