Loading asoc/codecs/wcd-mbhc-v2.c +8 −2 Original line number Original line Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. */ */ #include <linux/module.h> #include <linux/module.h> #include <linux/init.h> #include <linux/init.h> Loading Loading @@ -850,7 +850,7 @@ static bool wcd_mbhc_moisture_detect(struct wcd_mbhc *mbhc, bool detection_type) { { bool ret = false; bool ret = false; if (!mbhc->mbhc_cfg->moisture_en || if (!mbhc->mbhc_cfg->moisture_en && !mbhc->mbhc_cfg->moisture_duty_cycle_en) !mbhc->mbhc_cfg->moisture_duty_cycle_en) return ret; return ret; Loading Loading @@ -1342,9 +1342,15 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc) else else WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_HS_L_DET_PULL_UP_CTRL, 3); WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_HS_L_DET_PULL_UP_CTRL, 3); /* Configure for moisture detection when duty cycle is not enabled. * Otherwise disable moisture detection. */ if (mbhc->mbhc_cfg->moisture_en && mbhc->mbhc_cb->mbhc_moisture_config if (mbhc->mbhc_cfg->moisture_en && mbhc->mbhc_cb->mbhc_moisture_config && !mbhc->mbhc_cfg->moisture_duty_cycle_en) && !mbhc->mbhc_cfg->moisture_duty_cycle_en) mbhc->mbhc_cb->mbhc_moisture_config(mbhc); mbhc->mbhc_cb->mbhc_moisture_config(mbhc); else if (mbhc->mbhc_cfg->moisture_duty_cycle_en && mbhc->mbhc_cb->mbhc_moisture_detect_en) mbhc->mbhc_cb->mbhc_moisture_detect_en(mbhc, false); /* /* * For USB analog we need to override the switch configuration. * For USB analog we need to override the switch configuration. Loading Loading
asoc/codecs/wcd-mbhc-v2.c +8 −2 Original line number Original line Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only // SPDX-License-Identifier: GPL-2.0-only /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2019, The Linux Foundation. All rights reserved. */ */ #include <linux/module.h> #include <linux/module.h> #include <linux/init.h> #include <linux/init.h> Loading Loading @@ -850,7 +850,7 @@ static bool wcd_mbhc_moisture_detect(struct wcd_mbhc *mbhc, bool detection_type) { { bool ret = false; bool ret = false; if (!mbhc->mbhc_cfg->moisture_en || if (!mbhc->mbhc_cfg->moisture_en && !mbhc->mbhc_cfg->moisture_duty_cycle_en) !mbhc->mbhc_cfg->moisture_duty_cycle_en) return ret; return ret; Loading Loading @@ -1342,9 +1342,15 @@ static int wcd_mbhc_initialise(struct wcd_mbhc *mbhc) else else WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_HS_L_DET_PULL_UP_CTRL, 3); WCD_MBHC_REG_UPDATE_BITS(WCD_MBHC_HS_L_DET_PULL_UP_CTRL, 3); /* Configure for moisture detection when duty cycle is not enabled. * Otherwise disable moisture detection. */ if (mbhc->mbhc_cfg->moisture_en && mbhc->mbhc_cb->mbhc_moisture_config if (mbhc->mbhc_cfg->moisture_en && mbhc->mbhc_cb->mbhc_moisture_config && !mbhc->mbhc_cfg->moisture_duty_cycle_en) && !mbhc->mbhc_cfg->moisture_duty_cycle_en) mbhc->mbhc_cb->mbhc_moisture_config(mbhc); mbhc->mbhc_cb->mbhc_moisture_config(mbhc); else if (mbhc->mbhc_cfg->moisture_duty_cycle_en && mbhc->mbhc_cb->mbhc_moisture_detect_en) mbhc->mbhc_cb->mbhc_moisture_detect_en(mbhc, false); /* /* * For USB analog we need to override the switch configuration. * For USB analog we need to override the switch configuration. Loading