Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161909AbbKTGSM (ORCPT ); Fri, 20 Nov 2015 01:18:12 -0500 Received: from mail-bn1on0113.outbound.protection.outlook.com ([157.56.110.113]:5917 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752163AbbKTGSF (ORCPT ); Fri, 20 Nov 2015 01:18:05 -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 1/3] ASoC: fsl_esai: spba clock is needed by esai device Date: Fri, 20 Nov 2015 14:17:51 +0800 Message-ID: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD031;1:1F2rFEmZzfwv9kcj8VHCD3wQIzdfjv6JVJ4UorMBrf/LjXuP85RqSIf0S7RSDlLIspeiU8cYVPB9zb+sD+hRDodf+0ZBMJOXvyvdWJOm5YfHBg/8qWL0EXm83AJA2AB2fQdvvsopxVRp4/BU2MisCZRjit9j+l32X6DrlD+oVCKB9ALEtZF2LL3aEhf+qxboCR96EFBjGz+YhkjZOP8MDHumvcJJZCWHcbohm2JxN5nAd2Zx/J7YBejnQg4IBCZ+5Z/2BG87p1tUFc5HLjcxvgdNzK03F7+JT7o3WeibVqTJKQRRg2wGHmAI3f1s/hrLnCIwxC01Dl/KRXJmOPF4aEqM/xCWB7cFvci6mZWNquLggW0PehwVPKpQA8vF6VIoiQRkMfnNFxCWdlGiG/BKwQ== 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)(118296001)(81156007)(50986999)(2950100001)(19580405001)(97736004)(47776003)(69596002)(77096005)(229853001)(189998001)(5001960100002)(36756003)(86362001)(5008740100001)(50226001)(76176999)(5001770100001)(87936001)(92566002)(5003940100001)(50466002)(85326001)(104016004)(33646002)(48376002)(5007970100001)(106466001)(11100500001)(586003)(6806005)(2201001)(921003)(1121003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR0301MB1227;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;CY1PR0301MB1227;2:gXCLlGaSNd9HwBUHDGMz07IyJ+2uHquwxHFBjsSA23qqkAuNlmb4/Bq4o5NgtLrmna4+9Any6Q3aUKwY5KDa3coK4cL8czBPIQffe53yy9kqsndrubu24VnysQydhZ8k5LqnI3CR+tt8skM7GRVQ3A==;3:8i/l5be4m9NlFgJkMbDPcsZBXhKskJWP3WCe/Z1f7rHbEXl+MB3B2lxmptCPpTm1vComVG86hGDRQEAUK33UO19n8b1iQkxWQWAVAjSkO0Gs8si6F8TVFjs9xMeU7IQMeDUW5v9Gsnr5t/0HNfO7bj8RfcH1DkwKQrefBV4e2zC3LjaqpzyKydK+8em2YIMzCbjKd9+GRhTfIVSsrJPzUp1O8s/2UkrdYEAeL1WgTMk=;25:TUvPkrr8JTMdzAzTqIW4MxB6ZC+jsV9Q/w2J9qxx5KsWWX0jO1MqV6H3hjBbrMHK9JrxLKrxszmQQqd4gIGpeSZJtcS89V0zndwCtxJDLYJLiB0w/wgz3Z+Gcv1mqqdGYRgjk7DFaw+acSEujuEMh8JViRWoxfa7cuIJBGbB98GVNRFeoeTgbJiNzcE2Qi/bkCzkIwy3RsmaP01lA2hGeR7DiOXULfX8LSs/Ri7Cy6wHTzg1UTb/DEM66Z5VmvbeAm+PH1GXrNJetmrFvECyaQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1227; X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1227;20:pp7QcwYIO8VezLtk/VL/pY6ootUhRGpPR60rF6xSlLjXD6/RweUTuCKtzWMFI190Z0iJEDlJt42rzAiOH9uvPw32pecc7oY60y0+09exsMcLe+XU6vUzGZ0uLxioWfFipjlLobSpvsQ9upQ+LykUtJsoDU3PchII9Vz94kLujtrfgBDzA7uF8DB+4B5znE0LneqIVEC10mMX76LSXhdmcgawWU7rGVukTrQUhTQlIk442A6enWAFjswRcu6416GysBpUL+N52J00N6IROUWc97MxJWmiq9oDgJ0bhkTzYU3ouYtKQ6j9clJfZuQwEOjDVBZaNLgvfOCV6dOZ24znS2VFu9agHQf18S1hYYmQ5Cw=;4:wWuN4rSzAKBmBriZ1l0O8G2dLMtljNr9//tYsq4Au1qNm/ffIt8FBr/cImgfpx75ZNP01zSEaG2FtCK1ZG470+roSMCjOHEuvB+IvTM61ubUy/NnbhxS0fnNyTYZWjUAbGAlUXXaeu3XInJ/zTKAK3PaLdp2nMQCd8hNCUuFWNhoDLUjzLXdzr0PWFMv5M+BIpnVQZdyuumLq75xFtzj2SNSURJjK6pyCV4acBiLY/f0rclaPPBbzPpb5F+kAeepeWerB8WyQlbPgNCeb5irGMCPJuAt6t5onmM/kL5IN/XhvNZz6wee0DpG41bNTAJYPJ6SLUKZZwFv/bCtOw7+sREst0ISbJcrnTh9zy8ykfGXblQDymJMaCsHG48XCd7anZD1b/8UtgsytHhGFYaVEIz9ZzgCH5W8ro8iWmkn0mgjFU2FG8VjpIz1JjVxFI+Q 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:CY1PR0301MB1227;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1227; X-Forefront-PRVS: 07665BE9D1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY1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wFl19kU4?= =?us-ascii?Q?Ov3eMVwIuZvoFFZHnKnsqvQpegZvzq/blXlU1brw+Si27CPklJjYRLkKgqCL?= =?us-ascii?Q?4E/CiwEy+2I81o0atlwYSOBykLsDhvrcGaTsghIpgbKbrys8yrGWNorCT7rT?= =?us-ascii?Q?mdELLk/GeEkBPpIEapHVKas7rfM1r+K5iOTfBQ5hBme4JMSuKo7jeIO67MEL?= =?us-ascii?Q?uvFSbRzK+6OXfieY+7xs4tTKk8lzZ?= X-Microsoft-Exchange-Diagnostics: 1;CY1PR0301MB1227;5:GzXtOpK+DI6JX4Vc5MmZNYLzEKt6jQCYxxuc8QQeuJV3ReHhyVTJKsERWKpUP04emf1bfoc1AngAlejN/hm6vz5JiRYMnnWF09ewKL8xpTVvtHiXbxyZfW8R3cSXP3EB3/iGNUWnp9O3iuo1ykjnkA==;24:wZvVwdAQ/r+h3LoBAlO2Ei092a0LQdE/EpH9tT/RolOD7n1qpoWXRL8XwjJyRWyfhu9+oTDYLGCZHD1JHSZ7fG08S08uPEtQfqGglhumFRY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2015 06:18:01.9389 (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: CY1PR0301MB1227 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3097 Lines: 83 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 | 2 ++ sound/soc/fsl/fsl_esai.c | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/fsl,esai.txt b/Documentation/devicetree/bindings/sound/fsl,esai.txt index d3b6b5f..f1d5351 100644 --- a/Documentation/devicetree/bindings/sound/fsl,esai.txt +++ b/Documentation/devicetree/bindings/sound/fsl,esai.txt @@ -27,6 +27,8 @@ 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 needed when two spba master port + is used. - 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..8749f53 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -54,6 +54,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 +470,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 +503,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 +570,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 +826,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, "Cannot 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/