From patchwork Sun Dec 3 20:41:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 10089381 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 946236035E for ; Sun, 3 Dec 2017 20:42:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D85228DD1 for ; Sun, 3 Dec 2017 20:42:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90C0E28DE5; Sun, 3 Dec 2017 20:42:59 +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.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D3E728DD1 for ; Sun, 3 Dec 2017 20:42:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ekYCgPof3V8Kin89ylvB04Q5zYj8FBMshm2SL3Jbk7g=; b=EXF9wObrPuZzltYKsafLyBpvsk k0OjPCJHxEdc4cG2lnlsPE9xaHAGcPUyzkvhtdcKcax8tFZvn4UnIRdUiWi9jW+4dg7ZnrT9EL7KR KUoUtgSfn2CSmdVeyqiEajuFb83TUZxG0dbBNN2U4JaSP77ArE0sQI442AOUunWHFQfyISH0ivvYT EA7MyDipKyCnVcA6ckUICT55j+UGG/pgjINIBA3l1AG+06AXScX2zPHyKHcSQaDW7GVNHw7lXHopX 2pRdZdfcJv0nN6eYFP8xW0piEDuexjWrr2TSmne+9BQyQTHiOjQv8+iLKskAtTseT/lh4Xs7hqOC6 oCBtZu6Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eLb6I-0007Z5-7v; Sun, 03 Dec 2017 20:42:58 +0000 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eLb5j-00070H-0W for linux-arm-kernel@lists.infradead.org; Sun, 03 Dec 2017 20:42:26 +0000 Received: by mail-pf0-x244.google.com with SMTP id l24so6987432pfj.6 for ; Sun, 03 Dec 2017 12:42:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Leq5VksJzs15/gRYUInoknpFtYZJ6a1Q8N6YOcgtS5k=; b=HMGNTZpSLJrITEuVfUhvSGMO5k38KmKB5IjYdsaa/Pux43YUPpR45rqS8EE9CsmbKU saXAfBoAnJ4jRKlgpFb8S4Ft7Ya/IV64KVwQCRv4dqwohgP7RdG2ANoPZlurayApoRjr 9hOSHLaW+VTd97dmGaXgS1JAiCRJKZ9hAnqmy2CeM6V/S90gdcxtz2zTULZscldDl3Wp F2e2mLjbK6+zleOL824s+Bn4bPLOJBnvc+IRSZoebWmVWplcmLqMbXNr2F5FgpQ0NMV6 0INdabKnLa3imD/2TEP1GDW/fCv5M+e2U/DL1etcwZykB00i/gjJ1ToLNa7pc9pdRnmf maDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Leq5VksJzs15/gRYUInoknpFtYZJ6a1Q8N6YOcgtS5k=; b=nK3d4E8UqsDRlgNmAxjjqeMfLxhX7W9OvDhHZL4JvZ6PlYSneD9gKBNFEq5Xx2wd3w D+8Cz1gHl+VVefrC2y3vy2yT+/xW0bSpsv4DpKOxWxP9cw2jy3f9mNvAu/8m3AGxCZDi gQdOtrIYEhpI63DiyLZSEwmYmxMQBu8lbRQackGs1ZULBxbBQ6/400B/lwlrzAQ9IvJR KwS5+7H+0Q0Jpbe5G5s9mOO7HzU583RQymVz8lrlFUOGwIoNgE2UyCXxs3qIFomnUCxV 5DZkUAnFCejNmL73fbPq9FUVVVuEMNYd6DJc0PP3aYJiObxk/uysmw37W9Lww7hhL2yn TkWw== X-Gm-Message-State: AJaThX6Si39L+kiUf7d+XOHBFZ+bUGpo9M4ayzJm+QzTbBq8q2AkKEyi GseSd9Xjo2aF0TBQxnQcB1s= X-Google-Smtp-Source: AGs4zMaB1Dr2MKWaJyADCEEfy/4KySkB7DESpNLFHro28URMn2geyG7dw+OrmzZs9WoM8sYC51Dk5g== X-Received: by 10.84.172.195 with SMTP id n61mr12523205plb.49.1512333725988; Sun, 03 Dec 2017 12:42:05 -0800 (PST) Received: from anarsoul-thinkpad.lan (216-71-193-140.dyn.novuscom.net. [216.71.193.140]) by smtp.gmail.com with ESMTPSA id z25sm19264929pfe.121.2017.12.03.12.42.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Dec 2017 12:42:05 -0800 (PST) From: Vasily Khoruzhick To: Liam Girdwood , Mark Brown , Maxime Ripard , Chen-Yu Tsai , Marcus Cooper , =?UTF-8?q?Myl=C3=A8ne=20Josserand?= , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/9] ASoC: sun8i-codec: Add support for A64 SoC Date: Sun, 3 Dec 2017 12:41:52 -0800 Message-Id: <20171203204157.20829-5-anarsoul@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171203204157.20829-1-anarsoul@gmail.com> References: <20171203204157.20829-1-anarsoul@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171203_124223_155912_6BABC2E9 X-CRM114-Status: GOOD ( 12.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasily Khoruzhick 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 Digital part of audio codec block in the A64 is very similar to what is used by the A33(sun8i) devices. However, it uses different LRCK divider. Signed-off-by: Vasily Khoruzhick --- .../bindings/sound/{sun8i-a33-codec.txt => sun8i-codec.txt} | 6 ++++-- sound/soc/sunxi/sun8i-codec.c | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) rename Documentation/devicetree/bindings/sound/{sun8i-a33-codec.txt => sun8i-codec.txt} (91%) diff --git a/Documentation/devicetree/bindings/sound/sun8i-a33-codec.txt b/Documentation/devicetree/bindings/sound/sun8i-codec.txt similarity index 91% rename from Documentation/devicetree/bindings/sound/sun8i-a33-codec.txt rename to Documentation/devicetree/bindings/sound/sun8i-codec.txt index 2ca3d138528e..ffcf9079a67c 100644 --- a/Documentation/devicetree/bindings/sound/sun8i-a33-codec.txt +++ b/Documentation/devicetree/bindings/sound/sun8i-codec.txt @@ -1,7 +1,7 @@ Allwinner SUN8I audio codec ------------------------------------ -On Sun8i-A33 SoCs, the audio is separated in different parts: +On Sun8i-A33 and Sun50i-A64 SoCs, the audio is separated in different parts: - A DAI driver. It uses the "sun4i-i2s" driver which is documented here: Documentation/devicetree/bindings/sound/sun4i-i2s.txt @@ -16,7 +16,9 @@ On Sun8i-A33 SoCs, the audio is separated in different parts: This bindings documentation exposes Sun8i codec (digital part). Required properties: -- compatible: must be "allwinner,sun8i-a33-codec" +- compatible: should be one of the following: + - "allwinner,sun8i-a33-codec" + - "allwinner,sun50i-a64-codec" - reg: must contain the registers location and length - interrupts: must contain the codec interrupt - clocks: a list of phandle + clock-specifer pairs, one for each entry diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c index 054201d1de03..0e2a5adcfb96 100644 --- a/sound/soc/sunxi/sun8i-codec.c +++ b/sound/soc/sunxi/sun8i-codec.c @@ -52,6 +52,7 @@ #define SUN8I_AIF1CLK_CTRL_AIF1_BCLK_DIV 9 #define SUN8I_AIF1CLK_CTRL_AIF1_LRCK_DIV 6 #define SUN8I_AIF1CLK_CTRL_AIF1_LRCK_DIV_16 (1 << 6) +#define SUN8I_AIF1CLK_CTRL_AIF1_LRCK_DIV_64 (2 << 6) #define SUN8I_AIF1CLK_CTRL_AIF1_WORD_SIZ 4 #define SUN8I_AIF1CLK_CTRL_AIF1_WORD_SIZ_16 (1 << 4) #define SUN8I_AIF1CLK_CTRL_AIF1_DATA_FMT 2 @@ -456,6 +457,10 @@ static const struct sun8i_codec_quirks sun8i_a33_codec_quirks = { .aif1_lrck_div = SUN8I_AIF1CLK_CTRL_AIF1_LRCK_DIV_16, }; +static const struct sun8i_codec_quirks sun50i_a64_codec_quirks = { + .aif1_lrck_div = SUN8I_AIF1CLK_CTRL_AIF1_LRCK_DIV_64, +}; + static int sun8i_codec_probe(struct platform_device *pdev) { struct resource *res_base; @@ -551,6 +556,10 @@ static const struct of_device_id sun8i_codec_of_match[] = { .compatible = "allwinner,sun8i-a33-codec", .data = &sun8i_a33_codec_quirks, }, + { + .compatible = "allwinner,sun50i-a64-codec", + .data = &sun50i_a64_codec_quirks, + }, {} }; MODULE_DEVICE_TABLE(of, sun8i_codec_of_match);