ASoC: wcd938x: Fix headset detection during SSR/PDR
Headset is corrected as lineout during SSR/PDR. This is because adc voltage is not measured correctly due to SSR state. Enable flag deinit_in_progress during SSR down to check if device is not reported and disable it after device up. Change-Id: I6fc4fff4149c36ba16aa668a960505504a5d811f Signed-off-by: Vatsal Bucha <vbucha@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
f34687bd3a
commit
71e95c67ea
@@ -1589,6 +1589,7 @@ static int wcd937x_event_notify(struct notifier_block *block,
|
|||||||
0x80, 0x00);
|
0x80, 0x00);
|
||||||
break;
|
break;
|
||||||
case BOLERO_WCD_EVT_SSR_DOWN:
|
case BOLERO_WCD_EVT_SSR_DOWN:
|
||||||
|
wcd937x->mbhc->wcd_mbhc.deinit_in_progress = true;
|
||||||
mbhc = &wcd937x->mbhc->wcd_mbhc;
|
mbhc = &wcd937x->mbhc->wcd_mbhc;
|
||||||
wcd937x_mbhc_ssr_down(wcd937x->mbhc, component);
|
wcd937x_mbhc_ssr_down(wcd937x->mbhc, component);
|
||||||
wcd937x_reset_low(wcd937x->dev);
|
wcd937x_reset_low(wcd937x->dev);
|
||||||
@@ -1612,6 +1613,7 @@ static int wcd937x_event_notify(struct notifier_block *block,
|
|||||||
} else {
|
} else {
|
||||||
wcd937x_mbhc_hs_detect(component, mbhc->mbhc_cfg);
|
wcd937x_mbhc_hs_detect(component, mbhc->mbhc_cfg);
|
||||||
}
|
}
|
||||||
|
wcd937x->mbhc->wcd_mbhc.deinit_in_progress = false;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(component->dev, "%s: invalid event %d\n", __func__,
|
dev_err(component->dev, "%s: invalid event %d\n", __func__,
|
||||||
|
@@ -2032,6 +2032,7 @@ static int wcd938x_event_notify(struct notifier_block *block,
|
|||||||
break;
|
break;
|
||||||
case BOLERO_WCD_EVT_SSR_DOWN:
|
case BOLERO_WCD_EVT_SSR_DOWN:
|
||||||
wcd938x->dev_up = false;
|
wcd938x->dev_up = false;
|
||||||
|
wcd938x->mbhc->wcd_mbhc.deinit_in_progress = true;
|
||||||
mbhc = &wcd938x->mbhc->wcd_mbhc;
|
mbhc = &wcd938x->mbhc->wcd_mbhc;
|
||||||
wcd938x_mbhc_ssr_down(wcd938x->mbhc, component);
|
wcd938x_mbhc_ssr_down(wcd938x->mbhc, component);
|
||||||
wcd938x_reset_low(wcd938x->dev);
|
wcd938x_reset_low(wcd938x->dev);
|
||||||
@@ -2056,6 +2057,7 @@ static int wcd938x_event_notify(struct notifier_block *block,
|
|||||||
} else {
|
} else {
|
||||||
wcd938x_mbhc_hs_detect(component, mbhc->mbhc_cfg);
|
wcd938x_mbhc_hs_detect(component, mbhc->mbhc_cfg);
|
||||||
}
|
}
|
||||||
|
wcd938x->mbhc->wcd_mbhc.deinit_in_progress = false;
|
||||||
wcd938x->dev_up = true;
|
wcd938x->dev_up = true;
|
||||||
break;
|
break;
|
||||||
case BOLERO_WCD_EVT_CLK_NOTIFY:
|
case BOLERO_WCD_EVT_CLK_NOTIFY:
|
||||||
|
Reference in New Issue
Block a user