From patchwork Sat Jul 30 15:56:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code Kipper X-Patchwork-Id: 9253205 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 5AA3E6077C for ; Sat, 30 Jul 2016 15:57:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4964F28440 for ; Sat, 30 Jul 2016 15:57:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 398FB28445; Sat, 30 Jul 2016 15:57:51 +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=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 660D328440 for ; Sat, 30 Jul 2016 15:57:50 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AA9A0266812; Sat, 30 Jul 2016 17:57:48 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6471D265DC3; Sat, 30 Jul 2016 17:56:53 +0200 (CEST) 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 9B93A265D9B; Sat, 30 Jul 2016 17:56:51 +0200 (CEST) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by alsa0.perex.cz (Postfix) with ESMTP id 43B252659BF for ; Sat, 30 Jul 2016 17:56:44 +0200 (CEST) Received: by mail-lf0-f68.google.com with SMTP id l69so6617595lfg.1 for ; Sat, 30 Jul 2016 08:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sm3OQg0/ClPr6eehPCzubgHwWrUQkyjZ09SUOBXC8ig=; b=TilFDD52eP0IJsLaiySn4CDqaHm0DpxMQH0mUufVlk0mIUKWgir4PvrgIHDo0rbp7B a6b1CsEr+jWP/TzEGmy9QkLEoqMjdjia5Q9gqPl41DDQca0PbYFAq9iFwOkr3iAT450y tx/TB6nJ/Tfic43DAldkiWtYVPTewdimy/vJjVc+wHtUvIYqZ0xvzM1DJfBQICHaIdPe MhHlscttbAx4ZqLoboiuz1aPXQqMh33Y4KEIy9wBfQ9sHyevoEumYdjCF1qel0wGCTCt ILL89QwbVHPlpIdo/HJxJIIJMTpn4bF87RHA2d5T/TmC4j0PpLAbfTGsQsH2/Py445Kc NrGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=sm3OQg0/ClPr6eehPCzubgHwWrUQkyjZ09SUOBXC8ig=; b=MtBtLyH8Udy+ZUY7fOl2iO/aDSljWq9BhfSbxRjfSX94XGGab/10S3syOmvO04A3jn Zjuz+zN2W8fS+L41u0FNQfbftal1JT3QAW7GprpKfNDdyYmEATdB0qccWCPJanE2kIux akopIffgTdorgq0zcgCmzaz0Swsof8ciQRO8oKsMXt+xqg8PTP/IMbZAtA3jvUhYDZ3O YFC9oFvlPxeHobg6ZKLbAAcRFu+E1ts4Q93ay8tLDGFOAC349AP3C68+zQLPlyRSBnwZ BoJaPIePFtRIrwH1v6qAU0c+y0c825TsT0ydibHDCZ0VDEp28He09f9O2PnE+vazp0Cc J34g== X-Gm-Message-State: AEkoousf73UsNFDoFB3oIxUCbEtokM712eC59aLlheQm0ysPsJZ3a76F0FG9WVzaTeXe4g== X-Received: by 10.25.90.198 with SMTP id o189mr14048121lfb.193.1469894203830; Sat, 30 Jul 2016 08:56:43 -0700 (PDT) Received: from localhost.localdomain (c80-217-8-99.bredband.comhem.se. [80.217.8.99]) by smtp.gmail.com with ESMTPSA id r196sm3634060lfd.41.2016.07.30.08.56.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jul 2016 08:56:42 -0700 (PDT) From: codekipper@gmail.com To: maxime.ripard@free-electrons.com Date: Sat, 30 Jul 2016 17:56:38 +0200 Message-Id: <20160730155638.24455-3-codekipper@gmail.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160730155638.24455-1-codekipper@gmail.com> References: <20160730155638.24455-1-codekipper@gmail.com> Cc: alsa-devel@alsa-project.org, Marcus Cooper , lgirdwood@gmail.com, linux-kernel@vger.kernel.org, be17068@iperbole.bo.it, linux-sunxi@googlegroups.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH v2 2/2] ASoC: sunxi: compatibility for sun6i to SPDIF 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP From: Marcus Cooper The A31 SoC uses the same SPDIF block as found in earlier SoCs, but its reset is controlled via a separate reset controller. The DMA also complains when the maxburst is set to 4 so it's been adjusted to 8 which suites both the older and newer SoCs. Signed-off-by: Marcus Cooper --- sound/soc/sunxi/sun4i-spdif.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index 0b04fb0..88fbb3a 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +163,7 @@ struct sun4i_spdif_dev { struct platform_device *pdev; struct clk *spdif_clk; struct clk *apb_clk; + struct reset_control *rst; struct snd_soc_dai_driver cpu_dai_drv; struct regmap *regmap; struct snd_dmaengine_dai_dma_data dma_params_tx; @@ -411,6 +413,7 @@ static const struct snd_soc_dapm_route dit_routes[] = { static const struct of_device_id sun4i_spdif_of_match[] = { { .compatible = "allwinner,sun4i-a10-spdif", }, + { .compatible = "allwinner,sun6i-a31-spdif", }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sun4i_spdif_of_match); @@ -482,11 +485,23 @@ static int sun4i_spdif_probe(struct platform_device *pdev) } host->dma_params_tx.addr = res->start + SUN4I_SPDIF_TXFIFO; - host->dma_params_tx.maxburst = 4; + host->dma_params_tx.maxburst = 8; host->dma_params_tx.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; platform_set_drvdata(pdev, host); + if (of_device_is_compatible(pdev->dev.of_node, + "allwinner,sun6i-a31-spdif")) { + host->rst = devm_reset_control_get_optional(&pdev->dev, NULL); + if (IS_ERR(host->rst) && PTR_ERR(host->rst) == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + dev_err(&pdev->dev, "Failed to get reset: %d\n", ret); + goto err_disable_apb_clk; + } + if (!IS_ERR(host->rst)) + reset_control_deassert(host->rst); + } + ret = devm_snd_soc_register_component(&pdev->dev, &sun4i_spdif_component, &sun4i_spdif_dai, 1); if (ret)