Skip to content

Commit d5aa46d

Browse files
charleskeepaxchanwoochoi
authored andcommitted
extcon: arizona: Tidy up transition from mic to headphone detect
Moving from microphone detection to headphone detection is done fairly haphazardly at the moment, sometimes calling arizona_stop_mic at the call site sometimes relying on a call inside arizona_identify_headphone. Simplify all this and always call arizona_stop_mic at the top of arizona_identify_headphone. Signed-off-by: Charles Keepax <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent ac7614f commit d5aa46d

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/extcon/extcon-arizona.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,7 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info)
705705

706706
info->hpdet_active = true;
707707

708-
if (info->mic)
709-
arizona_stop_mic(info);
708+
arizona_stop_mic(info);
710709

711710
arizona_extcon_hp_clamp(info, true);
712711

@@ -815,8 +814,6 @@ static void arizona_micd_timeout_work(struct work_struct *work)
815814

816815
arizona_identify_headphone(info);
817816

818-
arizona_stop_mic(info);
819-
820817
mutex_unlock(&info->lock);
821818
}
822819

@@ -906,7 +903,6 @@ static void arizona_micd_detect(struct work_struct *work)
906903
if (!(val & ARIZONA_MICD_STS)) {
907904
dev_warn(arizona->dev, "Detected open circuit\n");
908905
info->mic = false;
909-
arizona_stop_mic(info);
910906
info->detecting = false;
911907
arizona_identify_headphone(info);
912908
goto handled;
@@ -948,8 +944,6 @@ static void arizona_micd_detect(struct work_struct *work)
948944
info->detecting = false;
949945

950946
arizona_identify_headphone(info);
951-
952-
arizona_stop_mic(info);
953947
} else {
954948
info->micd_mode++;
955949
if (info->micd_mode == info->micd_num_modes)
@@ -988,7 +982,6 @@ static void arizona_micd_detect(struct work_struct *work)
988982
} else if (info->detecting) {
989983
dev_dbg(arizona->dev, "Headphone detected\n");
990984
info->detecting = false;
991-
arizona_stop_mic(info);
992985

993986
arizona_identify_headphone(info);
994987
} else {

0 commit comments

Comments
 (0)