[PATCH v2 0/3] soc: qcom: Add Qualcomm PMIC GIO framework and RTC driver using it
From: Fenglin Wu
Date: Tue Nov 17 2026 - 02:33:34 EST
Qualcomm SoCCP battery-management firmware on the Glymur platform
introduces a General I/O (GIO) interface. GIO exposes firmware
functionality through fixed-size register blocks grouped into
virtual peripherals, including core, battery, USB-C, service,
settings, debug, and OEM, etc. These blocks require block-aligned
transactions, while asynchronous firmware events are reported
as alerts identified by peripheral and alert IDs.
This series introduces a transport-agnostic PMIC GIO framework that
exposes the register space through regmap, tracks transport
availability, and routes alerts through a virtual IRQ domain.
It also provides managed interfaces for registering transports,
state notifiers, IRQ mappings, and auxiliary consumer devices.
It then adds a PMIC GLINK transport instance that converts GIO
block read/write transactions and alert notifications exchanged
over RPMSG into regmap accesses and IRQ delivery, and updated Glymur
to instantiate this GIO client while retaining the existing pmic_glink
clients.
Also, add a new RTC driver based on GIO interface to demonstrate
GIO usage, by accessing the firmware TAD real-time register block
for reading and setting the system time through the GIO regmap.
This also addresses a concern on the Glymur platform, where no
writable RTC device is available to retain the system time during
device reboot.
The battery manager, UCSI, and USB-C altmode functions currently
provided by dedicated PMIC GLINK clients can also be implemented
using the GIO interface. Changes have been made in qcom_battmgr/
ucsi_glink/pmic_glink_altmode drivers and tested on Glymur CRD
device by using the new GIO interface, including SSR scenarios.
This primarily helped validate the function and API sanity of
routing GIO alert messages through virtual interrupts, which
could not be done in the RTC driver because it does not need to
handle alert messages.
However, these client changes are not included in this series to
reduce the risk of introducing the GIO framework while migrating
all existing functionalities at the same time. They could be posted
to migrate these client drivers to their corresponding GIO auxiliary
devices and remove the legacy clients from Glymur once the GIO
implementations have been independently reviewed and accepted.
Signed-off-by: Fenglin Wu <fenglin.wu@xxxxxxxxxxxxxxxx>
---
Changes in v2:
- Fixes issues reported by Sashiko
1. Updated to use devm_auxiliary_device_create() for consumer creation
to ensure the auxiliary device remains valid until its final device
reference is released. Also, updated to use the API when creating the
RTC auxiliary device.
2. Marked the USB-C UCSI message-output register blocks as writable.
3. Made transaction preparation atomic with service and removal state checks,
preventing teardown from missing a newly armed transaction and causing a
timeout.
4. Clear pending transaction opcode and buffer state before signaling completion,
preventing PDR teardown or duplicate firmware responses from corrupting a
completed transaction’s result.
5. Moved the GLINK client allocation ahead of GIO/regmap registration so
regmap and debugfs users are drained before the client is released during
unbind.
- Fixed an issue reported by Jeff Roach:
1. PMIC Glink GIO alert enabling was removed, as it would switch all
notifications to the GIO channel, and the clients are using PMIC Glink
OPCODE would not be functional.
- Link to v1: https://patch.msgid.link/20261110-gio-framework-rtc-driver-2026-10-12-v1-0-e4164178183a@xxxxxxxxxxxxxxxx
---
Fenglin Wu (3):
soc: qcom: Add pmic-gio GIO framework driver
soc: qcom: pmic_glink: Add GIO pmic_glink instance
rtc: Add Qualcomm GIO RTC driver
drivers/rtc/Kconfig | 11 +
drivers/rtc/Makefile | 1 +
drivers/rtc/rtc-qcom-gio.c | 153 ++++++++
drivers/soc/qcom/Kconfig | 29 ++
drivers/soc/qcom/Makefile | 2 +
drivers/soc/qcom/pmic_gio.c | 672 +++++++++++++++++++++++++++++++++
drivers/soc/qcom/pmic_glink.c | 25 +-
drivers/soc/qcom/pmic_glink_gio.c | 558 +++++++++++++++++++++++++++
include/linux/soc/qcom/pmic_gio.h | 153 ++++++++
include/linux/soc/qcom/pmic_gio_regs.h | 239 ++++++++++++
include/linux/soc/qcom/pmic_glink.h | 1 +
11 files changed, 1842 insertions(+), 2 deletions(-)
---
base-commit: ef922b721a5e99348fc1f5801fdeb427ee14ee9f
change-id: 20261011-gio-framework-rtc-driver-2026-10-12-8f26c1e53d4b
Best regards,
--
Fenglin Wu <fenglin.wu@xxxxxxxxxxxxxxxx>