Merge "asoc: codecs: wcd938x: remove delays in headphone power down"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
76880681c6
@@ -674,28 +674,25 @@ static int wcd938x_codec_enable_hphr_pa(struct snd_soc_dapm_widget *w,
|
|||||||
WCD938X_IRQ_HPHR_PDM_WD_INT);
|
WCD938X_IRQ_HPHR_PDM_WD_INT);
|
||||||
break;
|
break;
|
||||||
case SND_SOC_DAPM_PRE_PMD:
|
case SND_SOC_DAPM_PRE_PMD:
|
||||||
wcd_disable_irq(&wcd938x->irq_info,
|
|
||||||
WCD938X_IRQ_HPHR_PDM_WD_INT);
|
|
||||||
if (wcd938x->update_wcd_event)
|
if (wcd938x->update_wcd_event)
|
||||||
wcd938x->update_wcd_event(wcd938x->handle,
|
wcd938x->update_wcd_event(wcd938x->handle,
|
||||||
WCD_BOLERO_EVT_RX_MUTE,
|
WCD_BOLERO_EVT_RX_MUTE,
|
||||||
(WCD_RX2 << 0x10 | 0x1));
|
(WCD_RX2 << 0x10 | 0x1));
|
||||||
if (wcd938x->update_wcd_event)
|
wcd_disable_irq(&wcd938x->irq_info,
|
||||||
|
WCD938X_IRQ_HPHR_PDM_WD_INT);
|
||||||
|
if (wcd938x->update_wcd_event && wcd938x->comp2_enable)
|
||||||
wcd938x->update_wcd_event(wcd938x->handle,
|
wcd938x->update_wcd_event(wcd938x->handle,
|
||||||
WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST,
|
WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST,
|
||||||
(WCD_RX2 << 0x10));
|
(WCD_RX2 << 0x10));
|
||||||
/* 7 msec delay as per HW requirement */
|
/*
|
||||||
usleep_range(7000, 7100);
|
* 7ms sleep is required if compander is enabled as per
|
||||||
if (wcd938x->update_wcd_event)
|
* HW requirement. If compander is disabled, then
|
||||||
wcd938x->update_wcd_event(wcd938x->handle,
|
* 20ms delay is required.
|
||||||
WCD_BOLERO_EVT_RX_MUTE,
|
*/
|
||||||
(WCD_RX2 << 0x10 | 0x0));
|
if (!wcd938x->comp2_enable)
|
||||||
/* 20 msec delay as per HW requirement */
|
usleep_range(20000, 20100);
|
||||||
usleep_range(21000, 21100);
|
else
|
||||||
if (wcd938x->update_wcd_event)
|
usleep_range(7000, 7100);
|
||||||
wcd938x->update_wcd_event(wcd938x->handle,
|
|
||||||
WCD_BOLERO_EVT_RX_MUTE,
|
|
||||||
(WCD_RX2 << 0x10 | 0x1));
|
|
||||||
snd_soc_component_update_bits(component, WCD938X_ANA_HPH,
|
snd_soc_component_update_bits(component, WCD938X_ANA_HPH,
|
||||||
0x40, 0x00);
|
0x40, 0x00);
|
||||||
blocking_notifier_call_chain(&wcd938x->mbhc->notifier,
|
blocking_notifier_call_chain(&wcd938x->mbhc->notifier,
|
||||||
@@ -721,8 +718,6 @@ static int wcd938x_codec_enable_hphr_pa(struct snd_soc_dapm_widget *w,
|
|||||||
&wcd938x->mbhc->wcd_mbhc);
|
&wcd938x->mbhc->wcd_mbhc);
|
||||||
snd_soc_component_update_bits(component, WCD938X_ANA_HPH,
|
snd_soc_component_update_bits(component, WCD938X_ANA_HPH,
|
||||||
0x10, 0x00);
|
0x10, 0x00);
|
||||||
/* 20 msec delay as per HW requirement */
|
|
||||||
usleep_range(20000, 20100);
|
|
||||||
snd_soc_component_update_bits(component,
|
snd_soc_component_update_bits(component,
|
||||||
WCD938X_DIGITAL_PDM_WD_CTL1, 0x17, 0x00);
|
WCD938X_DIGITAL_PDM_WD_CTL1, 0x17, 0x00);
|
||||||
wcd_cls_h_fsm(component, &wcd938x->clsh_info,
|
wcd_cls_h_fsm(component, &wcd938x->clsh_info,
|
||||||
@@ -804,28 +799,25 @@ static int wcd938x_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,
|
|||||||
WCD938X_IRQ_HPHL_PDM_WD_INT);
|
WCD938X_IRQ_HPHL_PDM_WD_INT);
|
||||||
break;
|
break;
|
||||||
case SND_SOC_DAPM_PRE_PMD:
|
case SND_SOC_DAPM_PRE_PMD:
|
||||||
wcd_disable_irq(&wcd938x->irq_info,
|
|
||||||
WCD938X_IRQ_HPHL_PDM_WD_INT);
|
|
||||||
if (wcd938x->update_wcd_event)
|
if (wcd938x->update_wcd_event)
|
||||||
wcd938x->update_wcd_event(wcd938x->handle,
|
wcd938x->update_wcd_event(wcd938x->handle,
|
||||||
WCD_BOLERO_EVT_RX_MUTE,
|
WCD_BOLERO_EVT_RX_MUTE,
|
||||||
(WCD_RX1 << 0x10 | 0x1));
|
(WCD_RX1 << 0x10 | 0x1));
|
||||||
if (wcd938x->update_wcd_event)
|
wcd_disable_irq(&wcd938x->irq_info,
|
||||||
|
WCD938X_IRQ_HPHL_PDM_WD_INT);
|
||||||
|
if (wcd938x->update_wcd_event && wcd938x->comp1_enable)
|
||||||
wcd938x->update_wcd_event(wcd938x->handle,
|
wcd938x->update_wcd_event(wcd938x->handle,
|
||||||
WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST,
|
WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST,
|
||||||
(WCD_RX1 << 0x10));
|
(WCD_RX1 << 0x10));
|
||||||
/* 7 msec delay as per HW requirement */
|
/*
|
||||||
usleep_range(7000, 7100);
|
* 7ms sleep is required if compander is enabled as per
|
||||||
if (wcd938x->update_wcd_event)
|
* HW requirement. If compander is disabled, then
|
||||||
wcd938x->update_wcd_event(wcd938x->handle,
|
* 20ms delay is required.
|
||||||
WCD_BOLERO_EVT_RX_MUTE,
|
*/
|
||||||
(WCD_RX1 << 0x10 | 0x0));
|
if (!wcd938x->comp1_enable)
|
||||||
/* 20 msec delay as per HW requirement */
|
usleep_range(20000, 20100);
|
||||||
usleep_range(21000, 21100);
|
else
|
||||||
if (wcd938x->update_wcd_event)
|
usleep_range(7000, 7100);
|
||||||
wcd938x->update_wcd_event(wcd938x->handle,
|
|
||||||
WCD_BOLERO_EVT_RX_MUTE,
|
|
||||||
(WCD_RX1 << 0x10 | 0x1));
|
|
||||||
snd_soc_component_update_bits(component, WCD938X_ANA_HPH,
|
snd_soc_component_update_bits(component, WCD938X_ANA_HPH,
|
||||||
0x80, 0x00);
|
0x80, 0x00);
|
||||||
blocking_notifier_call_chain(&wcd938x->mbhc->notifier,
|
blocking_notifier_call_chain(&wcd938x->mbhc->notifier,
|
||||||
@@ -851,8 +843,6 @@ static int wcd938x_codec_enable_hphl_pa(struct snd_soc_dapm_widget *w,
|
|||||||
&wcd938x->mbhc->wcd_mbhc);
|
&wcd938x->mbhc->wcd_mbhc);
|
||||||
snd_soc_component_update_bits(component, WCD938X_ANA_HPH,
|
snd_soc_component_update_bits(component, WCD938X_ANA_HPH,
|
||||||
0x20, 0x00);
|
0x20, 0x00);
|
||||||
/* 20 msec delay as per HW requirement */
|
|
||||||
usleep_range(21000, 21100);
|
|
||||||
snd_soc_component_update_bits(component,
|
snd_soc_component_update_bits(component,
|
||||||
WCD938X_DIGITAL_PDM_WD_CTL0, 0x17, 0x00);
|
WCD938X_DIGITAL_PDM_WD_CTL0, 0x17, 0x00);
|
||||||
wcd_cls_h_fsm(component, &wcd938x->clsh_info,
|
wcd_cls_h_fsm(component, &wcd938x->clsh_info,
|
||||||
|
Reference in New Issue
Block a user