diff --git a/drivers/haptics/drv2605.c b/drivers/haptics/drv2605.c index 30306a08e56..bc8c2f3a8c0 100644 --- a/drivers/haptics/drv2605.c +++ b/drivers/haptics/drv2605.c @@ -461,6 +461,12 @@ static int drv2605_hw_config(const struct device *dev) return ret; } + ret = i2c_reg_write_byte_dt(&config->i2c, DRV2605_REG_OVERDRIVE_CLAMP_VOLTAGE, + config->overdrive_clamp_voltage); + if (ret < 0) { + return ret; + } + return 0; } @@ -610,6 +616,8 @@ static const struct haptics_driver_api drv2605_driver_api = { .loop_gain = DT_INST_ENUM_IDX(inst, loop_gain), \ .actuator_mode = DT_INST_ENUM_IDX(inst, actuator_mode), \ .rated_voltage = DRV2605_CALCULATE_VOLTAGE(DT_INST_PROP(inst, vib_rated_mv)), \ + .overdrive_clamp_voltage = \ + DRV2605_CALCULATE_VOLTAGE(DT_INST_PROP(inst, vib_overdrive_mv)), \ }; \ \ static struct drv2605_data drv2605_data_##inst = { \ diff --git a/dts/bindings/haptics/ti,drv2605.yaml b/dts/bindings/haptics/ti,drv2605.yaml index f27a241a076..484267c4abe 100644 --- a/dts/bindings/haptics/ti,drv2605.yaml +++ b/dts/bindings/haptics/ti,drv2605.yaml @@ -49,6 +49,12 @@ properties: description: | Sets the reference voltage for full-scale output during closed-loop operation. The default value is inherited from ti,drv260x.yaml in Linux. + vib-overdrive-mv: + type: int + default: 3200 + description: | + Sets a clamp so that the automatic overdrive is bounded. The default + value is inherited from ti,drv260x.yaml in Linux. en-gpios: type: phandle-array description: GPIO to enable and disable the device.