Skip to content

Commit

Permalink
drivers: gpio: siwx917: Add GPIO driver
Browse files Browse the repository at this point in the history
Implement GPIO driver for HP, ULP and UULP GPIOs.

Signed-off-by: Aksel Skauge Mellbye <[email protected]>
  • Loading branch information
asmellby committed Aug 26, 2024
1 parent ebd9f69 commit f7a2cc4
Show file tree
Hide file tree
Showing 12 changed files with 731 additions and 1 deletion.
32 changes: 32 additions & 0 deletions boards/silabs/radio_boards/siwx917_rb4338a/siwx917_rb4338a.dts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

/dts-v1/;
#include <silabs/siwg917m111mgtba.dtsi>
#include <dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "Silicon Labs BRD4338A (SiWG917 Radio Board)";
Expand All @@ -17,6 +19,36 @@
zephyr,console = &ulpuart0;
zephyr,shell-uart = &ulpuart0;
};

aliases {
led0 = &led0;
led1 = &led1;
sw0 = &button0;
sw1 = &button1;
};

leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpioulp 2 GPIO_ACTIVE_HIGH>;
};

led1: led_1 {
gpios = <&gpioa 10 GPIO_ACTIVE_HIGH>;
};
};

buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpiouulp 2 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_0>;
};
button1: button_1 {
gpios = <&gpioa 11 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_1>;
};
};
};

&ulpuart0 {
Expand Down
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2024 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(gpio)
add_subdirectory(pinctrl)
5 changes: 5 additions & 0 deletions drivers/gpio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

zephyr_library_sources_ifdef(CONFIG_GPIO_SILABS_SIWX917 gpio_silabs_siwx917.c)
zephyr_library_sources_ifdef(CONFIG_GPIO_SILABS_SIWX917_UULP gpio_silabs_siwx917_uulp.c)
8 changes: 8 additions & 0 deletions drivers/gpio/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2024 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

if GPIO

rsource "Kconfig.siwx917"

endif
16 changes: 16 additions & 0 deletions drivers/gpio/Kconfig.siwx917
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2024 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

config GPIO_SILABS_SIWX917
bool "Silabs SiWx917 GPIO driver"
default y
depends on DT_HAS_SILABS_SIWX917_GPIO_ENABLED
help
Enable the HP/ULP GPIO driver for the Silabs SiWx917 SoC series.

config GPIO_SILABS_SIWX917_UULP
bool "Silabs SiWx917 UULP GPIO driver"
default y
depends on DT_HAS_SILABS_SIWX917_GPIO_UULP_ENABLED
help
Enable the UULP GPIO driver for the Silabs SiWx917 SoC series.
Loading

0 comments on commit f7a2cc4

Please sign in to comment.