All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: sun4i-codec: fix first delay on Speaker
@ 2019-05-15 12:58 ` Georgii Staroselskii
  0 siblings, 0 replies; 10+ messages in thread
From: Georgii Staroselskii @ 2019-05-15 12:58 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, maxime.ripard, wens, dannym
  Cc: georgii.staroselskii, alsa-devel, linux-arm-kernel

This commit fixes the same issue as bf14da7 but for another codepath.
The issue can be triggered by having Speaker in codec audio routing.

&codec {
        allwinner,pa-gpios = <&r_pio 0 11 GPIO_ACTIVE_HIGH>; /* PL11 */
        allwinner,audio-routing =
                "Speaker", "LINEOUT";

        status = "okay";
}

Signed-off-by: Georgii Staroselskii <georgii.staroselskii@emlid.com>
---
 sound/soc/sunxi/sun4i-codec.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
index 15d08e3..e0099519 100644
--- a/sound/soc/sunxi/sun4i-codec.c
+++ b/sound/soc/sunxi/sun4i-codec.c
@@ -1329,6 +1329,15 @@ static int sun4i_codec_spk_event(struct snd_soc_dapm_widget *w,
 	gpiod_set_value_cansleep(scodec->gpio_pa,
 				 !!SND_SOC_DAPM_EVENT_ON(event));
 
+	if (SND_SOC_DAPM_EVENT_ON(event)) {
+		/*
+		 * Need a delay to have the amplifier up. 700ms seems the best
+		 * compromise between the time to let the amplifier up and the
+		 * time not to feel this delay while playing a sound.
+		 */
+		msleep(700);
+	}
+
 	return 0;
 }
 
-- 
2.7.4

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

end of thread, other threads:[~2019-05-17  2:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-15 12:58 [PATCH] ASoC: sun4i-codec: fix first delay on Speaker Georgii Staroselskii
2019-05-15 12:58 ` Georgii Staroselskii
2019-05-15 13:58 ` Maxime Ripard
2019-05-15 13:58   ` Maxime Ripard
2019-05-15 15:27   ` Georgii Staroselskii
2019-05-15 15:27     ` Georgii Staroselskii
2019-05-16 20:12     ` Maxime Ripard
2019-05-16 20:12       ` Maxime Ripard
2019-05-17  2:29       ` Chen-Yu Tsai
2019-05-17  2:29         ` Chen-Yu Tsai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.