From 2e5deec278e620f942f2fd1a2dc8e39f663632a5 Mon Sep 17 00:00:00 2001 From: Fenglin Wu Date: Mon, 11 Oct 2021 09:51:09 +0800 Subject: [PATCH] input: qcom-hv-haptics: Add a flag to include hBoost control logic SW_CTRL_HBST flag is added to include the hBoost control logic which is required for HAP520 haptics module. Change-Id: I6615e6cff90f4cfb8d266752c61b3daf06dfe571 Signed-off-by: Fenglin Wu --- drivers/input/misc/qcom-hv-haptics.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/input/misc/qcom-hv-haptics.c b/drivers/input/misc/qcom-hv-haptics.c index 5ce3520125bf..3b2d63b31c8e 100644 --- a/drivers/input/misc/qcom-hv-haptics.c +++ b/drivers/input/misc/qcom-hv-haptics.c @@ -343,6 +343,7 @@ enum haptics_hw_type { enum wa_flags { TOGGLE_CAL_RC_CLK = BIT(0), + SW_CTRL_HBST = BIT(1), }; static const char * const src_str[] = { @@ -1137,6 +1138,9 @@ static int haptics_boost_vreg_enable(struct haptics_chip *chip, bool en) if (is_haptics_external_powered(chip)) return 0; + if (!(chip->wa_flags & SW_CTRL_HBST)) + return 0; + if (chip->hap_cfg_nvmem == NULL) { dev_dbg(chip->dev, "nvmem device for hap_cfg is not defined\n"); return 0; @@ -1207,6 +1211,9 @@ static int haptics_wait_hboost_ready(struct haptics_chip *chip) if (is_haptics_external_powered(chip)) return 0; + + if (!(chip->wa_flags & SW_CTRL_HBST)) + return 0; /* * Wait ~20ms until hBoost is ready, otherwise * bail out and return -EBUSY @@ -2364,7 +2371,7 @@ static int haptics_config_wa(struct haptics_chip *chip) { switch (chip->hw_type) { case HAP520: - chip->wa_flags |= TOGGLE_CAL_RC_CLK; + chip->wa_flags |= TOGGLE_CAL_RC_CLK | SW_CTRL_HBST; break; case HAP520_MV: break;