Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753441AbbKXJTn (ORCPT ); Tue, 24 Nov 2015 04:19:43 -0500 Received: from mail-bn1on0144.outbound.protection.outlook.com ([157.56.110.144]:60608 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752571AbbKXJTg (ORCPT ); Tue, 24 Nov 2015 04:19:36 -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 V4 1/3] ASoC: fsl_esai: spba clock is needed by esai device Date: Tue, 24 Nov 2015 17:19:32 +0800 Message-ID: <1201ff5b1edf387138e3cb8c98f91804d9866c4d.1448356624.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;BN1AFFO11FD040;1:u98W05eWNmE51dmWtueuv+U+AmwGfLGIKBIFqzV/j3miTWEYlnTYGAU71ZrNz7b/UFmfrMUWvNHTejGt1UBGf2Bt+BVZBAxO6lnHSXTHc9EtIThdvz4j9sr5Y1ClDV8Fy7oYV6vA3LhYxDEELQvhC2NeJEzHWUj6iDxtY2Odf2qKRbAGFO9dSDklLfLBkfc1pcwWjhAtEfk6cN/pfai2wNDr86yRyE/TmofX35Hx8J8ey6e7UDrEBVAKYJd+rpcpmh9Ev9WAm4lphqEYbGv3fb0bofC4KDsnlRRh0eTF5vm5NY0kkdDh+QPXtrS50+6P/3j3zLub0ZyXWBgTtXiirZE57jpIYCMIm0Iu0MSQ1nS/xr5IT0jexQYbWWzG17cH/dqemVAggg60JwPQe8KnNw== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(448002)(199003)(189002)(50986999)(189998001)(97736004)(11100500001)(5008740100001)(2950100001)(50226001)(106466001)(118296001)(5001770100001)(50466002)(586003)(81156007)(229853001)(86362001)(48376002)(2201001)(19580405001)(5001960100002)(104016004)(92566002)(33646002)(19580395003)(47776003)(5003940100001)(36756003)(85326001)(76176999)(77096005)(6806005)(87936001)(5007970100001)(69596002)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:DM2PR03MB558;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;DM2PR03MB558;2:rlUopr+FlPnB3Go2B5SKeCxsNXeTaQAVw8oeQbKqal63LuJx48rLs5OBgKRnvJuh+cV382kiTedgRaizbH6qzzjoscTdy18UbvGfo0yqpMaOp5TdMQUgbqZkSCuGKrFLuFUeZc+peAFd/FMUYZ/P1kJLms2PwYA2/uVEaeQLLm4=;3:gTM0MouoA1qrCoIlqwDBc3487Rck/DAFrk9emQArqvO96n/ys+LPu8ojc6Bcm1IjVrULOLQbJh/Wp+WtchGOlqcb+/wvnvKZjj0BMyoYj3tSUmy1uiAIlg92bxyMfdMllTqEOPEtWNdyF79fCDc170c91HfBrkPdRB4x5c83K8f4YCpy3s36Y1Di4lfRcsmO2Dwn0iCA+zvJRqEHJQEg4C/eqtULLzTufW3l2HT9o8I=;25:cjDS1Z3/haBPeTYKELsIJTyA5kTMkvXyZ5MbDOshbtzm++ELmcx/8rMlB3dqFG6LfapW788psEJS8RY0kzkppSTxsbs3ciP9pQPpwRy/qN//+otD1/XQnfYltnd+zeb+YFb+KgbpfTle70mjkbAYF18om1JD+J7m30WbBsGfRcyzZZ4b0qLF3q7imCv1GR2VQyNfdLTuHI7GjGXFwEhheXHVDxV4guE6GFe9QfEf4vCrLRSc/zzs9iX/UGFwAUK8Y5yckkVckGaIdRWx+lw0aA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB558; X-Microsoft-Exchange-Diagnostics: 1;DM2PR03MB558;20:t0LU/wW8rHHzC/oWT4orAvS++lRArytkkvktbLH2N8cfGZVqkqAVNIZxlB4iuZbxWEflxoGBwi1q60TLkPQD1F+dyEBZULaZ6JgUt33t5/Cd1uF8uLOfSTy3ZlHnkmAm/QSuMUQmuyOIKXR6tlhwUQr0vKi6Gtbz8hQNnOK/wVoo8ZstK4B07xZwoMGs7xBTnJlKl40YMtidaSawX5D7qJEISWoVJMDUlRq17Bk7cOiDgufLEuHw3KTLW1tlBqeK6dD0Np8X/jWHpTfXGTxh42cgvFbzksGjxouvMSab/A/u1lP/GYu6IPsPYkAwR6HSFU0InKXEUoq6cIlipVuJ2ytL6vT4/Gj4k6bsHNV/eYg=;4:OIt+j2YvOGNJgKgg55k7KAfJazSA32oWamiL1x0ALCBMacONNtDkzh/RPqNWRm0UcMfzjA7+4wAav4s+KAPUKHEw+BmzXPjkYYcGi5wIw3V8GNP/BS9duszclBqESFt4GnfJXvIWiDaecX68TwUa92Sim6XgunVGH00cmd5wnsIgw9lLp0oFWBGlf9mhUIwnmMJuuY7cqKWazXWYLOiq62CXfFJXAGm960rKCwwFmjnhxns707pAd0JcyuiCSXYu7d/SJXP/9aHbxKKYtfwidDJnWzZ1U4Z7N3Z0qigoi4cGcJH7Gu80/FONh7lMJYBtnAYeBU/25nd6Bydn3pn4yMjy1NqSwtVBVVyeLai/+QsHIkXLysWwJK+0gqXK/8r3 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:DM2PR03MB558;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB558; X-Forefront-PRVS: 0770F75EA9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM2PR03MB558;23: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wyeOlDYnt?= =?us-ascii?Q?X2Rhj6P7zd5GlAHIMUdLLybqHmHfVyn99SfME74DdmiVTURMb2FPhHW3SUXg?= =?us-ascii?Q?TtYMMQDqv11UyJmhGElaUyQpRaZX64mpSeSMh4ZVJKbACLQeBhiN+5p81TIS?= =?us-ascii?Q?X4r1QKj7fXZurJICxIcHCeiWjEn1yp8dssiYWUPioB39Ht7j5nSj41573s9r?= =?us-ascii?Q?FuiBWM6RxzBI98R8cve2NCrju2?= X-Microsoft-Exchange-Diagnostics: 1;DM2PR03MB558;5:5VoGmiXiW2SqxoXA1Ur3Pm2LdOrE+v4qfn9apnozbk1G/x+ErppXI9DkbkB7V5PHeir97tFuIQMg2WkPdec2KSUjrRoOqsFIUVtBQJgDDLldqXeDV8SFutIyJedQjmOFBswpXRUUz9FFZ2eQy4rDRg==;24:xEM8tooPhxxyTHkgO4gjiASkeLPJc1pmEFwZAw+TSjNuf7HiuypwN5nQa0CD73mZTgCM+Hi0h3LQ7bvWkbNj6HIir04mCZ1XN+QPK+p/7Wg=;20:4RrBn8UcU9ABFywjrMNC8K80wNV0vJ82UbO+O5CTuybHT03xc78PydvRktv/+Dy/n5OyL+bMMAaaiLqyAtnInA== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2015 09:19:31.4985 (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: DM2PR03MB558 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3748 Lines: 98 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 --- Documentation/devicetree/bindings/sound/fsl,esai.txt | 5 +++++ sound/soc/fsl/fsl_esai.c | 17 +++++++++++++++++ 2 files changed, 22 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..054e64b 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,11 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream, ret = clk_prepare_enable(esai_priv->coreclk); if (ret) return ret; + if (!IS_ERR(esai_priv->spbaclk)) { + 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 +506,9 @@ err_fsysclk: if (!IS_ERR(esai_priv->extalclk)) clk_disable_unprepare(esai_priv->extalclk); err_extalck: + if (!IS_ERR(esai_priv->spbaclk)) + clk_disable_unprepare(esai_priv->spbaclk); +err_spbaclk: clk_disable_unprepare(esai_priv->coreclk); return ret; @@ -564,6 +574,8 @@ 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); + if (!IS_ERR(esai_priv->spbaclk)) + clk_disable_unprepare(esai_priv->spbaclk); clk_disable_unprepare(esai_priv->coreclk); } @@ -819,6 +831,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); -- 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/