mediatek: build rtl8367s_gsw as a kernel module
authorSchneider Azima <[email protected]>
Fri, 28 Nov 2025 10:34:02 +0000 (05:34 -0500)
committerHauke Mehrtens <[email protected]>
Sun, 30 Nov 2025 21:59:28 +0000 (22:59 +0100)
The RTL8367S_GSW config for filogic target is not set by default.
This switch model can be recognized by multiple drivers. Configure it as an optional module instead of default set in config.

Signed-off-by: Schneider Azima <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/19187
Signed-off-by: Hauke Mehrtens <[email protected]>
target/linux/mediatek/modules.mk

index ade8d60ab385b9c696a448428f8138bf87f69f9a..3a970821117ecf26d47f61d6ee8ca53c1f6c9513 100644 (file)
@@ -37,3 +37,17 @@ define KernelPackage/iio-mt6577-auxadc
   $(call AddDepends/iio)
 endef
 $(eval $(call KernelPackage,iio-mt6577-auxadc))
+
+define KernelPackage/switch-rtl8367s
+  SUBMENU:=Network Devices
+  TITLE:=Realtek RTL8367S switch support
+  KCONFIG:= \
+       CONFIG_RTL8367S_GSW \
+       CONFIG_SWCONFIG=y
+  DEPENDS:=@TARGET_mediatek +kmod-swconfig
+  FILES:= \
+       $(LINUX_DIR)/drivers/net/phy/rtk/rtl8367s_gsw.ko
+  AUTOLOAD:=$(call AutoProbe,rtl8367s_gsw,1)
+endef
+
+$(eval $(call KernelPackage,switch-rtl8367s))