From patchwork Tue Oct 4 09:46:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mylene JOSSERAND X-Patchwork-Id: 9361505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9EFDC608A7 for ; Tue, 4 Oct 2016 09:51:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89E39286C2 for ; Tue, 4 Oct 2016 09:51:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E2EB287EF; Tue, 4 Oct 2016 09:51:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ECA4287F0 for ; Tue, 4 Oct 2016 09:51:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753674AbcJDJrx (ORCPT ); Tue, 4 Oct 2016 05:47:53 -0400 Received: from down.free-electrons.com ([37.187.137.238]:53706 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753541AbcJDJrw (ORCPT ); Tue, 4 Oct 2016 05:47:52 -0400 Received: by mail.free-electrons.com (Postfix, from userid 110) id 740A3373; Tue, 4 Oct 2016 11:47:49 +0200 (CEST) Received: from dell-desktop.home (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 6D3712F9; Tue, 4 Oct 2016 11:47:47 +0200 (CEST) From: =?UTF-8?q?Myl=C3=A8ne=20Josserand?= To: vinod.koul@intel.com, maxime.ripard@free-electrons.com, wens@csie.org, mturquette@baylibre.com, sboyd@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, lee.jones@linaro.org, mark.rutland@arm.com, robh+dt@kernel.org Cc: linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-sunxi@googlegroups.com, thomas.petazzoni@free-electrons.com, mylene.josserand@free-electrons.com, alexandre.belloni@free-electrons.com Subject: [PATCH 03/14] ASoC: sun4i-i2s: Add apb reset Date: Tue, 4 Oct 2016 11:46:16 +0200 Message-Id: <2c5abe6578c8e4e841cb59357d88ce397551a593.1475571575.git.mylene.josserand@free-electrons.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add APB deassert function for sun4i-i2s driver. Signed-off-by: Mylène Josserand --- sound/soc/sunxi/sun4i-i2s.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 687a8f8..f3f7026 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -589,6 +590,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev) { struct sun4i_i2s *i2s; struct resource *res; + struct reset_control *reset_apb; void __iomem *regs; int irq, ret; @@ -626,7 +628,19 @@ static int sun4i_i2s_probe(struct platform_device *pdev) dev_err(&pdev->dev, "Can't get our mod clock\n"); return PTR_ERR(i2s->mod_clk); } - + + reset_apb = devm_reset_control_get(&pdev->dev, "apb_reset"); + if (IS_ERR(reset_apb)) { + dev_err(&pdev->dev, "Can't get apb reset\n"); + return PTR_ERR(i2s->mod_clk); + } + + ret = reset_control_deassert(reset_apb); + if (ret < 0) { + dev_err(&pdev->dev, "Can't deassert apb reset (%d)\n", ret); + return ret; + } + i2s->playback_dma_data.addr = res->start + SUN4I_I2S_FIFO_TX_REG; i2s->playback_dma_data.maxburst = 4;