From 152ae036e4860cd67ec0419c84d27a293cdfdc4a Mon Sep 17 00:00:00 2001 From: Jilay Pandya Date: Mon, 16 Dec 2024 17:38:50 +0100 Subject: [PATCH] drivers: stepper: tmc: create rampstat Kconfig template create rampstat Kconfig template to enable respective tmc drivers to reuse the common configurations Signed-off-by: Jilay Pandya --- drivers/stepper/adi_tmc/Kconfig.tmc5041 | 20 +++---------------- .../adi_tmc/Kconfig.tmc_rampstat_template | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 drivers/stepper/adi_tmc/Kconfig.tmc_rampstat_template diff --git a/drivers/stepper/adi_tmc/Kconfig.tmc5041 b/drivers/stepper/adi_tmc/Kconfig.tmc5041 index af3e0de4f820167..20829eda18fdf56 100644 --- a/drivers/stepper/adi_tmc/Kconfig.tmc5041 +++ b/drivers/stepper/adi_tmc/Kconfig.tmc5041 @@ -9,20 +9,6 @@ config STEPPER_ADI_TMC5041 help Stepper driver for TMC5041. -config STEPPER_ADI_TMC5041_RAMPSTAT_POLL - bool "TMC5041 poll ramp status" - depends on STEPPER_ADI_TMC5041 - default y - help - When enabled, the ramp status will be polled on TMC5041, to check for events: - - TMC5041_POS_REACHED_EVENT - - TMC5041_STOP_SG_EVENT - - TMC5041_STOP_LEFT_EVENT - - TMC5041_STOP_RIGHT_EVENT - -config STEPPER_ADI_TMC5041_RAMPSTAT_POLL_INTERVAL_IN_MSEC - int "TMC5041 poll ramp status interval in ms" - depends on STEPPER_ADI_TMC5041_RAMPSTAT_POLL - default 100 - help - The interval in ms to poll the ramp status on TMC5041. +module = TMC5041 +module-str = tmc5041 +rsource "Kconfig.tmc_rampstat_template" diff --git a/drivers/stepper/adi_tmc/Kconfig.tmc_rampstat_template b/drivers/stepper/adi_tmc/Kconfig.tmc_rampstat_template new file mode 100644 index 000000000000000..b42ff2086355476 --- /dev/null +++ b/drivers/stepper/adi_tmc/Kconfig.tmc_rampstat_template @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: Copyright (c) 2024 Jilay Sandeep Pandya +# SPDX-License-Identifier: Apache-2.0 + +config STEPPER_ADI_$(module)_RAMPSTAT_POLL + bool "$(module-str) poll ramp status" + depends on STEPPER_ADI_$(module) + default y + help + When enabled, the ramp status will be polled on TMC, to check for events: + - TMC_POS_REACHED_EVENT + - TMC_STOP_SG_EVENT + - TMC_STOP_LEFT_EVENT + - TMC_STOP_RIGHT_EVENT + +config STEPPER_ADI_$(module)_RAMPSTAT_POLL_INTERVAL_IN_MSEC + int "$(module-str) poll ramp status interval in ms" + depends on STEPPER_ADI_$(module)_RAMPSTAT_POLL + default 100 + help + The interval in ms to poll the ramp status on TMC.