qcom: smb-lib: Disable HW trigger when forcing sink-only mode
Due to an existing HW workaround, the UFP_EN_CMD bit may end up
getting cleared even after having been set. The result of this
is the Type-C state machine returns to DRP behavior despite SW
intention to force sink mode, such as PR Swap or Try.SNK.
Temporarily disable this particular HW trigger whenever the
typec_power_role property is getting set to sink-only mode, and
restore it when leaving sink mode.
Change-Id: I21e840bfeee3ad88b0562645378b1fea200e3803
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
diff --git a/drivers/power/supply/qcom/smb-reg.h b/drivers/power/supply/qcom/smb-reg.h
index 54b6b38..f4afb80 100644
--- a/drivers/power/supply/qcom/smb-reg.h
+++ b/drivers/power/supply/qcom/smb-reg.h
@@ -1018,6 +1018,8 @@
#define CFG_BUCKBOOST_FREQ_SELECT_BUCK_REG (MISC_BASE + 0xA0)
#define CFG_BUCKBOOST_FREQ_SELECT_BOOST_REG (MISC_BASE + 0xA1)
+#define TM_IO_DTEST4_SEL (MISC_BASE + 0xE9)
+
/* CHGR FREQ Peripheral registers */
#define FREQ_CLK_DIV_REG (CHGR_FREQ_BASE + 0x50)