From fd5b97690ddb9ea569c8b632531547e0f1ef1ba0 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Thu, 9 Jan 2025 15:30:32 +0000 Subject: [PATCH] drivers: pwm: sam: move SAM V71 register fixup from SoC to PWM driver Move the SAM V71 register name fixup from the SoC code into the PWM driver next to the other PWM driver fixup. Signed-off-by: Henrik Brix Andersen --- drivers/pwm/pwm_sam.c | 9 ++++++++- soc/atmel/sam/common/pwm_fixup.h | 17 ----------------- soc/atmel/sam/samv71/soc.h | 2 -- 3 files changed, 8 insertions(+), 20 deletions(-) delete mode 100644 soc/atmel/sam/common/pwm_fixup.h diff --git a/drivers/pwm/pwm_sam.c b/drivers/pwm/pwm_sam.c index 8a5f52dd061..5902c0fdb85 100644 --- a/drivers/pwm/pwm_sam.c +++ b/drivers/pwm/pwm_sam.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2019 Aurelien Jarno + * Copyright (c) 2021 Linaro Limited * * SPDX-License-Identifier: Apache-2.0 */ @@ -11,7 +12,6 @@ #include #include #include -#include #include @@ -22,6 +22,13 @@ LOG_MODULE_REGISTER(pwm_sam, CONFIG_PWM_LOG_LEVEL); #define PWMCHNUM_NUMBER PWMCH_NUM_NUMBER #endif +/* The SAMV71 HALs change the name of the field, so we need to + * define it this way to match how the other SoC variants name it + */ +#if defined(CONFIG_SOC_SERIES_SAMV71) +#define PWM_CH_NUM PwmChNum +#endif + struct sam_pwm_config { Pwm *regs; const struct atmel_sam_pmc_config clock_cfg; diff --git a/soc/atmel/sam/common/pwm_fixup.h b/soc/atmel/sam/common/pwm_fixup.h deleted file mode 100644 index b2a038f8e86..00000000000 --- a/soc/atmel/sam/common/pwm_fixup.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright (c) 2021 Linaro Limited - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#ifndef _ATMEL_SAM_PWM_FIXUP_H_ -#define _ATMEL_SAM_PWM_FIXUP_H_ - -/* The SAMV71 HALs change the name of the field, so we need to - * define it this way to match how the other SoC variants name it - */ -#if defined(CONFIG_SOC_SERIES_SAMV71) -#define PWM_CH_NUM PwmChNum -#endif - -#endif /* _ATMEL_SAM_PWM_FIXUP_H_ */ diff --git a/soc/atmel/sam/samv71/soc.h b/soc/atmel/sam/samv71/soc.h index 8b54125bce5..c87e1d12fbc 100644 --- a/soc/atmel/sam/samv71/soc.h +++ b/soc/atmel/sam/samv71/soc.h @@ -79,6 +79,4 @@ #endif /* _ASMLANGUAGE */ -#include "pwm_fixup.h" - #endif /* _SOC_ATMEL_SAM_SAMV71_SOC_H_ */