summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorViorel Suman <viorel.suman@nxp.com>2019-07-12 11:46:26 +0300
committerViorel Suman <viorel.suman@nxp.com>2019-07-12 13:18:49 +0300
commit9f6803b34348ee8e6fbf15e817947b69a5fdb43b (patch)
treebf91f3d8b12a8f2aa2915be56499d4b7093a159d /sound
parente7b9883802fc4d574995abcc5f704ccc7b619a4e (diff)
MLK-21775-3: ASoC: fsl_micfil: prepare for atomic context
Replace "sleep" calls with corresponding "delay" equivalents in order to prepare the code for running in atomic context. Signed-off-by: Viorel Suman <viorel.suman@nxp.com> Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> (cherry picked from commit 91a783081dc722ed35024862fd483c60f23f6a36)
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_micfil.c10
-rw-r--r--sound/soc/fsl/fsl_micfil.h3
2 files changed, 6 insertions, 7 deletions
diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c
index 6cc8d6e81457..cb26d8f8c5c3 100644
--- a/sound/soc/fsl/fsl_micfil.c
+++ b/sound/soc/fsl/fsl_micfil.c
@@ -955,7 +955,7 @@ static int init_hwvad_internal_filters(struct device *dev)
/* sleep for 100ms - it should be enough for bit to stay
* pulsed for more than 2 cycles
*/
- usleep_range(MICFIL_SLEEP_MIN, MICFIL_SLEEP_MAX);
+ mdelay(MICFIL_SLEEP);
/* Voice Activity Detector Enabled */
ret = regmap_update_bits(micfil->regmap, REG_MICFIL_VAD0_CTRL1,
@@ -1070,7 +1070,7 @@ static int init_hwvad_energy_mode(struct device *dev)
/* it would be a good idea to wait some time before VADEN
* is set
*/
- usleep_range(5 * MICFIL_SLEEP_MIN, 5 * MICFIL_SLEEP_MAX);
+ mdelay(5 * MICFIL_SLEEP);
/* Enable Interrupts */
ret = configure_hwvad_interrupts(dev, 1);
@@ -1102,7 +1102,7 @@ static int init_hwvad_energy_mode(struct device *dev)
if (flag == 0)
break;
- usleep_range(MICFIL_SLEEP_MIN, MICFIL_SLEEP_MAX);
+ mdelay(MICFIL_SLEEP);
}
if (i == MICFIL_MAX_RETRY) {
@@ -1236,7 +1236,7 @@ static int init_hwvad_envelope_mode(struct device *dev)
/* it would be a good idea to wait some time before VADEN
* is set
*/
- usleep_range(3 * MICFIL_SLEEP_MIN, 3 * MICFIL_SLEEP_MAX);
+ mdelay(3 * MICFIL_SLEEP);
/* Wait for INITF to be asserted */
for (i = 0; i < MICFIL_MAX_RETRY; i++) {
@@ -1251,7 +1251,7 @@ static int init_hwvad_envelope_mode(struct device *dev)
if (flag == 0)
break;
- usleep_range(MICFIL_SLEEP_MIN, MICFIL_SLEEP_MAX);
+ mdelay(MICFIL_SLEEP);
}
if (i == MICFIL_MAX_RETRY) {
diff --git a/sound/soc/fsl/fsl_micfil.h b/sound/soc/fsl/fsl_micfil.h
index 28d585f5fb64..14ad08b6b150 100644
--- a/sound/soc/fsl/fsl_micfil.h
+++ b/sound/soc/fsl/fsl_micfil.h
@@ -309,8 +309,7 @@
#define MICFIL_IRQ_LINES 4
#define MICFIL_MAX_RETRY 25
-#define MICFIL_SLEEP_MIN 90000 /* in us */
-#define MICFIL_SLEEP_MAX 100000 /* in us */
+#define MICFIL_SLEEP 100 /* in ms */
#define MICFIL_DMA_MAXBURST_RX 6
#define MICFIL_CTRL2_OSR_DEFAULT (0 << MICFIL_CTRL2_CICOSR_SHIFT)
#define MICFIL_DEFAULT_RATE 48000