Loading asoc/codecs/bolero/bolero-cdc.c +6 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,12 @@ static int bolero_cdc_update_wcd_event(void *handle, u16 event, u32 data) priv->component, BOLERO_MACRO_EVT_RX_COMPANDER_SOFT_RST, data); break; case WCD_BOLERO_EVT_BCS_CLK_OFF: if (priv->macro_params[TX_MACRO].event_handler) priv->macro_params[TX_MACRO].event_handler( priv->component, BOLERO_MACRO_EVT_BCS_CLK_OFF, data); break; default: dev_err(priv->dev, "%s: Invalid event %d trigger from wcd\n", __func__, event); Loading asoc/codecs/bolero/bolero-cdc.h +2 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,8 @@ enum { BOLERO_MACRO_EVT_WAIT_VA_CLK_RESET, BOLERO_MACRO_EVT_CLK_RESET, BOLERO_MACRO_EVT_REG_WAKE_IRQ, BOLERO_MACRO_EVT_RX_COMPANDER_SOFT_RST BOLERO_MACRO_EVT_RX_COMPANDER_SOFT_RST, BOLERO_MACRO_EVT_BCS_CLK_OFF }; struct macro_ops { Loading asoc/codecs/bolero/internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ enum { WCD_BOLERO_EVT_IMPED_TRUE, /* for imped true */ WCD_BOLERO_EVT_IMPED_FALSE, /* for imped false */ WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST, WCD_BOLERO_EVT_BCS_CLK_OFF, }; struct wcd_ctrl_platform_data { Loading asoc/codecs/bolero/tx-macro.c +17 −2 Original line number Diff line number Diff line Loading @@ -172,6 +172,8 @@ struct tx_macro_priv { int tx_clk_status; bool bcs_enable; int dec_mode[NUM_DECIMATORS]; bool bcs_clk_en; bool hs_slow_insert_complete; }; static bool tx_macro_get_data(struct snd_soc_component *component, Loading Loading @@ -387,6 +389,15 @@ static int tx_macro_event_handler(struct snd_soc_component *component, case BOLERO_MACRO_EVT_CLK_RESET: bolero_rsc_clk_reset(tx_dev, TX_CORE_CLK); break; case BOLERO_MACRO_EVT_BCS_CLK_OFF: if (tx_priv->bcs_clk_en) snd_soc_component_update_bits(component, BOLERO_CDC_TX0_TX_PATH_SEC7, 0x40, data << 6); if (data) tx_priv->hs_slow_insert_complete = true; else tx_priv->hs_slow_insert_complete = false; break; } return 0; } Loading Loading @@ -902,8 +913,11 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, if (tx_priv->bcs_enable) { snd_soc_component_update_bits(component, dec_cfg_reg, 0x01, 0x01); tx_priv->bcs_clk_en = true; if (tx_priv->hs_slow_insert_complete) snd_soc_component_update_bits(component, BOLERO_CDC_TX0_TX_PATH_SEC7, 0x40, 0x40); BOLERO_CDC_TX0_TX_PATH_SEC7, 0x40, 0x40); } break; case SND_SOC_DAPM_PRE_PMD: Loading Loading @@ -946,6 +960,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, 0x01, 0x00); snd_soc_component_update_bits(component, BOLERO_CDC_TX0_TX_PATH_SEC7, 0x40, 0x00); tx_priv->bcs_clk_en = false; } break; } Loading asoc/codecs/wcd-mbhc-adc.c +11 −0 Original line number Diff line number Diff line Loading @@ -689,6 +689,13 @@ static void wcd_correct_swch_plug(struct work_struct *work) } correct_plug_type: /* * Callback to disable BCS slow insertion detection */ if (plug_type == MBHC_PLUG_TYPE_HEADSET || plug_type == MBHC_PLUG_TYPE_HEADPHONE) mbhc->mbhc_cb->bcs_enable(mbhc, false); timeout = jiffies + msecs_to_jiffies(HS_DETECT_PLUG_TIME_MS); while (!time_after(jiffies, timeout)) { if (mbhc->hs_detect_work_stop) { Loading Loading @@ -833,6 +840,10 @@ static void wcd_correct_swch_plug(struct work_struct *work) wrk_complete = false; } } if ((plug_type == MBHC_PLUG_TYPE_HEADSET || plug_type == MBHC_PLUG_TYPE_HEADPHONE)) mbhc->mbhc_cb->bcs_enable(mbhc, true); if (!wrk_complete) { /* * If plug_tye is headset, we might have already reported either Loading Loading
asoc/codecs/bolero/bolero-cdc.c +6 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,12 @@ static int bolero_cdc_update_wcd_event(void *handle, u16 event, u32 data) priv->component, BOLERO_MACRO_EVT_RX_COMPANDER_SOFT_RST, data); break; case WCD_BOLERO_EVT_BCS_CLK_OFF: if (priv->macro_params[TX_MACRO].event_handler) priv->macro_params[TX_MACRO].event_handler( priv->component, BOLERO_MACRO_EVT_BCS_CLK_OFF, data); break; default: dev_err(priv->dev, "%s: Invalid event %d trigger from wcd\n", __func__, event); Loading
asoc/codecs/bolero/bolero-cdc.h +2 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,8 @@ enum { BOLERO_MACRO_EVT_WAIT_VA_CLK_RESET, BOLERO_MACRO_EVT_CLK_RESET, BOLERO_MACRO_EVT_REG_WAKE_IRQ, BOLERO_MACRO_EVT_RX_COMPANDER_SOFT_RST BOLERO_MACRO_EVT_RX_COMPANDER_SOFT_RST, BOLERO_MACRO_EVT_BCS_CLK_OFF }; struct macro_ops { Loading
asoc/codecs/bolero/internal.h +1 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ enum { WCD_BOLERO_EVT_IMPED_TRUE, /* for imped true */ WCD_BOLERO_EVT_IMPED_FALSE, /* for imped false */ WCD_BOLERO_EVT_RX_COMPANDER_SOFT_RST, WCD_BOLERO_EVT_BCS_CLK_OFF, }; struct wcd_ctrl_platform_data { Loading
asoc/codecs/bolero/tx-macro.c +17 −2 Original line number Diff line number Diff line Loading @@ -172,6 +172,8 @@ struct tx_macro_priv { int tx_clk_status; bool bcs_enable; int dec_mode[NUM_DECIMATORS]; bool bcs_clk_en; bool hs_slow_insert_complete; }; static bool tx_macro_get_data(struct snd_soc_component *component, Loading Loading @@ -387,6 +389,15 @@ static int tx_macro_event_handler(struct snd_soc_component *component, case BOLERO_MACRO_EVT_CLK_RESET: bolero_rsc_clk_reset(tx_dev, TX_CORE_CLK); break; case BOLERO_MACRO_EVT_BCS_CLK_OFF: if (tx_priv->bcs_clk_en) snd_soc_component_update_bits(component, BOLERO_CDC_TX0_TX_PATH_SEC7, 0x40, data << 6); if (data) tx_priv->hs_slow_insert_complete = true; else tx_priv->hs_slow_insert_complete = false; break; } return 0; } Loading Loading @@ -902,8 +913,11 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, if (tx_priv->bcs_enable) { snd_soc_component_update_bits(component, dec_cfg_reg, 0x01, 0x01); tx_priv->bcs_clk_en = true; if (tx_priv->hs_slow_insert_complete) snd_soc_component_update_bits(component, BOLERO_CDC_TX0_TX_PATH_SEC7, 0x40, 0x40); BOLERO_CDC_TX0_TX_PATH_SEC7, 0x40, 0x40); } break; case SND_SOC_DAPM_PRE_PMD: Loading Loading @@ -946,6 +960,7 @@ static int tx_macro_enable_dec(struct snd_soc_dapm_widget *w, 0x01, 0x00); snd_soc_component_update_bits(component, BOLERO_CDC_TX0_TX_PATH_SEC7, 0x40, 0x00); tx_priv->bcs_clk_en = false; } break; } Loading
asoc/codecs/wcd-mbhc-adc.c +11 −0 Original line number Diff line number Diff line Loading @@ -689,6 +689,13 @@ static void wcd_correct_swch_plug(struct work_struct *work) } correct_plug_type: /* * Callback to disable BCS slow insertion detection */ if (plug_type == MBHC_PLUG_TYPE_HEADSET || plug_type == MBHC_PLUG_TYPE_HEADPHONE) mbhc->mbhc_cb->bcs_enable(mbhc, false); timeout = jiffies + msecs_to_jiffies(HS_DETECT_PLUG_TIME_MS); while (!time_after(jiffies, timeout)) { if (mbhc->hs_detect_work_stop) { Loading Loading @@ -833,6 +840,10 @@ static void wcd_correct_swch_plug(struct work_struct *work) wrk_complete = false; } } if ((plug_type == MBHC_PLUG_TYPE_HEADSET || plug_type == MBHC_PLUG_TYPE_HEADPHONE)) mbhc->mbhc_cb->bcs_enable(mbhc, true); if (!wrk_complete) { /* * If plug_tye is headset, we might have already reported either Loading