From patchwork Tue Oct 27 18:31:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 310833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2EDA6C55178 for ; Tue, 27 Oct 2020 18:33:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E3ED1207C4 for ; Tue, 27 Oct 2020 18:33:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xa3aRlWC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1828404AbgJ0Sb5 (ORCPT ); Tue, 27 Oct 2020 14:31:57 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:55245 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1828392AbgJ0Sb4 (ORCPT ); Tue, 27 Oct 2020 14:31:56 -0400 Received: by mail-wm1-f67.google.com with SMTP id w23so2318555wmi.4; Tue, 27 Oct 2020 11:31:54 -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=HWW+ZfyCHyBaIjHVek844VU+H74q8wumivr8pDBz3+c=; b=Xa3aRlWC9ljsRrq+ZxZgYJULHxsgPA0ckHAQ19+tNrf10j+9QY8DA/WYBZS1fMKzl5 8GYE10EvUT32mxJHeLCKJ/Mcqp6ZYITrS/Lw6JWjGM0JoUXfwC0OZCPBrbXH4lYllfHL 7Nsu8vWTkAFdyvMqwm7YbggvoUv+zhP08zPknzg/lVE+UkS5kOPLMSWdsJaaN8rVqPi/ hJPJyDbwvwA6ZzCHRnjE1TpbnXlFcdUJDy5IsJd0h4KZ5bcDHZ0fZZ97gbUuCkvsIaym gI+NtTldqxulAoFlhrBoVALDkSpwyrdNhozI7M8Cq7gEpbZZPrBVwjNcTQDmY1ao8fQS +JEQ== 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=HWW+ZfyCHyBaIjHVek844VU+H74q8wumivr8pDBz3+c=; b=EZoaCBBu8c/1CmHbk4h+0I4Ttj0bMlaL5QZn23JiVVylHBmkqmYRKAY2u1qifBSsR8 gewJMy9CcMEjea0Tsz5Ql+rggEBnIqkCogbJuDyPDmUoYtNbHpPz8pLycixq7/g21LPX XFavXgpdGJqPMN5d8Bg6QqU/+tNFbdbtFH4p6wHEpJHDMNYW6+EG1sJzobbWYQ47r16f nHWrDbks4KZiQWOA1bigIhCACkhMZMhfm0Mu57TRC6DBgP8DdfMFo6jWI3PTJg6qUqQv v0TZHJPu9YRk71IU0+7iRlAXolfhBxiYon+dSX/h4GN4vdr/EAnfQ1nUn1ei9bbUVv6u OxzA== X-Gm-Message-State: AOAM532fhs4l2GrT0A7g7ZekauFuhUAyTO21v+JgrP02NUnbLahcN04S +Z2tAAuuf0mVN/CAiuwj17U= X-Google-Smtp-Source: ABdhPJw5odAjh3G76+qql0JT4kD/cXQYlrTOXEYaGxulwmcWowGzECtkFMHPjpCXF16eHf3suW/ukQ== X-Received: by 2002:a1c:4d05:: with SMTP id o5mr4002368wmh.94.1603823513610; Tue, 27 Oct 2020 11:31:53 -0700 (PDT) Received: from localhost.localdomain (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id m9sm2864148wmc.31.2020.10.27.11.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:31:52 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , Samuel Holland Subject: [PATCH v9 01/14] ASoC: sun4i-i2s: Change set_chan_cfg() params Date: Tue, 27 Oct 2020 19:31:36 +0100 Message-Id: <20201027183149.145165-2-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027183149.145165-1-peron.clem@gmail.com> References: <20201027183149.145165-1-peron.clem@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org As slots and slot_width can be set manually using set_tdm(). These values are then kept in sun4i_i2s struct. So we need to check if these values are set or not. This is not done actually and will trigger a bug. For example, if we set to the simple soundcard in the device-tree dai-tdm-slot-width = <32> and then start a stream using S16_LE, currently we would calculate BCLK for 32-bit slots, but program lrck_period for 16-bit slots, making the sample rate double what we expected. To fix this, we need to check if these values are set or not but as this logic is already done by the caller. Avoid duplicating this logic and just pass the required values as params to set_chan_cfg(). Suggested-by: Samuel Holland Acked-by: Maxime Ripard Signed-off-by: Clément Péron --- sound/soc/sunxi/sun4i-i2s.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index f23ff29e7c1d..7c1f57eb2462 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -162,8 +162,15 @@ struct sun4i_i2s_quirks { unsigned long (*get_bclk_parent_rate)(const struct sun4i_i2s *); s8 (*get_sr)(const struct sun4i_i2s *, int); s8 (*get_wss)(const struct sun4i_i2s *, int); - int (*set_chan_cfg)(const struct sun4i_i2s *, - const struct snd_pcm_hw_params *); + + /* + * In the set_chan_cfg() function pointer: + * @slots: channels per frame + padding slots, regardless of format + * @slot_width: bits per sample + padding bits, regardless of format + */ + int (*set_chan_cfg)(const struct sun4i_i2s *i2s, + unsigned int channels, unsigned int slots, + unsigned int slot_width); int (*set_fmt)(const struct sun4i_i2s *, unsigned int); }; @@ -399,10 +406,9 @@ static s8 sun8i_i2s_get_sr_wss(const struct sun4i_i2s *i2s, int width) } static int sun4i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, - const struct snd_pcm_hw_params *params) + unsigned int channels, unsigned int slots, + unsigned int slot_width) { - unsigned int channels = params_channels(params); - /* Map the channels for playback and capture */ regmap_write(i2s->regmap, SUN4I_I2S_TX_CHAN_MAP_REG, 0x76543210); regmap_write(i2s->regmap, SUN4I_I2S_RX_CHAN_MAP_REG, 0x00003210); @@ -419,15 +425,11 @@ static int sun4i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, } static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, - const struct snd_pcm_hw_params *params) + unsigned int channels, unsigned int slots, + unsigned int slot_width) { - unsigned int channels = params_channels(params); - unsigned int slots = channels; unsigned int lrck_period; - if (i2s->slots) - slots = i2s->slots; - /* Map the channels for playback and capture */ regmap_write(i2s->regmap, SUN8I_I2S_TX_CHAN_MAP_REG, 0x76543210); regmap_write(i2s->regmap, SUN8I_I2S_RX_CHAN_MAP_REG, 0x76543210); @@ -452,11 +454,11 @@ static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, case SND_SOC_DAIFMT_DSP_B: case SND_SOC_DAIFMT_LEFT_J: case SND_SOC_DAIFMT_RIGHT_J: - lrck_period = params_physical_width(params) * slots; + lrck_period = slot_width * slots; break; case SND_SOC_DAIFMT_I2S: - lrck_period = params_physical_width(params); + lrck_period = slot_width; break; default: @@ -482,7 +484,9 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, unsigned int word_size = params_width(params); unsigned int slot_width = params_physical_width(params); unsigned int channels = params_channels(params); + unsigned int slots = channels; + int ret, sr, wss; u32 width; @@ -492,7 +496,7 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, if (i2s->slot_width) slot_width = i2s->slot_width; - ret = i2s->variant->set_chan_cfg(i2s, params); + ret = i2s->variant->set_chan_cfg(i2s, channels, slots, slot_width); if (ret < 0) { dev_err(dai->dev, "Invalid channel configuration\n"); return ret; From patchwork Tue Oct 27 18:31:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 310839 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6C37AC4363A for ; Tue, 27 Oct 2020 18:32:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23CDD2224E for ; Tue, 27 Oct 2020 18:32:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DNkj+Piz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1828413AbgJ0Sb7 (ORCPT ); Tue, 27 Oct 2020 14:31:59 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:55360 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1828382AbgJ0Sb6 (ORCPT ); Tue, 27 Oct 2020 14:31:58 -0400 Received: by mail-wm1-f65.google.com with SMTP id a72so2311613wme.5; Tue, 27 Oct 2020 11:31:56 -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=MyrgB1AwEElcU6uoJ2FqX5PMdFXQkCgXivSbRL5ep4E=; b=DNkj+Piz0Om+GlBXB1VmhimTuK/nSLowEHG2zWBgg3WSp6WoZYjj8lxB6MeqJxwLLK H9f44Pe3Qgm+GQQb53ymB9f3zFKJxuIWrkGDM12YXn3RLqHzTDPoD363A3fULoK5xPRt U39PLKCsU4BCqQkKxYnUdUjbAzodsCkdfyMr0FSpdMDZDzZ4UOFkK7+Hqx15+bf4lNg9 2Ts8vi/G/ktxoS+PxSPNw3hFotL7a69jPTSjbh4Cb6zLT/RS1R46aouo4C8scKpaC2jT +fvo5BhsI7euEErtYqaYf0Ph0bCwizCeGr8VRlnrSvcnTQZxcOjN5r9LJxW3Qwjr8VBH +f4w== 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=MyrgB1AwEElcU6uoJ2FqX5PMdFXQkCgXivSbRL5ep4E=; b=JQU6cbUvLqfNO5RmA/mF4sgiRrkmWPWTRnfJOusnKwqbxUrz1xxxODWeaGaqRB3wxu XKBe612xV3Df3oS8I7PJM/G2L+I1IVi98EwmpJjM9yu5adfiMtCRPTB5r4dCcByS/pj4 /DMYsfEQvk0RnhCil6hLKNmkzHM3yEFsQg5UKIhJ9AOOeQAfi55Zz7c4q5BHOWYKtXbs WtN0JNSkho4HWsr34GLLL0HgDLxbkk39UKkfT1JD2I3jqXmYOzDtkhh0ZupzpNpYdYqz HZdky95nFLgFRDBgTj57DpKZx6PP2MgclbSLA8Mn5FyqTCFcct0ceQfzryau8pfV1lct +mcw== X-Gm-Message-State: AOAM531627kHCpoK9vXzzVz3lI8B3IPPgBT3HSlX9d24nFVKm5qtNnhS k5IJVz9qTV5PKkbgUZMCWAg= X-Google-Smtp-Source: ABdhPJyF6ZdXaQzST5/s0N2Dhm9FeBiO3dYoy4glx6HJq/VUSfo5xXU9LEg9PIBhahO1EuL7oBl4GA== X-Received: by 2002:a05:600c:214c:: with SMTP id v12mr3948227wml.23.1603823515538; Tue, 27 Oct 2020 11:31:55 -0700 (PDT) Received: from localhost.localdomain (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id m9sm2864148wmc.31.2020.10.27.11.31.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:31:54 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v9 03/14] ASoC: sun4i-i2s: Change get_sr() and get_wss() to be more explicit Date: Tue, 27 Oct 2020 19:31:38 +0100 Message-Id: <20201027183149.145165-4-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027183149.145165-1-peron.clem@gmail.com> References: <20201027183149.145165-1-peron.clem@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org We are actually using a complex formula to just return a bunch of simple values. Also this formula is wrong for sun4i when calling get_wss() the function return 4 instead of 3. Replace this with a simpler switch case. Also drop the i2s params which is unused and return a simple int as returning an error code could be out of range for an s8 and there is no optim to return a s8 here. Fixes: 619c15f7fac9 ("ASoC: sun4i-i2s: Change SR and WSS computation") Reviewed-by: Chen-Yu Tsai Acked-by: Maxime Ripard Signed-off-by: Clément Péron --- sound/soc/sunxi/sun4i-i2s.c | 69 +++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 25 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 9aa837d4fe99..073ee60da011 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -175,8 +175,8 @@ struct sun4i_i2s_quirks { unsigned int num_mclk_dividers; unsigned long (*get_bclk_parent_rate)(const struct sun4i_i2s *); - s8 (*get_sr)(const struct sun4i_i2s *, int); - s8 (*get_wss)(const struct sun4i_i2s *, int); + int (*get_sr)(unsigned int width); + int (*get_wss)(unsigned int width); /* * In the set_chan_cfg() function pointer: @@ -387,37 +387,56 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai, return 0; } -static s8 sun4i_i2s_get_sr(const struct sun4i_i2s *i2s, int width) +static int sun4i_i2s_get_sr(unsigned int width) { - if (width < 16 || width > 24) - return -EINVAL; - - if (width % 4) - return -EINVAL; + switch (width) { + case 16: + return 0; + case 20: + return 1; + case 24: + return 2; + } - return (width - 16) / 4; + return -EINVAL; } -static s8 sun4i_i2s_get_wss(const struct sun4i_i2s *i2s, int width) +static int sun4i_i2s_get_wss(unsigned int width) { - if (width < 16 || width > 32) - return -EINVAL; - - if (width % 4) - return -EINVAL; + switch (width) { + case 16: + return 0; + case 20: + return 1; + case 24: + return 2; + case 32: + return 3; + } - return (width - 16) / 4; + return -EINVAL; } -static s8 sun8i_i2s_get_sr_wss(const struct sun4i_i2s *i2s, int width) +static int sun8i_i2s_get_sr_wss(unsigned int width) { - if (width % 4) - return -EINVAL; - - if (width < 8 || width > 32) - return -EINVAL; + switch (width) { + case 8: + return 1; + case 12: + return 2; + case 16: + return 3; + case 20: + return 4; + case 24: + return 5; + case 28: + return 6; + case 32: + return 7; + } - return (width - 8) / 4 + 1; + return -EINVAL; } static int sun4i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, @@ -582,11 +601,11 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream *substream, } i2s->playback_dma_data.addr_width = width; - sr = i2s->variant->get_sr(i2s, word_size); + sr = i2s->variant->get_sr(word_size); if (sr < 0) return -EINVAL; - wss = i2s->variant->get_wss(i2s, slot_width); + wss = i2s->variant->get_wss(slot_width); if (wss < 0) return -EINVAL; From patchwork Tue Oct 27 18:31:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 310834 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4254CC55178 for ; Tue, 27 Oct 2020 18:32:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EFA3920715 for ; Tue, 27 Oct 2020 18:32:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hfD0lzWr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1828562AbgJ0Scv (ORCPT ); Tue, 27 Oct 2020 14:32:51 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34355 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1828405AbgJ0Sb7 (ORCPT ); Tue, 27 Oct 2020 14:31:59 -0400 Received: by mail-wr1-f65.google.com with SMTP id i1so3075720wro.1; Tue, 27 Oct 2020 11:31:57 -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=PzIzkaAO7tDGE4Xw0UBFwOTz26e4q0eFQkKHnes8+P0=; b=hfD0lzWrpzfZOIduBPFba3YAYManfeVarb3bKIdMXRc5b6DtV5rN8nGTpbr0BQX0qR pHqtI1aXXMw3YLLd4VAEZLXEhLkmlvPv76MlAaTNtP8OEhiJS+cmqSy+31XSDoUrLLH+ Xu3eWYQuGL++qB0LvvocxJg0MgmOta9Ywn6Lt78wFYLNin9yB8sM22PBbUB5V56pEepn YuZ71YdqZ4nPuNHdtb5caERa6AuB0fRMeY793DaNPwVRiX1Ap5PlVpxGmxYmDE9JADto p6QCotdYHYu5A+1qEzUsAKabdAykBEe1/wOOlFeIZbNUmhODtNEbVJxFlpjnKEt/1bQe pcwQ== 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=PzIzkaAO7tDGE4Xw0UBFwOTz26e4q0eFQkKHnes8+P0=; b=BB9zdypK/9afyFWGJhZr7guER10bB6D7CCnEkHGwqCDl0sf7OJJgF+uqmHtSB+dw7a k0FdvF5fHu45YYTITAvfd8sBb3XRFh3ZpiZgctaLGCcDHRzzdAzqJMafVs8qvxMifijK ojeMnRHsZTdllYCGpAXdOnDAFQuLIk9RL8LzvIhMOjfTD30qSmj47RAdt1+1i1vwO4s2 n4OYyyjlO+qFkqKjuBEN29mBWbA7mPahtaGtqnapW51x8oIFMCU95m0VTUnqf0Mo/pdL fA++kWztVGbsrEpGmIQHptVQIvs0erEPrrip8xslMNFYL8UWfhVWmmsosTDJe65bojmL QVhw== X-Gm-Message-State: AOAM533Td+Rr9Urt6BWRyJ7eb1n45zkDm9uOd+z5kkHbpLLjN7EgM9O1 ItNDUukH+Eb8OjbMofK2N4w= X-Google-Smtp-Source: ABdhPJwMwK6nzkh0dSOrG4Zp1NIatSqiv5juI0VS0YtzY1h6rKylT8P1NxrdyZGomNP6L2JT/BtS3A== X-Received: by 2002:adf:ce8a:: with SMTP id r10mr4595923wrn.188.1603823516832; Tue, 27 Oct 2020 11:31:56 -0700 (PDT) Received: from localhost.localdomain (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id m9sm2864148wmc.31.2020.10.27.11.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:31:55 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v9 04/14] ASoC: sun4i-i2s: Set sign extend sample Date: Tue, 27 Oct 2020 19:31:39 +0100 Message-Id: <20201027183149.145165-5-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027183149.145165-1-peron.clem@gmail.com> References: <20201027183149.145165-1-peron.clem@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Marcus Cooper On the newer SoCs such as the H3 and A64 this is set by default to transfer a 0 after each sample in each slot. However the A10 and A20 SoCs that this driver was developed on had a default setting where it padded the audio gain with zeros. This isn't a problem while we have only support for 16bit audio but with larger sample resolution rates in the pipeline then SEXT bits should be cleared so that they also pad at the LSB. Without this the audio gets distorted. Set sign extend sample for all the sunxi generations even if they are not affected. This will keep consistency and avoid relying on default. Signed-off-by: Marcus Cooper Reviewed-by: Chen-Yu Tsai Acked-by: Maxime Ripard Signed-off-by: Clément Péron --- sound/soc/sunxi/sun4i-i2s.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 073ee60da011..9f9d3e7baad0 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -48,6 +48,9 @@ #define SUN4I_I2S_FMT0_FMT_I2S (0 << 0) #define SUN4I_I2S_FMT1_REG 0x08 +#define SUN4I_I2S_FMT1_REG_SEXT_MASK BIT(8) +#define SUN4I_I2S_FMT1_REG_SEXT(sext) ((sext) << 8) + #define SUN4I_I2S_FIFO_TX_REG 0x0c #define SUN4I_I2S_FIFO_RX_REG 0x10 @@ -105,6 +108,9 @@ #define SUN8I_I2S_FMT0_BCLK_POLARITY_INVERTED (1 << 7) #define SUN8I_I2S_FMT0_BCLK_POLARITY_NORMAL (0 << 7) +#define SUN8I_I2S_FMT1_REG_SEXT_MASK GENMASK(5, 4) +#define SUN8I_I2S_FMT1_REG_SEXT(sext) ((sext) << 4) + #define SUN8I_I2S_INT_STA_REG 0x0c #define SUN8I_I2S_FIFO_TX_REG 0x20 @@ -686,6 +692,7 @@ static int sun4i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, } regmap_update_bits(i2s->regmap, SUN4I_I2S_CTRL_REG, SUN4I_I2S_CTRL_MODE_MASK, val); + return 0; } @@ -788,6 +795,11 @@ static int sun8i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, SUN8I_I2S_CTRL_BCLK_OUT | SUN8I_I2S_CTRL_LRCK_OUT, val); + /* Set sign extension to pad out LSB with 0 */ + regmap_update_bits(i2s->regmap, SUN4I_I2S_FMT1_REG, + SUN8I_I2S_FMT1_REG_SEXT_MASK, + SUN8I_I2S_FMT1_REG_SEXT(0)); + return 0; } @@ -890,6 +902,11 @@ static int sun50i_h6_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, SUN8I_I2S_CTRL_BCLK_OUT | SUN8I_I2S_CTRL_LRCK_OUT, val); + /* Set sign extension to pad out LSB with 0 */ + regmap_update_bits(i2s->regmap, SUN4I_I2S_FMT1_REG, + SUN8I_I2S_FMT1_REG_SEXT_MASK, + SUN8I_I2S_FMT1_REG_SEXT(0)); + return 0; } From patchwork Tue Oct 27 18:31:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 310836 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B038C55179 for ; Tue, 27 Oct 2020 18:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C310020738 for ; Tue, 27 Oct 2020 18:32:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hTp0/C5Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1828430AbgJ0ScE (ORCPT ); Tue, 27 Oct 2020 14:32:04 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39078 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1828424AbgJ0ScE (ORCPT ); Tue, 27 Oct 2020 14:32:04 -0400 Received: by mail-wr1-f68.google.com with SMTP id y12so3033309wrp.6; Tue, 27 Oct 2020 11:32:01 -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=Gt3AZ0hX1jExXQvct5PeSssH0eAYOD3HBZ6+o5mysMA=; b=hTp0/C5QqU8sGft7gs+VKYluyNQdjzqWgZZh3pTwmFWeYye1IhomVJiHNIygIcMqGF 3JyEzn8ks79yZ7mUPgkZJ4QdHgJM+JSlwrgXtjVBC6cMZkiSr/gUj/CZCJBPVDPK++Pc 2M899v1JBFuVKa4zBRvRcBeOdQIczJyaWkK2bxsPg3LJqh8Q4G+ta/Qi0yrLdRmvpMm+ ESobrLYqLEMZkMnHE3hYWLwhKEZftWOqm8L7w6aRy7m66I+jM+WCfFqB3vmSjDi4Ct00 LJbtTS5mgqbTY+YJgkq4YRI8JVQlRw+PP1Hv+sWB52MGqHJIFXo4h/t52Y/Rvy/Eujlx zk0g== 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=Gt3AZ0hX1jExXQvct5PeSssH0eAYOD3HBZ6+o5mysMA=; b=BELvsPZBZQCMmgjKWBMSxYrvz6qEyDcTqkyPVEGK0st4UCIIzjfwy0HrI2wVIzqNnN 2ec+34llgS3jZzetEtrG1UTAuqtnJ2Hc3xcuQtYDaMMuNNncdefDel2+nZG805egEab0 G0Y8hpSKNQAW/MKQMeKazFG34F0I8wiibR4y+TGcTzwGxqdx5NLuWBGt5hXAonfyaOjd opq+HOF8C9byZ/0pVQeaLb1nNinj1XkonhEZQhcEcmlkDL+Rew5lNqFdJJ6uJtCft3E1 XHqwneDbkHb1igAEugn9mkPfd+G8s9gtzZiNrOdB1fmFhs+53X43y82J8822r+lPQC8Q M3fQ== X-Gm-Message-State: AOAM532B1QdtDyU91ff5Shb8+PAFq9iLgXkiN/zGAeVsTNaKrOATJH/g 6IdDJfbruCfZEL2R64ehW14= X-Google-Smtp-Source: ABdhPJxKySdExdQpdchzKr5y+uxq5+4d+zLWKNcwipKrO/nMsTtpM3Hkjs5/cvYGG9bJ1egUEF7Y+A== X-Received: by 2002:adf:b787:: with SMTP id s7mr4637129wre.390.1603823520965; Tue, 27 Oct 2020 11:32:00 -0700 (PDT) Received: from localhost.localdomain (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id m9sm2864148wmc.31.2020.10.27.11.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:32:00 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v9 08/14] ASoC: sun4i-i2s: fix coding-style for callback definition Date: Tue, 27 Oct 2020 19:31:43 +0100 Message-Id: <20201027183149.145165-9-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027183149.145165-1-peron.clem@gmail.com> References: <20201027183149.145165-1-peron.clem@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Checkpatch script produces warning: WARNING: function definition argument 'const struct sun4i_i2s *' should also have an identifier name. Let's fix this by adding identifier name to get_bclk_parent_rate() and set_fmt() callback definition. Acked-by: Maxime Ripard Signed-off-by: Clément Péron --- sound/soc/sunxi/sun4i-i2s.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 6a3207245ae2..4cf8a67efa4f 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -180,7 +180,7 @@ struct sun4i_i2s_quirks { const struct sun4i_i2s_clk_div *mclk_dividers; unsigned int num_mclk_dividers; - unsigned long (*get_bclk_parent_rate)(const struct sun4i_i2s *); + unsigned long (*get_bclk_parent_rate)(const struct sun4i_i2s *i2s); int (*get_sr)(unsigned int width); int (*get_wss)(unsigned int width); @@ -192,7 +192,7 @@ struct sun4i_i2s_quirks { int (*set_chan_cfg)(const struct sun4i_i2s *i2s, unsigned int channels, unsigned int slots, unsigned int slot_width); - int (*set_fmt)(const struct sun4i_i2s *, unsigned int); + int (*set_fmt)(const struct sun4i_i2s *i2s, unsigned int fmt); }; struct sun4i_i2s { From patchwork Tue Oct 27 18:31:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 310835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D21A7C55178 for ; Tue, 27 Oct 2020 18:32:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9980F20715 for ; Tue, 27 Oct 2020 18:32:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JFgeG23Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1828545AbgJ0Scm (ORCPT ); Tue, 27 Oct 2020 14:32:42 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:36166 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1828426AbgJ0ScE (ORCPT ); Tue, 27 Oct 2020 14:32:04 -0400 Received: by mail-wm1-f66.google.com with SMTP id e2so2472662wme.1; Tue, 27 Oct 2020 11:32:03 -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=oVJ/FVhCtH2Sw1ZFhzCNscPSk9Fte7d6nvWFGpvDBLs=; b=JFgeG23QtomWzS6Bha5qw611bEGje19zVx46h+fkAYzTIEQEBDZbDytqruHW1MHBYh hbc8NB4nOr8thDTFGHqduRXOXoFBlnKpnO0wrSfxEobmMiLKB6sgx0DSlrrbd/e8XGcc v3Q1np6j6sYXNpfOwkyo7ckuOUPScb55Qpob9lT1bzzh7g6w2Z52RaquJtpBmeFg59A+ VlcLTMlpwf3+F4jjd3BnuiuWlxkJKnD+y7H5nW9kv+8EbPPjJmmRUyT/j9vhqbN/xt+4 Cl7lri2vSikNhdmr83MYTg/n9cNYPlgX0Dv3lDkirzJ92qxxVXAF/Qm+GbCv5d9qy0AH EyBw== 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=oVJ/FVhCtH2Sw1ZFhzCNscPSk9Fte7d6nvWFGpvDBLs=; b=XQGaA3lJeWSc+FbPu3aW6FPHtkl6X+3+Kx8Aqsex6pqmlTKSoy6lMH/VoAq1qt+wd2 Uv79SompAob/GjhppxVB5njG3OUSMm/yxgfH40cWmiDzmHeUfeBGBk0FhKyPz3l4vKNL nUmHpCzSni0acEn9dMbjFBihlZ0cr2tayk0NsVPzN9uLlORsC7+YLYbIxr5/umESdLFP X7A5oZQkeCgosxfvx2Th2UwZGNdDtfeE3jOeNmLjYGRaa2pgzarHHCNqamrz6/HPDalA 28TFmUzo7TvY1VWo3Jzla52DSATPvWeH7UEl4R8wyWMCeG4J922T3sn4smXV6s4tQVge 5Bmw== X-Gm-Message-State: AOAM5327yjhWawVDvSOgOyxuNziQnh9P8edCzp29WabxhDO5kDdB34OI +0dvNQPFMnQEDWxtCuXJyNs= X-Google-Smtp-Source: ABdhPJwFXy7NDinDWuVTnQgP1h3IJuPLQhmkRksX/wb66eKevjZt2XttkN7abcq/vklzoDAAuVhS7Q== X-Received: by 2002:a7b:cc85:: with SMTP id p5mr3993245wma.24.1603823522148; Tue, 27 Oct 2020 11:32:02 -0700 (PDT) Received: from localhost.localdomain (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id m9sm2864148wmc.31.2020.10.27.11.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:32:01 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Rob Herring , =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v9 09/14] dt-bindings: ASoC: sun4i-i2s: Add H6 compatible Date: Tue, 27 Oct 2020 19:31:44 +0100 Message-Id: <20201027183149.145165-10-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027183149.145165-1-peron.clem@gmail.com> References: <20201027183149.145165-1-peron.clem@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Jernej Skrabec H6 I2S is very similar to H3, except that it supports up to 16 channels and thus few registers have fields on different position. Signed-off-by: Jernej Skrabec Signed-off-by: Marcus Cooper Acked-by: Maxime Ripard Acked-by: Rob Herring Acked-by: Chen-Yu Tsai Signed-off-by: Clément Péron --- .../devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml index 112ae00d63c1..606ad2d884a8 100644 --- a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml +++ b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml @@ -24,6 +24,7 @@ properties: - items: - const: allwinner,sun50i-a64-i2s - const: allwinner,sun8i-h3-i2s + - const: allwinner,sun50i-h6-i2s reg: maxItems: 1 @@ -59,6 +60,7 @@ allOf: - allwinner,sun8i-a83t-i2s - allwinner,sun8i-h3-i2s - allwinner,sun50i-a64-codec-i2s + - allwinner,sun50i-h6-i2s then: required: From patchwork Tue Oct 27 18:31:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 310837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC92BC388F9 for ; Tue, 27 Oct 2020 18:32:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B96A20715 for ; Tue, 27 Oct 2020 18:32:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VTOeIPc2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1828530AbgJ0Sce (ORCPT ); Tue, 27 Oct 2020 14:32:34 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37492 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1828434AbgJ0ScH (ORCPT ); Tue, 27 Oct 2020 14:32:07 -0400 Received: by mail-wr1-f68.google.com with SMTP id w1so3053550wrm.4; Tue, 27 Oct 2020 11:32:05 -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=8Id6RP1VS5hXJUMhUzwY34yVBORZ0nCdjPMNOwgBnW8=; b=VTOeIPc21SPDfrYYYmM4tXIGoNyCzGTE5YvPQ1ZxpCZrtRHKzyp7qaHleRwvHCQZBN OUMoABB8d66NAw4xhyJUDC1JR9d539NmmbQpncNXa7/8o8HRjGlfjMAE56Fh7GgH3it4 ac5TamvvQT05upVyw7s4kaQlWMzWNFqwQ1rTbX2E4OY0/pGITpCYCsauMFgQ+FvZcXlp ZMeWyYu4pn1ivcmU7kBj2fhPr1+OxB1l8YxiE87/lz960eue7IxKntRCb0EjFV3zCfxh TvvjglS9aMRx7ai6Vn7o4u55OU/EjMu6gvWDC5OL0zhoIbjo1Y/ZKWVLJ15PITC1QU6v 3u5Q== 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=8Id6RP1VS5hXJUMhUzwY34yVBORZ0nCdjPMNOwgBnW8=; b=Nl0v3hgJnFiTsrQaXKBPrsWh3lpdTIOwj+GyIB8YTzbC3LD03TYNUeI96wfut+Y8P9 C2Nh93c8nP8i7n/Ynah+o1RltcsDIRJwXq+fLpJUmSHc9SUizWOqlxAv3+rne1uwRAfB WSZKCbIWY/sF/6sTgRPt4NIRozsjGnd9S58w2b8Ks4lRuQwtnHWtrv/s/mjAGn17gNyB 1tvDax8SoF0sTIK22ufYT+0+alJZr9MjemuaYYXAsLE7ATma2pnWmNPAuctLsk515ki3 uKlnsj50hBa5wYjZJ0KEoNn1o/Sgebri9pTnDEMxasVqTsxYvfb9ynvVYcktcZh6fEPu OknA== X-Gm-Message-State: AOAM530m++cEQCBIlFM7uw30KsQIKR1CJdl58IPIIFOeqAB5ilqxQQSQ 6qwhZ9ORoeCoTtJexT71HaA= X-Google-Smtp-Source: ABdhPJw8Wn6ERQSJ1vafvTcwkql50kuQIxHbMuKXVvBOYEtVy4RF0vMwn0Tq6O32lBxiusXzyxdh7Q== X-Received: by 2002:a05:6000:1051:: with SMTP id c17mr4196893wrx.290.1603823524580; Tue, 27 Oct 2020 11:32:04 -0700 (PDT) Received: from localhost.localdomain (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id m9sm2864148wmc.31.2020.10.27.11.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:32:03 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v9 11/14] arm64: dts: allwinner: a64: Add I2S2 node Date: Tue, 27 Oct 2020 19:31:46 +0100 Message-Id: <20201027183149.145165-12-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027183149.145165-1-peron.clem@gmail.com> References: <20201027183149.145165-1-peron.clem@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Marcus Cooper Add the I2S2 node connected to the HDMI interface. Signed-off-by: Jernej Skrabec Signed-off-by: Marcus Cooper Acked-by: Chen-Yu Tsai Signed-off-by: Clément Péron --- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index dc238814013c..51cc30e84e26 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -846,6 +846,20 @@ i2s1: i2s@1c22400 { status = "disabled"; }; + i2s2: i2s@1c22800 { + #sound-dai-cells = <0>; + compatible = "allwinner,sun50i-a64-i2s", + "allwinner,sun8i-h3-i2s"; + reg = <0x01c22800 0x400>; + interrupts = ; + clocks = <&ccu CLK_BUS_I2S2>, <&ccu CLK_I2S2>; + clock-names = "apb", "mod"; + resets = <&ccu RST_BUS_I2S2>; + dma-names = "rx", "tx"; + dmas = <&dma 27>, <&dma 27>; + status = "disabled"; + }; + dai: dai@1c22c00 { #sound-dai-cells = <0>; compatible = "allwinner,sun50i-a64-codec-i2s"; From patchwork Tue Oct 27 18:31:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 310838 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C96CC55179 for ; Tue, 27 Oct 2020 18:32:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6436120760 for ; Tue, 27 Oct 2020 18:32:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KHWmTg6i" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1828456AbgJ0ScN (ORCPT ); Tue, 27 Oct 2020 14:32:13 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33443 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1828442AbgJ0ScJ (ORCPT ); Tue, 27 Oct 2020 14:32:09 -0400 Received: by mail-wr1-f66.google.com with SMTP id b8so3079423wrn.0; Tue, 27 Oct 2020 11:32:07 -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=Lryb+OP/I/Ms7egySRuAjr25d3wKcdnJ3fbOd1ZGv1M=; b=KHWmTg6iNDzrUklwwoPUYeB3JIWWDKo+WfE3xEOm21ijBsMHfDp0aI6XXbDtue4XaH yF0uAVTb/N3UE0kxVcoNUSQePrz1qUYCgERhqUVFas+4XWL00P9Hmtu9HqBv5R4oVP+j c0quqR5yhlruMZ1kqMBRXJrD3WZ91qofkjITlAPNS3FBjTiT9ERLIdTTJ1YBcGnRdNfw L4sBfxOFuTEqxkMidOBmwJFJZXxEHsghsrEsS5BpZbSp2CNXNzHcG3rR9gLEvd8k3hGd N1yNXHh/yq0neAeDIT8ponfii5LZjEWnjSjHBfMCLEgYqbPpmXKyoyPuEN5vAiA5+glm PG5Q== 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=Lryb+OP/I/Ms7egySRuAjr25d3wKcdnJ3fbOd1ZGv1M=; b=MzkfGlXSASBTyyi9CESHwLKlPdjeuQ6Ty6K057+KjzEWG8tcX3gU+IY2Sf8U6pcRgd PZQ+a/tsJ85eylRwHYnluPwQogi1VtZNHrZQerjSRCSPgqDqlPLon2L0rt340J2ToUkH BF7zHSkqt+GyPROM+esb7Ou1Ona89c3xXGiKB4P9S+9vzPAG+2nVstZR09ZDTc0Ntuz+ hxaBJ58tEsdQMw8OpuNHYRpMFZTIs63hHEOdV5SGp271baOjpdMwYSfaIULPKKDGtW2E qo3X1lCN+P3b3Kn4CfQT/k+821E2y68MTgfN37JoVHUZwPPdy8KGvEpuHLP5kYya7eHR 9GjA== X-Gm-Message-State: AOAM533D97hqF0vJZsPOmGfcYXKYHIaH1iuiJ23MVkyMSAJhaoWUAYC7 rZR89QPSKBbp3pY0jNlnGfA= X-Google-Smtp-Source: ABdhPJxafdY3wzwsE3nWndD8a+Tz8AuK8P+cxxtLyIH8fPdH/CbdGOoBaBsh/wxXO/+pPitC+UGQmQ== X-Received: by 2002:adf:e30e:: with SMTP id b14mr4120044wrj.195.1603823526969; Tue, 27 Oct 2020 11:32:06 -0700 (PDT) Received: from localhost.localdomain (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id m9sm2864148wmc.31.2020.10.27.11.32.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 11:32:06 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Maxime Ripard , Chen-Yu Tsai , Rob Herring , Mark Brown , Liam Girdwood Cc: Jaroslav Kysela , Takashi Iwai , Marcus Cooper , Jernej Skrabec , alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , Rob Herring Subject: [PATCH v9 13/14] dt-bindings: sound: sun4i-i2s: Document H3 with missing RX channel possibility Date: Tue, 27 Oct 2020 19:31:48 +0100 Message-Id: <20201027183149.145165-14-peron.clem@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201027183149.145165-1-peron.clem@gmail.com> References: <20201027183149.145165-1-peron.clem@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Like A83T the Allwinner H3 doesn't have the DMA reception available for some audio interfaces. As it's already documented for A83T convert this to an enum and add the H3 interface. Acked-by: Rob Herring Signed-off-by: Clément Péron --- .../devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml index 606ad2d884a8..a16e37b01e1d 100644 --- a/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml +++ b/Documentation/devicetree/bindings/sound/allwinner,sun4i-a10-i2s.yaml @@ -70,7 +70,9 @@ allOf: properties: compatible: contains: - const: allwinner,sun8i-a83t-i2s + enum: + - allwinner,sun8i-a83t-i2s + - allwinner,sun8i-h3-i2s then: properties: