aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt7
-rw-r--r--sound/soc/rockchip/rk3399_gru_sound.c14
2 files changed, 21 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt b/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
index f19b6c830a34..eac91db07178 100644
--- a/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
+++ b/Documentation/devicetree/bindings/sound/rockchip,rk3399-gru-sound.txt
@@ -6,10 +6,17 @@ Required properties:
6 connected to the codecs 6 connected to the codecs
7- rockchip,codec: The phandle of the MAX98357A/RT5514/DA7219 codecs 7- rockchip,codec: The phandle of the MAX98357A/RT5514/DA7219 codecs
8 8
9Optional properties:
10- dmic-wakeup-delay-ms : specify delay time (ms) for DMIC ready.
11 If this option is specified, which means it's required dmic need
12 delay for DMIC to ready so that rt5514 can avoid recording before
13 DMIC send valid data
14
9Example: 15Example:
10 16
11sound { 17sound {
12 compatible = "rockchip,rk3399-gru-sound"; 18 compatible = "rockchip,rk3399-gru-sound";
13 rockchip,cpu = <&i2s0>; 19 rockchip,cpu = <&i2s0>;
14 rockchip,codec = <&max98357a &rt5514 &da7219>; 20 rockchip,codec = <&max98357a &rt5514 &da7219>;
21 dmic-wakeup-delay-ms = <20>;
15}; 22};
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index ee0648927afc..9ed735a6cf49 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -38,6 +38,8 @@
38 38
39#define SOUND_FS 256 39#define SOUND_FS 256
40 40
41unsigned int rt5514_dmic_delay;
42
41static struct snd_soc_jack rockchip_sound_jack; 43static struct snd_soc_jack rockchip_sound_jack;
42 44
43static const struct snd_soc_dapm_widget rockchip_dapm_widgets[] = { 45static const struct snd_soc_dapm_widget rockchip_dapm_widgets[] = {
@@ -123,6 +125,9 @@ static int rockchip_sound_rt5514_hw_params(struct snd_pcm_substream *substream,
123 return ret; 125 return ret;
124 } 126 }
125 127
128 /* Wait for DMIC stable */
129 msleep(rt5514_dmic_delay);
130
126 return 0; 131 return 0;
127} 132}
128 133
@@ -343,6 +348,15 @@ static int rockchip_sound_probe(struct platform_device *pdev)
343 return -ENODEV; 348 return -ENODEV;
344 } 349 }
345 350
351 /* Set DMIC delay */
352 ret = device_property_read_u32(&pdev->dev, "dmic-delay",
353 &rt5514_dmic_delay);
354 if (ret) {
355 rt5514_dmic_delay = 0;
356 dev_dbg(&pdev->dev,
357 "no optional property 'dmic-delay' found, default: no delay\n");
358 }
359
346 rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL); 360 rockchip_dailinks[DAILINK_RT5514_DSP].cpu_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
347 rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL); 361 rockchip_dailinks[DAILINK_RT5514_DSP].cpu_dai_name = kstrdup_const(dev_name(dev), GFP_KERNEL);
348 rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL); 362 rockchip_dailinks[DAILINK_RT5514_DSP].platform_name = kstrdup_const(dev_name(dev), GFP_KERNEL);