Skip to content
Permalink
Browse files

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>
  • Loading branch information...
Sizurka authored and MaureenHelm committed May 1, 2019
1 parent b8c2c7e commit 6324c8a27a75b233b8a8f4aa722bfc8582153b9d
@@ -9,9 +9,9 @@

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
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
ARG_UNUSED(dev);

@@ -9,7 +9,7 @@

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);

@@ -9,8 +9,8 @@

static int board_pinmux_init(struct device *dev)
{
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL);
struct device *muxb = device_get_binding(DT_PINMUX_SAM0_B_LABEL);
struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
struct device *muxb = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL);

ARG_UNUSED(dev);

@@ -9,8 +9,8 @@

static int board_pinmux_init(struct device *dev)
{
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL);
struct device *muxb = device_get_binding(DT_PINMUX_SAM0_B_LABEL);
struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
struct device *muxb = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL);

ARG_UNUSED(dev);

@@ -9,8 +9,8 @@

static int board_pinmux_init(struct device *dev)
{
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL);
struct device *muxb = device_get_binding(DT_PINMUX_SAM0_B_LABEL);
struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
struct device *muxb = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL);

ARG_UNUSED(dev);

@@ -10,8 +10,8 @@

static int board_pinmux_init(struct device *dev)
{
struct device *muxa = device_get_binding(DT_PINMUX_SAM0_A_LABEL);
struct device *muxb = device_get_binding(DT_PINMUX_SAM0_B_LABEL);
struct device *muxa = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_A_LABEL);
struct device *muxb = device_get_binding(DT_ATMEL_SAM0_PINMUX_PINMUX_B_LABEL);

ARG_UNUSED(dev);

@@ -69,34 +69,34 @@ const struct pinmux_driver_api pinmux_sam0_api = {
.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 = {
.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,
PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY,
&pinmux_sam0_api);
#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 = {
.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,
PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY,
&pinmux_sam0_api);
#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 = {
.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,
PRE_KERNEL_1, CONFIG_PINMUX_INIT_PRIORITY,
&pinmux_sam0_api);
@@ -33,6 +33,11 @@
<0x0080A048 0x4>;
};

aliases {
pinmux-a = &pinmux_a;
pinmux-b = &pinmux_b;
};

soc {
nvmctrl: nvmctrl@41004000 {
compatible = "atmel,sam0-nvmctrl";
@@ -7,6 +7,10 @@
#include <atmel/samd.dtsi>

/ {
aliases {
pinmux-c = &pinmux_c;
};

soc {
usb0: usb@41005000 {
compatible = "atmel,sam0-usb";
@@ -95,12 +95,6 @@
#define DT_WDT_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS
#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_IRQ DT_ATMEL_SAM0_RTC_40001400_IRQ_0
#define DT_RTC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_RTC_40001400_IRQ_0_PRIORITY
@@ -107,12 +107,6 @@
#define DT_WDT_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS
#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_IRQ DT_ATMEL_SAM0_RTC_40001400_IRQ_0
#define DT_RTC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_RTC_40001400_IRQ_0_PRIORITY
@@ -114,15 +114,6 @@
#define DT_WDT_SAM0_BASE_ADDRESS DT_ATMEL_SAM0_WATCHDOG_40001000_BASE_ADDRESS
#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_IRQ DT_ATMEL_SAM0_RTC_40001400_IRQ_0
#define DT_RTC_SAM0_IRQ_PRIORITY DT_ATMEL_SAM0_RTC_40001400_IRQ_0_PRIORITY

0 comments on commit 6324c8a

Please sign in to comment.
You can’t perform that action at this time.