From 2df3a5b04c40d548391c69c18780fefd420fac02 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Thu, 17 Sep 2020 14:53:29 -0400 Subject: Headphone / lineout pause/resume #FS13237 Allow Lineout to behave like headphone port in regards to plug/unplug pause/resume Change-Id: I9cb2c9c40e0bdf3bf7e1e272164acd343f6b3850 --- apps/audio_path.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'apps/audio_path.c') diff --git a/apps/audio_path.c b/apps/audio_path.c index bb73052a95..f908017bc3 100644 --- a/apps/audio_path.c +++ b/apps/audio_path.c @@ -169,10 +169,19 @@ int audio_get_spdif_sample_rate(void) #ifdef HAVE_SPEAKER void audio_enable_speaker(int mode) { -#ifdef HAVE_HEADPHONE_DETECTION +#if defined(HAVE_HEADPHONE_DETECTION) || defined(HAVE_LINEOUT_DETECTION) /* if needed, query jack state */ if(mode == 2) - mode = !headphones_inserted(); + { +#ifdef HAVE_HEADPHONE_DETECTION + if (headphones_inserted()) + mode = 0; +#endif +#ifdef HAVE_LINEOUT_DETECTION + if (lineout_inserted()) + mode = 0; +#endif + } #endif /* treat any nonzero value as enable */ audiohw_enable_speaker(mode); -- cgit v1.2.3