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: 9253209 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 854E46077C for ; Sat, 30 Jul 2016 15:58:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7737128440 for ; Sat, 30 Jul 2016 15:58:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BB5828445; Sat, 30 Jul 2016 15:58:50 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 316B528440 for ; Sat, 30 Jul 2016 15:58:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bTWdt-0005Lj-Ph; Sat, 30 Jul 2016 15:57:37 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bTWdN-0004sr-Jc for linux-arm-kernel@lists.infradead.org; Sat, 30 Jul 2016 15:57:07 +0000 Received: by mail-lf0-x243.google.com with SMTP id l89so6626752lfi.2 for ; Sat, 30 Jul 2016 08:56:45 -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=Z1qzOjPdQlw7enuWAjhQdS5k1fY2RA2mX+iUlG8qZ7sp08HwRNHWuP2MEmLB7SZsoq d8ESaM2jtz+P8rZm7oEdp6W1o8+XH5AuXogXD5RrjjJeUyFD6gqtmz2FbSUJyIamm8tE I2+OwNxMJIM7pO3mgak6a7nSqHxzNl/fiWmK048mHEnK2JH5HQPC9Ut3GsgjmeH/j8Kw pBx7J9UbLWLp4WIG1WRfTsgo9kHZ1X6gqbIwvwBxaZRHXyYLk9B1os37N97NC9gpFkYl ERn5Ti7AOJ4nJFsaQIyBFjetWX1dKXZ2saGotZKGBQEXe97OT/gh+9C37+GM56kHYJZ1 hm4Q== X-Gm-Message-State: AEkoous9Cz3bzbfFHvt09O1xTZNOmtDhzd1f9MTUHJ7534p7vcY8JorIJRg/AkUfjd8LtA== 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 Subject: [PATCH v2 2/2] ASoC: sunxi: compatibility for sun6i to SPDIF 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160730_085705_945904_441AC0F5 X-CRM114-Status: GOOD ( 17.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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)