Commit 935c8e47 authored by Sai Santhosh Malae's avatar Sai Santhosh Malae Committed by Benjamin Cabé
Browse files

drivers: pwm: siwx91x: Add siwx91x PWM driver

Implement PWM driver for siwx91x device

Signed-off-by: default avatarSai Santhosh Malae <Santhosh.Malae@silabs.com>
parent 128ba449
Loading
Loading
Loading
Loading
+1 −0
Changes for boards/silabs/radio_boards/siwx917_rb4338a/siwx917_rb4338a.yaml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,5 +14,6 @@ supported:
  - flash
  - gpio
  - i2c
  - pwm
  - wifi
vendor: silabs
+8 −0
Changes for drivers/clock_control/clock_control_silabs_siwx91x.c: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -64,6 +64,10 @@ static int siwx91x_clock_on(const struct device *dev, clock_control_subsys_t sys
		RSI_PS_M4ssPeriPowerUp(M4SS_PWRGATE_ULP_EFUSE_PERI);
		RSI_CLK_PeripheralClkEnable(M4CLK, UDMA_CLK, ENABLE_STATIC_CLK);
		break;
	case SIWX91X_CLK_PWM:
		RSI_PS_M4ssPeriPowerUp(M4SS_PWRGATE_ULP_EFUSE_PERI);
		RSI_CLK_PeripheralClkEnable(M4CLK, PWM_CLK, ENABLE_STATIC_CLK);
		break;
	default:
		return -EINVAL;
	}
@@ -121,6 +125,10 @@ static int siwx91x_clock_get_rate(const struct device *dev, clock_control_subsys
	case SIWX91X_CLK_UART2:
		*rate = RSI_CLK_GetBaseClock(M4_UART1);
		return 0;
	case SIWX91X_CLK_PWM:
		/* PWM peripheral operates at the system clock frequency */
		*rate = CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC;
		return 0;
	default:
		/* For now, no other driver need clock rate */
		return -EINVAL;
+1 −0
Changes for drivers/pwm/CMakeLists.txt: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ zephyr_library_sources_ifdef(CONFIG_PWM_NPCX pwm_npcx.c)
zephyr_library_sources_ifdef(CONFIG_PWM_XLNX_AXI_TIMER	pwm_xlnx_axi_timer.c)
zephyr_library_sources_ifdef(CONFIG_PWM_MCUX_PWT 	pwm_mcux_pwt.c)
zephyr_library_sources_ifdef(CONFIG_PWM_GECKO		pwm_gecko.c)
zephyr_library_sources_ifdef(CONFIG_PWM_SILABS_SIWX91X	pwm_silabs_siwx91x.c)
zephyr_library_sources_ifdef(CONFIG_PWM_GD32		pwm_gd32.c)
zephyr_library_sources_ifdef(CONFIG_PWM_RCAR		pwm_rcar.c)
zephyr_library_sources_ifdef(CONFIG_PWM_PCA9685 	pwm_pca9685.c)
+2 −0
Changes for drivers/pwm/Kconfig: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -84,6 +84,8 @@ source "drivers/pwm/Kconfig.mcux_pwt"

source "drivers/pwm/Kconfig.gecko"

source "drivers/pwm/Kconfig.siwx91x"

source "drivers/pwm/Kconfig.gd32"

source "drivers/pwm/Kconfig.rcar"
+9 −0
Changes for drivers/pwm/Kconfig.siwx91x: 9 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Copyright (c) 2025 Silicon Laboratories Inc.
# SPDX-License-Identifier: Apache-2.0

config PWM_SILABS_SIWX91X
	bool "Silabs SiWx91x PWM driver"
	default y
	depends on DT_HAS_SILABS_SIWX91X_PWM_ENABLED
	help
	  Enable the PWM driver for the Silabs SiWx91x SoC series.
Loading