Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755545AbbKYCUH (ORCPT ); Tue, 24 Nov 2015 21:20:07 -0500 Received: from mail-by2on0136.outbound.protection.outlook.com ([207.46.100.136]:19168 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754922AbbKYCUD (ORCPT ); Tue, 24 Nov 2015 21:20:03 -0500 Authentication-Results: spf=permerror (sender IP is 192.88.168.50) 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; Date: Wed, 25 Nov 2015 10:02:32 +0800 From: Shengjiu Wang To: Rob Herring , CC: , , , , , , , , , , , , , , , Subject: Re: [PATCH V3 1/3] ASoC: fsl_esai: spba clock is needed by esai device Message-ID: <20151125020229.GA26087@shlinux2> References: <37808c01df126622c41c2d413fddf838dc2aa71d.1448348336.git.shengjiu.wang@freescale.com> <20151124232130.GA3400@rob-hp-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20151124232130.GA3400@rob-hp-laptop> User-Agent: Mutt/1.5.21 (2010-09-15) X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11FD006;1:4BgEXT81PpNaNL4/4I4Qekz1votVcndhvhrdBDU/d/T8/czJBzgfw7H9E6Tlz3uADvtTSIPBfw0Pby+W8zltNOZPLZTkMDGeDn+cXG9g3KOhB6PiWatr3zwD5dLCjmQcIgXbSfXSqb357vCRAWDB8p42Tp4Smfzq6YcGCkpHb4TTn6be77N6mmfUGkl2pOwuOeg8d15bqi4YBhzVPHTOERy8/Pu/HHGJOXp0Mphfa+GzA2DZMdHIjRLp0Wjv3WRUp+YA+qbHAIxHydyEac9z4EknQz+2JQSD2c58fAa+he6a6EmUdesKOPKVr8wEm5r71Q1XNnjVdaGyCYXQ2vVRKidPgbo9YinWbWrJqbAej4e0ViHFFTyjrRsCohaxsy36qCMbYWAuRwBtlTcBZhTcjQ== X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(448002)(199003)(24454002)(189002)(53434003)(83506001)(586003)(33716001)(97756001)(77096005)(86362001)(4001350100001)(5001960100002)(189998001)(23726003)(19580395003)(5007970100001)(50986999)(19580405001)(33656002)(1076002)(81156007)(87936001)(97736004)(11100500001)(76176999)(5001770100001)(106466001)(85326001)(47776003)(50466002)(5008740100001)(104016004)(54356999)(6806005)(92566002)(46406003)(2950100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BLUPR03MB549;H:tx30smr01.am.freescale.net;FPR:;SPF:PermError;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB549;2:90MsNC0nUAwtPL4M/tBlGieYJnf41NMFzrl5JIPRBDXtx74L+DaVihhT/tXmk2V0DIVHgm5XcKmbAAYuN/oStiCyLs2AyVvaVOOp1RYJsLTv1n/lZb/fimOCaGmBtNK3P+vfw86zfz84hQ92B/TIDA==;3:kHdcEOGFdD8+GZux45VYX0bJcuYvjcQH9GI/gez2Z43zcuu1H1UgDhIe0xM75/4yfdz7EQxK5xy2DEOLkZeOhkFQt/v67XveIsQUr90NX85qnEP70eI05zoWIgy37dsHvUATXL91ScmS9wUG0oz212G/UoE9u3V5kJr8HEvm+xr0wjy4qc0D3T1UdcwBrBbvYbObEk/bFOXS731lZjTFS9MYBsZ7/OZLQZEy0r8drnk=;25:0299/AO4/tDoiwrhLZTG3CvzxjpqnkzIY2mzeSXGsY4t1i1jH/91xIi1BCdKze9T+nx908WqU9VoFfrFhtBHnGUGiewOXg01dz0aLzNArUVUjqBQz8RkPB/7vTT/DvXWLuwarRG4i643Tz0SrLOc7dwsg5wM60JpSCjsmA3aFElEExOU+/90c6IxuQlQdmV+/4+6yXbO3vbSq1SmkeH+ruGgkuMq7tGCNo/OaWyym5Icf1egbBtQgSX/VBwPqfBCphMluW6bu8clBTpSws5ogg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB549; X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB549;20:IHOPuecdrTd45YrjopPwBJT8NPi0Jll8yoqGRmltKe1LUy16zJYn/6BhZPkzfns2DQYtac0ajEeVX2MxX9JSX2y/xuPNmBAousqgtzlTGa7GD0+mJbkSidYujIRkdgdDTAX2L6yl/PPbbaRHBcDVj6298zyJONC/5XsxWGGnnLxPC8l3n+qRj6LMJA28dZGd3x01u+VA2Aehq1b5LD+S2U6WpHyxrRRZX31jMvzF9KJpcg9dR43qP3Po1bLTmReMLFvRQSwaJEaoQL6urAK9TaI12e857IjBaDeM7JWL5Homru4Ns5pi0/FgbdvS1Uaozn6Au9i1vkzVe2XOfJ4zEwaPah47rfhn6b8BZ2KNHZA=;4:ulAXwriDZk3H/Vvl4Gni/3OGK7BYhQQRzIm2YOeE/3E6UQ9nd1qiWHlzu1rKqPai2fumJ3cvCU7MB838ykU58L4RbRmGxu2QZVzg8bI1LvPgCqR4edznVn7rzPke7Yxu38qOjrDnjxWwLloelvU3/cYCnX2sC8KgMx7EFM1qihZW3miJ9CcKWYChrHDhFvBe5E2Tfmhj1T1NkgxdrtVW0b1GlueTmLAw0zf/NLiAmv7gvgRcA0g+AvlBanGQEeIhkRqMp0siqYLuMEZcl8Du2/F55CunHxzRSv5P/p3CRVgxmzUu4RvjYOH7l0vOyuFkPNaWix7nvyVYCVz3Lf7NVot/DhT04xTOpF7M8C2NQiGhc+uVhtRuVGq1GA5b6/N/rC+HJcGHLZMFfQLK5Iyq2GkTdpp7nJ4AGGtoIst0ilEPjhiqADtOHAkm31di7t56 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)(5005006)(520078)(3002001)(10201501046);SRVR:BLUPR03MB549;BCL:0;PCL:0;RULEID:;SRVR:BLUPR03MB549; X-Forefront-PRVS: 0771670921 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BLUPR03MB549;23:AZ0c+2AV+pJ8cnHuZjL+M8T2cMhv/MvjuCfx/AUqmf?= =?us-ascii?Q?yTK0bF8DgCGD0AXyyIZP9AVZ3/2159fBmkkJUyPpBWy55Kx1rVtDar8gRZON?= =?us-ascii?Q?GZW55/dPRtHfy1bQ8JMGqnb2pCkUjCHwZbzO+4xI2GlQi8n6m7s7ld4chjcA?= =?us-ascii?Q?KDcsoWNFZb2GGCK1S4kOblkdeF4vA7Zu/S9Q/OVsX1rLWOviAOtKeTzv5+Zk?= =?us-ascii?Q?bGpHspeoRUO/HcT0mEY4wWib1Me1mo6h2vwaaPUnR7/mbrXOb0r0z7XJL9lh?= =?us-ascii?Q?i7lL+VWVi7aeHHW9sZ6VfjkUljP+2eoy+FVVjbSs9FUzLaZj4LIO+FCfKTYq?= =?us-ascii?Q?BNkJCt00vc5HEhwktD/KDsLYsRRzE8qzWwuFOSm86QE4dyHfMMaYdapGgaIw?= =?us-ascii?Q?mhucpF1HwHpWZmcmokOOUnhkmMb+xL7vCC8g9jWOkjJDwkv6RJV4xKmbWRmb?= =?us-ascii?Q?eZhTI1rYMJ7kwlbRDNX/pFwIUzc+fQH29hEhwK84nl+Os4RD7cFuRYa81xq3?= =?us-ascii?Q?XzEPcLvc4VMuKYGhrPOMQDAQHZMQLHS4vKxbdpamVhpFGBzlc9TtqltpSonN?= =?us-ascii?Q?TRXfyQZjMqoTr6ltrV6TObpivgi2dlCFvnSaElJCUSUCBuIquH0vQQbqOwA9?= =?us-ascii?Q?XAtbjT5u5MNT2C35sWM2w9klEl5Gr9ZrGCYfU8FQlPyF6ZJc9u/p+43tgnd7?= =?us-ascii?Q?kx0vjAmAKqsHYD+EXqvQGyK9LeCz6OPbW7CmaQPCvDSLo4ReGwoWTx+w5SbV?= =?us-ascii?Q?U53PcxzIfm/BJGzga8or7AbDWZK/vPBfnPDGk8hLec4+1Uli7ya42gF1xIX0?= =?us-ascii?Q?EUrwaF3AN++QR8TibOV6R5yVoGghadI40Aue29WLtI7Z+IgFAqECShm37l37?= =?us-ascii?Q?3ePkkW6Ox4r3bOu1wS7sN+sDrUGcPb7yG1Z+OzIljGC76/mXtNO+FuryC6ZT?= =?us-ascii?Q?9KGO5ExMr4agG9wqsIDmOlw96WTulJ7Gt6ZNxCsTIJceG/ddP/DP8l2rS8UN?= =?us-ascii?Q?s/fJxP7+/SG2cHP0K3bNFUa3TeeGe1IMJ6OPvesG8cTEov20IITXZk2Z2AWp?= =?us-ascii?Q?NIYDAsphdarNWm01LaiGROLb3v?= X-Microsoft-Exchange-Diagnostics: 1;BLUPR03MB549;5:pDYk6QKlPs2ynNWkJdP/snPp1ij6oWz3vwmXCt/FKG4S/Jfcn/sEk7YG8WzaiQNzyLyN/hx+NipwF32ZsUJxLRirTshfHGSqlvRq7u9W8bMPj2zQCQok01NHttI9c0s2Dr8saD/TkkfZIgvB/5deNA==;24:mgiEOwN7wFAZfejuZ50e0vmZq+zDEOjJB5kt9NkNRkK5r+tee417iYJPqAnlrmSI/4onXAgVAafVO674/QYl8aLUh2oKjB+r/yd10gevudM= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2015 02:05:41.0102 (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.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB549 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4300 Lines: 108 On Tue, Nov 24, 2015 at 05:21:30PM -0600, Rob Herring wrote: > On Tue, Nov 24, 2015 at 03:03:28PM +0800, Shengjiu Wang wrote: > > 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 +++++ > > Acked-by: Rob Herring Hi Mark, Rob Just a reminder. There is V4 for this patch set. I think the "Acked-by:" is for the V4. Thanks. best regards wang shengjiu > > > sound/soc/fsl/fsl_esai.c | 13 +++++++++++++ > > 2 files changed, 18 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..4d7589c 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,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 +504,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 +571,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 +827,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/