mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 03:27:03 +02:00
input: qcom-hv-haptics: keep FORCE_VREG_RDY always set in non-HBoost case
FORCE_VREG_RDY bit can be always set when non-HBoost regulator is used and don't clear it when stopping play in non-HBoost case. Also set this bit in driver initialization in non-HBoost case so that swr-haptics driver can take the advantage of triggering SWR play without setting this bit. Change-Id: I6283396d9d5a4f0b87d87932d6db2d8e7bb7a623 Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
This commit is contained in:
parent
19b7ad347f
commit
72e5413d75
|
|
@ -1205,13 +1205,12 @@ static int haptics_enable_hpwr_vreg(struct haptics_chip *chip, bool en)
|
|||
|
||||
static int haptics_open_loop_drive_config(struct haptics_chip *chip, bool en)
|
||||
{
|
||||
int rc;
|
||||
int rc = 0;
|
||||
u8 val;
|
||||
|
||||
if ((is_boost_vreg_enabled_in_open_loop(chip) ||
|
||||
chip->hpwr_vreg != NULL) && en) {
|
||||
/* Force VREG_RDY */
|
||||
val = FORCE_VREG_RDY_BIT;
|
||||
rc = haptics_masked_write(chip, chip->cfg_addr_base,
|
||||
HAP_CFG_VSET_CFG_REG, FORCE_VREG_RDY_BIT,
|
||||
FORCE_VREG_RDY_BIT);
|
||||
|
|
@ -1242,11 +1241,10 @@ static int haptics_open_loop_drive_config(struct haptics_chip *chip, bool en)
|
|||
|
||||
dev_dbg(chip->dev, "Toggle CAL_EN in open-loop-VREG playing\n");
|
||||
}
|
||||
} else {
|
||||
val = en ? FORCE_VREG_RDY_BIT : 0;
|
||||
} else if (chip->hpwr_vreg == NULL) {
|
||||
rc = haptics_masked_write(chip, chip->cfg_addr_base,
|
||||
HAP_CFG_VSET_CFG_REG,
|
||||
FORCE_VREG_RDY_BIT, val);
|
||||
FORCE_VREG_RDY_BIT, 0);
|
||||
}
|
||||
|
||||
return rc;
|
||||
|
|
@ -2335,6 +2333,15 @@ static int haptics_hw_init(struct haptics_chip *chip)
|
|||
if (rc < 0)
|
||||
return rc;
|
||||
|
||||
/* Force VREG_RDY if non-HBoost is used for powering haptics */
|
||||
if (chip->hpwr_vreg) {
|
||||
rc = haptics_masked_write(chip, chip->cfg_addr_base,
|
||||
HAP_CFG_VSET_CFG_REG, FORCE_VREG_RDY_BIT,
|
||||
FORCE_VREG_RDY_BIT);
|
||||
if (rc < 0)
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (config->is_erm)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user