summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>2024-12-10 19:09:34 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-02-08 09:57:28 +0100
commit2ac66e67678ad05e9278fb823658de1c77593d75 (patch)
tree51e2d7c99b3dfe80253003b1eb8fe5f9a1105a9f /sound
parente63deda2a51b2d89edb481774297be0c81044bea (diff)
downloadlinux-2ac66e67678ad05e9278fb823658de1c77593d75.tar.gz
linux-2ac66e67678ad05e9278fb823658de1c77593d75.tar.bz2
linux-2ac66e67678ad05e9278fb823658de1c77593d75.zip
ASoC: renesas: rz-ssi: Use only the proper amount of dividers
[ Upstream commit 55c209cd4318c701e6e88e0b2512a0f12dd02a7d ] There is no need to populate the ckdv[] with invalid dividers as that part will not be indexed anyway. The ssi->audio_mck/bclk_rate should always be >= 0. While at it, change the ckdv type as u8, as the divider 128 was previously using the s8 sign bit. Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com> Fixes: 03e786bd43410fa9 ("ASoC: sh: Add RZ/G2L SSIF-2 driver") Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20241210170953.2936724-6-claudiu.beznea.uj@bp.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sh/rz-ssi.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sound/soc/sh/rz-ssi.c b/sound/soc/sh/rz-ssi.c
index 040ce0431fd2..32db2cead8a4 100644
--- a/sound/soc/sh/rz-ssi.c
+++ b/sound/soc/sh/rz-ssi.c
@@ -258,8 +258,7 @@ static void rz_ssi_stream_quit(struct rz_ssi_priv *ssi,
static int rz_ssi_clk_setup(struct rz_ssi_priv *ssi, unsigned int rate,
unsigned int channels)
{
- static s8 ckdv[16] = { 1, 2, 4, 8, 16, 32, 64, 128,
- 6, 12, 24, 48, 96, -1, -1, -1 };
+ static u8 ckdv[] = { 1, 2, 4, 8, 16, 32, 64, 128, 6, 12, 24, 48, 96 };
unsigned int channel_bits = 32; /* System Word Length */
unsigned long bclk_rate = rate * channels * channel_bits;
unsigned int div;