drivers: pinmux: sam0: Remove defines from dts_fixup.h

Move SAM0 pinmux to use the raw defines generated from the DTS
parsing.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
This commit is contained in:
Derek Hageman 2019-04-30 19:58:42 -06:00 committed by Maureen Helm
commit 6324c8a27a
12 changed files with 29 additions and 41 deletions

View file

@ -9,9 +9,9 @@
static int board_pinmux_init(struct device *dev) static int board_pinmux_init(struct device *dev)
{ {
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL); struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
#if DT_SPI_SAM0_SERCOM4_BASE_ADDRESS #if DT_SPI_SAM0_SERCOM4_BASE_ADDRESS
struct device *muxb = device_get_binding(DT_PINMUX_SAM0_B_LABEL); struct device *muxb = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL);
#endif #endif
ARG_UNUSED(dev); ARG_UNUSED(dev);

View file

@ -9,7 +9,7 @@
static int board_pinmux_init(struct device *dev) static int board_pinmux_init(struct device *dev)
{ {
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL); struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
ARG_UNUSED(dev); ARG_UNUSED(dev);

View file

@ -9,8 +9,8 @@
static int board_pinmux_init(struct device *dev) static int board_pinmux_init(struct device *dev)
{ {
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL); struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
struct device *muxb = device_get_binding(DT_PINMUX_SAM0_B_LABEL); struct device *muxb = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL);
ARG_UNUSED(dev); ARG_UNUSED(dev);

View file

@ -9,8 +9,8 @@
static int board_pinmux_init(struct device *dev) static int board_pinmux_init(struct device *dev)
{ {
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL); struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
struct device *muxb = device_get_binding(DT_PINMUX_SAM0_B_LABEL); struct device *muxb = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL);
ARG_UNUSED(dev); ARG_UNUSED(dev);

View file

@ -9,8 +9,8 @@
static int board_pinmux_init(struct device *dev) static int board_pinmux_init(struct device *dev)
{ {
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL); struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
struct device *muxb = device_get_binding(DT_PINMUX_SAM0_B_LABEL); struct device *muxb = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL);
ARG_UNUSED(dev); ARG_UNUSED(dev);

View file

@ -10,8 +10,8 @@
static int board_pinmux_init(struct device *dev) static int board_pinmux_init(struct device *dev)
{ {
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL); struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
struct device *muxb = device_get_binding(DT_PINMUX_SAM0_B_LABEL); struct device *muxb = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL);
ARG_UNUSED(dev); ARG_UNUSED(dev);

View file

@ -69,34 +69,34 @@ const struct pinmux_driver_api pinmux_sam0_api = {
.input = pinmux_sam0_input, .input = pinmux_sam0_input,
}; };
#if DT_PINMUX_SAM0_A_BASE_ADDRESS #if DT_ATMEL_SAM0_PINMUX_PINMUX_A_BASE_ADDRESS
static const struct pinmux_sam0_config pinmux_sam0_config_0 = { static const struct pinmux_sam0_config pinmux_sam0_config_0 = {
.regs = (PortGroup *)DT_PINMUX_SAM0_A_BASE_ADDRESS, .regs = (PortGroup *)DT_ATMEL_SAM0_PINMUX_PINMUX_A_BASE_ADDRESS,
}; };
DEVICE_AND_API_INIT(pinmux_sam0_0, DT_PINMUX_SAM0_A_LABEL, DEVICE_AND_API_INIT(pinmux_sam0_0, DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL,
pinmux_sam0_init, NULL, &pinmux_sam0_config_0, pinmux_sam0_init, NULL, &pinmux_sam0_config_0,
PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY, PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY,
&pinmux_sam0_api); &pinmux_sam0_api);
#endif #endif
#if DT_PINMUX_SAM0_B_BASE_ADDRESS #if DT_ATMEL_SAM0_PINMUX_PINMUX_B_BASE_ADDRESS
static const struct pinmux_sam0_config pinmux_sam0_config_1 = { static const struct pinmux_sam0_config pinmux_sam0_config_1 = {
.regs = (PortGroup *)DT_PINMUX_SAM0_B_BASE_ADDRESS, .regs = (PortGroup *)DT_ATMEL_SAM0_PINMUX_PINMUX_B_BASE_ADDRESS,
}; };
DEVICE_AND_API_INIT(pinmux_sam0_1, DT_PINMUX_SAM0_B_LABEL, DEVICE_AND_API_INIT(pinmux_sam0_1, DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL,
pinmux_sam0_init, NULL, &pinmux_sam0_config_1, pinmux_sam0_init, NULL, &pinmux_sam0_config_1,
PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY, PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY,
&pinmux_sam0_api); &pinmux_sam0_api);
#endif #endif
#if DT_PINMUX_SAM0_C_BASE_ADDRESS #if DT_ATMEL_SAM0_PINMUX_PINMUX_C_BASE_ADDRESS
static const struct pinmux_sam0_config pinmux_sam0_config_2 = { static const struct pinmux_sam0_config pinmux_sam0_config_2 = {
.regs = (PortGroup *)DT_PINMUX_SAM0_C_BASE_ADDRESS, .regs = (PortGroup *)DT_ATMEL_SAM0_PINMUX_PINMUX_C_BASE_ADDRESS,
}; };
DEVICE_AND_API_INIT(pinmux_sam0_2, DT_PINMUX_SAM0_C_LABEL, DEVICE_AND_API_INIT(pinmux_sam0_2, DT_ATMEL_SAM0_PINMUX_PINMUX_C_LABEL,
pinmux_sam0_init, NULL, &pinmux_sam0_config_2, pinmux_sam0_init, NULL, &pinmux_sam0_config_2,
PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY, PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY,
&pinmux_sam0_api); &pinmux_sam0_api);

