Commit 3bc13842 authored by Kumar Gala's avatar Kumar Gala Committed by Kumar Gala
Browse files

boards: sam4s_xplained: Move led/button info to DTS



Move the details about LEDs and Buttons from board.h into device tree.

Signed-off-by: default avatarKumar Gala <kumar.gala@linaro.org>
parent f331cc5c
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -8,22 +8,4 @@

#include <soc.h>

#define BOARD_YELLOW_LED1_GPIO_PORT  CONFIG_GPIO_SAM_PORTC_LABEL
#define BOARD_YELLOW_LED1_GPIO_PIN   10

#define BOARD_YELLOW_LED2_GPIO_PORT  CONFIG_GPIO_SAM_PORTC_LABEL
#define BOARD_YELLOW_LED2_GPIO_PIN   17

#define BOARD_USER_PB2_GPIO_PORT     CONFIG_GPIO_SAM_PORTA_LABEL
#define BOARD_USER_PB2_GPIO_PIN      5

/* Aliases to make the basic samples work. */
#define LED0_GPIO_PORT		BOARD_YELLOW_LED1_GPIO_PORT
#define LED0_GPIO_PIN		BOARD_YELLOW_LED1_GPIO_PIN
#define LED1_GPIO_PORT		BOARD_YELLOW_LED2_GPIO_PORT
#define LED1_GPIO_PIN		BOARD_YELLOW_LED2_GPIO_PIN
#define SW0_GPIO_NAME		BOARD_USER_PB2_GPIO_PORT
#define SW0_GPIO_PIN		BOARD_USER_PB2_GPIO_PIN
#define SW0_GPIO_PIN_PUD	GPIO_PUD_PULL_UP

#endif /* __INC_BOARD_H */
+24 −0
Original line number Diff line number Diff line
@@ -14,6 +14,9 @@
	aliases {
		i2c-0 = &i2c0;
		i2c-1 = &i2c1;
		led0 = &yellow_led_1;
		led1 = &yellow_led_2;
		sw0 = &user_button;
	};

	chosen {
@@ -21,6 +24,27 @@
		zephyr,sram = &sram0;
		zephyr,flash = &flash0;
	};

	leds {
		compatible = "gpio-leds";
		yellow_led_1: led_1 {
			gpios = <&portc 10 0>;
			label = "LED 1";
		};
		yellow_led_2: led_2 {
			gpios = <&portc 17 0>;
			label = "LED 2";
		};
	};

	gpio_keys {
		compatible = "gpio-keys";
		user_button: button_1 {
			label = "User Button";
			gpios = <&porta 5 (GPIO_PUD_PULL_UP |
					   GPIO_INT_ACTIVE_LOW)>;
		};
	};
};

&i2c0 {