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 <fenglinw@codeaurora.org>
This commit is contained in:
Fenglin Wu 2021-10-11 09:51:09 +08:00 committed by David Collins
parent ee656b6cb1
commit 2e5deec278

View File

@ -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;