Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752881AbbKXHDq (ORCPT ); Tue, 24 Nov 2015 02:03:46 -0500 Received: from mail-bn1on0113.outbound.protection.outlook.com ([157.56.110.113]:8087 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752773AbbKXHDk (ORCPT ); Tue, 24 Nov 2015 02:03:40 -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 V3 3/3] ASoC: fsl_asrc: spba clock is needed by asrc device Date: Tue, 24 Nov 2015 15:03:30 +0800 Message-ID: <40629d5e0c3509afe27877874d225d5cd3cde261.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;BL2FFO11FD046;1:SnEaLcSIIT8ODgZJGEWnHbUUmp8Re1sdM3aMyHjxnscRc6/0NsQ7coSPWrvUt3j0eYW9GooaYXukJSpuHjX3loalCipen7aCQId0iVFqeam1Qtzj3/Z9o4uvAnAN5OVMm22KELf3gC4XaCh4mv2TpjiVFuSicg37EEpsS8OOZh7/D67qqJFsB6pCVrZE3hqtJq0EEzkRBOpSSn+rzMvem5xzH25XYUzKmaROvWURP5zmtx8pzs53z4UOviYmAZF4skElIEceFROiH/Se46iYvYL/reCwxCJ98bdJXWkkuS7Ft2k79AUmwTPkkJ5i4Q1+MfJNZ7tLmDatPK+w4bjz79NK53PHU5ug9M5nhl+WbhpgsgC1egDIePbbtJMvBGE4Wpp57g6Q4OPoYZBSX/c3/Q== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(19580395003)(50986999)(19580405001)(5001920100001)(5001960100002)(2201001)(50226001)(92566002)(106466001)(118296001)(189998001)(86362001)(229853001)(87936001)(85326001)(11100500001)(6806005)(69596002)(5003940100001)(5007970100001)(33646002)(76176999)(48376002)(5008740100001)(97736004)(104016004)(77096005)(586003)(2950100001)(36756003)(47776003)(81156007)(5001770100001)(50466002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB1225;H:az84smr01.freescale.net;FPR:;SPF:PermError;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1225;2:iy1D8sU2yda4aDNaYuuVuaX1dYjLR4z4J/egc065XlzmCUGWPgYDhKKY3uRvXf1wU15XGslR6aqHNx4ujqhqNBQI6XalxuEMZSXKrASrSR40+YAuoH0Gcq85dur/K4dxozzyyKYgSqKzInzxUedpww==;3:UVrtNK0jU2unrk9Io3tTeKFqw8UQqs7GH5RKvRQ5J8tByBivfTDAgHo2vmJN8bpHixOA+kf8rOGLbbtdY1kD6I0HlGF0+vqfy8WRHXQAT4YdbaS+mkLyHS2Aed+koMUOSRDLyQtj1meQ3ke8yUhHY9LjS3XhZDEVDkiRFWoVLCs8d5aeh7KeQN+tk5gpfPcal1sg+tTfQnTTwY8hNxWpi7nVeuzlhgllPlRNc/EJkDQ=;25:GwPQXd32bL7JiJJQMfLOLe/WcUp3hz8c0nV+sKGujQ9PJfrAsvL1x1NUie5TvqlI/Da2f9SOJ1PpihJl01RhL8OVovVwK7Zw3bcfh2NC6ZZuwwcJbSB5ke1xO4jzwdSsBfc5p6enLGLDhIBqlvlDQU67foYbZHKuaXJBQdCL0iGo8HTOjDJ3ex8dQdVQ/J/XLOTJUW40dV3XXcUF3aP60Q6lJV1unnO/5Qv3Xugi3Zz4RdPL3WcNgfMs1BhuisTt X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1225; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1225;20:JWRqIYV4+crTS19fyRYthIN1tcgA1Sk4wAjfupDA3ZY0BiUVeNzjHUER3ie0uC0v9v9/U+qnFXUhE1Ry/WtsL044FkFlqtHX4Vdj+U1v0NFzilbwXbCMOq6rm8kNNxX8p+OjeyDcWTHN+CzQ7Ufi0BT8U2Q5VQpUNeKUkD8wNLHXM3FM/Cy2kIz8T2rsRiC1BO1GiFP6YPq8K16/xVu3W9Lq0aHOcNCkEr+MJP3B7XqYUQhaGiZ7P4d0HPf2gy/+yvEhcOa980KXMKoZ+LiM0tyobeZA4WFvmW0/wojU0mjw08RM+klwtAeV06mc0UdQMe6SM0mvtLze3lLt1fUMWUwFRfWz1+YxBsIz0RZ7ytM=;4:VU6xnSyrSjbPV/i5vU1vLgwI8h7YT53tbnus0teanFgm+DQ0TVuPjHjMUX+0ynXHWjzVcVf1kSBxcs2fiJa5vxp/5PhNuCT4khsXyN+e6ckM24TseSXQUUicluJA3ImFzc7ux+i4DYN2R4sJqnxx7lw0+yLxPKGas+glkAenYwX4N7jyohe2+kmOhAM99SOZDOM3vykuedzinbHc1TPhsFaYfL12lq3sekjiCV1ePTGPe3GSCbXws4RFx8oJuIqlf+ARY/dfufqxutcUlpLra/VKF50c5wq/f7LELiJVMH1TEOQm32+mu1V4eSHQf5CCfLDZdmtdFTORaGGpqEmYQC+qFjssNFzp/JBHImE37b51SXQMEn6Z82UBUIkiStmQjj47+dVZHsgjF0Y8yoDnrx7bx+2ZLXLyzLpajHIY/LQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(520078)(5005006)(8121501046)(10201501046)(3002001);SRVR:CY1PR0301MB1225;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1225; X-Forefront-PRVS: 0770F75EA9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1PR0301MB1225;23:cJz/xEuwQqUmphqKXJVMk+193sQzakOs/VNLlGI?= =?us-ascii?Q?+/eE2rrMLsk2jBOseb50gp6HOe6vxvYbOnbBQYdpiqDuEMhq3OYGy5WqbC4X?= =?us-ascii?Q?BqokVm+2hbsOOTucAcgR+DniBhDUxAA76r39a71OYoLcUfCZqSDwWsOyHkCC?= =?us-ascii?Q?m1GVtkVWgUpYmElr1yVq6/Wgz6LPVhLkhcjC22cH6fJhY3GwgrdnNkZp7zZv?= =?us-ascii?Q?GcWyCuFYFgM0+xPLNfg533e0vHkjU4dmg7+wNO30J2F6CSs+QZtxiaW7M72O?= =?us-ascii?Q?2/nSr+jUujfPTU9HH4x6FlsLAbDlyRKXqFPQEXbJmUKmE4CG3o5u6mk+Sb2k?= =?us-ascii?Q?zqm0FhNohdt2U6bNTNx56JOAZpBeBS98Mjt6qFr67HRbTmLFszOKe7TQv0kv?= =?us-ascii?Q?GUIeDNex856Oap7b8BhcziPua1sORT4ID+gy1EraASnLol/U5oL/cV5v6+LT?= =?us-ascii?Q?sD+s/tnBNVpeEfQbvWIliAwBnbwduXPxrsXDSW7B1zjb1hi7zXP7TDZZMeFe?= =?us-ascii?Q?o5a1c9dO4iMJhSupM/Mal/Cyraabe0DO29+OlYcEgrK0qx7nkIoggcEAyL1H?= =?us-ascii?Q?lSFr48rtb3WYZE5uCKyzUCWKUuY0GMPOV2YomfTporEDZ0Icf+F76FJqk6Cs?= =?us-ascii?Q?MSzr7CPz+FUMMefTnbRe24jvhRI2PTeUpjNtDzWd97ANYzen+Og7P0fte/Rx?= =?us-ascii?Q?kB7+rb7NIJCl/3Z0K9cx6icmmT31SBOh3J7rzYJHUQF5KEs2skm777Zz8UOM?= =?us-ascii?Q?OX8pazaAlzaI8N1T7wktw7f950YSLx5ln02odD7b8gdE8n73VmIe9vV5+Df+?= =?us-ascii?Q?CG8NpTj4+4QwkQ1NvA9qMJkGc4HGLxKYZsAZ7ib70CZnBiLy8bCVhNsUCZwv?= =?us-ascii?Q?ukqxy6Q/dMC2tGGiuAcHQUE5VidzDu5gKuCsIvhExFhWceqIte4P2DrDdLyy?= =?us-ascii?Q?NBawqENsnfLhwp5bBg0Duh69DDpP+95AODhY3aC4UDGcsPsCcxD9ksWDibn2?= =?us-ascii?Q?aInfTKiBNNIUWgfRjkg3yYNagn3ukOC5NjGVi4IuYMcC91U6aYLpkbwHO00B?= =?us-ascii?Q?Y71ldljMimFMXaZGeisRjqN7Pdjw3KE8MKKrLnqLG/knLcUsTVg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1225;5:jbe/BhfpJH6xKusqXaGftBrF/uBdOD9n5HSmTE4k6HkVfmzzwYigJ0UZtvouhMiXRoQwzBKQN8DkN6+29k0LmV6bEmLJ3j0YJR33oyxFl4wqiyPsgcvgKZDBt5Tm6T6A58qQiD8ukK0QneIZdKlliQ==;24:vV/aRD6nPfZVXLCjto/vmKB9WzUa/oAv05iuw7OoIpTGY5MkMfbTBAaiDmlej8ujLeUEVceUd3hT7MBmul3YxSxSRAkBPvU69IbhuoV+Tw4= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2015 07:03:37.3783 (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: CY1PR0301MB1225 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3980 Lines: 98 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 | 5 +++++ sound/soc/fsl/fsl_asrc.c | 10 ++++++++++ sound/soc/fsl/fsl_asrc.h | 2 ++ 3 files changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/fsl,asrc.txt b/Documentation/devicetree/bindings/sound/fsl,asrc.txt index b93362a..3e26a94 100644 --- a/Documentation/devicetree/bindings/sound/fsl,asrc.txt +++ b/Documentation/devicetree/bindings/sound/fsl,asrc.txt @@ -25,6 +25,11 @@ 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 required when ASRC 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. - 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..68802cd 100644 --- a/sound/soc/fsl/fsl_asrc.h +++ b/sound/soc/fsl/fsl_asrc.h @@ -426,6 +426,7 @@ struct fsl_asrc_pair { * @paddr: physical address to the base address of registers * @mem_clk: clock source to access register * @ipg_clk: clock source to drive peripheral + * @spba_clk: SPBA clock (optional, depending on SoC design) * @asrck_clk: clock sources to driver ASRC internal logic * @lock: spin lock for resource protection * @pair: pair pointers @@ -442,6 +443,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/