devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vasily Khoruzhick <anarsoul@gmail.com>
To: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Maxime Ripard <maxime.ripard@bootlin.com>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Marcus Cooper <codekipper@gmail.com>,
	Mylene JOSSERAND <mylene.josserand@free-electrons.com>,
	alsa-devel@alsa-project.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Jerome Brunet <jbrunet@baylibre.com>
Cc: Vasily Khoruzhick <anarsoul@gmail.com>
Subject: [PATCH v2 1/9] ASoC: sun4i-i2s: Add compatibility with A64 codec I2S
Date: Sat, 13 Oct 2018 09:53:21 -0700	[thread overview]
Message-ID: <20181013165329.13363-2-anarsoul@gmail.com> (raw)
In-Reply-To: <20181013165329.13363-1-anarsoul@gmail.com>

From: Marcus Cooper <codekipper@gmail.com>

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 <codekipper@gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
 .../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 ed30d30ac720..83374617962c 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -967,6 +967,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)
 {
@@ -1175,6 +1192,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);
-- 
2.19.0

  reply	other threads:[~2018-10-13 16:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-13 16:53 [PATCH v2 0/9] Add support for audiocodec in Allwinner A64 Vasily Khoruzhick
2018-10-13 16:53 ` Vasily Khoruzhick [this message]
2018-10-15  8:18   ` [PATCH v2 1/9] ASoC: sun4i-i2s: Add compatibility with A64 codec I2S Maxime Ripard
2018-10-19 16:14     ` Vasily Khoruzhick
2018-10-19 16:16       ` Vasily Khoruzhick
2018-10-13 16:53 ` [PATCH v2 2/9] ASoC: sun8i-codec: Don't hardcode BCLK / LRCK ratio Vasily Khoruzhick
2018-10-15  7:07   ` Maxime Ripard
2018-10-15 15:14     ` Vasily Khoruzhick
2018-10-13 16:53 ` [PATCH v2 3/9] ASoC: sun8i-codec-analog: split regmap code into separate driver Vasily Khoruzhick
2018-10-15  8:24   ` Maxime Ripard
2018-10-13 16:53 ` [PATCH v2 4/9] ASoC: dt-binding: Add bindings for Allwinner A64 codec's analog path controls Vasily Khoruzhick
2018-10-15  8:18   ` Maxime Ripard
2018-10-13 16:53 ` [PATCH v2 5/9] ASoC: sunxi: Add new driver " Vasily Khoruzhick
2018-10-15  8:24   ` Maxime Ripard
2018-10-13 16:53 ` [PATCH v2 6/9] ASoC: sunxi: allow the sun8i-codec driver to be built on ARM64 Vasily Khoruzhick
2018-10-15  7:31   ` Maxime Ripard
2018-10-13 16:53 ` [PATCH v2 7/9] arm64: dts: allwinner: a64: add nodes necessary for analog sound support Vasily Khoruzhick
2018-10-13 16:53 ` [PATCH v2 8/9] arm64: dts: allwinner: a64: enable sound on Pine64 and SoPine Vasily Khoruzhick
2018-10-13 16:53 ` [PATCH v2 9/9] arm64: dts: allwinner: a64: enable sound on Pinebook Vasily Khoruzhick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181013165329.13363-2-anarsoul@gmail.com \
    --to=anarsoul@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=codekipper@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=mylene.josserand@free-electrons.com \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).