From patchwork Wed Oct 17 07:38:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 10644823 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 853F9109C for ; Wed, 17 Oct 2018 07:39:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 709992A787 for ; Wed, 17 Oct 2018 07:39:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 617872A7AF; Wed, 17 Oct 2018 07:39:35 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 E23142A787 for ; Wed, 17 Oct 2018 07:39:34 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=d/zHGIjiPjcmxY5hG0Cu+Rzrvyd/XxOLB5LhAcB5n3g=; b=EOu9t+poPFWK8G W+lsS4QDlgT9/yjzr2H+IJ+OyAsZy2HkvFyX6DLQz+yjoqETT5uzLX0m/qLkHVIsPbCbIeKetHP4F 7bm4Os8yfpxJLdB2lr/YsK+D1yX6bk3cEOUZH8KyEjCWO9C24/wm2Y15W50EMumC9bwDXBeZJzVZy 5KxCcyvvvJHZeyP3PMbx9PsId/hgzMJ22ydJjgncer/4S4aEm9OnAQ97xuZ+Xb8PnRMSQmihcqOgC QakbT6cpiBtQXX1ALm8J/bBNYegGI3/KU7OSC7Jp7D1pZBSQITVSrMAZTovOd6G6/aH27rDxKFIdM 7PCg5+/TcvnWV7sOix6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCgQN-0006Od-K5; Wed, 17 Oct 2018 07:39:23 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gCgPb-000676-14 for linux-arm-kernel@lists.infradead.org; Wed, 17 Oct 2018 07:38:37 +0000 Received: by mail-pf1-x444.google.com with SMTP id f78-v6so7005334pfe.1 for ; Wed, 17 Oct 2018 00:38:24 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=LLfaoApCIilapor49SHuvnmPFPuwDKtem88kmIG5NmQ=; b=HhgdLyQdQ6shq8AwSheHIXOIL4/S/K1attN/+lW89akDqflPk3bo0qw2pUuaEpxYj3 Z7ix1ElGFBq+WezhenfJwawlLQ4ifNe5MTAqLR/xItcpjqwOoLf7RsQTLM8NX68nlCCX ryMaDghUVKtUMfBBzy+rxZOehJ0PaCsZAUDyaITfksNjNhbiPWnMXN/5jQMRpYGDqUGs kw3ONrwYWwcK4umaJlGGd5ZwGtbiANYSpw6l+NeS9CF+r62uLQGtUR+mbh+B0hWSwBHK OA8zVC5euEkaQi79T478+3IHeWlOeux8cmsuq9S+Dh0GYZ0VstbYS2Fvbro2TrVteXBT eR7g== 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:mime-version:content-transfer-encoding; bh=LLfaoApCIilapor49SHuvnmPFPuwDKtem88kmIG5NmQ=; b=pIWyD5ojZ+qCXgQQKHfEM7OSmOEKPQh5SdQEZ9phZruTK4fIC9p9+kqpnrbvd9MjYy GbfwmnE4OfIwdyx4nCgy4COFOwy2ta2yV/SYWcGdhp8LRo2MSWNTD8vNrFbJlixhfxK6 Iol1S0PiY5N63mY148dOEHAoN9F3xTQLihEnl15i0uLPbZzAFeejKh28N0oUDzYVd+XS Hj2t2giebC1azbOxHYwvOBVY99tsqYIcIFWNC7BTd4Pj79xLpYX2g2wAZUMWSze1v4uq XS6PCv+I6y+JU9wNGGB3YA1NANcG2r6V0pr4yi3WZZVjRfckiRYiesM2GuNOgjpHw9YR roJQ== X-Gm-Message-State: ABuFfoh8v+OJ4CZltQNpqigmXB49safh5M5OtOLza/5Lfv597db/LLe8 cvDsDFdFWzuvotR4dXv4Rzg= X-Google-Smtp-Source: ACcGV60bTGxuA7Numa0YvbDLUoFLNsAIEbEkn2fep7R3bUzTXHQ+Rt3YBSx9+0D8X7jeFZLFX/sW8g== X-Received: by 2002:a62:d286:: with SMTP id c128-v6mr25422562pfg.14.1539761904430; Wed, 17 Oct 2018 00:38:24 -0700 (PDT) Received: from anarsoul-thinkpad.lan (216-71-193-140.dyn.novuscom.net. [216.71.193.140]) by smtp.gmail.com with ESMTPSA id o12-v6sm23426387pfh.20.2018.10.17.00.38.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Oct 2018 00:38:23 -0700 (PDT) From: Vasily Khoruzhick To: Liam Girdwood , Mark Brown , Rob Herring , Mark Rutland , Maxime Ripard , Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Mylene JOSSERAND , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jerome Brunet Subject: [PATCH v5 1/9] ASoC: sun4i-i2s: Add compatibility with A64 codec I2S Date: Wed, 17 Oct 2018 00:38:05 -0700 Message-Id: <20181017073813.14127-2-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181017073813.14127-1-anarsoul@gmail.com> References: <20181017073813.14127-1-anarsoul@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181017_003835_096402_381B93D5 X-CRM114-Status: GOOD ( 14.61 ) 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 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 differs from other 3 I2S modules in A64 and isn't compatible with H3. But it is very similar to what is found in A10(sun4i). However, its TX FIFO is located at a different address. Signed-off-by: Marcus Cooper Signed-off-by: Vasily Khoruzhick Acked-by: Maxime Ripard --- .../devicetree/bindings/sound/sun4i-i2s.txt | 2 ++ sound/soc/sunxi/sun4i-i2s.c | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt index b9d50d6cdef3..61e71c1729e0 100644 --- a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt +++ b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt @@ -10,6 +10,7 @@ Required properties: - "allwinner,sun6i-a31-i2s" - "allwinner,sun8i-a83t-i2s" - "allwinner,sun8i-h3-i2s" + - "allwinner,sun50i-a64-codec-i2s" - reg: physical base address of the controller and length of memory mapped region. - interrupts: should contain the I2S interrupt. @@ -26,6 +27,7 @@ Required properties for the following compatibles: - "allwinner,sun6i-a31-i2s" - "allwinner,sun8i-a83t-i2s" - "allwinner,sun8i-h3-i2s" + - "allwinner,sun50i-a64-codec-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 daa6c08cffbc..d5ec1a20499d 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -950,6 +950,23 @@ 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_codec_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, + .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) { @@ -1158,6 +1175,10 @@ static const struct of_device_id sun4i_i2s_match[] = { .compatible = "allwinner,sun8i-h3-i2s", .data = &sun8i_h3_i2s_quirks, }, + { + .compatible = "allwinner,sun50i-a64-codec-i2s", + .data = &sun50i_a64_codec_i2s_quirks, + }, {} }; MODULE_DEVICE_TABLE(of, sun4i_i2s_match);