ASoC: rt1015p: delay 300ms after SDB pulling high for calibration
Subsystems (3)
PATCH 1/1 ASoC: rt1015p: delay 300ms after SDB pulling high for calibration
RT1015p needs 300ms delay after SDB pulling high for internal calibration during the power on sequence.
Delays 300ms right before data sends out to avoid data truncated.
--- sound/soc/codecs/rt1015p.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/codecs/rt1015p.c +7 -0
@@ -4,6 +4,7 @@// // Copyright 2020 The Linux Foundation. All rights reserved. +#include <linux/delay.h> #include <linux/device.h> #include <linux/err.h> #include <linux/gpio.h>
@@ -20,6 +21,7 @@struct rt1015p_priv {struct gpio_desc *sdb;int sdb_switch; +bool calib_done; }; static int rt1015p_daiops_trigger(struct snd_pcm_substream *substream,
@@ -39,6 +41,11 @@ static int rt1015p_daiops_trigger(struct snd_pcm_substream *substream,if (rt1015p->sdb_switch) {gpiod_set_value (rt1015p->sdb,1 );dev_dbg (component->dev,"set sdb to 1" ); + +if (!rt1015p->calib_done) { +mdelay (300 ); + rt1015p->calib_done = true; + } }break ;case SNDRV_PCM_TRIGGER_STOP :
Signature · 1 line
2.29.2.576.ga3fc446d84-goog
Jaroslav Kysela
maintainerDne 09. 12. 20 v 4:37 Tzung-Bi Shih napsal(a):
Quoted 4 lines
RT1015p needs 300ms delay after SDB pulling high for internal calibration during the power on sequence.
Delays 300ms right before data sends out to avoid data truncated.
I think that this codec driver should be redesigned to add this power-up delay the the correct sequence like in rt1015.c - rt1015_amp_drv_event().
Those huge delays in the trigger callbacks looks and are messy.
Jaroslav
Signature · 2 lines
Jaroslav Kysela <[email protected]> Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
Mark Brown
maintainerQuoted 10 lines · Jaroslav Kysela
Dne 09. 12. 20 v 4:37 Tzung-Bi Shih napsal(a):
Quoted 4 lines
RT1015p needs 300ms delay after SDB pulling high for internal calibration during the power on sequence.
Delays 300ms right before data sends out to avoid data truncated.
I think that this codec driver should be redesigned to add this power-up delay the the correct sequence like in
rt1015.c-rt1015_amp_drv_event().Those huge delays in the trigger callbacks looks and are messy.
Right, trigger is supposed to be very fast and this sort of stuff would normally be part of the power up sequence and those are handled through DAPM. set_bias_level() is another option for placing this sort of thing depending on what exactly is being controlled here.