Skip to content

Commit 04dae3a

Browse files
rriveramcrusnashif
authored andcommitted
drivers: haptics: drv2605: Hard codes open loop mode for LRA mode
Enables open loop operation when initializing into LRA mode. Open loop operation is enabled by default for ERM mode. This is hard coded for LRA mode because calibration is currently unsupported. Signed-off-by: Ricardo Rivera-Matos <[email protected]>
1 parent 6825fc3 commit 04dae3a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/haptics/drv2605.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ LOG_MODULE_REGISTER(DRV2605, CONFIG_HAPTICS_LOG_LEVEL);
9090
#define DRV2605_LOOP_GAIN GENMASK(3, 2)
9191
#define DRV2605_BEMF_GAIN GENMASK(1, 0)
9292

93+
#define DRV2605_ACTUATOR_MODE_ERM 0
94+
#define DRV2605_ACTUATOR_MODE_LRA 1
95+
9396
#define DRV2605_REG_CONTROL1 0x1b
9497
#define DRV2605_STARTUP_BOOST BIT(7)
9598
#define DRV2605_AC_COUPLE BIT(5)
@@ -467,6 +470,14 @@ static int drv2605_hw_config(const struct device *dev)
467470
return ret;
468471
}
469472

473+
if (config->actuator_mode == DRV2605_ACTUATOR_MODE_LRA) {
474+
ret = i2c_reg_update_byte_dt(&config->i2c, DRV2605_REG_CONTROL3,
475+
DRV2605_LRA_OPEN_LOOP, DRV2605_LRA_OPEN_LOOP);
476+
if (ret < 0) {
477+
return ret;
478+
}
479+
}
480+
470481
return 0;
471482
}
472483

0 commit comments

Comments
 (0)