ASoC: wcd-mbhc: correct special headset detection logic
When detecting special headset, vref for special headset is set based on headset threshold reference 1800mv or based on regular micbias settings from device tree. Scale threshold reference as per the special headset micbias voltage. Change-Id: Ic4cc24e18efeb420b53a2154707c9399eb886181 Signed-off-by: Meng Wang <mwang@codeaurora.org>
This commit is contained in:

gecommit door
Meng Wang

bovenliggende
e039f16fa4
commit
37621b06ee
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
@@ -1102,6 +1102,7 @@ int tavil_mbhc_init(struct wcd934x_mbhc **mbhc,
|
||||
struct wcd934x_mbhc *wcd934x_mbhc;
|
||||
struct wcd_mbhc *wcd_mbhc;
|
||||
int ret;
|
||||
struct wcd9xxx_pdata *pdata;
|
||||
|
||||
wcd934x_mbhc = devm_kzalloc(component->dev, sizeof(struct wcd934x_mbhc),
|
||||
GFP_KERNEL);
|
||||
@@ -1122,6 +1123,14 @@ int tavil_mbhc_init(struct wcd934x_mbhc **mbhc,
|
||||
/* Setting default mbhc detection logic to ADC for Tavil */
|
||||
wcd_mbhc->mbhc_detection_logic = WCD_DETECTION_ADC;
|
||||
|
||||
pdata = dev_get_platdata(component->dev->parent);
|
||||
if (!pdata) {
|
||||
dev_err(component->dev, "%s: pdata pointer is NULL\n", __func__);
|
||||
ret = -EINVAL;
|
||||
goto err;
|
||||
}
|
||||
wcd_mbhc->micb_mv = pdata->micbias.micb2_mv;
|
||||
|
||||
ret = wcd_mbhc_init(wcd_mbhc, component, &mbhc_cb,
|
||||
&intr_ids, wcd_mbhc_registers,
|
||||
TAVIL_ZDET_SUPPORTED);
|
||||
|
Verwijs in nieuw issue
Block a user