Skip to content

Conversation

@rriveramcrus
Copy link
Contributor

#76343 (comment)
Address the issues raised by this comment:

  • Drop manufacturer prefix from properties in the driver
  • Document the GPIOs in the devicetree bindings

Documents the enable GPI and the input/trigger GPI in the dt bindings.

Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Removes the "ti_" prefix form the the device tree properties.

Signed-off-by: Ricardo Rivera-Matos <[email protected]>
@zephyrbot zephyrbot added the platform: TI SimpleLink Texas Instruments SimpleLink MCU label Aug 12, 2024
@rriveramcrus rriveramcrus requested a review from kartben August 12, 2024 15:30
@kartben kartben requested a review from fabiobaltieri August 12, 2024 17:25
Copy link
Member

@fabiobaltieri fabiobaltieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drv2605_pm_state also seems unused, also should this allow setting DRV2605_REG_RATED_VOLTAGE and DRV2605_REG_OVERDRIVE_CLAMP_VOLTAGE? I think they are fairly important parameters

Removes an unused enum defining the DRV2605 power states. This enum is
dead code so it is being removed.

Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Comment on lines 604 to 608
.en_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, en_gpios, {}), \
.in_trig_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, in_trig_gpios, {}), \
.feedback_brake_factor = DT_INST_ENUM_IDX_OR(inst, feedback_brake_factor, 3), \
.loop_gain = DT_INST_ENUM_IDX_OR(inst, loop_gain, 2), \
.actuator_mode = DT_INST_ENUM_IDX_OR(inst, actuator_mode, 0), \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default values should actually be set (and maybe more importantly, documented) in the binding... I think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I know this is not strictly related to this change, but I missed it in initial review and am catching this now as I'm actually starting to play with the driver). Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default values should actually be set (and maybe more importantly, documented) in the binding... I think?

Will do!

as I'm actually starting to play with the driver

Don't have too much fun buzzing around.

@rriveramcrus
Copy link
Contributor Author

@fabiobaltieri

drv2605_pm_state also seems unused,

Will drop, good catch.

also should this allow setting DRV2605_REG_RATED_VOLTAGE and DRV2605_REG_OVERDRIVE_CLAMP_VOLTAGE? I think they are fairly important parameters

Sure, ack!

fabiobaltieri
fabiobaltieri previously approved these changes Aug 15, 2024
Copy link
Contributor

@kartben kartben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully @fabiobaltieri can chime in an confirm I am not making unreasonable requests 😅

BTW the MikroE Vibro 4 click I'm using seems to use a motor that requires LRA open-loop mode. No idea what this actually means 😅 but it's true the motor vibrates more smoothly when I hard code CTRL3.LRA_OPEN_LOOP=1. It feels like there are many other flags from CTRL1/2/3 that would be worth exposing, and I wonder what's the best way to do this, since there's certainly a lot of things that can be tuned there (so to be clear: I'm not asking you to add them in this PR). Regarding open loop specifically, it feels like having an open-loop boolean that sets either LRA_OPEN_LOOP or ERM_OPEN_LOOP based on the current mode would be a good starting point?

Thanks!

@rriveramcrus
Copy link
Contributor Author

@kartben

I'm using seems to use a motor that requires LRA open-loop mode. No idea what this actually means 😅 but it's true the motor vibrates more smoothly when I hard code CTRL3.LRA_OPEN_LOOP=1

I will hardcode this in the driver based on the actuator mode selected. I am opposed to adding a property to control open/closed loop operation without adding support for calibration and OTP burning.

My DRV2605 breakout board does not make it easy to swap out actuators (it's cheap) and adding calibration support would require testing a couple different actuators. I defer adding calibration and OTP burning to a future PR.

@rriveramcrus rriveramcrus force-pushed the drv2605-bindings-cleanup branch 2 times, most recently from 096a881 to 14ca761 Compare August 15, 2024 20:23
Requires the actuator-mode property to be set as there is no safe
default value.

Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Adds the default value for the existing properties to the device tree
and fall back on those values at initialization if necessary.

Signed-off-by: Ricardo Rivera-Matos <[email protected]>
@rriveramcrus rriveramcrus force-pushed the drv2605-bindings-cleanup branch from 14ca761 to 4680131 Compare August 15, 2024 20:32
@fabiobaltieri
Copy link
Member

Hey played a bit with the driver in this PR, I have an unknown LRA salvaged from a phone connected, seems to work quite nicely, just the comment above about the macro.

Adds support for boot time configuration of the rated voltage at
initialization via "vib-rated-mv" devicetree property.

Signed-off-by: Ricardo Rivera-Matos <[email protected]>
Adds "vib-overdrive-mv" device tree property to configure the overdrive
clamp at initialization.

Signed-off-by: Ricardo Rivera-Matos <[email protected]>
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]>
@rriveramcrus rriveramcrus force-pushed the drv2605-bindings-cleanup branch from 4680131 to 341aeeb Compare August 16, 2024 15:36
@rriveramcrus rriveramcrus requested a review from kartben August 16, 2024 15:56
@nashif nashif merged commit 04dae3a into zephyrproject-rtos:main Aug 20, 2024
@rriveramcrus rriveramcrus deleted the drv2605-bindings-cleanup branch August 20, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Haptics platform: TI SimpleLink Texas Instruments SimpleLink MCU

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants