From patchwork Fri Nov 20 06:17:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengjiu Wang X-Patchwork-Id: 7664601 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 7A1E2BF90C for ; Fri, 20 Nov 2015 06:19:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 939E720494 for ; Fri, 20 Nov 2015 06:19:51 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 69ECA20462 for ; Fri, 20 Nov 2015 06:19:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B3B9A2665BD; Fri, 20 Nov 2015 07:19:44 +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 3E4EE2665FB; Fri, 20 Nov 2015 07:18:42 +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 32BF02665FB; Fri, 20 Nov 2015 07:18:41 +0100 (CET) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0132.outbound.protection.outlook.com [207.46.100.132]) by alsa0.perex.cz (Postfix) with ESMTP id 68CC12606C1 for ; Fri, 20 Nov 2015 07:18:10 +0100 (CET) Received: from BN3PR0301CA0062.namprd03.prod.outlook.com (10.160.152.158) by DM2PR0301MB1230.namprd03.prod.outlook.com (10.160.219.19) with Microsoft SMTP Server (TLS) id 15.1.325.17; Fri, 20 Nov 2015 06:18:07 +0000 Received: from BY2FFO11OLC013.protection.gbl (2a01:111:f400:7c0c::121) by BN3PR0301CA0062.outlook.office365.com (2a01:111:e400:401e::30) with Microsoft SMTP Server (TLS) id 15.1.331.20 via Frontend Transport; Fri, 20 Nov 2015 06:18:07 +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 BY2FFO11OLC013.mail.protection.outlook.com (10.1.15.25) with Microsoft SMTP Server (TLS) id 15.1.331.11 via Frontend Transport; Fri, 20 Nov 2015 06:18:06 +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 tAK6HoR4006053; Thu, 19 Nov 2015 23:18:02 -0700 From: Shengjiu Wang To: , , , , , , , , , , , , Date: Fri, 20 Nov 2015 14:17:52 +0800 Message-ID: <13b069f41f05e1d37ba7d698b2bb5417639055c3.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; BY2FFO11OLC013; 1:Gd2T5RUeZbACtee/theD44xKNKpS3whuSg6QbuQEUWqXe4nxQwqf5BWCe9AlVVxohtTYpB85J7cagv2fY+MYPU/FSKJGh94elhmYf2nBMqiV/iBzp75ZlSM3s45Oo2J5JWIL/VrvWmBUQ130Ug9MSdOYdbDfAR7ZVPHvA/wksZ1lNEHYQi9ZMyxNpyhSK4wxwBZUsb012kQZf8o5XngPozVLqNU6940/faCZwTjPdImUu48M9B6N9M/jWVHGhsg9G0ApFeU/kB3nl2TZcgb1xbExUA8ugSi6Iwjt8EHYLTEWwoPj9HOGhWZAgzxVFcAOf6D05qujn9zl82npwWmajDgPQoQRCPLGG/xbuZ6a7AyuYx38Nqtlazp8Dto9ZHdDqMvR/FQUDVeCXjtnru2vuQ== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(448002)(189002)(199003)(97736004)(5008740100001)(50226001)(87936001)(11100500001)(106466001)(6806005)(229853001)(19580395003)(50466002)(586003)(48376002)(92566002)(36756003)(104016004)(189998001)(69596002)(81156007)(5007970100001)(33646002)(76176999)(47776003)(50986999)(2950100001)(118296001)(77096005)(19580405001)(85326001)(5001960100002)(5001770100001)(575784001)(2201001)(5001920100001)(86362001)(5003940100001)(921003)(1121003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB1230; H:az84smr01.freescale.net; FPR:; SPF:PermError; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1230; 2:XrZhKQFm3nhSVFivXYVYJ/4mzyIRETY5zZKwBYBv1CSe6Id0u3Okbo7Y7KroMrG2kRTeIG75SJOu58NJGO3JMKw4WSuhvdiFmaNeMNKfaHdVZZDz5jE75fxZFzXOo8AidmSgqZ5Ur2Q/1WgtJDh5sgLVi3ZyduOKqenrxvS6xIs=; 3:UIezvLUc49boUkxrNRT3c0IbGNnv5XkJiem6KziXnwdyFTdLZ+e1Aj9aSCBSwB2tzltqQXbFRfFp29K/cMVPGwy/rqZQBV6Wdf1qWLLL37ADvuLtmUNpKcGuPG2SAM1mXaPr3rjfZo0dLfpZYinnkRe8icBVUV69o8+Z/zYFIt3AvdIV/DkxPk240q55rZItrckdYGK+k9r9wqQgSuOuIykJmJOix3NdtPRsyCT5GKQ=; 25:pvLqxk9bvH8fTyP5YX6k9JznPOGC5iVOrxusTuLrl48CNyPl2XVG5W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VICLLFeKgg9wcluqhSy7TpKWMOw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(10201501046)(3002001); SRVR:DM2PR0301MB1230; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB1230; X-Forefront-PRVS: 07665BE9D1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB1230; 23:EaHinkaBrsyqI81X3axwvxp1jVx4iJQI+93P0bu?= =?us-ascii?Q?2L/piWRMD5equdARAwP0PSqpPor0ZLX+pW4la0gbExeqdXmqlq5p3Vlt2rbH?= =?us-ascii?Q?KFNgJa+HDFa3QvY18tacWAkwp0wV+NVSNMmNbAEghBhEI8OZK7bfvhThHWyb?= =?us-ascii?Q?eU2nddGYzdnsDMNXgNliU+786UwZ0sqp7pii+gY64r4bls3TMfU6TIU7ls2V?= =?us-ascii?Q?j4uGGns30EhA4fsOLCx8iyxey/ZA4Vd86kuUOIZfzN8AWNVb88erNEYqk3j1?= =?us-ascii?Q?HNcbNmdnSTxwkmYPXjEgBfnVtYzXBmnzh2JbySyMs9t+XYsqtLDgBTrKGvuR?= =?us-ascii?Q?P/wSUzrT17VYiDnoxQ83PcpxPdTMYjcZMwoIJOH+8YI7m9ee8jz9vnxx7Q6o?= =?us-ascii?Q?T2XAPCPHitk34JLkT1miE+6P3f9M7cfUC+EY0PhcnHxvkOQu7x/0n1ad3tHi?= =?us-ascii?Q?wFbYMkKwyMux5VgPU78Mu9lLUNlaIuJ/hVUhl9dQBf+qkXF7MPM4qzwX6mqD?= =?us-ascii?Q?ACtnk+x8d429M85DcIBnB2zAWVw/JJENFWlm9o4sK/jQ2HD2vS8IfSiY00Rb?= =?us-ascii?Q?/1zI9WIibJTyaY58k1v1U6oalRW5KXCAvib7OXSTCBxrqAJHDq0rLpRtHPPK?= =?us-ascii?Q?nnYVEWhCL93qfckI1AyFlUFvB3sAucBR0McHhlPnJwDXtsW4BdN7LC+kIOIe?= =?us-ascii?Q?zlynbOuOuwC2U4p5BrfukuikrwULU7D8d8EKMIV+A8F8FDV8qAQvjqNCspRB?= =?us-ascii?Q?YZm9GN7UPqRag/zPFh5Oz+A9C5cXiZNsY94ygi5X/zbNi8Os19pQdEw1ACbX?= =?us-ascii?Q?9TdrsypeBjEPsIM9lMHHpaVnFjsyIeGrOnq8dI8Jcj+P+LDYKe2E+YVB8gjL?= =?us-ascii?Q?v7WVfkv1zCPiXrYuq7qKHDQmQzXq3opgD7APzqRVbVxvVtR/D9Dp0At4fJZQ?= =?us-ascii?Q?NFiBmX6qSaBpzn9Ot913pY+fzhEth7uHBQhfgC/rjj/82ITio6okZctwFJ29?= =?us-ascii?Q?Tkf269J4bZGoaoMaE5gf/L+JLTOMR6d9lgmHfxnY47xKiws9OGUxUdHjyE7L?= =?us-ascii?Q?39xNtmvvMCTEHjaDHNzTqLJ9H2MUoem5Fl/4Z8nH/emdmlRZZxhIJdNFxtDe?= =?us-ascii?Q?ApsYB7BiajOE=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1230; 5:ny71a2Z/4GDnlo+TxL+7AANzvFxf1Nhqv3vH9VmBhGQYOTPV03VHfjWqPDO2AIozUAFK0m8IgdQzJAyUTXcglI46lkrnRCuoSieuGJF+x/z5VWVY+WVkl3eO3RI8+0lOYSQC24xtdBX+MMgvOy3Stg==; 24:WyVQzZdQ5M4cwl2iGR3ucBCblswl7qJ3zQiSOP8mCNSSrDa+KNN96F6U/mn4TlZVQITQeGT3Gnutm5WhUHE9xq5CP5sk5zlTBfgZBdPsjsM=; 20:QrECsS7YXkSQ1gokDwVr3rJ9BJy4yrKZe2Gx0EH6n3Pr1wmJ4yyqUjGKXCh/h8o4oikWptyNRoOocbQN41Dnuw== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2015 06:18:06.7363 (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: DM2PR0301MB1230 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 2/3] ASoC: fsl_spdif: spba clk is needed by spdif 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 SPDIF 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 SPDIF registers. Signed-off-by: Shengjiu Wang --- Documentation/devicetree/bindings/sound/fsl,spdif.txt | 2 ++ sound/soc/fsl/fsl_spdif.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/fsl,spdif.txt b/Documentation/devicetree/bindings/sound/fsl,spdif.txt index b5ee32e..7bcd9d0 100644 --- a/Documentation/devicetree/bindings/sound/fsl,spdif.txt +++ b/Documentation/devicetree/bindings/sound/fsl,spdif.txt @@ -27,6 +27,8 @@ Required properties: Transceiver Clock Diagram" of SoC reference manual. It can also be referred to TxClk_Source bit of register SPDIF_STC. + "spba" The spba clock is needed when two spba master port + is used. - big-endian : If this property is absent, the native endian mode will be in use as default, or the big endian mode diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 28a8823..d4b0ba3 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -106,6 +106,7 @@ struct fsl_spdif_priv { struct clk *rxclk; struct clk *coreclk; struct clk *sysclk; + struct clk *spbaclk; struct snd_dmaengine_dai_dma_data dma_params_tx; struct snd_dmaengine_dai_dma_data dma_params_rx; /* regcache for SRPC */ @@ -474,6 +475,12 @@ static int fsl_spdif_startup(struct snd_pcm_substream *substream, return ret; } + ret = clk_prepare_enable(spdif_priv->spbaclk); + if (ret) { + dev_err(&pdev->dev, "failed to enable spba clock\n"); + goto err_spbaclk; + } + ret = spdif_softreset(spdif_priv); if (ret) { dev_err(&pdev->dev, "failed to soft reset\n"); @@ -515,6 +522,8 @@ disable_txclk: for (i--; i >= 0; i--) clk_disable_unprepare(spdif_priv->txclk[i]); err: + clk_disable_unprepare(spdif_priv->spbaclk); +err_spbaclk: clk_disable_unprepare(spdif_priv->coreclk); return ret; @@ -548,6 +557,7 @@ static void fsl_spdif_shutdown(struct snd_pcm_substream *substream, spdif_intr_status_clear(spdif_priv); regmap_update_bits(regmap, REG_SPDIF_SCR, SCR_LOW_POWER, SCR_LOW_POWER); + clk_disable_unprepare(spdif_priv->spbaclk); clk_disable_unprepare(spdif_priv->coreclk); } } @@ -1261,6 +1271,10 @@ static int fsl_spdif_probe(struct platform_device *pdev) return PTR_ERR(spdif_priv->coreclk); } + spdif_priv->spbaclk = devm_clk_get(&pdev->dev, "spba"); + if (IS_ERR(spdif_priv->spbaclk)) + dev_warn(&pdev->dev, "no spba clock in devicetree\n"); + /* Select clock source for rx/tx clock */ spdif_priv->rxclk = devm_clk_get(&pdev->dev, "rxtx1"); if (IS_ERR(spdif_priv->rxclk)) {