Skip to content

Microchip sama7g5 gpio driver #92494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions boards/microchip/sam/sama7g54_ek/sama7g54_ek.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@
#include <common/freq.h>
#include <dt-bindings/mfd/mfd_mchp_sam_flexcom.h>
#include <dt-bindings/pinctrl/sama7g5-pinctrl.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/gpio/microchip-sam-gpio.h>
#include <dt-bindings/input/input-event-codes.h>
#include <microchip/sam/sama7g5.dtsi>

/ {
model = "SAMA7G54-EK board";
compatible = "microchip,sama7g5ek", "microchip,sama7g5", "microchip,sama7";

aliases {
led0 = &led_green;
sw0 = &button_user;
};

chosen {
zephyr,sram = &ddram;
zephyr,console = &usart3;
Expand All @@ -35,6 +43,37 @@
compatible = "ddram";
reg = <0x60000000 DT_SIZE_M(512)>;
};

leds {
compatible = "gpio-leds";
status = "okay";

led_red: red {
label = "red";
gpios = <&piob 8 GPIO_ACTIVE_HIGH>;
};

led_green: green {
label = "green";
gpios = <&pioa 13 GPIO_ACTIVE_HIGH>;
};

led_blue: blue {
label = "blue";
gpios = <&piod 20 GPIO_ACTIVE_HIGH>;
};
};

gpio_keys {
compatible = "gpio-keys";
status = "okay";

button_user: button_0 {
label = "PB_USER";
gpios = <&pioa 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_0>;
};
};
};

&flx3 {
Expand Down
1 change: 1 addition & 0 deletions drivers/gpio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ zephyr_library_sources_ifdef(CONFIG_GPIO_RZT2M gpio_rzt2m.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SAM gpio_sam.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SAM0 gpio_sam0.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SAM4L gpio_sam4l.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SAM_PIO4 gpio_sam_pio4.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SEDI gpio_sedi.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SI32 gpio_si32.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SIFIVE gpio_sifive.c)
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpio/Kconfig.sam
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ config GPIO_SAM4L
depends on DT_HAS_ATMEL_SAM4L_GPIO_ENABLED
help
Enable support for the Atmel SAM4L 'PORT' GPIO controllers.

config GPIO_SAM_PIO4
bool "Microchip SAM PIO4 GPIO driver"
default y
depends on DT_HAS_MICROCHIP_SAM_PIO4_ENABLED
help
Microchip Parallel Input/Output Controller is used on SAMA5D2 and
SAMA7G5 SoC series
Loading