From patchwork Sun Dec 3 20:41:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 10089377 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 685486035E for ; Sun, 3 Dec 2017 20:42:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7069D28DD1 for ; Sun, 3 Dec 2017 20:42:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 63DB528DE5; Sun, 3 Dec 2017 20:42:43 +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 C656928DD1 for ; Sun, 3 Dec 2017 20:42:42 +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=iLtuqbibnc09pTDwvuYe7OwRLd27i/35rhGWh5GLRyA=; b=ArWQC4sS6zJXgyF7nbN7tTiqUr gbjnRoC89OHa3b5H/kcJsUSWERaNRKggAeG+KOWMhm1vscxiTCc5Tv5qGB4XmMClx1bAAmBJ4LNXN 8x4/CNymZYt+KTAMZw5PJKrjEbzFt2JVQ9SEPxKTqZctK2Aw8uZiYB0K+CtG3UdTDk6XrOAPd4Nz5 qgcclkP/YmFMNqqkbZ/zV7FhBnl6OhZEzx7Hz1SVMbG4KG3tEwezi5kIx77Mbl0XRSZUZFgRzpaWJ /ksYQN6rFfE0F9gfRbBunqcbbT2d8V30kLuQMC0qj3uc1Duo+s6gfH/zS014CSLgRYDjIo0n2VKVN vPMdjZxw==; 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 1eLb61-0007GK-Sd; Sun, 03 Dec 2017 20:42:41 +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-00070F-0S for linux-arm-kernel@lists.infradead.org; Sun, 03 Dec 2017 20:42:24 +0000 Received: by mail-pf0-x244.google.com with SMTP id a90so7002212pfk.1 for ; Sun, 03 Dec 2017 12:42:04 -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=Td3pG3bjV0NN0Q1fI7c6kZ5vED70qZl0wMhUg0AsBSs=; b=UJPtTxJh4xEed/iG0dby3cmiBz6YOfBsA/8KdYC5IZBPM+aANIjO5SDAmjw4+f1iFq seQBE48TbCL7qBVaxz8DX/OFbY55ZtVquFc7xy0K5oQ9Xu8nZh70lnUHMYLzhvdBqGnM JzAm/ACoGa2oTmzakU4XcFF+Nr6krrQgOoWNTkSIC7OXpHFhJyhCvOZvOVGSB83eJfk/ WjScXPSrWxCUX4Ws3MTQICn6jhr06cTANlEP5PQTgrRU7qpXJZ90rkz8kGSWnE1q0CL7 aVZWQtiapu6aPl4/Tue1buR3LS+nRRYMAbvPuchLEI4QV1tXxe5RL86cBSYTTlfZ1tz9 sS7w== 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=Td3pG3bjV0NN0Q1fI7c6kZ5vED70qZl0wMhUg0AsBSs=; b=auvHzGuKF/rzreGYrNVfacZzZe2BQKP9mASfOOUKIVq6/qhooBINX+9SsOzwt2nAw8 J1W6XbUq+oRwkNNGsbxK7XmnvhS7keaF+bzz2+EMHe7tgVs/G1GSgjsxJhUmiNUEwutc sibFKcHBO4ZsbWmzRrC4WtvyuwaIwZfdO1aL+KhdPMVfSZi+3LEwn6ZhpkwD6AQRnG9l 9ygCVNf/vmwSQaafhB5FBjj5lrNxulssSpy4dg0r/NneaSC+SEMC9PigngA/rTOrQDi7 yxmRjIgj3cpYldHSLe6ReN9KHGiTormBWwQcpL4A/5p6jz5c5lQuuv010wpDzigFbI7p WPdg== X-Gm-Message-State: AJaThX5Kp1Zs2YavVCT1Ee5A2WlGOKOuYyJUTVoe85pH/oR+48pXFCPR 1MGEdavMgzjIh/dXRct9tPU= X-Google-Smtp-Source: AGs4zMZiiBGEZSbTavcpG0sjQlTE7xvN024uygdUP3Esem/XBrotJ9yAkPvqzL7q47+LrFlaUEhWJg== X-Received: by 10.101.82.203 with SMTP id z11mr11960965pgp.404.1512333723794; Sun, 03 Dec 2017 12:42:03 -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.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Dec 2017 12:42:03 -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 2/9] ASoC: sun4i-i2s: Add compatibility with A64 codec I2S Date: Sun, 3 Dec 2017 12:41:50 -0800 Message-Id: <20171203204157.20829-3-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_186150_9F3BDE7B X-CRM114-Status: GOOD ( 11.93 ) 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 From: Marcus Cooper The I2S block used for the audio codec in the A64 is very similar to what is used by the A10(sun4i) devices. However, its TX FIFO is located at a different address. [vasilykh: - added fixed_wss and wss_value to A64 quirks, - changed compatible to 'allwinner,sun50i-a64-acodec-i2s, since A64 has 3 more I2S blocks that are not compatible with audio codec I2S] Signed-off-by: Marcus Cooper Signed-off-by: Vasily Khoruzhick --- .../devicetree/bindings/sound/sun4i-i2s.txt | 2 ++ sound/soc/sunxi/sun4i-i2s.c | 23 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt index 05d7135a8d2f..ab86f266962a 100644 --- a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt +++ b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt @@ -9,6 +9,7 @@ Required properties: - "allwinner,sun4i-a10-i2s" - "allwinner,sun6i-a31-i2s" - "allwinner,sun8i-h3-i2s" + - "allwinner,sun50i-a64-acodec-i2s" - reg: physical base address of the controller and length of memory mapped region. - interrupts: should contain the I2S interrupt. @@ -24,6 +25,7 @@ Required properties: Required properties for the following compatibles: - "allwinner,sun6i-a31-i2s" - "allwinner,sun8i-h3-i2s" + - "allwinner,sun50i-a64-acodec-i2s" - resets: phandle to the reset line for this codec Example: diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 54c16eb64713..2c060e015725 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -942,6 +942,25 @@ static const struct sun4i_i2s_quirks sun8i_h3_i2s_quirks = { .field_rxchansel = REG_FIELD(SUN8I_I2S_RX_CHAN_SEL_REG, 0, 2), }; +static const struct sun4i_i2s_quirks sun50i_a64_acodec_i2s_quirks = { + .has_reset = true, + .reg_offset_txdata = SUN8I_I2S_FIFO_TX_REG, + .sun4i_i2s_regmap = &sun4i_i2s_regmap_config, + .has_slave_select_bit = true, + .fixed_wss = true, + .wss_value = 3, + .field_clkdiv_mclk_en = REG_FIELD(SUN4I_I2S_CLK_DIV_REG, 7, 7), + .field_fmt_wss = REG_FIELD(SUN4I_I2S_FMT0_REG, 2, 3), + .field_fmt_sr = REG_FIELD(SUN4I_I2S_FMT0_REG, 4, 5), + .field_fmt_bclk = REG_FIELD(SUN4I_I2S_FMT0_REG, 6, 6), + .field_fmt_lrclk = REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7), + .field_fmt_mode = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 1), + .field_txchanmap = REG_FIELD(SUN4I_I2S_TX_CHAN_MAP_REG, 0, 31), + .field_rxchanmap = REG_FIELD(SUN4I_I2S_RX_CHAN_MAP_REG, 0, 31), + .field_txchansel = REG_FIELD(SUN4I_I2S_TX_CHAN_SEL_REG, 0, 2), + .field_rxchansel = REG_FIELD(SUN4I_I2S_RX_CHAN_SEL_REG, 0, 2), +}; + static int sun4i_i2s_init_regmap_fields(struct device *dev, struct sun4i_i2s *i2s) { @@ -1146,6 +1165,10 @@ static const struct of_device_id sun4i_i2s_match[] = { .compatible = "allwinner,sun8i-h3-i2s", .data = &sun8i_h3_i2s_quirks, }, + { + .compatible = "allwinner,sun50i-a64-acodec-i2s", + .data = &sun50i_a64_acodec_i2s_quirks, + }, {} }; MODULE_DEVICE_TABLE(of, sun4i_i2s_match);