From: Serv Pol via B4 Relay <devnull+servpol.tuta.io@kernel.org>
To: Serv Pol <servpol@tuta.io>, Sebastian Reichel <sre@kernel.org>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Conor Dooley" <conor.dooley@microchip.com>
Subject: [PATCH v2 0/2] power: supply: Add GL.iNet GL-E750 MCU battery driver
Date: Wed, 21 Oct 2026 19:33:42 +0000 [thread overview]
Message-ID: <20261021-gl-e750-mcu-v2-0-9bd7e7c2e0e1@tuta.io> (raw)
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@tuta.io
---
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@tuta.io>
next reply other threads:[~2026-10-21 19:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-21 19:33 Serv Pol via B4 Relay [this message]
2026-10-21 19:33 ` [PATCH v2 1/2] dt-bindings: power: supply: Add GL.iNet GL-E750 MCU Serv Pol via B4 Relay
2026-10-21 19:33 ` [PATCH v2 2/2] power: supply: Add GL.iNet GL-E750 MCU battery driver Serv Pol via B4 Relay
2026-11-08 23:35 ` Sebastian Reichel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261021-gl-e750-mcu-v2-0-9bd7e7c2e0e1@tuta.io \
--to=devnull+servpol.tuta.io@kernel.org \
--cc=conor+dt@kernel.org \
--cc=conor.dooley@microchip.com \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=robh@kernel.org \
--cc=servpol@tuta.io \
--cc=sre@kernel.org \
--cc=u.kleine-koenig@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®