From patchwork Mon Aug 26 18:07:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code Kipper X-Patchwork-Id: 11115217 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B541D1398 for ; Mon, 26 Aug 2019 18:11:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 45DE42186A for ; Mon, 26 Aug 2019 18:11:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="jTNq+Hkw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EgvQISlK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45DE42186A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6017016CA; Mon, 26 Aug 2019 20:10:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6017016CA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566843071; bh=NwmcmV5XWNDL2ri2LqCJato5Eg4y5PfA4RnAXUCjpAk=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=jTNq+HkwuJiDRfWU8DjFzrf7efa89LdnI+aOx1/IXezyejxM4h0d3U0Pj2lftZF5U C2Mo4n09aQKntZauLObgBHQTwd5FJRMgZlDM4BxKLpcxVlrv/k4O7LN1kD9gmP5AD2 s7xbpB2NajLmSl09gpkHz12fukEcWsgkc240JBwg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 24ACDF805FC; Mon, 26 Aug 2019 20:07:56 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A133DF80390; Mon, 26 Aug 2019 20:07:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 644A6F80444 for ; Mon, 26 Aug 2019 20:07:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 644A6F80444 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EgvQISlK" Received: by mail-lf1-x143.google.com with SMTP id x3so12995404lfn.6 for ; Mon, 26 Aug 2019 11:07:38 -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=/JiaxK/MezpMCfRnwIhrVE4IjsVGzm6Nc+QZ48CrwOY=; b=EgvQISlKJ+5es9A7LQNq8YnjzB6ejn9iKFaSRGei+/ko/Yjunes3Znum8wo5UnxF2Z Lz3PC6TCzXPQrogqz+mh3pSChnbCcndR6u0HBdD0n+vohJBgqkIZk719s9zvhhuW1HP3 5HeMxENPm0LECvwvf/t0HXvBT9WgLhQEp5jUp8q4CRaopGDRFdctsx1PR/ttozm+/n/g 3uYoHXVB8CCSEl3QkoRrbw8UHsTFhX/5x4Lv3+mGx1XPfT8Y+h/AkJN8q1p57iCO8EWv 4xsX4dL2ZDGxcO6Usje9s1b2Y7lhJoT1lislmHWIKcK9hBu05ewqcKYUkMQvliw5WLy8 sSFA== 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=/JiaxK/MezpMCfRnwIhrVE4IjsVGzm6Nc+QZ48CrwOY=; b=rVHQ8rcnRxcpkeGCq5LxzpOZHsiB86bki+85Y5DwCvVy1Cmqx0paayxjzyn8alFveM zLG06MqoveUd+SsxWg8ZcravcjfaQ1ybO/a0Aoj069bufssEjNCosmZGdDlT/WmNkfAC fgU4Z+4pGXAG8onnPfjyA8Zw19AY+AfpwEcLfK1mdI/BRkwGo5RdOjJ2v48GouN3O6qB QmZPqow1eqI39L2UcQ3RZsxZjqISROsmWbI0bxlxDb0FtenAFlYbM/wjmj7w5BMrFIr/ 8JswgEEH9EpiKufjivMUtmmDngNrQfeF94tHdZPdg4Wr2p1asnlsmTuUfHpx5ka7zXZ3 t83w== X-Gm-Message-State: APjAAAWFWnVXMBwGt3R03c6m1VU3xxpD3Y1uBlGBulP7yXwX7Gs+lgPn /1MS+bdLOQsj8pXP6xcpdRI= X-Google-Smtp-Source: APXvYqzvwQEeLDNp/oEFJY/UIHzL09RuXN5pNsb/Lcsmp9zAEJz0rTV9pQLcZzBHFdtOCEO3bmOhPg== X-Received: by 2002:ac2:5939:: with SMTP id v25mr11839754lfi.115.1566842858249; Mon, 26 Aug 2019 11:07:38 -0700 (PDT) Received: from localhost.localdomain (c213-102-74-69.bredband.comhem.se. [213.102.74.69]) by smtp.gmail.com with ESMTPSA id u3sm2215564lfm.16.2019.08.26.11.07.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 11:07:37 -0700 (PDT) From: codekipper@gmail.com To: mripard@kernel.org, wens@csie.org, linux-sunxi@googlegroups.com Date: Mon, 26 Aug 2019 20:07:32 +0200 Message-Id: <20190826180734.15801-2-codekipper@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826180734.15801-1-codekipper@gmail.com> References: <20190826180734.15801-1-codekipper@gmail.com> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Marcus Cooper , lgirdwood@gmail.com, linux-kernel@vger.kernel.org, be17068@iperbole.bo.it, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH v6 1/3] ASoC: sun4i-i2s: incorrect regmap for A83T X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Marcus Cooper The regmap configuration is set up for the legacy block on the A83T whereas it uses the new block with a larger register map. Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T") Signed-off-by: Marcus Cooper --- sound/soc/sunxi/sun4i-i2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 57bf2a33753e..34575a8aa9f6 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -1100,7 +1100,7 @@ static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = { static const struct sun4i_i2s_quirks sun8i_a83t_i2s_quirks = { .has_reset = true, .reg_offset_txdata = SUN8I_I2S_FIFO_TX_REG, - .sun4i_i2s_regmap = &sun4i_i2s_regmap_config, + .sun4i_i2s_regmap = &sun8i_i2s_regmap_config, .field_clkdiv_mclk_en = REG_FIELD(SUN4I_I2S_CLK_DIV_REG, 8, 8), .field_fmt_wss = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 2), .field_fmt_sr = REG_FIELD(SUN4I_I2S_FMT0_REG, 4, 6), From patchwork Mon Aug 26 18:07:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code Kipper X-Patchwork-Id: 11115213 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CAC4F1398 for ; Mon, 26 Aug 2019 18:09:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CF6D20850 for ; Mon, 26 Aug 2019 18:09:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="SyDSHdHH"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X5ZI20/C" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CF6D20850 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 24F5816BF; Mon, 26 Aug 2019 20:08:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 24F5816BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566842970; bh=/JHtPOAnU0ugHyDr5bX6DVwxvMaDIfUkbeQ7BvJESUg=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=SyDSHdHHCgyFZWD3UGPy2jN+bk7kahu0pyhrerf/VXPe/BWqSmHBEd9mGXUy7EAPi Bp3f0QW70wL1u+/y5xlu7V+5Pipcgh3dDKSI4G0eZZoWfoqwnd1lNAW+sCrYmep36L 0SEWsXveZGxQFz93VTeU+VXCPAGYcsQlZjA1gZNI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id DF3A9F80143; Mon, 26 Aug 2019 20:07:50 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 18D88F80390; Mon, 26 Aug 2019 20:07:45 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 78D34F802BC for ; Mon, 26 Aug 2019 20:07:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 78D34F802BC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X5ZI20/C" Received: by mail-lj1-x242.google.com with SMTP id f9so15901411ljc.13 for ; Mon, 26 Aug 2019 11:07:40 -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=ukuuUBdDBhaCevdSYR2WXtuXiYA+/tk7SlxUyZaPi3U=; b=X5ZI20/CE7C81ZGz/W4Y/X/QmOCV5xtQN4RNxkIU7eUjrSA0n/z9clpTiZX8hVFZoH HNGhFUWhuJTyoDCrhkWLZsZroLsojNdY+wFLYWSJWG1uyRHfg0sORzhZbRAip95gEy/7 lqUNDC53zrLWta46uPCP0BcIrIrFO60CvRXNNG0KmVAB30fJrH62qtQY/mhNh6g0E1Q/ yIJJ0HvGKPGAo+cp+UVVk3Y/8NQQKxsGBUpQ0lkk26zIGilaPpgZN1C+hNOQsHFNxntS XW44tdSO2UMcU70Gq8LOsItG6SnVdwyMPE5UtwaTK8Dv7qCbF9801WXmw5EC9N+ONuod k0Nw== 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=ukuuUBdDBhaCevdSYR2WXtuXiYA+/tk7SlxUyZaPi3U=; b=f/seZA7Cm4Di84rwctC+ZY/ptJrHd8MICqCTG/9zC0/T637qBo3bkgDEOK3j9Yckp/ eU1cmtldSx47pXGOgybZtLgumQeYHIKylOSd3fZKFTDimPOINxL+tr3SP7RTuEPsXxRL 8ZwZSvtitB24XCWqshUSMqRcenlEOuxcB0/3dDdEesTVitNdAMcNKozm4ri2RWerMrpM e/gnjy7D8MES9LNrnKTdwc+jiGOYS2QoDlD+nOd3dX8s5IkItGSzPv9WM4iYiaBg+nIn AF47RQOgslKJFYAnmhIEaUjoJEC9Vmfm734eRfN5g7O8jPyQRDxULzH1yG62L53WYUT5 VIHA== X-Gm-Message-State: APjAAAUm3k2gSkwVfhM6WeWoAfQOvPIXBB1J5dE2kqOPxFmO7MjzVYCE dH2u4JyHMYUKd4Q9gc17fn4= X-Google-Smtp-Source: APXvYqyYEpihsZF+JV1SShitkdzIKCoMZNNq7L/fwZ9FV8upcocQMT8ztPvcFOkyMOEOCgpILghRAA== X-Received: by 2002:a2e:6393:: with SMTP id s19mr11066423lje.46.1566842859207; Mon, 26 Aug 2019 11:07:39 -0700 (PDT) Received: from localhost.localdomain (c213-102-74-69.bredband.comhem.se. [213.102.74.69]) by smtp.gmail.com with ESMTPSA id u3sm2215564lfm.16.2019.08.26.11.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 11:07:38 -0700 (PDT) From: codekipper@gmail.com To: mripard@kernel.org, wens@csie.org, linux-sunxi@googlegroups.com Date: Mon, 26 Aug 2019 20:07:33 +0200 Message-Id: <20190826180734.15801-3-codekipper@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826180734.15801-1-codekipper@gmail.com> References: <20190826180734.15801-1-codekipper@gmail.com> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Marcus Cooper , lgirdwood@gmail.com, linux-kernel@vger.kernel.org, be17068@iperbole.bo.it, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH v6 2/3] ASoC: sun4i-i2s: Add regmap field to sign extend sample X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 whilst 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. Signed-off-by: Marcus Cooper --- 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 34575a8aa9f6..056a299c03fb 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -135,6 +135,7 @@ struct sun4i_i2s; * @field_clkdiv_mclk_en: regmap field to enable mclk output. * @field_fmt_wss: regmap field to set word select size. * @field_fmt_sr: regmap field to set sample resolution. + * @field_fmt_sext: regmap field to set the sign extension. */ struct sun4i_i2s_quirks { bool has_reset; @@ -145,6 +146,7 @@ struct sun4i_i2s_quirks { struct reg_field field_clkdiv_mclk_en; struct reg_field field_fmt_wss; struct reg_field field_fmt_sr; + struct reg_field field_fmt_sext; const struct sun4i_i2s_clk_div *bclk_dividers; unsigned int num_bclk_dividers; @@ -177,6 +179,7 @@ struct sun4i_i2s { struct regmap_field *field_clkdiv_mclk_en; struct regmap_field *field_fmt_wss; struct regmap_field *field_fmt_sr; + struct regmap_field *field_fmt_sext; const struct sun4i_i2s_quirks *variant; }; @@ -354,6 +357,10 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai, regmap_field_write(i2s->field_clkdiv_mclk_en, 1); + + /* Set sign extension to pad out LSB with 0 */ + regmap_field_write(i2s->field_fmt_sext, 0); + return 0; } @@ -1073,6 +1080,7 @@ static const struct sun4i_i2s_quirks sun4i_a10_i2s_quirks = { .mclk_dividers = sun4i_i2s_mclk_div, .num_mclk_dividers = ARRAY_SIZE(sun4i_i2s_mclk_div), .get_bclk_parent_rate = sun4i_i2s_get_bclk_parent_rate, + .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8), .get_sr = sun4i_i2s_get_sr, .get_wss = sun4i_i2s_get_wss, .set_chan_cfg = sun4i_i2s_set_chan_cfg, @@ -1091,6 +1099,7 @@ static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks = { .mclk_dividers = sun4i_i2s_mclk_div, .num_mclk_dividers = ARRAY_SIZE(sun4i_i2s_mclk_div), .get_bclk_parent_rate = sun4i_i2s_get_bclk_parent_rate, + .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8), .get_sr = sun4i_i2s_get_sr, .get_wss = sun4i_i2s_get_wss, .set_chan_cfg = sun4i_i2s_set_chan_cfg, @@ -1109,6 +1118,7 @@ static const struct sun4i_i2s_quirks sun8i_a83t_i2s_quirks = { .mclk_dividers = sun8i_i2s_clk_div, .num_mclk_dividers = ARRAY_SIZE(sun8i_i2s_clk_div), .get_bclk_parent_rate = sun8i_i2s_get_bclk_parent_rate, + .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 4, 5), .get_sr = sun8i_i2s_get_sr_wss, .get_wss = sun8i_i2s_get_sr_wss, .set_chan_cfg = sun8i_i2s_set_chan_cfg, @@ -1127,6 +1137,7 @@ static const struct sun4i_i2s_quirks sun50i_a64_codec_i2s_quirks = { .mclk_dividers = sun4i_i2s_mclk_div, .num_mclk_dividers = ARRAY_SIZE(sun4i_i2s_mclk_div), .get_bclk_parent_rate = sun4i_i2s_get_bclk_parent_rate, + .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8), .get_sr = sun4i_i2s_get_sr, .get_wss = sun4i_i2s_get_wss, .set_chan_cfg = sun4i_i2s_set_chan_cfg, @@ -1154,6 +1165,12 @@ static int sun4i_i2s_init_regmap_fields(struct device *dev, if (IS_ERR(i2s->field_fmt_sr)) return PTR_ERR(i2s->field_fmt_sr); + i2s->field_fmt_sext = + devm_regmap_field_alloc(dev, i2s->regmap, + i2s->variant->field_fmt_sext); + if (IS_ERR(i2s->field_fmt_sext)) + return PTR_ERR(i2s->field_fmt_sext); + return 0; } From patchwork Mon Aug 26 18:07:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code Kipper X-Patchwork-Id: 11115215 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1AB7113B1 for ; Mon, 26 Aug 2019 18:10:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9EC8920850 for ; Mon, 26 Aug 2019 18:10:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="opqpmOqM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GwyfHcpH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9EC8920850 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B060216CB; Mon, 26 Aug 2019 20:09:30 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B060216CB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1566843020; bh=YNESQM51czk2CIi08wzCgfrRtTBBNIeSGaSVCH4wlwE=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=opqpmOqMi+vAF/fZDpQfeC3T9qzUBHd5wU/83oKvK/x062AQs8uPvWzmm3Kmu3wCq 21cI6HGWMk8aQKUEzmfpIFT9luJERnWvF1PP0jc1Js7XGe9vcQea3JoSan1/m4jDp3 SMFOiglAQnS1RcQ9diEDgdQyYzB0YL32bvJUHMfU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 05849F80445; Mon, 26 Aug 2019 20:07:53 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 49109F80390; Mon, 26 Aug 2019 20:07:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C073BF8014A for ; Mon, 26 Aug 2019 20:07:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C073BF8014A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GwyfHcpH" Received: by mail-lf1-x144.google.com with SMTP id n19so12970735lfe.13 for ; Mon, 26 Aug 2019 11:07:41 -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=P/7Ac+4X6tEO+jpy2vLz06LyblKHxTeQKnAx8UL/5B8=; b=GwyfHcpHh6oCnOObXxprhf+5ZJySN4hhx4pk0Sfe4JaSQbx2PWs9c+R43Ast0qnzoE LcwntTn4M3aJIAuL3KYpk9Od3Dg+XmFowEempsIwPBGnd9R/8B30Vox8n2jrJZgNqdjg IeR3b/03SRv4FV10zzkl6pBWJbPoGrM/a5yPavLCDNoQKVXQbtep+q0HCzmTc7/G/M+f qwC0oLckmd8bIeU/IDJb0jjeN3i9HBL11iHIynCLwl+3mm0L0kpUsXZ6jugjiZAUgniU XC/HioTr/phLLSjNCYaqeaJjc+mdMfvR6IOZ/SM7Rqa4jIb5qpIbYLf4JRd972wjeeFZ BRmA== 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=P/7Ac+4X6tEO+jpy2vLz06LyblKHxTeQKnAx8UL/5B8=; b=Qp6NE+NoWMey4dd/PzpMTKqpZcYXZjiML3McCQL/jiH7MlxnFTwPxPaBQFWXcYPFnT zwokBrbTZkpU1RRZVZniB2jiBWJ8rZJCsv8O2rs8teo53gKmuV07VTmvbMuMJKkdyskG MLQJDLbK65gKg7aRbaqzbtHCPjaPEkzqVnL8g5tbeF9OxqHwK2/HLygaVOc8BF6EyKE9 SFqvlH8ZFrZEXrmC6TgbEhhd2nLiP5f+MAICkLImV4PdBmOX8hAlJY8S60mbNuM3X01T XiPZdpvXcSxoyVDntLPSbLv13yFoBgpIkdz6dW/M5HC/h4TH74j1eX2asleEEAuGtEb1 Dpww== X-Gm-Message-State: APjAAAWmW+kO1BA/Hi3j4uEIcCCo3ODA6ToPM/Bem6ko70Z/XjRHgK4P IeMPuqvuhYBEII3vpEk9G7c= X-Google-Smtp-Source: APXvYqzMGtg6mqhU7IhdflXEfGSyI6kfm6cUUGMijAWKYBGqX9ttFftleyS3u/IvkUS1sQRh3Ba4Qw== X-Received: by 2002:ac2:44af:: with SMTP id c15mr12669898lfm.32.1566842860391; Mon, 26 Aug 2019 11:07:40 -0700 (PDT) Received: from localhost.localdomain (c213-102-74-69.bredband.comhem.se. [213.102.74.69]) by smtp.gmail.com with ESMTPSA id u3sm2215564lfm.16.2019.08.26.11.07.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 11:07:39 -0700 (PDT) From: codekipper@gmail.com To: mripard@kernel.org, wens@csie.org, linux-sunxi@googlegroups.com Date: Mon, 26 Aug 2019 20:07:34 +0200 Message-Id: <20190826180734.15801-4-codekipper@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826180734.15801-1-codekipper@gmail.com> References: <20190826180734.15801-1-codekipper@gmail.com> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Marcus Cooper , lgirdwood@gmail.com, linux-kernel@vger.kernel.org, be17068@iperbole.bo.it, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH v6 3/3] ASoC: sun4i-i2s: Adjust LRCLK width X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Marcus Cooper Some codecs such as i2s based HDMI audio and the Pine64 DAC require a different amount of bit clocks per frame than what is calculated by the sample width. Use the values obtained by the tdm slot bindings to adjust the LRCLK width accordingly. Signed-off-by: Marcus Cooper --- sound/soc/sunxi/sun4i-i2s.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c index 056a299c03fb..0965a97c96e5 100644 --- a/sound/soc/sunxi/sun4i-i2s.c +++ b/sound/soc/sunxi/sun4i-i2s.c @@ -455,7 +455,10 @@ static int sun8i_i2s_set_chan_cfg(const struct sun4i_i2s *i2s, break; case SND_SOC_DAIFMT_I2S: - lrck_period = params_physical_width(params); + if (i2s->slot_width) + lrck_period = i2s->slot_width; + else + lrck_period = params_physical_width(params); break; default: