From patchwork Sat Oct 13 16:53:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 983579 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fKCMt6A/"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42XW5L4g1lz9sCm for ; Sun, 14 Oct 2018 03:54:30 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726464AbeJNAcV (ORCPT ); Sat, 13 Oct 2018 20:32:21 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36550 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726329AbeJNAcU (ORCPT ); Sat, 13 Oct 2018 20:32:20 -0400 Received: by mail-pf1-f194.google.com with SMTP id l81-v6so7684269pfg.3 for ; Sat, 13 Oct 2018 09:54:27 -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=qG6QWtKIuzDYWSHXOcuwaWHfSliZPpSCA0nPwEReY3E=; b=fKCMt6A/jTsAdkFcvVahGFJjeFXVVAHpjV9WpOeP5VxrTgVR2bM5NVPmo7zEvIigCE kgI4hTN5jKD4CcKbi39gtCXqBQoQ0ZbwOcEoaepH6S+KzkVdYB5JvXyMK3jtHSQowyrd QOm8h8Zxt1JEou17uZR2nV+SvXVeflhghMPMQKNRdtCkqJZT9NxGpQuWHKuYXh2r27qi IxSeKiKfR3snO20VNTlIRWBbDKu4X0BcxLVrRUDrX/gnxxYUdr5oaYUDYw/X6Py8e5bi UFzhzSh/BWxcECsYWlJ6oPR+NCdsCRO+W9FKV1FMGAlTWHKzwUrA0Z1p2RWDgPgFFFTh dGFA== 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=qG6QWtKIuzDYWSHXOcuwaWHfSliZPpSCA0nPwEReY3E=; b=TYLrblCrmy5wqyiyYM1A3uJZzm3LEkztbEPBQxS/jtbgy71iJ7ZQ3VKFacnIRGS8kx lJ4RaYHElPPUEQG4li3QaxWlhxpXzyuXo8iIAUlgnB2tA/Ero2NtSSvm7gtUCFAy7U3E hnKZu1ii3903998sHp6m5x6jw65jnVxxWSsv0PZogyeez1nBJ2PX4OqAlpa1Y4me7UzX GYp6iD5o+zpMpOxWdZ9TShi7W5GX87g2O0wWrB2smbbtSMHfUccFFvCgMd/SSberqdY3 s5pM4lPo0S838eAWQzmHrrUHpTvfDDwm41GEsflYc3lraNNtQ5xkhPxvZj4AnqLoF0GL cb9g== X-Gm-Message-State: ABuFfoiCU2Pko/uakEA/nKq9+cyQhxEq883aOwiAq46ZxJADwyiKv8UY ubFHGtaErzV6C4xZitwMwgU= X-Google-Smtp-Source: ACcGV62zpe6iZoc71XR8D9hnoEW9EvQ+ISEfloxrUyd+1mRhDwBv319OJaOFsS2T6yjtcJVYINC2Gw== X-Received: by 2002:a65:6295:: with SMTP id f21-v6mr9968879pgv.167.1539449667508; Sat, 13 Oct 2018 09:54:27 -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 n82-v6sm8727514pfg.21.2018.10.13.09.54.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Oct 2018 09:54:26 -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 Cc: Vasily Khoruzhick Subject: [PATCH v2 1/9] ASoC: sun4i-i2s: Add compatibility with A64 codec I2S Date: Sat, 13 Oct 2018 09:53:21 -0700 Message-Id: <20181013165329.13363-2-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181013165329.13363-1-anarsoul@gmail.com> References: <20181013165329.13363-1-anarsoul@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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 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); From patchwork Sat Oct 13 16:53:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 983580 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Igr12yiz"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42XW5P0tDZz9sCW for ; Sun, 14 Oct 2018 03:54:33 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726329AbeJNAcY (ORCPT ); Sat, 13 Oct 2018 20:32:24 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40569 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbeJNAcX (ORCPT ); Sat, 13 Oct 2018 20:32:23 -0400 Received: by mail-pg1-f196.google.com with SMTP id n31-v6so7236767pgm.7 for ; Sat, 13 Oct 2018 09:54:30 -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=+zU3F+3HUNskC02tr5l8egTduscDKoYaVaz1eaU76RY=; b=Igr12yizNmzIA16OihYlDAHa/phr8FSMvSSS6XLOIs5rWxqONyR+iYAHqETI22ZFa+ STIQZfR/LGN6dH+liXOMYmPcyURJJTRElqU2c6aGXEyOin1ru+GqY3w7njZTYfcfbxge AY2V7i2CTfyA0blV0uzepiPMCjAP9rIgOvePJfBC9ZnB4/3u2/SdD+nca1Xoxo06ev/5 HOca3JmpDRh9JkJVneu3SS7B+enjJZAKlXJa1ALswaZuBqCHe9pjDkOTMme22TTOvLyj UdHI1pfn/h/Jfeq9DXHvwwRt3X+x+cSfda6lilLGrnx4DuCLkAGcOjN9iETE7ZCXMm6k 3nvg== 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=+zU3F+3HUNskC02tr5l8egTduscDKoYaVaz1eaU76RY=; b=fYoeqnfYjwkWb14awPy+QjdLqqsxD6LzNyMTtP9PhHWfs2UF77cC3zhdMRtiz32y2K XxJrdcxR60+aVFQlyPvqw0Btonx5ulWPUp9QZvve/oW0hAdMHoJImy5oUQBSV3+z16Ow dihQbn1xG5Wzm6arDUpXoaUuhUUsvAXmgdMnjwHRqrktTBR68XUBWXJRaZ4qLLcs5AU6 FyfIaTdvd2t+LK9dEAuNgAZISwP/i69wtPvJlsD8A3DDC5pr8XxUnwcsr7rAJ9Y4nWq6 fIElqfdX8MTmd6ebsnmIjzTCuqcqAko/Ls8hpgPgSFEojvwAjZrDwUwyKD+cQOci5px/ HdUQ== X-Gm-Message-State: ABuFfohM1tioJZnsCOYZbIv3jdxQGoD/l4FZ07ooh8pxA0bzbnsE+l1J nyKS9MaLPrwW5roQ1Ad7N5A= X-Google-Smtp-Source: ACcGV63eQ/rzUOOqHHlkxZCbkUxwFNb5NfiV4UykVlYY2Sxwr1GcmteAu3xcILHmvxpDcO2/lchGEQ== X-Received: by 2002:a63:fd09:: with SMTP id d9-v6mr10105257pgh.164.1539449670444; Sat, 13 Oct 2018 09:54:30 -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 n82-v6sm8727514pfg.21.2018.10.13.09.54.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Oct 2018 09:54:29 -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 Cc: Vasily Khoruzhick Subject: [PATCH v2 4/9] ASoC: dt-binding: Add bindings for Allwinner A64 codec's analog path controls Date: Sat, 13 Oct 2018 09:53:24 -0700 Message-Id: <20181013165329.13363-5-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181013165329.13363-1-anarsoul@gmail.com> References: <20181013165329.13363-1-anarsoul@gmail.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The internal codec on Allwinner A64 is split into 2 parts. The analog path controls are routed through an embedded custom register bus accessed through the PRCM block just as on A23/A33/H3. Add a binding for this hardware. Signed-off-by: Vasily Khoruzhick Acked-by: Maxime Ripard --- .../bindings/sound/sun50i-codec-analog.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt diff --git a/Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt b/Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt new file mode 100644 index 000000000000..4f8ad0e04d20 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/sun50i-codec-analog.txt @@ -0,0 +1,12 @@ +* Allwinner A64 Codec Analog Controls + +Required properties: +- compatible: must be one of the following compatibles: + - "allwinner,sun50i-a64-codec-analog" +- reg: must contain the registers location and length + +Example: + codec_analog: codec-analog@1f015c0 { + compatible = "allwinner,sun50i-a64-codec-analog"; + reg = <0x01f015c0 0x4>; + };