kernel: add phtotnicat2 power management driver

This add the photonicat2 power management driver and the necessary
device trees nodes to monitor battery, charging status and pwmfan.
Then mount them to sysfs.
The c files was imported from the photonocat official
openwrt sdk patchfile and lack detailed commit message.

Signed-off-by: Jason Zou <jasonforhise@outlook.com>
This commit is contained in:
Jason Zou
2025-12-26 22:03:52 +08:00
parent 68b4cf8dd0
commit df7a7a39b3
4 changed files with 1559 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=photonicat-pm
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0-or-later
include $(INCLUDE_DIR)/package.mk
define KernelPackage/photonicat-pm
SUBMENU:=Other modules
TITLE:=Photonicat Power Manager
FILES:=$(PKG_BUILD_DIR)/photonicat-pm.ko
AUTOLOAD:=$(call AutoLoad,60,photonicat-pm,1)
DEPENDS:= @TARGET_rockchip_armv8 +kmod-hwmon-core +kmod-thermal
KCONFIG:=
endef
define KernelPackage/photonicat-pm/description
Power manager for photonicat board.
Unless you have the platform, you will want to say 'N'.
endef
define Build/Compile
$(KERNEL_MAKE) M="$(PKG_BUILD_DIR)" modules
endef
$(eval $(call KernelPackage,photonicat-pm))
@@ -0,0 +1 @@
obj-m += photonicat-pm.o
File diff suppressed because it is too large Load Diff
@@ -981,6 +981,9 @@
charger {
monitored-battery = <&battery>;
};
fan {
};
};
};