View file

@ -33,6 +33,11 @@
<0x0080A048 0x4>; <0x0080A048 0x4>;
}; };
aliases {
pinmux-a = &pinmux_a;
pinmux-b = &pinmux_b;
};
soc { soc {
nvmctrl: nvmctrl@41004000 { nvmctrl: nvmctrl@41004000 {
compatible = "atmel,sam0-nvmctrl"; compatible = "atmel,sam0-nvmctrl";

View file

@ -7,6 +7,10 @@
#include <atmel/samd.dtsi> #include <atmel/samd.dtsi>
/ { / {
aliases {
pinmux-c = &pinmux_c;
};
soc { soc {
usb0: usb@41005000 { usb0: usb@41005000 {
compatible = "atmel,sam0-usb"; compatible = "atmel,sam0-usb";

View file

@ -95,12 +95,6 @@
#define DT_WDT_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS #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_WDT_SAM0_LABEL
#define DT_PINMUX_SAM0_A_BASE_ADDRESS DT_ATMEL_SAM0_PINMUX_41004400_BASE_ADDRESS
#define DT_PINMUX_SAM0_A_LABEL DT_ATMEL_SAM0_PINMUX_41004400_LABEL
#define DT_PINMUX_SAM0_B_BASE_ADDRESS DT_ATMEL_SAM0_PINMUX_41004480_BASE_ADDRESS
#define DT_PINMUX_SAM0_B_LABEL DT_ATMEL_SAM0_PINMUX_41004480_LABEL
#define DT_RTC_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_RTC_40001400_BASE_ADDRESS #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 #define DT_RTC_SAM0_IRQ DT_ATMEL_SAM0_RTC_40001400_IRQ_0
#define DT_RTC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_RTC_40001400_IRQ_0_PRIORITY #define DT_RTC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_RTC_40001400_IRQ_0_PRIORITY

View file

@ -107,12 +107,6 @@
#define DT_WDT_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS #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_WDT_SAM0_LABEL
#define DT_PINMUX_SAM0_A_BASE_ADDRESS DT_ATMEL_SAM0_PINMUX_41004400_BASE_ADDRESS
#define DT_PINMUX_SAM0_A_LABEL DT_ATMEL_SAM0_PINMUX_41004400_LABEL
#define DT_PINMUX_SAM0_B_BASE_ADDRESS DT_ATMEL_SAM0_PINMUX_41004480_BASE_ADDRESS
#define DT_PINMUX_SAM0_B_LABEL DT_ATMEL_SAM0_PINMUX_41004480_LABEL
#define DT_RTC_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_RTC_40001400_BASE_ADDRESS #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 #define DT_RTC_SAM0_IRQ DT_ATMEL_SAM0_RTC_40001400_IRQ_0
#define DT_RTC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_RTC_40001400_IRQ_0_PRIORITY #define DT_RTC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_RTC_40001400_IRQ_0_PRIORITY

View file

@ -114,15 +114,6 @@
#define DT_WDT_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS #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_WDT_SAM0_LABEL
#define DT_PINMUX_SAM0_A_BASE_ADDRESS DT_ATMEL_SAM0_PINMUX_41004400_BASE_ADDRESS
#define DT_PINMUX_SAM0_A_LABEL DT_ATMEL_SAM0_PINMUX_41004400_LABEL
#define DT_PINMUX_SAM0_B_BASE_ADDRESS DT_ATMEL_SAM0_PINMUX_41004480_BASE_ADDRESS
#define DT_PINMUX_SAM0_B_LABEL DT_ATMEL_SAM0_PINMUX_41004480_LABEL
#define DT_PINMUX_SAM0_C_BASE_ADDRESS DT_ATMEL_SAM0_PINMUX_41004500_BASE_ADDRESS
#define DT_PINMUX_SAM0_C_LABEL DT_ATMEL_SAM0_PINMUX_41004500_LABEL
#define DT_RTC_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_RTC_40001400_BASE_ADDRESS #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 #define DT_RTC_SAM0_IRQ DT_ATMEL_SAM0_RTC_40001400_IRQ_0
#define DT_RTC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_RTC_40001400_IRQ_0_PRIORITY #define DT_RTC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_RTC_40001400_IRQ_0_PRIORITY