Commit 92bd8a0c authored by Kumar Gala's avatar Kumar Gala Committed by Kumar Gala
Browse files

boards: zedboard_pulpino: Move led & button to dts



Move describing of LED & Buttons on the Zedboard-Pulpino into the device
tree.

Signed-off-by: default avatarKumar Gala <kumar.gala@linaro.org>
parent db2ca70a
Loading
Loading
Loading
Loading
+0 −50
Original line number Diff line number Diff line
@@ -8,55 +8,5 @@
#define __INC_BOARD_H

#include <soc.h>
#include <gpio.h>

/* LEDS configuration */
#define LED0_GPIO_PORT        "gpio0"
#define LED1_GPIO_PORT        "gpio0"
#define LED2_GPIO_PORT        "gpio0"
#define LED3_GPIO_PORT        "gpio0"
#define LED4_GPIO_PORT        "gpio0"
#define LED5_GPIO_PORT        "gpio0"
#define LED6_GPIO_PORT        "gpio0"
#define LED7_GPIO_PORT        "gpio0"

#define LED0_GPIO_PIN         8
#define LED1_GPIO_PIN         9
#define LED2_GPIO_PIN         10
#define LED3_GPIO_PIN         11
#define LED4_GPIO_PIN         12
#define LED5_GPIO_PIN         13
#define LED6_GPIO_PIN         14
#define LED7_GPIO_PIN         15

/* Push buttons configuration */
#define SW0_GPIO_NAME         "gpio0"
#define SW1_GPIO_NAME         "gpio0"
#define SW2_GPIO_NAME         "gpio0"
#define SW3_GPIO_NAME         "gpio0"
#define SW4_GPIO_NAME         "gpio0"

#define SW0_GPIO_PIN	      16
#define SW1_GPIO_PIN	      17
#define SW2_GPIO_PIN	      18
#define SW3_GPIO_PIN	      19
#define SW4_GPIO_PIN	      20

/*
 * GPIO PULL-UP config does not exist in pulpino
 * set all to 1 for buttons to compile against apps.
 */
#define SW0_GPIO_PULL_UP      1
#define SW1_GPIO_PULL_UP      1
#define SW2_GPIO_PULL_UP      1
#define SW3_GPIO_PULL_UP      1
#define SW4_GPIO_PULL_UP      1

/* Interrupt config for push buttons */
#define SW0_GPIO_FLAGS     (GPIO_INT_EDGE | GPIO_INT_ACTIVE_HIGH)
#define SW1_GPIO_FLAGS     SW0_GPIO_FLAGS
#define SW2_GPIO_FLAGS     SW0_GPIO_FLAGS
#define SW3_GPIO_FLAGS     SW0_GPIO_FLAGS
#define SW4_GPIO_FLAGS     SW0_GPIO_FLAGS

#endif /* __INC_BOARD_H */
+78 −0
Original line number Diff line number Diff line
@@ -15,11 +15,89 @@
	aliases {
		uart-0 = &uart0;
		gpio-0 = &gpio0;
		led0 = &led0;
		led1 = &led1;
		led2 = &led2;
		led3 = &led3;
		led4 = &led4;
		led5 = &led5;
		led6 = &led6;
		led7 = &led7;
		sw0 = &btnc;
		sw1 = &btnd;
		sw2 = &btnl;
		sw3 = &btnr;
		sw4 = &btnu;
	};

	chosen {
		zephyr,console = &uart0;
	};

	leds {
		compatible = "gpio-leds";
		led0: led_0 {
			gpios = <&gpio0 8 0>;
			label = "LD0";
		};
		led1: led_1 {
			gpios = <&gpio0 9 0>;
			label = "LD1";
		};
		led2: led_2 {
			gpios = <&gpio0 10 0>;
			label = "LD2";
		};
		led3: led_3 {
			gpios = <&gpio0 11 0>;
			label = "LD3";
		};
		led4: led_4 {
			gpios = <&gpio0 12 0>;
			label = "LD4";
		};
		led5: led_5 {
			gpios = <&gpio0 13 0>;
			label = "LD5";
		};
		led6: led_6 {
			gpios = <&gpio0 14 0>;
			label = "LD6";
		};
		led7: led_7 {
			gpios = <&gpio0 15 0>;
			label = "LD7";
		};
	};

	gpio_keys {
		compatible = "gpio-keys";
		/* center */
		btnc: button_c {
			label = "BTNC";
			gpios = <&gpio0 16 (GPIO_INT_EDGE | GPIO_INT_ACTIVE_HIGH)>;
		};
		/* down */
		btnd: button_d {
			label = "BTNC";
			gpios = <&gpio0 17 (GPIO_INT_EDGE | GPIO_INT_ACTIVE_HIGH)>;
		};
		/* left */
		btnl: button_l {
			label = "BTNL";
			gpios = <&gpio0 18 (GPIO_INT_EDGE | GPIO_INT_ACTIVE_HIGH)>;
		};
		/* right */
		btnr: button_r {
			label = "BTNR";
			gpios = <&gpio0 19 (GPIO_INT_EDGE | GPIO_INT_ACTIVE_HIGH)>;
		};
		/* up */
		btnu: button_u {
			label = "BTNU";
			gpios = <&gpio0 20 (GPIO_INT_EDGE | GPIO_INT_ACTIVE_HIGH)>;
		};
	};
};

&uart0 {