diff --git a/asoc/codecs/wcd9378/internal.h b/asoc/codecs/wcd9378/internal.h index cbee1b0ae8..721e03c61b 100644 --- a/asoc/codecs/wcd9378/internal.h +++ b/asoc/codecs/wcd9378/internal.h @@ -138,7 +138,6 @@ struct wcd9378_priv { struct snd_info_entry *version_entry; struct snd_info_entry *variant_entry; int flyback_cur_det_disable; - bool dev_up; u8 tx_master_ch_map[WCD9378_MAX_SLAVE_CH_TYPES]; bool usbc_hs_status; /* wcd to swr dmic notification */ diff --git a/asoc/codecs/wcd9378/wcd9378.c b/asoc/codecs/wcd9378/wcd9378.c index d0920bdf4e..0e95eea9ae 100644 --- a/asoc/codecs/wcd9378/wcd9378.c +++ b/asoc/codecs/wcd9378/wcd9378.c @@ -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, WCD9378_PDE47_REQ_PS_PDE47_REQ_PS_MASK, 0x00); - /*TBD: SET SDCA GAIN, NEED CHECK THE LOGIC*/ wcd9378_hph_set_channel_volume(component); 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, pull_up_mask, pull_up_en); snd_soc_component_update_bits(component, - micb_usage, micb_mask, 0x03); + micb_usage, micb_mask, micb_usage_val); if (micb_num == MIC_BIAS_2) { snd_soc_component_update_bits(component, WCD9378_IT31_MICB, WCD9378_IT31_MICB_IT31_MICB_MASK, - 0x03); - wcd9378->curr_micbias2 = 1800; + micb_usage_val); + wcd9378->curr_micbias2 = mb->micb2_mv; } } break; @@ -2287,12 +2286,6 @@ int wcd9378_micbias_control(struct snd_soc_component *component, } break; 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]++; if (wcd9378->micb_ref[micb_index] == 1) { 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_IT31_MICB_MASK, micb_usage_val); - wcd9378->curr_micbias2 = 1800; + wcd9378->curr_micbias2 = mb->micb2_mv; } if (post_on_event) blocking_notifier_call_chain( @@ -2327,7 +2320,7 @@ int wcd9378_micbias_control(struct snd_soc_component *component, pull_up_mask, pull_up_en); if (micb_num == MIC_BIAS_2) - wcd9378->curr_micbias2 = 1800; + wcd9378->curr_micbias2 = mb->micb2_mv; } else if ((wcd9378->micb_ref[micb_index] == 0) && (wcd9378->pullup_ref[micb_index] == 0)) { 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], wcd9378->pullup_ref[micb_index]); -done: mutex_unlock(&wcd9378->micb_lock); return ret; } @@ -2468,7 +2460,6 @@ static int wcd9378_event_notify(struct notifier_block *block, 0x80, 0x00); break; case BOLERO_SLV_EVT_SSR_DOWN: - wcd9378->dev_up = false; if (wcd9378->notify_swr_dmic) blocking_notifier_call_chain(&wcd9378->notifier, 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->wcd_mbhc.deinit_in_progress = false; - wcd9378->dev_up = true; if (wcd9378->notify_swr_dmic) blocking_notifier_call_chain(&wcd9378->notifier, WCD9378_EVT_SSR_UP, @@ -4383,7 +4373,6 @@ static int wcd9378_bind(struct device *dev) __func__); goto err_irq; } - wcd9378->dev_up = true; return ret; err_irq: