gecko pwm: pwm description to efr32fg1 and brd4250b

Add minimal support for efr32fg1p and the brd4250b board
as an exmaple for the driver description support

Signed-off-by: Sun Amar <sun681@gmail.com>
This commit is contained in:
Sun Amar 2021-03-22 00:20:30 +02:00 committed by Anas Nashif
commit ffbf6b14ee
3 changed files with 41 additions and 0 deletions

View file

@ -12,12 +12,33 @@
model = "Silicon Labs BRD4250B (Flex Gecko Radio Board)";
compatible = "silabs,efr32_radio_brd4250b", "silabs,efr32fg1p";
pwmleds {
compatible = "pwm-leds";
status = "okay";
pwm_led0: pwm_led0 {
pwms = <&pwm0 0 PWM_POLARITY_NORMAL>;
};
};
aliases {
pwm-led0 = &pwm_led0;
};
};
&cpu0 {
clock-frequency = <38400000>;
};
&timer0 {
status = "okay";
pwm0: pwm {
status = "okay";
pin-location = <GECKO_LOCATION(28) GECKO_PORT_F GECKO_PIN(4)>;
prescaler = <1024>;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";

View file

@ -4,6 +4,7 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/i2c/i2c.h>
#include "gpio_gecko.h"
#include <dt-bindings/pwm/pwm.h>
/ {
chosen {
@ -172,6 +173,21 @@
interrupts = <2 0>;
status = "disabled";
};
timer0: timer@40018000 {
compatible = "silabs,gecko-timers";
reg = <0x40018000 0x400>;
status = "disabled";
label = "TIMER_0";
pwm {
compatible = "silabs,gecko-pwm";
status = "disabled";
label = "PWM_0";
#pwm-cells = <2>;
};
};
};
};

View file

@ -22,3 +22,7 @@ config SOC_FLASH_GECKO
config SPI_GECKO
default y
depends on SPI
config PWM_GECKO
default y
depends on PWM