Re: [PATCH v3 2/3] soc: qcom: pmic_glink: Add GIO pmic_glink instance

From: Konrad Dybcio

Date: Thu Dec 03 2026 - 08:01:23 EST


On 11/19/26 7:55 AM, Fenglin Wu wrote:
> Add a PMIC GLINK transport instance for GIO (General I/O) which is a
> new communication model used by the SoCCP battery-management firmware
> on some of the Qualcomm platforms (e.g. Glymur): it turns the
> GIO_OPCODE_BLOCK_READ/_WRITE requests and the GIO_OPCODE_ALERT_IND
> notification exchanged over the pmic-glink rpmsg channel into a regmap
> and per-alert IRQ delivery. It registers as a "pmic_glink.gio"
> auxiliary driver and bound to a new "gio" auxiliary device that's created
> on GIO-capable platforms.
>
> Also, update the client_mask to additionally request the GIO client on
> Glymur, which is the 1st platform to support GIO. Even through the legacy
> clients (battmgr, ucsi, altmode) can also be supported using the new GIO
> interface, their per-client bits are still kept with the functionalities
> continue to be provided by the existing pmic_glink.* auxiliary devices
> using the pmic_glink interfaces, to minimize the risks associated with
> transitioning all of them to use the new GIO interface.
>
> Co-developed-by: Tingguo Cheng <tingguo.cheng@xxxxxxxxxxxxxxxx>
> Signed-off-by: Tingguo Cheng <tingguo.cheng@xxxxxxxxxxxxxxxx>
> Signed-off-by: Fenglin Wu <fenglin.wu@xxxxxxxxxxxxxxxx>
> ---
[...]


> +static int pmic_glink_gio_write_sync(struct pmic_glink_gio *pgio, u32 addr,
> + const u8 *data, size_t length)
> +{
> + struct gio_write_req *req = &pgio->write_req;
> + int ret;
> +
> + if (!data || !length)
> + return -EFAULT;

EINVAL

[...]
> +static int pmic_glink_gio_read(struct pmic_gio_device *gio, unsigned int reg,
> + void *val, size_t val_size)
> +{
> + struct pmic_glink_gio *pgio = gio->drvdata;
> + struct gio_read_req req = {};
> + int ret;
> +
> + if (!val || !val_size)
> + return -EFAULT;

EINVAL


[...]

> +static bool pmic_glink_gio_handle_alert(struct pmic_gio_device *gio,
> + u8 peripheral_id, u8 alert_id,
> + const void *payload)
> +{
> + dev_dbg(gio->dev,
> + "GIO alert: peripheral_id=0x%02x alert_id=0x%02x payload=%*ph\n",
> + peripheral_id, alert_id, PMIC_GIO_ALERT_PAYLOAD_SIZE, payload);
> +
> + return false;
> +}

If this isn't going to be more useful, we can just move this print to
the caller of >handle_alert()

Konrad