-
Notifications
You must be signed in to change notification settings - Fork 8.3k
drivers: tmc51xx: move DT_DRV_COMPAT to tmc51xx.c #100196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
drivers: tmc51xx: move DT_DRV_COMPAT to tmc51xx.c #100196
Conversation
8f2b1e9 to
d809af8
Compare
d809af8 to
cf3054b
Compare
| #if TMC51XX_BUS_SPI | ||
| /* SPI bus I/O operations for TMC51xx devices */ | ||
| const struct tmc_bus_io tmc51xx_spi_bus_io; | ||
| #endif | ||
|
|
||
| #if TMC51XX_BUS_UART | ||
| /* UART bus I/O operations for TMC51xx devices */ | ||
| const struct tmc_bus_io tmc51xx_uart_bus_io; | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #if TMC51XX_BUS_SPI | |
| /* SPI bus I/O operations for TMC51xx devices */ | |
| const struct tmc_bus_io tmc51xx_spi_bus_io; | |
| #endif | |
| #if TMC51XX_BUS_UART | |
| /* UART bus I/O operations for TMC51xx devices */ | |
| const struct tmc_bus_io tmc51xx_uart_bus_io; | |
| #endif |
tmc51xx_spi_bus_io and tmc51xx_uart_bus_io are already being declared in lines 107 and 158.
| } | ||
|
|
||
| /* Wait for the read to complete */ | ||
| k_sleep(K_MSEC(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with stepper driver ICs but why do you need a delay after a read operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really sure about this as well. Ping @dipakgmx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessary. Can be eliminated.
| } | ||
|
|
||
| /* Wait for the write to complete */ | ||
| k_sleep(K_MSEC(1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the delay really needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This too can be eliminated.
TMC51XX would have to be remodeled as a mfd, this means that each device tmc51xx, tmc51xx_motion_controller and tmc51xx_stepper_driver will have their own DT_DRV_COMPATs. Whenever the common header is included as of now, the adi_tmc51xx DT_DRV_COMPAT would have to be undef-ed each time in order to define a new DT_DRV_COMPAT i.e. required by the devices of the tmc51xx mfd. Signed-off-by: Jilay Pandya <[email protected]>
71e1bcc
cf3054b to
71e1bcc
Compare
|



TMC51XX would have to be remodeled as a mfd, this means that each device tmc51xx, tmc51xx_motion_controller and tmc51xx_stepper_driver will have their own DT_DRV_COMPATs.
Whenever the common header is included as of now, the adi_tmc51xx DT_DRV_COMPAT would have to be undef-ed each time in order to define a new DT_DRV_COMPAT i.e. required by the devices of the tmc51xx mfd.