From patchwork Sat Jul 30 14:27:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code Kipper X-Patchwork-Id: 9253129 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 ACFFC6077C for ; Sat, 30 Jul 2016 14:28:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E5C9283E7 for ; Sat, 30 Jul 2016 14:28:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9301C28445; Sat, 30 Jul 2016 14:28:22 +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 CCCF6283E7 for ; Sat, 30 Jul 2016 14:28:21 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A9C762666BD; Sat, 30 Jul 2016 16:28:20 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BC17E26585D; Sat, 30 Jul 2016 16:27:31 +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 B0D94265963; Sat, 30 Jul 2016 16:27:29 +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 0BAD026585A for ; Sat, 30 Jul 2016 16:27:21 +0200 (CEST) Received: by mail-lf0-f68.google.com with SMTP id 33so6555614lfw.3 for ; Sat, 30 Jul 2016 07:27:21 -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=yNcxiy5xdBMHU3VqdTx00uN6kiaql7aMxlW+LFnxKqBwdx7egF28x8Tat1CKyWfZcb pblwp+MXpHraAlbbrhTrDUy6x4XyHgEkiJDttqjsEczpg44ohESVgeY3idiiUBPuSvdp dL32lr7Ue8umzhkiCxS95lbFhU+4Ju9AvOx7wSVN3AqFuncbK6rjNJ09dnY6ylRjGSqs 0867OpniZDZQ0WqewtmdW/dmaWG3tlvDNQv4zdVAUIq094ELPf53N8bOPUwlDwz/1AOU RWFVnsmwi30fRvoovmfTh1GA1E05I5KngzRf3y0avIpndqB/g/D7FGpAzsgzjJpDEPZa pDzw== 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=V0ygiRGjrPoD4UDm9NfKdXjhhxo5F/IMqu3SELQd+tFRJm+f3GNF29Ho7AR1He0mGV ecCZqc5EGVrojD9pRZIno50A9IYsuo/19Hl9NkjO0Zb70smHtaV9zAJQPysUk2OElzD9 A2/m939H0FzniOw9jeVyqDkNwJBUhiCen+ptEyrwrNV4Lcvz5HGoNXSsUq8vIKc9tcP7 CAHYepOW8PTI9RQbTMBNFrkpE1llXcYpVP0qPNeAOJC2JOc63VzWrXfphm4994xnd8J+ VwuOWKorgzvysB3vFUgsAL4TE6U9IDtuNYzlEbuWIXWb4mqc3t7096YKOZZjYMXLXHoe fEvA== X-Gm-Message-State: AEkoousZbaB6dZAWRQULoBAbjOhRW7Euj8qALplRsMDkaefO3Kn3f366JTlPZ+/iW2jj7Q== X-Received: by 10.25.215.145 with SMTP id q17mr16410128lfi.30.1469888840609; Sat, 30 Jul 2016 07:27:20 -0700 (PDT) Received: from localhost.localdomain (c80-217-8-99.bredband.comhem.se. [80.217.8.99]) by smtp.gmail.com with ESMTPSA id l19sm3609055lfi.24.2016.07.30.07.27.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Jul 2016 07:27:19 -0700 (PDT) From: codekipper@gmail.com To: maxime.ripard@free-electrons.com Date: Sat, 30 Jul 2016 16:27:16 +0200 Message-Id: <20160730142716.29377-3-codekipper@gmail.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160730142716.29377-1-codekipper@gmail.com> References: <20160730142716.29377-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 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 Acked-by: Maxime Ripard --- 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)