Loading asoc/codecs/wcd937x/internal.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -90,6 +90,7 @@ struct wcd937x_priv { int ana_clk_count; int ana_clk_count; struct mutex ana_tx_clk_lock; struct mutex ana_tx_clk_lock; u8 tx_master_ch_map[WCD937X_MAX_SLAVE_CH_TYPES]; u8 tx_master_ch_map[WCD937X_MAX_SLAVE_CH_TYPES]; bool usbc_hs_status; }; }; struct wcd937x_micbias_setting { struct wcd937x_micbias_setting { Loading asoc/codecs/wcd937x/wcd937x.c +15 −0 Original line number Original line Diff line number Diff line Loading @@ -1567,6 +1567,17 @@ static int wcd937x_get_logical_addr(struct swr_device *swr_dev) return 0; return 0; } } static bool get_usbc_hs_status(struct snd_soc_component *component, struct wcd_mbhc_config *mbhc_cfg) { if (mbhc_cfg->enable_usbc_analog) { if (!(snd_soc_component_read32(component, WCD937X_ANA_MBHC_MECH) & 0x20)) return true; } return false; } static int wcd937x_event_notify(struct notifier_block *block, static int wcd937x_event_notify(struct notifier_block *block, unsigned long val, unsigned long val, void *data) void *data) Loading Loading @@ -1602,6 +1613,8 @@ static int wcd937x_event_notify(struct notifier_block *block, case BOLERO_WCD_EVT_SSR_DOWN: case BOLERO_WCD_EVT_SSR_DOWN: wcd937x->mbhc->wcd_mbhc.deinit_in_progress = true; wcd937x->mbhc->wcd_mbhc.deinit_in_progress = true; mbhc = &wcd937x->mbhc->wcd_mbhc; mbhc = &wcd937x->mbhc->wcd_mbhc; wcd937x->usbc_hs_status = get_usbc_hs_status(component, mbhc->mbhc_cfg); wcd937x_mbhc_ssr_down(wcd937x->mbhc, component); wcd937x_mbhc_ssr_down(wcd937x->mbhc, component); wcd937x_reset_low(wcd937x->dev); wcd937x_reset_low(wcd937x->dev); break; break; Loading @@ -1622,6 +1635,8 @@ static int wcd937x_event_notify(struct notifier_block *block, __func__); __func__); } else { } else { wcd937x_mbhc_hs_detect(component, mbhc->mbhc_cfg); wcd937x_mbhc_hs_detect(component, mbhc->mbhc_cfg); if (wcd937x->usbc_hs_status) mdelay(500); } } wcd937x->mbhc->wcd_mbhc.deinit_in_progress = false; wcd937x->mbhc->wcd_mbhc.deinit_in_progress = false; break; break; Loading asoc/codecs/wcd938x/internal.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -104,6 +104,7 @@ struct wcd938x_priv { int ear_rx_path; int ear_rx_path; bool dev_up; bool dev_up; u8 tx_master_ch_map[WCD938X_MAX_SLAVE_CH_TYPES]; u8 tx_master_ch_map[WCD938X_MAX_SLAVE_CH_TYPES]; bool usbc_hs_status; }; }; struct wcd938x_micbias_setting { struct wcd938x_micbias_setting { Loading asoc/codecs/wcd938x/wcd938x.c +15 −0 Original line number Original line Diff line number Diff line Loading @@ -1998,6 +1998,17 @@ static int wcd938x_get_logical_addr(struct swr_device *swr_dev) return 0; return 0; } } static bool get_usbc_hs_status(struct snd_soc_component *component, struct wcd_mbhc_config *mbhc_cfg) { if (mbhc_cfg->enable_usbc_analog) { if (!(snd_soc_component_read32(component, WCD938X_ANA_MBHC_MECH) & 0x20)) return true; } return false; } static int wcd938x_event_notify(struct notifier_block *block, static int wcd938x_event_notify(struct notifier_block *block, unsigned long val, unsigned long val, void *data) void *data) Loading Loading @@ -2043,6 +2054,8 @@ static int wcd938x_event_notify(struct notifier_block *block, wcd938x->dev_up = false; wcd938x->dev_up = false; wcd938x->mbhc->wcd_mbhc.deinit_in_progress = true; wcd938x->mbhc->wcd_mbhc.deinit_in_progress = true; mbhc = &wcd938x->mbhc->wcd_mbhc; mbhc = &wcd938x->mbhc->wcd_mbhc; wcd938x->usbc_hs_status = get_usbc_hs_status(component, mbhc->mbhc_cfg); wcd938x_mbhc_ssr_down(wcd938x->mbhc, component); wcd938x_mbhc_ssr_down(wcd938x->mbhc, component); wcd938x_reset_low(wcd938x->dev); wcd938x_reset_low(wcd938x->dev); break; break; Loading @@ -2065,6 +2078,8 @@ static int wcd938x_event_notify(struct notifier_block *block, __func__); __func__); } else { } else { wcd938x_mbhc_hs_detect(component, mbhc->mbhc_cfg); wcd938x_mbhc_hs_detect(component, mbhc->mbhc_cfg); if (wcd938x->usbc_hs_status) mdelay(500); } } wcd938x->mbhc->wcd_mbhc.deinit_in_progress = false; wcd938x->mbhc->wcd_mbhc.deinit_in_progress = false; wcd938x->dev_up = true; wcd938x->dev_up = true; Loading Loading
asoc/codecs/wcd937x/internal.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -90,6 +90,7 @@ struct wcd937x_priv { int ana_clk_count; int ana_clk_count; struct mutex ana_tx_clk_lock; struct mutex ana_tx_clk_lock; u8 tx_master_ch_map[WCD937X_MAX_SLAVE_CH_TYPES]; u8 tx_master_ch_map[WCD937X_MAX_SLAVE_CH_TYPES]; bool usbc_hs_status; }; }; struct wcd937x_micbias_setting { struct wcd937x_micbias_setting { Loading
asoc/codecs/wcd937x/wcd937x.c +15 −0 Original line number Original line Diff line number Diff line Loading @@ -1567,6 +1567,17 @@ static int wcd937x_get_logical_addr(struct swr_device *swr_dev) return 0; return 0; } } static bool get_usbc_hs_status(struct snd_soc_component *component, struct wcd_mbhc_config *mbhc_cfg) { if (mbhc_cfg->enable_usbc_analog) { if (!(snd_soc_component_read32(component, WCD937X_ANA_MBHC_MECH) & 0x20)) return true; } return false; } static int wcd937x_event_notify(struct notifier_block *block, static int wcd937x_event_notify(struct notifier_block *block, unsigned long val, unsigned long val, void *data) void *data) Loading Loading @@ -1602,6 +1613,8 @@ static int wcd937x_event_notify(struct notifier_block *block, case BOLERO_WCD_EVT_SSR_DOWN: case BOLERO_WCD_EVT_SSR_DOWN: wcd937x->mbhc->wcd_mbhc.deinit_in_progress = true; wcd937x->mbhc->wcd_mbhc.deinit_in_progress = true; mbhc = &wcd937x->mbhc->wcd_mbhc; mbhc = &wcd937x->mbhc->wcd_mbhc; wcd937x->usbc_hs_status = get_usbc_hs_status(component, mbhc->mbhc_cfg); wcd937x_mbhc_ssr_down(wcd937x->mbhc, component); wcd937x_mbhc_ssr_down(wcd937x->mbhc, component); wcd937x_reset_low(wcd937x->dev); wcd937x_reset_low(wcd937x->dev); break; break; Loading @@ -1622,6 +1635,8 @@ static int wcd937x_event_notify(struct notifier_block *block, __func__); __func__); } else { } else { wcd937x_mbhc_hs_detect(component, mbhc->mbhc_cfg); wcd937x_mbhc_hs_detect(component, mbhc->mbhc_cfg); if (wcd937x->usbc_hs_status) mdelay(500); } } wcd937x->mbhc->wcd_mbhc.deinit_in_progress = false; wcd937x->mbhc->wcd_mbhc.deinit_in_progress = false; break; break; Loading
asoc/codecs/wcd938x/internal.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -104,6 +104,7 @@ struct wcd938x_priv { int ear_rx_path; int ear_rx_path; bool dev_up; bool dev_up; u8 tx_master_ch_map[WCD938X_MAX_SLAVE_CH_TYPES]; u8 tx_master_ch_map[WCD938X_MAX_SLAVE_CH_TYPES]; bool usbc_hs_status; }; }; struct wcd938x_micbias_setting { struct wcd938x_micbias_setting { Loading
asoc/codecs/wcd938x/wcd938x.c +15 −0 Original line number Original line Diff line number Diff line Loading @@ -1998,6 +1998,17 @@ static int wcd938x_get_logical_addr(struct swr_device *swr_dev) return 0; return 0; } } static bool get_usbc_hs_status(struct snd_soc_component *component, struct wcd_mbhc_config *mbhc_cfg) { if (mbhc_cfg->enable_usbc_analog) { if (!(snd_soc_component_read32(component, WCD938X_ANA_MBHC_MECH) & 0x20)) return true; } return false; } static int wcd938x_event_notify(struct notifier_block *block, static int wcd938x_event_notify(struct notifier_block *block, unsigned long val, unsigned long val, void *data) void *data) Loading Loading @@ -2043,6 +2054,8 @@ static int wcd938x_event_notify(struct notifier_block *block, wcd938x->dev_up = false; wcd938x->dev_up = false; wcd938x->mbhc->wcd_mbhc.deinit_in_progress = true; wcd938x->mbhc->wcd_mbhc.deinit_in_progress = true; mbhc = &wcd938x->mbhc->wcd_mbhc; mbhc = &wcd938x->mbhc->wcd_mbhc; wcd938x->usbc_hs_status = get_usbc_hs_status(component, mbhc->mbhc_cfg); wcd938x_mbhc_ssr_down(wcd938x->mbhc, component); wcd938x_mbhc_ssr_down(wcd938x->mbhc, component); wcd938x_reset_low(wcd938x->dev); wcd938x_reset_low(wcd938x->dev); break; break; Loading @@ -2065,6 +2078,8 @@ static int wcd938x_event_notify(struct notifier_block *block, __func__); __func__); } else { } else { wcd938x_mbhc_hs_detect(component, mbhc->mbhc_cfg); wcd938x_mbhc_hs_detect(component, mbhc->mbhc_cfg); if (wcd938x->usbc_hs_status) mdelay(500); } } wcd938x->mbhc->wcd_mbhc.deinit_in_progress = false; wcd938x->mbhc->wcd_mbhc.deinit_in_progress = false; wcd938x->dev_up = true; wcd938x->dev_up = true; Loading