From patchwork Thu Sep 5 12:01:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 173136 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp611660ilq; Thu, 5 Sep 2019 05:02:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqye1tzYDe6NdXks4uz/7jtleASPD5l5mTHiMERvUAdSPCLNp19U/kCpBhQv9EY2YCqhrJSR X-Received: by 2002:a17:902:b086:: with SMTP id p6mr2890251plr.315.1567684919968; Thu, 05 Sep 2019 05:01:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567684919; cv=none; d=google.com; s=arc-20160816; b=rjezbylM+VS77dq0yoSREUWBcFP71zari696INi430NVH5khb3snSCFPGcpD8ndG4J d6WlG6HbueK/RJdCj0AOdfTYLVz3qMJJRcEpmO3WkjyYrSVZYyVr/PwSvscRRFbI3xON 4S+F7gQ/NDtVrKzLjF5tkKnuNCfbsboHYgrzmxxlQLXK/mrntUH/fQGRZMRlkFJflywv xAonA2j/r/ARViZajHPcH9p+ufzNkEa2x5Gl/Y4loreCpZ3RmJc/bDkSUhZRsR8UEkp/ foUfXXMM+D4uX8EU0/aRi0pxhPKmF5et8Eeahga/HmSQaQmfEEekRriQWSxrVHifFCiR 5GZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JtJp8hwFJlC+ElDAvP+29EWq9+aj8xhCfyxpFjJGuMU=; b=cPIq4HthYGKjaxndyNnbGjByhZ7qmH6F7lisnuCWPyh0ka/c8+r9AdapDeJGJSKHUk Z16G3aaupfsMBNFr0h/nodxk33yWgEkBH58nOWlb1RuVihiQo+lOgRlmK2HQp8qen3SQ 6zV0H2Vu9/efOMYVgWCp0KNqZQuOTA63sOwzFuN3+o+LYWzv4drSoeXxIwZTkOQSO0qq GpllcN1EPdSZrT/RIqtjYX8P6CyzbFm4bCIY9ukTxv6mFWX8NDG0urSL7SU1t/KJM+m4 Z4LLgsHr3vUwoM7shTDPLGzWwkoDB1kosZ0r+vVKBP5sJim7nr2ROv4KqHFOtbAkKRka ghWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=KvoyxWVL; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q4si1539505pgv.106.2019.09.05.05.01.59; Thu, 05 Sep 2019 05:01:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=KvoyxWVL; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388942AbfIEMBd (ORCPT + 8 others); Thu, 5 Sep 2019 08:01:33 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:40070 "EHLO mail-wr1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729809AbfIEMBd (ORCPT ); Thu, 5 Sep 2019 08:01:33 -0400 Received: by mail-wr1-f46.google.com with SMTP id w13so2447642wru.7 for ; Thu, 05 Sep 2019 05:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JtJp8hwFJlC+ElDAvP+29EWq9+aj8xhCfyxpFjJGuMU=; b=KvoyxWVLk27MSxWet5eXVTEvqpz7OZQMYgLSKMOIRVRN8rsctD7bnPqdMwnLL3zfea F9a+I+VnlL2sjNeccOjyir/GffR3nHzT5+vvnS40miEitiIwqkwWFePtCCIQQe+6pGKS phg09gOPaLHtB62WhhzohCzkg6ZYAahehhGLmE1UqmkLWSecAcgvcHOUZ2AeMgEUfg7h pSxePwVlV20zeOmm+F3v5RlPjQSSF0OaJlZWhTzoptuJ27kovmuiQ9MFH+B98IzX6gWH Dp/KxNn2aUJZMh96iRGVoPVvSRBn1dVIRDwacVjbTBbNBKoodXk4z/k0x7sTcek7lcjl pgyQ== 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=JtJp8hwFJlC+ElDAvP+29EWq9+aj8xhCfyxpFjJGuMU=; b=ATk7YI0TcV5jhite9s1P047od5lQ/nDxCOi96DeL5TPkAwRXC+6ZBD5IlxUmxVdmnJ QNUXODeZdNvgkskxegS5bA6Ewr54yLdIQMDihG1T88+umvutE4Jj4uit9gKX/yJk3HUT OcwECmnCp1vv8MpuQZgE1t85vem0Lz87AfbyRTxOe0TgizoCGbkBesF8OcC3TcD5fyiE TAfsuQYMjazMecSdTPvizCn6ETfO+v0fijK5zZTtLXWYVOAlXc3ieZmALdKcLO/rtY2T gMeKPDkMOKsSKs+zDx2wU6OSXKwwalhFQ3WZSR01Ip7bVkQb9dbWrAYrCSRcZWTrBAxI 4+6A== X-Gm-Message-State: APjAAAW1NzhADNUYV6lG2encGZgdVuwoM4OXLDFmgUFf8xQf9vg5rZMn gnLnrG4wRgQfO0meVz+Q5sutaw== X-Received: by 2002:adf:f543:: with SMTP id j3mr2444374wrp.243.1567684890446; Thu, 05 Sep 2019 05:01:30 -0700 (PDT) Received: from starbuck.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a18sm3436311wrh.25.2019.09.05.05.01.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 05:01:29 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, Kevin Hilman Subject: [PATCH 2/8] ASoC: meson: add reset binding Date: Thu, 5 Sep 2019 14:01:14 +0200 Message-Id: <20190905120120.31752-3-jbrunet@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190905120120.31752-1-jbrunet@baylibre.com> References: <20190905120120.31752-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The g12a audio subsystem, which is a derivative of the axg subsystem, provides a dedicated reset line for each of the audio components. The axg did not provide that and it is unclear if/when these reset are required. The reset already helped solve a channel mapping issue on the tdm formatter devices. Let's add the reset binding for the other components, so we can describe this in DT. We'll use it later on in the driver when/if needed. Signed-off-by: Jerome Brunet --- Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt | 5 ++++- Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt | 3 +++ .../devicetree/bindings/sound/amlogic,axg-spdifin.txt | 3 +++ .../devicetree/bindings/sound/amlogic,axg-spdifout.txt | 3 +++ .../devicetree/bindings/sound/amlogic,g12a-tohdmitx.txt | 2 ++ 5 files changed, 15 insertions(+), 1 deletion(-) -- 2.21.0 diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt index 4b17073c8f8c..3080979350a0 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-fifo.txt @@ -12,7 +12,10 @@ Required properties: - interrupts: interrupt specifier for the fifo. - clocks: phandle to the fifo peripheral clock provided by the audio clock controller. -- resets: phandle to memory ARB line provided by the arb reset controller. +- resets: list of reset phandle, one for each entry reset-names. +- reset-names: should contain the following: + * "arb" : memory ARB line (required) + * "rst" : dedicated device reset line (optional) - #sound-dai-cells: must be 0. Example of FRDDR A on the A113 SoC: diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt index b3f097976e6b..716878107a24 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-pdm.txt @@ -13,6 +13,9 @@ Required properties: * "sysclk" : dsp system clock - #sound-dai-cells: must be 0. +Optional property: +- resets: phandle to the dedicated reset line of the pdm input. + Example of PDM on the A113 SoC: pdm: audio-controller@ff632000 { diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt index 62e5bca71664..df92a4ecf288 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-spdifin.txt @@ -11,6 +11,9 @@ Required properties: * "refclk" : spdif input reference clock - #sound-dai-cells: must be 0. +Optional property: +- resets: phandle to the dedicated reset line of the spdif input. + Example on the A113 SoC: spdifin: audio-controller@400 { diff --git a/Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt b/Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt index d38aa35ec630..28381dd1f633 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,axg-spdifout.txt @@ -10,6 +10,9 @@ Required properties: * "mclk" : master clock - #sound-dai-cells: must be 0. +Optional property: +- resets: phandle to the dedicated reset line of the spdif output. + Example on the A113 SoC: spdifout: audio-controller@480 { diff --git a/Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.txt b/Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.txt index 173a95045540..4e8cd7eb7cec 100644 --- a/Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.txt +++ b/Documentation/devicetree/bindings/sound/amlogic,g12a-tohdmitx.txt @@ -6,6 +6,7 @@ Required properties: - reg: physical base address of the controller and length of memory mapped region. - #sound-dai-cells: should be 1. +- resets: phandle to the dedicated reset line of the hdmitx glue. Example on the S905X2 SoC: @@ -13,6 +14,7 @@ tohdmitx: audio-controller@744 { compatible = "amlogic,g12a-tohdmitx"; reg = <0x0 0x744 0x0 0x4>; #sound-dai-cells = <1>; + resets = <&clkc_audio AUD_RESET_TOHDMITX>; }; Example of an 'amlogic,axg-sound-card': From patchwork Thu Sep 5 12:01:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 173134 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp611260ilq; Thu, 5 Sep 2019 05:01:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzS9THmQ3as5yE5/kr6RgLhx9KDJ2v1OCsgY+eVoOBGM0QD32MY0c//g32NOOs4g5QVrVTb X-Received: by 2002:a63:184b:: with SMTP id 11mr2961525pgy.112.1567684904933; Thu, 05 Sep 2019 05:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567684904; cv=none; d=google.com; s=arc-20160816; b=R+xao5ti23tfGlp8JRVElNJgU33+xGI5txdfk5kR3YTfk2hNspVgZFpQiahOjmE1wx NCkRvlfvZTCCdlUEFdm4gdwayegvLehQm5Ndle6BKoqRPQqTDWn0slqtZ/2FWLEFPmXf 5ArsYg5JW79sjBcyO9IxOlV2uaPGNEU/a1872PtT79t7tP3SQQ57wsy6i8TnL6z5bmpp 1HDyAelieHmp6QF0EU/S7eqeAYkDQG/yRr3Dr0iT05fHZmQgqzO1hNvhM4D4cc9dMFuk yaqXouXD/zMqDwjspu7v0Oe8guaOnGiFFK7SatMNE1HyK6NTvvighM2bXii/+4MDDWHY WdPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MS5XJHYT75fAQfNDJZYmwsq3IlOqs5XUG9bj/DNEg1Y=; b=o/xivMcVLlomptqvctZnAOwdsLnn/JPFFKhLsjWgfHM3CAHyw+8ay7XQpBH5nDPNxT WV1FfRz5/dXJb8xw+6bhZKmB5DQuC4iqutjdysbtHJsbDlejhmKjSZPlTIVb1DknbvLX SupgThW2ui9kcDE85xHe4iQqkfSDBBOi0yh7urrMHQRy4elXSfRIReMQG+YwBSlOlVtV eX6RwJyRXkuWPBt6On5K9ODY6INsO/PjuhwGM6p9RafwQwnHSSTpO7M6bI7ELlW6Qm/l SRLZvm8Wh7gmROjD3wIAUxciJxcgaC1p94ytWSURT2WBbbbMipd+xzj47aJkK1VI4Zi+ 8AGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=K1wgI+Bm; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h45si1959883pjb.0.2019.09.05.05.01.44; Thu, 05 Sep 2019 05:01:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=K1wgI+Bm; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388995AbfIEMBo (ORCPT + 8 others); Thu, 5 Sep 2019 08:01:44 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37159 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388955AbfIEMBg (ORCPT ); Thu, 5 Sep 2019 08:01:36 -0400 Received: by mail-wr1-f68.google.com with SMTP id i1so1872883wro.4 for ; Thu, 05 Sep 2019 05:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MS5XJHYT75fAQfNDJZYmwsq3IlOqs5XUG9bj/DNEg1Y=; b=K1wgI+BmLlwGuWLvWOKjgEhqHak7dEDjBF6ia+HKWkPbjOg55sHa+seoDjFEUKR32D EQG+xGcV5myYoBYwljoZI1XJTj2u2VTdMQHT6YaqBzo1naDi19CrI6+xwYm/8O1R1Plt y8xx3bew6U/zIbR1KOWbOFyNqtD7I/e6tBpq7beLfwQMnw5bS5dNE8BCl25cDh3dVh64 X9Xmy4zUUExSFPPO/DWhtKEq5eowO6MSxJE+NZlFIgEGDk7G2zLdmVMr/+Q4yvmQaOfq ql4u1c4Uxts+yUfrXqB8AocXfyskaBTf7MODWsh1uCHHCxKv52CpgYcYKG9+mQQpgxDg 6z4Q== 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=MS5XJHYT75fAQfNDJZYmwsq3IlOqs5XUG9bj/DNEg1Y=; b=VfoTeoh+O9kZzktbTKi92GWAlTzPlvVd7rtsdVfA4Wqd6hyqcjIN6zM1pgtnScq5Tg jy0RjbKlUEzUiJd+SmhWSIfQPsm0+ZX1hIDUC3j1X+equtDpu3Itz1fQtVVWQwoBKZsL 0gbT0GtMMSRORpNNlrdjV/K9cnNpGb64+YRBJH3Hf9zeezYjQ2RaFJBwCGRfrVJCD1jM seiaPkyU/C5M647UIIldNycTjp/nHdREHIJ/6dTxtGHo5NEegI7eShAxRhaYKsocNgEx EOt5NEA0wXtDvdYb1z6G1SNtbu0xgL7nkrhbP+HwHoQUNBmIdQ0p/VffX3Y0g8LVgG50 N8+g== X-Gm-Message-State: APjAAAVc1is+IhEq6FgKfF6F6iP+7ZyTC0EM3ZKpmikSrsTrtXLXXWAx eaoia2CiE1dSc0qQ5DQePpSwDg== X-Received: by 2002:adf:e908:: with SMTP id f8mr1956221wrm.210.1567684894141; Thu, 05 Sep 2019 05:01:34 -0700 (PDT) Received: from starbuck.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a18sm3436311wrh.25.2019.09.05.05.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 05:01:33 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, Kevin Hilman Subject: [PATCH 6/8] ASoC: meson: axg-frddr: add sm1 support Date: Thu, 5 Sep 2019 14:01:18 +0200 Message-Id: <20190905120120.31752-7-jbrunet@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190905120120.31752-1-jbrunet@baylibre.com> References: <20190905120120.31752-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On sm1, the output routing bits have moved to CTRL2 register Signed-off-by: Jerome Brunet --- sound/soc/meson/axg-fifo.c | 2 +- sound/soc/meson/axg-fifo.h | 1 + sound/soc/meson/axg-frddr.c | 73 +++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 1 deletion(-) -- 2.21.0 diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c index 80a3dde35b5c..5a3749938900 100644 --- a/sound/soc/meson/axg-fifo.c +++ b/sound/soc/meson/axg-fifo.c @@ -306,7 +306,7 @@ static const struct regmap_config axg_fifo_regmap_cfg = { .reg_bits = 32, .val_bits = 32, .reg_stride = 4, - .max_register = FIFO_INIT_ADDR, + .max_register = FIFO_CTRL2, }; int axg_fifo_probe(struct platform_device *pdev) diff --git a/sound/soc/meson/axg-fifo.h b/sound/soc/meson/axg-fifo.h index 5caf81241dfe..bb1e2ce50256 100644 --- a/sound/soc/meson/axg-fifo.h +++ b/sound/soc/meson/axg-fifo.h @@ -61,6 +61,7 @@ struct snd_soc_pcm_runtime; #define STATUS1_INT_STS(x) ((x) << 0) #define FIFO_STATUS2 0x18 #define FIFO_INIT_ADDR 0x24 +#define FIFO_CTRL2 0x28 struct axg_fifo { struct regmap *map; diff --git a/sound/soc/meson/axg-frddr.c b/sound/soc/meson/axg-frddr.c index 0968e8375000..6ab111c31b28 100644 --- a/sound/soc/meson/axg-frddr.c +++ b/sound/soc/meson/axg-frddr.c @@ -23,6 +23,12 @@ #define CTRL0_SEL3_SHIFT 8 #define CTRL0_SEL3_EN_SHIFT 11 #define CTRL1_FRDDR_FORCE_FINISH BIT(12) +#define CTRL2_SEL1_SHIFT 0 +#define CTRL2_SEL1_EN_SHIFT 4 +#define CTRL2_SEL2_SHIFT 8 +#define CTRL2_SEL2_EN_SHIFT 12 +#define CTRL2_SEL3_SHIFT 16 +#define CTRL2_SEL3_EN_SHIFT 20 static int g12a_frddr_dai_prepare(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) @@ -269,6 +275,70 @@ static const struct axg_fifo_match_data g12a_frddr_match_data = { .dai_drv = &g12a_frddr_dai_drv }; +/* On SM1, the output selection in on CTRL2 */ +static const struct snd_kcontrol_new sm1_frddr_out1_enable = + SOC_DAPM_SINGLE_AUTODISABLE("Switch", FIFO_CTRL2, + CTRL2_SEL1_EN_SHIFT, 1, 0); +static const struct snd_kcontrol_new sm1_frddr_out2_enable = + SOC_DAPM_SINGLE_AUTODISABLE("Switch", FIFO_CTRL2, + CTRL2_SEL2_EN_SHIFT, 1, 0); +static const struct snd_kcontrol_new sm1_frddr_out3_enable = + SOC_DAPM_SINGLE_AUTODISABLE("Switch", FIFO_CTRL2, + CTRL2_SEL3_EN_SHIFT, 1, 0); + +static SOC_ENUM_SINGLE_DECL(sm1_frddr_sel1_enum, FIFO_CTRL2, CTRL2_SEL1_SHIFT, + axg_frddr_sel_texts); +static SOC_ENUM_SINGLE_DECL(sm1_frddr_sel2_enum, FIFO_CTRL2, CTRL2_SEL2_SHIFT, + axg_frddr_sel_texts); +static SOC_ENUM_SINGLE_DECL(sm1_frddr_sel3_enum, FIFO_CTRL2, CTRL2_SEL3_SHIFT, + axg_frddr_sel_texts); + +static const struct snd_kcontrol_new sm1_frddr_out1_demux = + SOC_DAPM_ENUM("Output Src 1", sm1_frddr_sel1_enum); +static const struct snd_kcontrol_new sm1_frddr_out2_demux = + SOC_DAPM_ENUM("Output Src 2", sm1_frddr_sel2_enum); +static const struct snd_kcontrol_new sm1_frddr_out3_demux = + SOC_DAPM_ENUM("Output Src 3", sm1_frddr_sel3_enum); + +static const struct snd_soc_dapm_widget sm1_frddr_dapm_widgets[] = { + SND_SOC_DAPM_AIF_OUT("SRC 1", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("SRC 2", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("SRC 3", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_SWITCH("SRC 1 EN", SND_SOC_NOPM, 0, 0, + &sm1_frddr_out1_enable), + SND_SOC_DAPM_SWITCH("SRC 2 EN", SND_SOC_NOPM, 0, 0, + &sm1_frddr_out2_enable), + SND_SOC_DAPM_SWITCH("SRC 3 EN", SND_SOC_NOPM, 0, 0, + &sm1_frddr_out3_enable), + SND_SOC_DAPM_DEMUX("SINK 1 SEL", SND_SOC_NOPM, 0, 0, + &sm1_frddr_out1_demux), + SND_SOC_DAPM_DEMUX("SINK 2 SEL", SND_SOC_NOPM, 0, 0, + &sm1_frddr_out2_demux), + SND_SOC_DAPM_DEMUX("SINK 3 SEL", SND_SOC_NOPM, 0, 0, + &sm1_frddr_out3_demux), + SND_SOC_DAPM_AIF_OUT("OUT 0", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 1", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 2", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 3", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 4", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 5", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 6", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_OUT("OUT 7", NULL, 0, SND_SOC_NOPM, 0, 0), +}; + +static const struct snd_soc_component_driver sm1_frddr_component_drv = { + .dapm_widgets = sm1_frddr_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(sm1_frddr_dapm_widgets), + .dapm_routes = g12a_frddr_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(g12a_frddr_dapm_routes), + .ops = &g12a_fifo_pcm_ops +}; + +static const struct axg_fifo_match_data sm1_frddr_match_data = { + .component_drv = &sm1_frddr_component_drv, + .dai_drv = &g12a_frddr_dai_drv +}; + static const struct of_device_id axg_frddr_of_match[] = { { .compatible = "amlogic,axg-frddr", @@ -276,6 +346,9 @@ static const struct of_device_id axg_frddr_of_match[] = { }, { .compatible = "amlogic,g12a-frddr", .data = &g12a_frddr_match_data, + }, { + .compatible = "amlogic,sm1-frddr", + .data = &sm1_frddr_match_data, }, {} }; MODULE_DEVICE_TABLE(of, axg_frddr_of_match); From patchwork Thu Sep 5 12:01:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 173131 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:ce:0:0:0:0 with SMTP id r14csp611086ilq; Thu, 5 Sep 2019 05:01:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0TaHVp1EuTQi18iGvjVN2nFmeF4AYMZKk7PHUtbm6xbr05TJod1b4k2j6avyi5xhK2U5S X-Received: by 2002:a17:902:6b4c:: with SMTP id g12mr2949585plt.118.1567684898752; Thu, 05 Sep 2019 05:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567684898; cv=none; d=google.com; s=arc-20160816; b=qbypRO3cP/TK9jfFi/3yV8YYNRbKPpNgGR5Coehypz6oSkilmS2IlKf4qMzqvJQc60 Nq3qm/m3ol94hZ6nDA1HqSclIXmx4oRYO+cJR9re67TZVZHN+O1k1OP4IlUyR4KYn7pm WcZG4h0GguFYZz/GIjCvV/ILwBQoKHGPtah4jbN73YJwjmC1OuBcAihVL0wCSgxBXzTW z8xml/SW/+VnuCEOvAxS/t6Wo9x6RJHuXbx0QRMQTEuu19kOvUozvbUAg5SOd8mg5qXI 62o9uaXzTY2xo2vxm3CxD/e5v6QpZ+8pcqz4BUEwvUUsHTmmHs38Mr4cBwRnI4Z/BOT3 I53g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ty6grr2CqBsGiLMZEwUvr96EbkiXeHRzoxeQk67yQIk=; b=0lTT10pyYI73lJwsGk8CarUg/SQXWa39iKHm0Vjecqvgm0xuElehAOpTKm5/eOoSBM 3wlbgAVJUE5hJgdR+fkRa39lb/T84Ty3NrWdFJPROsv/Fx8IgLQtVkZR7ZwG2sxkElij V0uO5jbpZ1IbZF7jXsekyvJK5AZb+CHj2nSv63fCk8raMjogwnqZ5BnH0TI8A6kQ5F/F tWYDJSFi0nOuCY1ncvHPiOs7BZktWBRv8Fvq/YSps1q0/QBdmIxD/b0AzJguhbB9yihK 069JxSFhDbiqoiLPPGukDH+0GxIMwM9E3N8OvNSKiiRVjt6mQ0DSzRG5DVrBdiM075Mi Cnuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=HGlhMhBa; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h45si1959883pjb.0.2019.09.05.05.01.38; Thu, 05 Sep 2019 05:01:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=HGlhMhBa; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388985AbfIEMBh (ORCPT + 8 others); Thu, 5 Sep 2019 08:01:37 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35191 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388966AbfIEMBh (ORCPT ); Thu, 5 Sep 2019 08:01:37 -0400 Received: by mail-wm1-f67.google.com with SMTP id n10so2687751wmj.0 for ; Thu, 05 Sep 2019 05:01:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ty6grr2CqBsGiLMZEwUvr96EbkiXeHRzoxeQk67yQIk=; b=HGlhMhBacIfIQFKMtkZsKhGnnBNTeG4ikwn1/HkS3Ajg2L6g78ZlyF8lhw6v6UbzqC RtheK/89P1pt+0pH3mLz0BKwndFqR0VToA+SyMftxNAqlO5g3ysFe6UUsS2JJDa7TT0U 02CpO0DjOm++hE8RswmYQ3dodOc6Vswu1Lyc5dY3dZlIlH18GXxfWTT3KMzh9iQAWhlL WrS4sMc5IqyT4baQ7udu5pYuIYVQ4eEYuu9FqAY2fEYIlhrVJZtNVTp3tFb7ayqaXIa+ OE9ydQzsc/jQsFWNkwiSwnL8ddqCQvM+elHpmcSgrwbFjqxrtrmpgu+FvSRv7h8YzKQW bP3Q== 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=ty6grr2CqBsGiLMZEwUvr96EbkiXeHRzoxeQk67yQIk=; b=e7rDohe7JdcHNWIhLHMRPUptcVT5FxibTvyubtaJ5KKO47c3X6plFnvgRLJIT0vhmE fXS9WvErxvhc9m6w5dEobZGkFxZ2Zbf8lw17SVyhpJWHrdAiwwMgu0PjuV7NG/xC68a4 9L+NkrNrHYDW1aYHcW46pSIZWBB2h9YZl16necjZ2ADQTJhALNh91/2WUkIvqdlT0R4z JuKHhZzBdBK8AZANxOVQYVnGp3Q57cYwTzNhxeFz+S15VdHx+GSK05cjntVllxTSJEZr usJ0K5vBdBeiLxDcOnrbYlQZ5P/5zrxsfj+hhHRpv5IdBL9PUQdkWr77DOQLy4RJtXoJ LsyA== X-Gm-Message-State: APjAAAV5jgtEH0GCEMgbsHiBcI0s1onzpG5GCvCJNlF6ej18nO20DxtH G7k1IcrfR0ZYhrwv8+tTRY+VlQ== X-Received: by 2002:a1c:1903:: with SMTP id 3mr2504214wmz.4.1567684895062; Thu, 05 Sep 2019 05:01:35 -0700 (PDT) Received: from starbuck.baylibre.local (lmontsouris-657-1-212-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id a18sm3436311wrh.25.2019.09.05.05.01.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2019 05:01:34 -0700 (PDT) From: Jerome Brunet To: Mark Brown , Liam Girdwood Cc: Jerome Brunet , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-amlogic@lists.infradead.org, Kevin Hilman Subject: [PATCH 7/8] ASoC: meson: axg-toddr: add sm1 support Date: Thu, 5 Sep 2019 14:01:19 +0200 Message-Id: <20190905120120.31752-8-jbrunet@baylibre.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190905120120.31752-1-jbrunet@baylibre.com> References: <20190905120120.31752-1-jbrunet@baylibre.com> MIME-Version: 1.0 X-Patchwork-Bot: notify Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On sm1, the maximum number TODDR inputs is extended to 16. Signed-off-by: Jerome Brunet --- sound/soc/meson/axg-toddr.c | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) -- 2.21.0 diff --git a/sound/soc/meson/axg-toddr.c b/sound/soc/meson/axg-toddr.c index 2e9a2e5862ce..c8ea2145f576 100644 --- a/sound/soc/meson/axg-toddr.c +++ b/sound/soc/meson/axg-toddr.c @@ -25,6 +25,7 @@ #define CTRL0_TODDR_LSB_POS_MASK GENMASK(7, 3) #define CTRL0_TODDR_LSB_POS(x) ((x) << 3) #define CTRL1_TODDR_FORCE_FINISH BIT(25) +#define CTRL1_SEL_SHIFT 28 #define TODDR_MSB_POS 31 @@ -221,6 +222,70 @@ static const struct axg_fifo_match_data g12a_toddr_match_data = { .dai_drv = &g12a_toddr_dai_drv }; +static const char * const sm1_toddr_sel_texts[] = { + "IN 0", "IN 1", "IN 2", "IN 3", "IN 4", "IN 5", "IN 6", "IN 7", + "IN 8", "IN 9", "IN 10", "IN 11", "IN 12", "IN 13", "IN 14", "IN 15" +}; + +static SOC_ENUM_SINGLE_DECL(sm1_toddr_sel_enum, FIFO_CTRL1, CTRL1_SEL_SHIFT, + sm1_toddr_sel_texts); + +static const struct snd_kcontrol_new sm1_toddr_in_mux = + SOC_DAPM_ENUM("Input Source", sm1_toddr_sel_enum); + +static const struct snd_soc_dapm_widget sm1_toddr_dapm_widgets[] = { + SND_SOC_DAPM_MUX("SRC SEL", SND_SOC_NOPM, 0, 0, &sm1_toddr_in_mux), + SND_SOC_DAPM_AIF_IN("IN 0", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 1", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 2", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 3", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 4", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 5", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 6", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 7", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 8", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 9", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 10", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 11", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 12", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 13", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 14", NULL, 0, SND_SOC_NOPM, 0, 0), + SND_SOC_DAPM_AIF_IN("IN 15", NULL, 0, SND_SOC_NOPM, 0, 0), +}; + +static const struct snd_soc_dapm_route sm1_toddr_dapm_routes[] = { + { "Capture", NULL, "SRC SEL" }, + { "SRC SEL", "IN 0", "IN 0" }, + { "SRC SEL", "IN 1", "IN 1" }, + { "SRC SEL", "IN 2", "IN 2" }, + { "SRC SEL", "IN 3", "IN 3" }, + { "SRC SEL", "IN 4", "IN 4" }, + { "SRC SEL", "IN 5", "IN 5" }, + { "SRC SEL", "IN 6", "IN 6" }, + { "SRC SEL", "IN 7", "IN 7" }, + { "SRC SEL", "IN 8", "IN 8" }, + { "SRC SEL", "IN 9", "IN 9" }, + { "SRC SEL", "IN 10", "IN 10" }, + { "SRC SEL", "IN 11", "IN 11" }, + { "SRC SEL", "IN 12", "IN 12" }, + { "SRC SEL", "IN 13", "IN 13" }, + { "SRC SEL", "IN 14", "IN 14" }, + { "SRC SEL", "IN 15", "IN 15" }, +}; + +static const struct snd_soc_component_driver sm1_toddr_component_drv = { + .dapm_widgets = sm1_toddr_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(sm1_toddr_dapm_widgets), + .dapm_routes = sm1_toddr_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(sm1_toddr_dapm_routes), + .ops = &g12a_fifo_pcm_ops +}; + +static const struct axg_fifo_match_data sm1_toddr_match_data = { + .component_drv = &sm1_toddr_component_drv, + .dai_drv = &g12a_toddr_dai_drv +}; + static const struct of_device_id axg_toddr_of_match[] = { { .compatible = "amlogic,axg-toddr", @@ -228,6 +293,9 @@ static const struct of_device_id axg_toddr_of_match[] = { }, { .compatible = "amlogic,g12a-toddr", .data = &g12a_toddr_match_data, + }, { + .compatible = "amlogic,sm1-toddr", + .data = &sm1_toddr_match_data, }, {} }; MODULE_DEVICE_TABLE(of, axg_toddr_of_match);