sound: fixed microphone detect crash error
authorPeipeng Zhao <peipeng.zhao@amlogic.com>
Wed, 28 Feb 2018 09:17:49 +0000 (17:17 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 12 Mar 2018 04:39:44 +0000 (20:39 -0800)
PD#161229: sound: fixed microphone detect crash error

Change-Id: If84c694275c68761a0844bcb3dcae797f2b9a4fd
Signed-off-by: Peipeng Zhao <peipeng.zhao@amlogic.com>
sound/soc/amlogic/auge/card.c

index 7e6fb06..6a5febb 100644 (file)
@@ -237,15 +237,15 @@ static void jack_work_func(struct work_struct *work)
                        card_data->mic_detect_flag = flag;
 
                        if (flag) {
-                               extcon_set_state_sync(audio_extcon_headphone,
+                               extcon_set_state_sync(audio_extcon_microphone,
                                        EXTCON_JACK_MICROPHONE, 1);
-                               snd_soc_jack_report(&card_data->hp_jack.jack,
-                                       status, SND_JACK_HEADPHONE);
+                               snd_soc_jack_report(&card_data->mic_jack.jack,
+                                       status, SND_JACK_MICROPHONE);
                        } else {
-                               extcon_set_state_sync(audio_extcon_headphone,
+                               extcon_set_state_sync(audio_extcon_microphone,
                                        EXTCON_JACK_MICROPHONE, 0);
-                               snd_soc_jack_report(&card_data->hp_jack.jack, 0,
-                                               SND_JACK_HEADPHONE);
+                               snd_soc_jack_report(&card_data->mic_jack.jack,
+                                       0, SND_JACK_MICROPHONE);
                        }
 
                }