Skip to content

Commit fd5b976

Browse files
henrikbrixandersenkartben
authored andcommitted
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 <[email protected]>
1 parent 6d6441d commit fd5b976

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

drivers/pwm/pwm_sam.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2019 Aurelien Jarno
3+
* Copyright (c) 2021 Linaro Limited
34
*
45
* SPDX-License-Identifier: Apache-2.0
56
*/
@@ -11,7 +12,6 @@
1112
#include <zephyr/drivers/pwm.h>
1213
#include <zephyr/drivers/pinctrl.h>
1314
#include <zephyr/drivers/clock_control/atmel_sam_pmc.h>
14-
#include <soc.h>
1515

1616
#include <zephyr/logging/log.h>
1717

@@ -22,6 +22,13 @@ LOG_MODULE_REGISTER(pwm_sam, CONFIG_PWM_LOG_LEVEL);
2222
#define PWMCHNUM_NUMBER PWMCH_NUM_NUMBER
2323
#endif
2424

25+
/* The SAMV71 HALs change the name of the field, so we need to
26+
* define it this way to match how the other SoC variants name it
27+
*/
28+
#if defined(CONFIG_SOC_SERIES_SAMV71)
29+
#define PWM_CH_NUM PwmChNum
30+
#endif
31+
2532
struct sam_pwm_config {
2633
Pwm *regs;
2734
const struct atmel_sam_pmc_config clock_cfg;

soc/atmel/sam/common/pwm_fixup.h

Lines changed: 0 additions & 17 deletions
This file was deleted.

soc/atmel/sam/samv71/soc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,4 @@
7979

8080
#endif /* _ASMLANGUAGE */
8181

82-
#include "pwm_fixup.h"
83-
8482
#endif /* _SOC_ATMEL_SAM_SAMV71_SOC_H_ */

0 commit comments

Comments
 (0)