Skip to content

Commit 6825fc3

Browse files
rriveramcrusnashif
authored andcommitted
drivers: haptics: drv2605: Introduces overdrive clamp prop
Adds "vib-overdrive-mv" device tree property to configure the overdrive clamp at initialization. Signed-off-by: Ricardo Rivera-Matos <[email protected]>
1 parent 38b827d commit 6825fc3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

drivers/haptics/drv2605.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,12 @@ static int drv2605_hw_config(const struct device *dev)
461461
return ret;
462462
}
463463

464+
ret = i2c_reg_write_byte_dt(&config->i2c, DRV2605_REG_OVERDRIVE_CLAMP_VOLTAGE,
465+
config->overdrive_clamp_voltage);
466+
if (ret < 0) {
467+
return ret;
468+
}
469+
464470
return 0;
465471
}
466472

@@ -610,6 +616,8 @@ static const struct haptics_driver_api drv2605_driver_api = {
610616
.loop_gain = DT_INST_ENUM_IDX(inst, loop_gain), \
611617
.actuator_mode = DT_INST_ENUM_IDX(inst, actuator_mode), \
612618
.rated_voltage = DRV2605_CALCULATE_VOLTAGE(DT_INST_PROP(inst, vib_rated_mv)), \
619+
.overdrive_clamp_voltage = \
620+
DRV2605_CALCULATE_VOLTAGE(DT_INST_PROP(inst, vib_overdrive_mv)), \
613621
}; \
614622
\
615623
static struct drv2605_data drv2605_data_##inst = { \

dts/bindings/haptics/ti,drv2605.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ properties:
4949
description: |
5050
Sets the reference voltage for full-scale output during closed-loop
5151
operation. The default value is inherited from ti,drv260x.yaml in Linux.
52+
vib-overdrive-mv:
53+
type: int
54+
default: 3200
55+
description: |
56+
Sets a clamp so that the automatic overdrive is bounded. The default
57+
value is inherited from ti,drv260x.yaml in Linux.
5258
en-gpios:
5359
type: phandle-array
5460
description: GPIO to enable and disable the device.

0 commit comments

Comments
 (0)