asoc: update curr_micbias2 val with mb->micb2_mv

Curr_micbias2 val should be same with mb->micba2_mv.
for some customers, their micbias is not 1800mv,
so we should set the curr_micbias as mb->micb2_mv which
was the actual micbias val the customer use.
remove the dev_up check from micbias, since with this check,
Headset may be detected as a incorrect type.

Change-Id: Ia5a1fd434a09617a57096531c69956479c69f079
Signed-off-by: Yuhui Zhao <quic_yuhuzhao@quicinc.com>
This commit is contained in:
Yuhui Zhao
2024-06-21 10:48:38 +08:00
parent cf87e20cb2
commit 0d15edc0e2
2 changed files with 5 additions and 17 deletions

View File

@@ -138,7 +138,6 @@ struct wcd9378_priv {
struct snd_info_entry *version_entry; struct snd_info_entry *version_entry;
struct snd_info_entry *variant_entry; struct snd_info_entry *variant_entry;
int flyback_cur_det_disable; int flyback_cur_det_disable;
bool dev_up;
u8 tx_master_ch_map[WCD9378_MAX_SLAVE_CH_TYPES]; u8 tx_master_ch_map[WCD9378_MAX_SLAVE_CH_TYPES];
bool usbc_hs_status; bool usbc_hs_status;
/* wcd to swr dmic notification */ /* wcd to swr dmic notification */

View File

@@ -1975,7 +1975,6 @@ static int wcd9378_hph_sequencer_enable(struct snd_soc_dapm_widget *w,
snd_soc_component_update_bits(component, WCD9378_PDE47_REQ_PS, snd_soc_component_update_bits(component, WCD9378_PDE47_REQ_PS,
WCD9378_PDE47_REQ_PS_PDE47_REQ_PS_MASK, 0x00); WCD9378_PDE47_REQ_PS_PDE47_REQ_PS_MASK, 0x00);
/*TBD: SET SDCA GAIN, NEED CHECK THE LOGIC*/
wcd9378_hph_set_channel_volume(component); wcd9378_hph_set_channel_volume(component);
if ((!wcd9378->comp1_enable) || (!wcd9378->comp2_enable)) if ((!wcd9378->comp1_enable) || (!wcd9378->comp2_enable))
@@ -2258,14 +2257,14 @@ int wcd9378_micbias_control(struct snd_soc_component *component,
snd_soc_component_update_bits(component, WCD9378_MB_PULLUP_EN, snd_soc_component_update_bits(component, WCD9378_MB_PULLUP_EN,
pull_up_mask, pull_up_en); pull_up_mask, pull_up_en);
snd_soc_component_update_bits(component, snd_soc_component_update_bits(component,
micb_usage, micb_mask, 0x03); micb_usage, micb_mask, micb_usage_val);
if (micb_num == MIC_BIAS_2) { if (micb_num == MIC_BIAS_2) {
snd_soc_component_update_bits(component, snd_soc_component_update_bits(component,
WCD9378_IT31_MICB, WCD9378_IT31_MICB,
WCD9378_IT31_MICB_IT31_MICB_MASK, WCD9378_IT31_MICB_IT31_MICB_MASK,
0x03); micb_usage_val);
wcd9378->curr_micbias2 = 1800; wcd9378->curr_micbias2 = mb->micb2_mv;
} }
} }
break; break;
@@ -2287,12 +2286,6 @@ int wcd9378_micbias_control(struct snd_soc_component *component,
} }
break; break;
case MICB_ENABLE: case MICB_ENABLE:
if (!wcd9378->dev_up) {
dev_dbg(component->dev, "%s: enable req %d wcd device down\n",
__func__, req);
ret = -ENODEV;
goto done;
}
wcd9378->micb_ref[micb_index]++; wcd9378->micb_ref[micb_index]++;
if (wcd9378->micb_ref[micb_index] == 1) { if (wcd9378->micb_ref[micb_index] == 1) {
dev_dbg(component->dev, "%s: enable micbias, micb_usage:0x%0x, val:0x%0x\n", dev_dbg(component->dev, "%s: enable micbias, micb_usage:0x%0x, val:0x%0x\n",
@@ -2305,7 +2298,7 @@ int wcd9378_micbias_control(struct snd_soc_component *component,
WCD9378_IT31_MICB, WCD9378_IT31_MICB,
WCD9378_IT31_MICB_IT31_MICB_MASK, WCD9378_IT31_MICB_IT31_MICB_MASK,
micb_usage_val); micb_usage_val);
wcd9378->curr_micbias2 = 1800; wcd9378->curr_micbias2 = mb->micb2_mv;
} }
if (post_on_event) if (post_on_event)
blocking_notifier_call_chain( blocking_notifier_call_chain(
@@ -2327,7 +2320,7 @@ int wcd9378_micbias_control(struct snd_soc_component *component,
pull_up_mask, pull_up_en); pull_up_mask, pull_up_en);
if (micb_num == MIC_BIAS_2) if (micb_num == MIC_BIAS_2)
wcd9378->curr_micbias2 = 1800; wcd9378->curr_micbias2 = mb->micb2_mv;
} else if ((wcd9378->micb_ref[micb_index] == 0) && } else if ((wcd9378->micb_ref[micb_index] == 0) &&
(wcd9378->pullup_ref[micb_index] == 0)) { (wcd9378->pullup_ref[micb_index] == 0)) {
if (pre_off_event && wcd9378->mbhc) if (pre_off_event && wcd9378->mbhc)
@@ -2366,7 +2359,6 @@ int wcd9378_micbias_control(struct snd_soc_component *component,
__func__, micb_num, wcd9378->micb_ref[micb_index], __func__, micb_num, wcd9378->micb_ref[micb_index],
wcd9378->pullup_ref[micb_index]); wcd9378->pullup_ref[micb_index]);
done:
mutex_unlock(&wcd9378->micb_lock); mutex_unlock(&wcd9378->micb_lock);
return ret; return ret;
} }
@@ -2468,7 +2460,6 @@ static int wcd9378_event_notify(struct notifier_block *block,
0x80, 0x00); 0x80, 0x00);
break; break;
case BOLERO_SLV_EVT_SSR_DOWN: case BOLERO_SLV_EVT_SSR_DOWN:
wcd9378->dev_up = false;
if (wcd9378->notify_swr_dmic) if (wcd9378->notify_swr_dmic)
blocking_notifier_call_chain(&wcd9378->notifier, blocking_notifier_call_chain(&wcd9378->notifier,
WCD9378_EVT_SSR_DOWN, WCD9378_EVT_SSR_DOWN,
@@ -2506,7 +2497,6 @@ static int wcd9378_event_notify(struct notifier_block *block,
wcd9378_mbhc_hs_detect(component, mbhc->mbhc_cfg); wcd9378_mbhc_hs_detect(component, mbhc->mbhc_cfg);
} }
wcd9378->mbhc->wcd_mbhc.deinit_in_progress = false; wcd9378->mbhc->wcd_mbhc.deinit_in_progress = false;
wcd9378->dev_up = true;
if (wcd9378->notify_swr_dmic) if (wcd9378->notify_swr_dmic)
blocking_notifier_call_chain(&wcd9378->notifier, blocking_notifier_call_chain(&wcd9378->notifier,
WCD9378_EVT_SSR_UP, WCD9378_EVT_SSR_UP,
@@ -4383,7 +4373,6 @@ static int wcd9378_bind(struct device *dev)
__func__); __func__);
goto err_irq; goto err_irq;
} }
wcd9378->dev_up = true;
return ret; return ret;
err_irq: err_irq: