mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 2/3] ASoC: codecs: tlv320dac33: Add default value for burst_bclkdiv
@ 2025-09-01 18:40 Alex Tran
  2025-09-01 18:40 ` [PATCH v3 3/3] ASoC: codecs: tlv320dac33: Convert to use gpiod api Alex Tran
  2025-09-01 18:40 ` [PATCH v3 1/3] ASoC: codecs: tlv320dac33: Remove unused struct tlv320dac33_platform_data and header file tlv320dac33-plat.h Alex Tran
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Tran @ 2025-09-01 18:40 UTC (permalink / raw)
  To: broonie
  Cc: lgirdwood, shenghao-ding, kevin-lu, baojun.xu, perex, tiwai,
	linux-sound, linux-kernel, Alex Tran

Add default value for field burst_bclkdiv as initializing it to 0
is incorrect, potentially leading to a divide by 0 issue.
Valid range is 2-17 per TI datasheet. 8 was chosen as a
dummy value.

Reference <https://www.ti.com/lit/ds/symlink/tlv320dac32.pdf>.

Signed-off-by: Alex Tran <alex.t.tran@gmail.com>
---
Changes in v2:
- Included removal of struct 'tlv320dac33_platform_data'
  and header file 'tlv320dac33-plat.h'
Changes in v3:
- Split into separate patches as per request
- Moved inter-version changelogs after '---' line

 sound/soc/codecs/tlv320dac33.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c
index 36b3de75a..feefc777c 100644
--- a/sound/soc/codecs/tlv320dac33.c
+++ b/sound/soc/codecs/tlv320dac33.c
@@ -1480,6 +1480,8 @@ static int dac33_i2c_probe(struct i2c_client *client)
 
 	i2c_set_clientdata(client, dac33);
 
+	if (!dac33->burst_bclkdiv)
+		dac33->burst_bclkdiv = 8;
 	if (!dac33->mode1_latency)
 		dac33->mode1_latency = 10000; /* 10ms */
 	dac33->irq = client->irq;
-- 
2.51.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-09 15:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-01 18:40 [PATCH v3 2/3] ASoC: codecs: tlv320dac33: Add default value for burst_bclkdiv Alex Tran
2025-09-01 18:40 ` [PATCH v3 3/3] ASoC: codecs: tlv320dac33: Convert to use gpiod api Alex Tran
2025-09-01 18:40 ` [PATCH v3 1/3] ASoC: codecs: tlv320dac33: Remove unused struct tlv320dac33_platform_data and header file tlv320dac33-plat.h Alex Tran
2025-09-09 15:15   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®