drivers: stepper: adi: tmc2209 allow instantiation of tmc2209 without msx

The current implementation of tmc2209 driver does not allow instantiation
of the driver without configuring msx pins.

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
This commit is contained in:
Jilay Pandya 2024-12-08 20:36:39 +01:00 committed by Benjamin Cabé
parent a1ad0ad6c6
commit 5a2c6bf66c

View file

@ -172,10 +172,9 @@ static DEVICE_API(stepper, tmc22xx_stepper_api) = {
static const struct tmc22xx_config tmc22xx_config_##inst = { \
.common = STEP_DIR_STEPPER_DT_INST_COMMON_CONFIG_INIT(inst), \
.enable_pin = GPIO_DT_SPEC_INST_GET(inst, enable_gpios), \
.msx_pins = DT_INST_NODE_HAS_PROP(inst, msx_gpios) \
? tmc22xx_stepper_msx_pins_##inst \
: NULL, \
.msx_resolutions = msx_table, \
IF_ENABLED(DT_INST_NODE_HAS_PROP(inst, msx_gpios), \
(.msx_pins = tmc22xx_stepper_msx_pins_##inst)) \
}; \
static struct tmc22xx_data tmc22xx_data_##inst = { \
.common = STEP_DIR_STEPPER_DT_INST_COMMON_DATA_INIT(inst), \