Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759030AbbKTGuz (ORCPT ); Fri, 20 Nov 2015 01:50:55 -0500 Received: from mail-bn1on0113.outbound.protection.outlook.com ([157.56.110.113]:20222 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753981AbbKTGux (ORCPT ); Fri, 20 Nov 2015 01:50:53 -0500 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; From: Shengjiu Wang To: , , , , , , , , , , , , CC: , , , Subject: [PATCH V2 3/3] ASoC: fsl_asrc: spba clock is needed by asrc device 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 Content-Type: text/plain 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+XlyJhG3TCXbrNr5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+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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3412 Lines: 87 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; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/