Commit 0ea13fe9 authored by Charles Keepax's avatar Charles Keepax Committed by DidntRead
Browse files

switch: arizona: Enable mic det along with hp det



The headphone detect may fail to run if the microphone detect did not
exit cleanly. Work around this by always running a microphone detection
along side a headphone detection.

Change-Id: I930c6e8bd357337acf08f3ca3de62e02781ebe4a
Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
parent 2031d49c
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1572,6 +1572,8 @@ int arizona_hpdet_start(struct arizona_extcon_info *info)
			goto err;
		}
		arizona_extcon_hp_clamp(info, true);

		arizona_hpdet_start_micd(info);
		break;
	}

@@ -1600,11 +1602,22 @@ void arizona_hpdet_restart(struct arizona_extcon_info *info)
	struct arizona *arizona = info->arizona;

	/* Reset back to starting range */
	regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1,
			   ARIZONA_MICD_ENA, 0);
	regmap_update_bits(arizona->regmap,
			   ARIZONA_HEADPHONE_DETECT_1,
			   ARIZONA_HP_IMPEDANCE_RANGE_MASK |
			   ARIZONA_HP_POLL, 0);

	switch (info->accdet_ip) {
	case 0:
		break;
	default:
		regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1,
				   ARIZONA_MICD_ENA, ARIZONA_MICD_ENA);
		break;
	}

	regmap_update_bits(arizona->regmap,
			   ARIZONA_HEADPHONE_DETECT_1,
			   ARIZONA_HP_POLL, ARIZONA_HP_POLL);
@@ -1616,6 +1629,8 @@ void arizona_hpdet_stop(struct arizona_extcon_info *info)
	struct arizona *arizona = info->arizona;

	/* Reset back to starting range */
	arizona_hpdet_stop_micd(info);

	regmap_update_bits(arizona->regmap,
			   ARIZONA_HEADPHONE_DETECT_1,
			   ARIZONA_HP_IMPEDANCE_RANGE_MASK |