Skip to contentSkip to conversation

pwm: Tighten some pwm driver dependencies

PATCH In review Tom Rini 1 participant 3 messages Aug 4, 2025 – Aug 14, 2025

Subsystems (2)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/2 pwm: Tighten some pwm driver dependencies

A few pwm drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well.

---
 drivers/pwm/Kconfig | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/pwm/Kconfig +5 -4
index e4c676d75c2b..06f42f699dec 100644
@@ -42,7 +42,7 @@ config PWM_CROS_EC
 
 config PWM_EXYNOS
 	bool "Enable support for the Exynos PWM"
-	depends on DM_PWM
+	depends on DM_PWM && ARCH_EXYNOS
 	help
 	  This PWM is found on Samsung Exynos 5250 and other Samsung SoCs. It
 	  supports a programmable period and duty cycle. A 32-bit counter is
@@ -51,6 +51,7 @@ config PWM_EXYNOS
 
 config PWM_IMX
 	bool "Enable support for i.MX27 and later PWM"
+	depends on MACH_IMX
 	help
 	  This PWM is found i.MX27 and later i.MX SoCs.
 
@@ -70,7 +71,7 @@ config PWM_MTK
 
 config PWM_ROCKCHIP
 	bool "Enable support for the Rockchip PWM"
-	depends on DM_PWM
+	depends on DM_PWM && ARCH_ROCKCHIP
 	help
 	  This PWM is found on RK3288 and other Rockchip SoCs. It supports a
 	  programmable period and duty cycle. A 32-bit counter is used.
@@ -98,7 +99,7 @@ config PWM_SIFIVE
 
 config PWM_TEGRA
 	bool "Enable support for the Tegra PWM"
-	depends on DM_PWM
+	depends on DM_PWM && ARCH_TEGRA
 	help
 	  This PWM is found on Tegra 20 and other Nvidia SoCs. It supports
 	  four channels with a programmable period and duty cycle. Only a
@@ -115,7 +116,7 @@ config PWM_STM32
 
 config PWM_SUNXI
 	bool "Enable support for the Allwinner Sunxi PWM"
-	depends on DM_PWM
+	depends on DM_PWM && ARCH_SUNXI
 	help
 	  This PWM is found on H3, A64 and other Allwinner SoCs. It supports a
 	  programmable period and duty cycle. A 16-bit counter is used.
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH 2/2 pwm: pwm-aspeed: Add missing <linux/log2.h> to pwm-aspeed.c

This driver references the logarithmic macros while relying on an indirection inclusion of <linux/log2.h>. Add the missing include directly.

---
 drivers/pwm/pwm-aspeed.c | 1 +
 1 file changed, 1 insertion(+)
drivers/pwm/pwm-aspeed.c +1 -0
index ebc9d9a89752..eefe018448f4 100644
@@ -46,6 +46,7 @@
 #include <regmap.h>
 #include <syscon.h>
 #include <dm/device_compat.h>
+#include <linux/log2.h>
 #include <linux/math64.h>
 #include <linux/bitfield.h>
 #include <linux/time.h>
Signature · 1 line
2.43.0
author
#2 lore raw
In reply to Tom Rini
Quoted 4 lines · Tom Rini

A few pwm drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well.

Applied to u-boot/next, thanks!

[1/2] pwm: Tighten some pwm driver dependencies

      commit: 678be99d563199551ed57fd771471eb1d2680e6e
[2/2] pwm: pwm-aspeed: Add missing <linux/log2.h> to pwm-aspeed.c
      commit: 00ad9ed4a775a6908a8654935f61df38e59178df
Signature · 1 line
Tom