[PATCH v2 0/2] power: supply: Add GL.iNet GL-E750 MCU battery driver

From: Serv Pol via B4 Relay

Date: Wed Oct 21 2026 - 15:36:14 EST


The GL.iNet GL-E750 (Mudi) is a battery powered LTE travel router
(QCA9531). A microcontroller on the SoC UART drives the OLED status
screen, monitors the battery and watches the power switch. The host talks
to it in text lines of JSON; on request it reports the battery state, and
when the power switch is turned off it sends a notification a few seconds
before cutting the power.

This series adds a binding and a serdev driver that exposes the battery
through the power_supply class and shuts the system down cleanly when the
switch is turned off. The screen content (SSIDs, clients, cellular state,
free-form vendor JSON) is deliberately left out.

The board itself is supported by OpenWrt (ath79), not by an in-tree DTS,
so there is no in-tree user of the binding yet. The OpenWrt side is at
https://github.com/openwrt/openwrt/pull/25649

Testing: OpenWrt main with kernel 6.18, v1 of this series on a GL-E750
V1 and this version on a GL-E750 V2. Battery properties read back as
expected (capacity, status, temperature, cycle count), the module was
unloaded and reloaded repeatedly without warnings, and turning the power
switch off logs "power switch turned off, shutting down" and leads to a
clean shutdown before the MCU removes power. The receive path was also
run in a userspace harness with ASan and UBSan, feeding replies and
events with and without line endings, glued together and split across
poll boundaries. On this tree: checkpatch --strict, W=1 and sparse
builds, and dt_binding_check are clean.

Tool use: the driver, the binding and the changelogs were written with
the help of an AI coding assistant (Claude, claude-opus-5-5), based on
the vendor protocol description at
https://github.com/gl-inet/GL-E750-MCU-instruction and on traces of the
MCU traffic on the device. I reviewed the code, tested it on the
hardware as described above and am responsible for it.

---
Changes in v2:
- Do not drop messages from the MCU when a status reply comes without a
line ending: a new message (they all start with '{') now ends the
previous one, and the poll work only consumes a pending status reply
instead of clearing the receive buffer, so a power switch event that
is being received is no longer lost (Sashiko AI review).
- Drop <linux/mod_devicetable.h>, <linux/serdev.h> provides of_device_id
(Uwe Kleine-König).
- Link to v1: https://patch.msgid.link/20261005-gl-e750-mcu-v1-0-499d2e31f786@xxxxxxx

---
Serv Pol (2):
dt-bindings: power: supply: Add GL.iNet GL-E750 MCU
power: supply: Add GL.iNet GL-E750 MCU battery driver

.../bindings/power/supply/glinet,gl-e750-mcu.yaml | 37 +++
MAINTAINERS | 7 +
drivers/power/supply/Kconfig | 13 +
drivers/power/supply/Makefile | 1 +
drivers/power/supply/gl-e750-mcu.c | 369 +++++++++++++++++++++
5 files changed, 427 insertions(+)
---
base-commit: 5c1c602463d597c5189ddc5a73dece588ba2c57a
change-id: 20261005-gl-e750-mcu-f606ccd66dec

Best regards,
--
Serv Pol <servpol@xxxxxxx>