From patchwork Tue Oct 16 03:02:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 984508 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="JwM5oLLs"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Z0VM3vkCz9sj4 for ; Tue, 16 Oct 2018 14:02:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727099AbeJPKu5 (ORCPT ); Tue, 16 Oct 2018 06:50:57 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46656 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726987AbeJPKu5 (ORCPT ); Tue, 16 Oct 2018 06:50:57 -0400 Received: by mail-pl1-f195.google.com with SMTP id v5-v6so10234794plz.13 for ; Mon, 15 Oct 2018 20:02:49 -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=o+XXIb2+wNPQqRZWe0Ij8weMFzD9QZHAY2GG5+KDACg=; b=JwM5oLLsbPKvNXptXYRLZFA0Q9bxpfqSVrYE3yupQrUC0+D1sGKfjwQfn8IELcx4A8 HNlm/jJyX3NPbb2A3glEHrr9PAQOQDJlSaOVV/eW86AVwlL3oC+/VHQa8SsbysabJksS rBT6/UUb7PABMXVAAO4WX9FDA/IbR+i9NNU9KHaS7L/0G4LphYY8bhJpxoVj9E9pj3o6 xYApdq5DDhiefFcVz6K6OZFOPzcKop06ziAYMVxbwKkePSXbBXPbO1QkEsr0B0FyVxku TaPJZLAYRexxp/Fla0X9e8n8SzhYL/GSCSnXzoJQmdIWHmfpG0gv6/0d6cxPt2TgXrEU 7TcQ== 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=o+XXIb2+wNPQqRZWe0Ij8weMFzD9QZHAY2GG5+KDACg=; b=go+W+sfeiiSDx908XyffQnkNKpybZq8ImPmHWJER+Sszf9BUTbdrpS9FZQ2sZiZaCs 1rNlmNlEaVvcDo6y+7lqDIKdF7C+pjJqZWAWpq8Qcfsfvy5Kc8Y28Ta6XuKhKzxpIE/D /O1AizVXS5Q3TKN+2BWlCC2SPecbWNHWOUPNHV8PeTsNkfp+DhVUdsgqx5DBj8R7cypb y2xsFifvLYr1bqb7vt1vk/lN1Fd/qr/PSs7831u6xzQJ/MeIM00J6sLg17aStexBly0F MQVXI/XOENf0Cj0Erqsokq9DY6C1CzGDPIV8utH+nf4MlXPv/yaR6rq7kB1SKWCLomUT Xy7w== X-Gm-Message-State: ABuFfojgFDgQ85U0Htkz26xjtYRv1ViKRqU9aFr26DgxIKT5q1vuTJCe L5u+EMg2TQk0256zq0mIqKU= X-Google-Smtp-Source: ACcGV60qTH9fbUWHNyS9DxKTrFOtgWbDmQG1vgcd3ZNWJCJoiiRfnXUcEzl678FPyJsH3pEdL7f7Xg== X-Received: by 2002:a17:902:ba8d:: with SMTP id k13-v6mr19779877pls.12.1539658968918; Mon, 15 Oct 2018 20:02:48 -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 p18-v6sm12812390pgi.5.2018.10.15.20.02.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 20:02:48 -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 v4 1/9] ASoC: sun4i-i2s: Add compatibility with A64 codec I2S Date: Mon, 15 Oct 2018 20:02:31 -0700 Message-Id: <20181016030239.15449-2-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181016030239.15449-1-anarsoul@gmail.com> References: <20181016030239.15449-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 --- .../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); From patchwork Tue Oct 16 03:02:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasily Khoruzhick X-Patchwork-Id: 984509 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="fsNlFWcS"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42Z0VR5c1Wz9sDX for ; Tue, 16 Oct 2018 14:02:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727454AbeJPKvB (ORCPT ); Tue, 16 Oct 2018 06:51:01 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33392 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727452AbeJPKvA (ORCPT ); Tue, 16 Oct 2018 06:51:00 -0400 Received: by mail-pf1-f196.google.com with SMTP id 78-v6so8300463pfq.0 for ; Mon, 15 Oct 2018 20:02:52 -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=fsNlFWcSK+n0YOY0Awxkfk/+QvKFDZyA7Bn0/RcKHidPnm3kYBqlcyOXJDebu50NWJ mSJExrf6Zvl8gnVc0I+5NFnQ+o/JR525K81ZJoIp3kYe9ZHgPrKp7A0BD07KsoxwbV0O 8GCNwfN5mrwp5vi0JKVklHBQ/IGuvE6J8GSigKMbJJIGByWqAYaAk7yvHbGzPciFLHlc tF5iyY0D2R9iTrWxkSYZFpRLs/EaEvgpJSGBIEvi11fzdS2/5DNFaY+oy0N/wSZgdZdB 9qxbxCzQTCxKDE1ND6FuDwhooa9ocpBSplIHqATc0zYtYYVzoebtJAx8c9nM7m2tRJf/ 2M9g== 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=A/7yfoLAmpBWtK4Wfhyc4+QwuH3oCK3TmyxCxmQmL5Z6StnpLTVYeFCHuWpWstgP+y GVY4IdwBjfVWQDmie8g+v1/1PIiZnvkQt6SVs46w6JK3d3rKmeeG4ZoR8a85gLuFqY4E 3vSz/lgXKSn70WZTfC845D+QfzazH+gzfwg2NXQa6VO6FdHTLkM0q1jsysrr7NZkpszM 54TT/VRCBffykwWIwHEQ363WQVAGs1ViLRAVYUg0BMzwqRdnU/ckHpPbOBoImbaAQPVt IlUocX+1vq+xMltdG3h2yqV6zSRbErro/lbEghadMs2m965cQF0yM14q2giUsiFyjQuj Eopg== X-Gm-Message-State: ABuFfoge+UNxBUy2pGmwVEV95k2GmLTPFgTRwHH5nET62zqm5C8tIXaN BPKzNwAwHO4hJSB07IMZ4lA= X-Google-Smtp-Source: ACcGV63xQEy8BoS638tbQ0Yaxo3Lg3/vmby739FSe9VTzCYEtm0Uvyx7zs9aUDOUl11MJ4b64V33ww== X-Received: by 2002:a62:1112:: with SMTP id z18-v6mr20245183pfi.200.1539658971997; Mon, 15 Oct 2018 20:02:51 -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 p18-v6sm12812390pgi.5.2018.10.15.20.02.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Oct 2018 20:02:51 -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 v4 4/9] ASoC: dt-binding: Add bindings for Allwinner A64 codec's analog path controls Date: Mon, 15 Oct 2018 20:02:34 -0700 Message-Id: <20181016030239.15449-5-anarsoul@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181016030239.15449-1-anarsoul@gmail.com> References: <20181016030239.15449-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 --- .../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>; + };