From patchwork Mon Nov 11 16:55:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code Kipper X-Patchwork-Id: 13870973 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 377E61A256E; Mon, 11 Nov 2024 16:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731344167; cv=none; b=pRicxgl9+6qimrz59tV9R/V+/t6nf0ykS+uc337ioLUT+m9vt96L0WRzCSccC8s+nY8lEveS7uZfwDrYZoNMKKK4K+MDLBpOJZh7PsnFDru7A34IDOe3sd8iQ2n1GmyjIoSkTwKHrj/LLUrhAYt39IatGVhW/7EkhwH9g+GOGL0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731344167; c=relaxed/simple; bh=GO5aSQ4UwyOlMXLzUsIbxvE6Gor/9I12CLAiYV7yBd0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t+p4CHDByevTz6nSlOQZHNhRX6Go0KyuExgsJCwP5R5w/sjvFv/+gZq/+3VTW2MOgv6D4aqr8mvBMccW6Acj2qpn9oGu+jrz/JFH3rcrEOCdNq0Aikp5DwX2Ry0K1CyhKKgarr2VozDHdHMjxhsqB5uNxkb9xSykKxaw/bRpL6A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=liifgJYA; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="liifgJYA" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-539e8607c2aso5299278e87.3; Mon, 11 Nov 2024 08:56:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731344164; x=1731948964; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=I+Q3XwignOREPSIds84RjtpG+Fky7bPoezx4NsmrbSc=; b=liifgJYA1OyDhF4ajQouoIcJNYqf7tZsF39fcf1RUAUGzerFTcvESmvlD26Q0I5KTN 1PWiLGq6NwvfSYYDmvOgLnOYXlMAUM8HvcG//z0bW6yAikLuaVkWAxJio4Y+qi9LDdhN AXDjWlOTxQpKfLeMO1iNJEGLG/6JgP0QtVDbchbDJP6YXL4HmZt/zho2qA8bYWkIfnAa ISH/6MOItiX5IQvRigWY0HOeTBJTNYRcYXUdZnIhJ1mZS+4MdVhNj1xdpyQOt9Yv5ezP uK0AR104lbXLeb0Dd93npv14fq8RyjRbA94idbW3mVn6CaqabJ45u5kml/nRtD9Ng9WV aOdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731344164; x=1731948964; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I+Q3XwignOREPSIds84RjtpG+Fky7bPoezx4NsmrbSc=; b=wBe+rxLkjc6ki3JcV3HSp/Riqik008PppKcXevu6CwjNHc07j2uI9ku9xlpKAqdf22 0AReflAAnVDfcx30ItsE3tOEC/Z9C9mt656tA3uiEeoEIp346Ct29oLpwLnMX7aRRW22 8MtHcVmTW6WuyjYjypv/LaqAxzt7CaaXasDlOo2L/a9Nhb3jsKnPRONVrJLT1UutYaHF wXsfS/+tz3LzRauO6vxvWr6eavQ50yu91qUf60DjPssMQzA6ovQHg+aHFpou0tqZl82P WKgjYLvfssbxjukDtoWAJBbvEe+d6eDIQGsDC9qQZEsVHhvJLhpsuPf78bfrOZQXhSP2 2jqQ== X-Forwarded-Encrypted: i=1; AJvYcCUzcGpcHovUNFRYMh+hFrJONps5/xsR22sxJFaUM43JTmqfMXXgjAacnR4r2/lwbAQjY3BVC6bIU8rDn8tObc1M@vger.kernel.org, AJvYcCWzN94DFMvinf5Bn6rtgE7t/3uj2puY251r6KDV6fSiuhpAK46ux8Ez/TLAilCH1A8MEptftSIsbRHWjzk=@vger.kernel.org X-Gm-Message-State: AOJu0YxjsXyuUxYwRS6ds/6mJbvbyujPP0lTeVuy4ImUzhuwEc/xe9+S xnjPCVZxp481kAEyppQWIydGIUIJ/1Enk7UgMLR00gojVNCpK16WlnT/MUUr X-Google-Smtp-Source: AGHT+IGTVIBZ001X2A47u65/h7kXIx7wTYYbJhZz0Pv22iqQ4Lq7f4suNjhPPU3TWq1X0o6RVDNa6A== X-Received: by 2002:a05:6512:158e:b0:53b:1fea:ba96 with SMTP id 2adb3069b0e04-53d862eb0fdmr6231906e87.50.1731344163728; Mon, 11 Nov 2024 08:56:03 -0800 (PST) Received: from localhost.localdomain (c90-142-33-119.bredband.tele2.se. [90.142.33.119]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53d826a7387sm1624737e87.140.2024.11.11.08.56.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 08:56:03 -0800 (PST) From: codekipper@gmail.com To: linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev, linux-sound@vger.kernel.org, lander@jagmn.com Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, jernej.skrabec@gmail.com, samuel@sholland.org, andre.przywara@arm.com, wens@csie.org, u.kleine-koenig@baylibre.com, Marcus Cooper Subject: [PATCH 1/3] ASoC: sun4i-spdif: Add clock multiplier settings Date: Mon, 11 Nov 2024 17:55:29 +0100 Message-ID: <20241111165600.57219-2-codekipper@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111165600.57219-1-codekipper@gmail.com> References: <20241111165600.57219-1-codekipper@gmail.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: George Lander There have been intermittent issues with the SPDIF output on H3 and H2+ devices which has been fixed by setting the s_clk to 4 times the audio pll. Add a quirk for the clock multiplier as not every supported SoC requires it. Without the multiplier, the audio at normal sampling rates was distorted and did not play at higher sampling rates. Fixes: 1bd92af877ab ("ASoC: sun4i-spdif: Add support for the H3 SoC") Signed-off-by: George Lander Signed-off-by: Marcus Cooper --- sound/soc/sunxi/sun4i-spdif.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index 0aa4164232464..7cf623cbe9ed4 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -176,6 +176,7 @@ struct sun4i_spdif_quirks { unsigned int reg_dac_txdata; bool has_reset; unsigned int val_fctl_ftx; + unsigned int mclk_multiplier; }; struct sun4i_spdif_dev { @@ -313,6 +314,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream, default: return -EINVAL; } + mclk *= host->quirks->mclk_multiplier; ret = clk_set_rate(host->spdif_clk, mclk); if (ret < 0) { @@ -347,6 +349,7 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream, default: return -EINVAL; } + mclk_div *= host->quirks->mclk_multiplier; reg_val = 0; reg_val |= SUN4I_SPDIF_TXCFG_ASS; @@ -540,24 +543,28 @@ static struct snd_soc_dai_driver sun4i_spdif_dai = { static const struct sun4i_spdif_quirks sun4i_a10_spdif_quirks = { .reg_dac_txdata = SUN4I_SPDIF_TXFIFO, .val_fctl_ftx = SUN4I_SPDIF_FCTL_FTX, + .mclk_multiplier = 1, }; static const struct sun4i_spdif_quirks sun6i_a31_spdif_quirks = { .reg_dac_txdata = SUN4I_SPDIF_TXFIFO, .val_fctl_ftx = SUN4I_SPDIF_FCTL_FTX, .has_reset = true, + .mclk_multiplier = 1, }; static const struct sun4i_spdif_quirks sun8i_h3_spdif_quirks = { .reg_dac_txdata = SUN8I_SPDIF_TXFIFO, .val_fctl_ftx = SUN4I_SPDIF_FCTL_FTX, .has_reset = true, + .mclk_multiplier = 4, }; static const struct sun4i_spdif_quirks sun50i_h6_spdif_quirks = { .reg_dac_txdata = SUN8I_SPDIF_TXFIFO, .val_fctl_ftx = SUN50I_H6_SPDIF_FCTL_FTX, .has_reset = true, + .mclk_multiplier = 1, }; static const struct of_device_id sun4i_spdif_of_match[] = { From patchwork Mon Nov 11 16:55:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code Kipper X-Patchwork-Id: 13870974 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74F911A303C; Mon, 11 Nov 2024 16:56:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731344169; cv=none; b=TDHxFeH8NTpHYntOk/JFdJ5zQq1S0zoyY9nnenrX/k8XkCXyHSew4cU1GsGd6el+/622an6/82oNYe2+g3gjGF9/hzxjqc9AJkJCMGFIWko38Wuu4Jh9WSCha+QrDeiVGgYesz1TSktDWRT554ZXRyGaofkDDTT26BZbpAOeBPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731344169; c=relaxed/simple; bh=BHuuImuZ9TK/Z6I6vu+VYwqEVvV0g6bfeFmkl8Tc8aI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MnvzCMe0z3ooiiMOFFeeezutk6NSbwVfbdf2Cq+EToZHvxY9ZnmZomGMQjax2UQrybklEo93uwwfmCVc/pJys11YSJddJQGkO5HD+d+qQATrr34j1HP1XYu+sSbA8TyjpdLULXGl5jDr3E5QgOalSi+cQG9kJWRENnogmURezis= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bRucuyHk; arc=none smtp.client-ip=209.85.167.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bRucuyHk" Received: by mail-lf1-f53.google.com with SMTP id 2adb3069b0e04-539eb97f26aso4563175e87.2; Mon, 11 Nov 2024 08:56:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731344165; x=1731948965; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Cq2vv+vlrS+liCK+o2xaokofGSYSa1PC7UgkAUeyMv0=; b=bRucuyHknPaZ+LPyzU+jhJnIb/cKyjvOnYM5SfCSSaX6P/rwNDfBvVtamDy0eN1rpW F1eK7pfaJoqe84SS0p6q5pbL46bk7Dr7odQLakCr4qmo6eCVHbJv+FG9zYqUeAjQWFMv h3wUb1QSjnG08dDW6qdmlS35Mu+thjILzV6wPfORVKGrD9ShFhAddCbi8UH4zqWVRyjk vT+hkdeEmpWuNRuOADLAk7FzgmqjnZtIpRAPPsYJ8bMd7Z4hFAOVt+g0quWtkz2J1jqH 7S7bnG1V7L1xANn98gpa+8eolpw60Cn3PaN3KnDO8QbGMawJBG+eC3abuUMWNE7I9XJj iVag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731344165; x=1731948965; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Cq2vv+vlrS+liCK+o2xaokofGSYSa1PC7UgkAUeyMv0=; b=AAihy85E6KZcvuAm3uTv/m+pOoi9LXoETVYIA7yazgXpXG+Fn3fA+pU0fmSX7ZMrU6 yA96j3OQJCGg9jx5974La7mf6wfn+TfkPpojgkF7vIYWwpHIpoL4xmFUsamuT4N4ax1U qvpkIyordlamwcLXM9+nqG6AiON7xPyHD/EJKf8vYGAiNwPaLhZDogTiDpRsRHzdMI/5 oESJQtX9Zl9Q23OzyZa6QoBCjCDhEyL3c4iS6yO7CaRaOpwAbJUe1TwUB6VAbBaOG/hg fBXiSO899KrsgU82M73R8choL1qSXRnnhB3+WxyaEGKBGbM/hsGb4W+QF6MBPeSHVQKt W1fw== X-Forwarded-Encrypted: i=1; AJvYcCUQrQeksn7+MmpShSy/qeAH7WB/EmkfK0e/gb8zV+1UXBjojzW4x7o2HUPJL/1zsk78NVBf6XX9OftFT9owQerh@vger.kernel.org, AJvYcCWR/7Rzqj2lryq8fTuDRhGBc1Pow0PfZAjrAF/vCuKFxxx+Z3mG77ek5URKY0+OmhUaA9mX+oQa5lEJuX4=@vger.kernel.org X-Gm-Message-State: AOJu0YxeJ81iMZua1eVKmJgoCpQRgzMenu6krc3hLLOB14ndOHGSwps9 NFsO105E3OtfyxeIxEUT+n5CwFwNX8Wdh6H0A1dCeK65VMttG/yVCyXmL0U/ X-Google-Smtp-Source: AGHT+IGVrnZ4G5gv1axm1AEb+TVo9siTiIXy9Fiw2dPk9skT6S15TI18REvnsc1gh1yGg2BeuWdGgA== X-Received: by 2002:a05:6512:3ca2:b0:53c:74dc:2252 with SMTP id 2adb3069b0e04-53d862793b6mr5909400e87.49.1731344165064; Mon, 11 Nov 2024 08:56:05 -0800 (PST) Received: from localhost.localdomain (c90-142-33-119.bredband.tele2.se. [90.142.33.119]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53d826a7387sm1624737e87.140.2024.11.11.08.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 08:56:04 -0800 (PST) From: codekipper@gmail.com To: linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev, linux-sound@vger.kernel.org, lander@jagmn.com Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, jernej.skrabec@gmail.com, samuel@sholland.org, andre.przywara@arm.com, wens@csie.org, u.kleine-koenig@baylibre.com, Marcus Cooper Subject: [PATCH 2/3] ASoC: sun4i-spdif: Always set the valid data to be the MSB Date: Mon, 11 Nov 2024 17:55:30 +0100 Message-ID: <20241111165600.57219-3-codekipper@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111165600.57219-1-codekipper@gmail.com> References: <20241111165600.57219-1-codekipper@gmail.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Marcus Cooper This doesn't affect 16bit formats and allows us to properly run 24bit formats. Signed-off-by: Marcus Cooper --- sound/soc/sunxi/sun4i-spdif.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index 7cf623cbe9ed4..5a9407aaa1a19 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -202,6 +202,10 @@ static void sun4i_spdif_configure(struct sun4i_spdif_dev *host) regmap_update_bits(host->regmap, SUN4I_SPDIF_FCTL, quirks->val_fctl_ftx, quirks->val_fctl_ftx); + /* Valid data at the MSB of TXFIFO Register */ + regmap_update_bits(host->regmap, SUN4I_SPDIF_FCTL, + SUN4I_SPDIF_FCTL_TXIM, 0); + /* clear TX counter */ regmap_write(host->regmap, SUN4I_SPDIF_TXCNT, 0); } @@ -323,9 +327,6 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream, return ret; } - regmap_update_bits(host->regmap, SUN4I_SPDIF_FCTL, - SUN4I_SPDIF_FCTL_TXIM, SUN4I_SPDIF_FCTL_TXIM); - switch (rate) { case 22050: case 24000: From patchwork Mon Nov 11 16:55:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Code Kipper X-Patchwork-Id: 13870975 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80D6A1A42A5; Mon, 11 Nov 2024 16:56:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731344170; cv=none; b=bEod3NLPypVhEC7gEDtYDVb7RSBHlSYlHkDIgDgP97/K93ecdpnbHbrmt9WOPedbIcxKgB7sU361XFCz0VpZtBRkpEvnsw5VIl2iNsGb1KyquYqDLexIknMVfrwFQN+X/V6brTZrXj2C1haX1bFFBEox44FFSwoGMQJN7odj4mM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731344170; c=relaxed/simple; bh=3kLzdXkGZ0goZ7AL14qJZ24tx/PDfvKjSoul4AfIyWc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gIJ8jH14WlNYFA2265EO6TNIoKuy3RrZuI2phH+26n3zvPFwvY8VSfwJDyIHsrHP0X3H8LuWbVA7z0YsrbUdtTc8EhWNIoVZDtFRVg6VJsNFifDcGb673eSVbn7iEjehnIu9y0b/dNC97wYt/7wUd4tWvuinOBcrXUQQnub64KY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MJYqlWzk; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MJYqlWzk" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-53a007743e7so5628800e87.1; Mon, 11 Nov 2024 08:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731344166; x=1731948966; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BGIyKdlKD2rjdr8nGTfStLxE86UsO3KrqZkzx50EpGg=; b=MJYqlWzk9CAAaGcNfTsVszqe6mFrTBTez7AXzIvjA0KiJ2VV1jskLmYzlWrfAW+wMK e1zIIvuRmsdLAwAKRPubgzrAv5aL5nmFWFIQU7tS/G1y9pzsyihYVgE62xG01/uQQw5u CxzRRGq8JWdC9e1K2yUsWfU7M/x/79O8+SNn72u1c8rkXqPQx8gqUqmV1xYsFTAbOiQh qe3DmIZTxS3RDd2OeEoIJaawos7CeYCB2K/X1NAhEoFV9sRx8kl/QVynaisxngS0JcQ8 z2j3NJzkiYh4QDhVnckqs2hAWc9w4/LBh0R4wzXGj0BON5inU5Sqy9zLIBfy+Q14alV+ FpTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731344166; x=1731948966; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BGIyKdlKD2rjdr8nGTfStLxE86UsO3KrqZkzx50EpGg=; b=wAhitgozH/kYKChRNdctQ2vpEfXyoxr5pDgzNJV7Q+Ddgc0LpsTM0/Aynr7HocmUj+ knFjlUAgb/UfuVSP1u8Xj8cCnde49AdVQ6rJR9SudUXIGNDwbrLUH2Pk0lpjMFR/P3PL Yk++5kFjlNpo+4/5/B5DakIJ+8eOyIjodduLBIzeE+5HtUTRaeJOytfOIULe/Io9sISm iRvFbFNJ9X3z4yFV4l0BVIC4yzRkZo/wc81GP49wb+kYpYIyXQGORHbJIIzrcuUZ5FTG EJa8NTJCC5Md0looW6dUKZadvCAjwkQud8MzaVf1joug1iOOlLWN0V+XMFaJM+x10n68 PF8Q== X-Forwarded-Encrypted: i=1; AJvYcCV53OOtGT8HGE7hfNvRIRrkhwZ12wiBM4ovmK919AbkPaIuL/kUaU8IOTgoXA9iccJtDtuxejegaKuzbOk=@vger.kernel.org, AJvYcCVNa7JTLd1lEgswuVj9TWaMWxtR1YPaEq0OqKlS3BssLeW0wAM7XsZasrTKKC5p+57QY6TOmRH2QYOtmS+2HW20@vger.kernel.org X-Gm-Message-State: AOJu0YwELH72N3hAT+O3NHVbc7fKhvmqL49hn+JNSg+ntQQWk/7Y6HTA CGKLHLcmuB6GQbklh8BPNQTddsgdSUbdBNAN3NomBBc11uTeHglenJB9927J X-Google-Smtp-Source: AGHT+IFnmYnGoXcuYt3AhU6Y+aYhmeuhcBjoUc/SyewEzKh1ml1lrjiD9FwIjoozeWWRRSk/eMeAlQ== X-Received: by 2002:a05:6512:6d1:b0:539:e873:6d7 with SMTP id 2adb3069b0e04-53d86228c57mr5864656e87.1.1731344166311; Mon, 11 Nov 2024 08:56:06 -0800 (PST) Received: from localhost.localdomain (c90-142-33-119.bredband.tele2.se. [90.142.33.119]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53d826a7387sm1624737e87.140.2024.11.11.08.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2024 08:56:05 -0800 (PST) From: codekipper@gmail.com To: linux-kernel@vger.kernel.org, linux-arm-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, linux-sunxi@lists.linux.dev, linux-sound@vger.kernel.org, lander@jagmn.com Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, jernej.skrabec@gmail.com, samuel@sholland.org, andre.przywara@arm.com, wens@csie.org, u.kleine-koenig@baylibre.com, Marcus Cooper Subject: [PATCH 3/3] ASoC: sun4i-spdif: Add working 24bit audio support Date: Mon, 11 Nov 2024 17:55:31 +0100 Message-ID: <20241111165600.57219-4-codekipper@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241111165600.57219-1-codekipper@gmail.com> References: <20241111165600.57219-1-codekipper@gmail.com> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Marcus Cooper 24 bit audio file can be detected by the alsa driver as S32_LE. Add this format to what is supported and change the DMA address width. Signed-off-by: Marcus Cooper --- sound/soc/sunxi/sun4i-spdif.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/soc/sunxi/sun4i-spdif.c b/sound/soc/sunxi/sun4i-spdif.c index 5a9407aaa1a19..41caf1795d09b 100644 --- a/sound/soc/sunxi/sun4i-spdif.c +++ b/sound/soc/sunxi/sun4i-spdif.c @@ -287,14 +287,17 @@ static int sun4i_spdif_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } + host->dma_params_tx.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; switch (params_format(params)) { case SNDRV_PCM_FORMAT_S16_LE: fmt |= SUN4I_SPDIF_TXCFG_FMT16BIT; + host->dma_params_tx.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES; break; case SNDRV_PCM_FORMAT_S20_3LE: fmt |= SUN4I_SPDIF_TXCFG_FMT20BIT; break; case SNDRV_PCM_FORMAT_S24_LE: + case SNDRV_PCM_FORMAT_S32_LE: fmt |= SUN4I_SPDIF_TXCFG_FMT24BIT; break; default: @@ -526,9 +529,10 @@ static const struct regmap_config sun4i_spdif_regmap_config = { #define SUN4I_RATES SNDRV_PCM_RATE_8000_192000 -#define SUN4I_FORMATS (SNDRV_PCM_FORMAT_S16_LE | \ - SNDRV_PCM_FORMAT_S20_3LE | \ - SNDRV_PCM_FORMAT_S24_LE) +#define SUN4I_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ + SNDRV_PCM_FMTBIT_S20_3LE | \ + SNDRV_PCM_FMTBIT_S24_LE | \ + SNDRV_PCM_FMTBIT_S32_LE) static struct snd_soc_dai_driver sun4i_spdif_dai = { .playback = {