From patchwork Sat Oct 13 03:32: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: 983416 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="KdtW2mQp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42X9JH6NK3z9sBZ for ; Sat, 13 Oct 2018 14:32:47 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726097AbeJMLIO (ORCPT ); Sat, 13 Oct 2018 07:08:14 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42339 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725970AbeJMLIO (ORCPT ); Sat, 13 Oct 2018 07:08:14 -0400 Received: by mail-pg1-f194.google.com with SMTP id i4-v6so6679505pgq.9 for ; Fri, 12 Oct 2018 20:32:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=7+z1b6zsQ3LAl9a8AE2UXWL1W3JeMoFLQb3iIALE3Fw=; b=KdtW2mQpl4OhaCABQj6yuE/W50yIb+TI7mg1GrUq3+JxwPF5QExEI8fUZvRp1JU38R 1bG1nU5lnXJJbB/Wl1odlaXezIfcE5gzVXV/fKBb1tewnmaurK2YPaAccrRe+16jWWSe f9jOwb3vNCQEgkJiynJliSLWgZSVPjvYVzA3NFUsKqA/l7OIBWaEz2kL/ukZlwumVmfh CBFlfMeh2ENkAwMZF9qgoteOV1R+dMcM+ROdX5JUpzZY6o3dhQa3OXuEc8OmpPaRNSnj pIxgYRfSt7jcXgjrCpn1MqYiABOb27zYKmVNJZ18Ou994B8fo7rudCzk4B1AGLkarzGO kcrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7+z1b6zsQ3LAl9a8AE2UXWL1W3JeMoFLQb3iIALE3Fw=; b=aJFmMw/1vTU6xu1oCLzwn1aj5yIDHQRaA9+lkS2106RWiTa/YsFG+H7TJEqWL7DUx8 /5XDXpJ1JTupDLdndJ0TbtTv+eW+B0uLZdDz9K7ld1EmgZWM7Gb8alUmeg/xjSqMZsoV jisBg6I4aemUJyGPIsoRpTDf/R6A3Grr206DZCwcmuCdvcbbPGw/rV1bb7vV9PFFMsyd WGvTmx3F2oThOl47Q2A/njfGjUo5xOHlE5UYc9CLph4O+q7PfT0pUx7Z/mo0VAmBRzka CkGYWXQtLrC6ve4C1yF255V3QluQ8iNVv8whd7FCVGfzmAcT45SzdTBinn/0GsJhHSGO XeQQ== X-Gm-Message-State: ABuFfoiWhBGYqTt+xSoyPjycED251mXVWSWXVrLvJgC1biipJ7pld9Cz MA5/vjocYkPTeSXL0AD3mcU= X-Google-Smtp-Source: ACcGV60gcJT1iLXWgcgaMLC4K8b85mOXwB3fJA6hJMHZfHDvMgiNWa5IJ3Atvw2Ct/XELUlxOWHKbg== X-Received: by 2002:a63:565d:: with SMTP id g29-v6mr7829689pgm.227.1539401565789; Fri, 12 Oct 2018 20:32:45 -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 u79-v6sm5565039pfi.104.2018.10.12.20.32.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 20:32:44 -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 Subject: [PATCH 01/10] ASoC: sun4i-i2s: Add compatibility with A64 codec I2S Date: Fri, 12 Oct 2018 20:32:21 -0700 Message-Id: <20181013033230.6506-2-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181013033230.6506-1-anarsoul@gmail.com> References: <20181013033230.6506-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 Reviewed-by: Chen-Yu Tsai --- .../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..9d81f965f666 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-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-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..787b67c4f845 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_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-i2s", + .data = &sun50i_a64_i2s_quirks, + }, {} }; MODULE_DEVICE_TABLE(of, sun4i_i2s_match);