mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 11:37:06 +02:00
input: misc: qcom-hv-haptics: check nvmem before using it
Currently, nvmem device is used to store closed loop brake settings. If nvmem-cells is not specified for closed loop brake, then nvmem device can be NULL. For such case, skip updating closed loop brake settings by not writing to the nvmem device. Change-Id: I18d455814f3731af519949f21a3a553bd1692548 Signed-off-by: Fenglin Wu <fenglinw@codeaurora.org>
This commit is contained in:
parent
d768902aed
commit
6992edc015
|
|
@ -1628,6 +1628,9 @@ static int haptics_store_cl_brake_settings(struct haptics_chip *chip)
|
|||
int rc = 0;
|
||||
u8 val;
|
||||
|
||||
if (!chip->cl_brake_nvmem)
|
||||
return 0;
|
||||
|
||||
val = MOD_STATUS_SEL_BRAKE_CAL_RNAT_RCAL_VAL;
|
||||
rc = haptics_write(chip, chip->cfg_addr_base,
|
||||
HAP_CFG_MOD_STATUS_SEL_REG, &val, 1);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user