From: Charles Keepax Date: Thu, 14 Nov 2013 16:18:25 +0000 (+0000) Subject: extcon: arizona: Add support for headphone detection on wm5110 rev D X-Git-Tag: v3.14-rc1~152^2~4^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77438610ffd93462348346430d17470cd3ce7bbc;p=profile%2Fcommon%2Fkernel-common.git extcon: arizona: Add support for headphone detection on wm5110 rev D wm5110 rev D is the first chip to use headphone detection IP 2, specify such and make a small correction as the impedance value is actually read in 0.5 ohm increments now. Signed-off-by: Charles Keepax Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 4487bda..c20602f 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -435,6 +435,8 @@ static int arizona_hpdet_read(struct arizona_extcon_info *info) } val &= ARIZONA_HP_LVL_B_MASK; + /* Convert to ohms, the value is in 0.5 ohm increments */ + val /= 2; regmap_read(arizona->regmap, ARIZONA_HEADPHONE_DETECT_1, &range); @@ -1147,6 +1149,16 @@ static int arizona_extcon_probe(struct platform_device *pdev) break; } break; + case WM5110: + switch (arizona->rev) { + case 0 ... 2: + break; + default: + info->micd_clamp = true; + info->hpdet_ip = 2; + break; + } + break; default: break; }