Skip to content

Commit

Permalink
drivers: watchdog: sam0: Remove defines from dts_fixup.h
Browse files Browse the repository at this point in the history
Move SAM0 GPIO to use the raw defines generated from the DTS
parsing.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
  • Loading branch information
Sizurka authored and MaureenHelm committed May 3, 2019
1 parent 4204700 commit 06caf27
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
10 changes: 5 additions & 5 deletions drivers/watchdog/wdt_sam0.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <logging/log.h>
LOG_MODULE_REGISTER(wdt_sam0);

#define WDT_REGS ((Wdt *)DT_WDT_SAM0_BASE_ADDRESS)
#define WDT_REGS ((Wdt *)DT_ATMEL_SAM0_WATCHDOG_0_BASE_ADDRESS)

struct wdt_sam0_dev_data {
wdt_callback_t cb;
Expand Down Expand Up @@ -208,16 +208,16 @@ static int wdt_sam0_init(struct device *dev)
| GCLK_CLKCTRL_GEN_GCLK2
| GCLK_CLKCTRL_CLKEN;

IRQ_CONNECT(DT_WDT_SAM0_IRQ,
DT_WDT_SAM0_IRQ_PRIORITY, wdt_sam0_isr,
IRQ_CONNECT(DT_ATMEL_SAM0_WATCHDOG_0_IRQ_0,
DT_ATMEL_SAM0_WATCHDOG_0_IRQ_0_PRIORITY, wdt_sam0_isr,
DEVICE_GET(wdt_sam0), 0);
irq_enable(DT_WDT_SAM0_IRQ);
irq_enable(DT_ATMEL_SAM0_WATCHDOG_0_IRQ_0);

return 0;
}

static struct wdt_sam0_dev_data wdt_sam0_data;

DEVICE_AND_API_INIT(wdt_sam0, DT_WDT_SAM0_LABEL, wdt_sam0_init,
DEVICE_AND_API_INIT(wdt_sam0, DT_ATMEL_SAM0_WATCHDOG_0_LABEL, wdt_sam0_init,
&wdt_sam0_data, NULL, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &wdt_sam0_api);
6 changes: 1 addition & 5 deletions soc/arm/atmel_sam0/samd20/dts_fixup.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,7 @@
#define DT_SPI_SAM0_SERCOM5_DIPO DT_ATMEL_SAM0_SPI_42001C00_DIPO
#define DT_SPI_SAM0_SERCOM5_DOPO DT_ATMEL_SAM0_SPI_42001C00_DOPO

#define DT_WDT_SAM0_IRQ DT_ATMEL_SAM0_WATCHDOG_40001000_IRQ_0
#define DT_WDT_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_WATCHDOG_40001000_IRQ_0_PRIORITY
#define DT_WDT_SAM0_LABEL DT_ATMEL_SAM0_WATCHDOG_40001000_LABEL
#define DT_WDT_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS
#define CONFIG_WDT_0_NAME DT_WDT_SAM0_LABEL
#define CONFIG_WDT_0_NAME DT_ATMEL_SAM0_WATCHDOG_0_LABEL

#define DT_RTC_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_RTC_40001400_BASE_ADDRESS
#define DT_RTC_SAM0_IRQ DT_ATMEL_SAM0_RTC_40001400_IRQ_0
Expand Down
6 changes: 1 addition & 5 deletions soc/arm/atmel_sam0/samd21/dts_fixup.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@
#define DT_SPI_SAM0_SERCOM5_RXDMA DT_ATMEL_SAM0_SPI_42001C00_RXDMA
#define DT_SPI_SAM0_SERCOM5_TXDMA DT_ATMEL_SAM0_SPI_42001C00_TXDMA

#define DT_WDT_SAM0_IRQ DT_ATMEL_SAM0_WATCHDOG_40001000_IRQ_0
#define DT_WDT_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_WATCHDOG_40001000_IRQ_0_PRIORITY
#define DT_WDT_SAM0_LABEL DT_ATMEL_SAM0_WATCHDOG_40001000_LABEL
#define DT_WDT_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS
#define CONFIG_WDT_0_NAME DT_WDT_SAM0_LABEL
#define CONFIG_WDT_0_NAME DT_ATMEL_SAM0_WATCHDOG_0_LABEL

#define DT_RTC_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_RTC_40001400_BASE_ADDRESS
#define DT_RTC_SAM0_IRQ DT_ATMEL_SAM0_RTC_40001400_IRQ_0
Expand Down
6 changes: 1 addition & 5 deletions soc/arm/atmel_sam0/samr21/dts_fixup.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@
#define DT_SPI_SAM0_SERCOM5_RXDMA DT_ATMEL_SAM0_SPI_42001C00_RXDMA
#define DT_SPI_SAM0_SERCOM5_TXDMA DT_ATMEL_SAM0_SPI_42001C00_TXDMA

#define DT_WDT_SAM0_IRQ DT_ATMEL_SAM0_WATCHDOG_40001000_IRQ_0
#define DT_WDT_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_WATCHDOG_40001000_IRQ_0_PRIORITY
#define DT_WDT_SAM0_LABEL DT_ATMEL_SAM0_WATCHDOG_40001000_LABEL
#define DT_WDT_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS
#define CONFIG_WDT_0_NAME DT_WDT_SAM0_LABEL
#define CONFIG_WDT_0_NAME DT_ATMEL_SAM0_WATCHDOG_0_LABEL

#define DT_RTC_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_RTC_40001400_BASE_ADDRESS
#define DT_RTC_SAM0_IRQ DT_ATMEL_SAM0_RTC_40001400_IRQ_0
Expand Down

0 comments on commit 06caf27

Please sign in to comment.