Skip to content

Conversation

@jilaypandya
Copy link
Member

@jilaypandya jilaypandya commented Nov 28, 2025

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.

@jilaypandya jilaypandya requested a review from dipakgmx November 28, 2025 08:51
@jilaypandya jilaypandya force-pushed the refactor/tmc51xx_dt_drv_compat branch 2 times, most recently from 8f2b1e9 to d809af8 Compare November 28, 2025 10:18
@jilaypandya jilaypandya reopened this Nov 28, 2025
@jilaypandya jilaypandya force-pushed the refactor/tmc51xx_dt_drv_compat branch from d809af8 to cf3054b Compare November 28, 2025 11:29
@jilaypandya jilaypandya marked this pull request as ready for review November 28, 2025 12:37
@zephyrbot zephyrbot added platform: ADI Analog Devices, Inc. area: Stepper labels Nov 28, 2025
fabiobaltieri
fabiobaltieri previously approved these changes Nov 28, 2025
jbehrensnx
jbehrensnx previously approved these changes Nov 28, 2025
Comment on lines 26 to 34
#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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#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));
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member

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));
Copy link
Contributor

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?

Copy link
Member

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]>
@jilaypandya jilaypandya dismissed stale reviews from jbehrensnx and fabiobaltieri via 71e1bcc November 28, 2025 19:40
@jilaypandya jilaypandya force-pushed the refactor/tmc51xx_dt_drv_compat branch from cf3054b to 71e1bcc Compare November 28, 2025 19:40
@jilaypandya jilaypandya requested a review from ttmut November 28, 2025 19:40
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Stepper platform: ADI Analog Devices, Inc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants