]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
soc: mediatek: mtk-cmdq: Extend cmdq_pkt_write API for SoCs without subsys ID
authorJason-JH Lin <jason-jh.lin@mediatek.com>
Fri, 31 Oct 2025 15:56:36 +0000 (23:56 +0800)
committerAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 19 Jan 2026 11:57:45 +0000 (12:57 +0100)
commit40dc5bbad63b5f60dd2e69a32def1a2673cba09e
tree23fd4c46a1d7c99c6feba126c560b8b18d97eb4f
parent4bf783d8415cc397334b375a05f0b2321fc6c319
soc: mediatek: mtk-cmdq: Extend cmdq_pkt_write API for SoCs without subsys ID

This patch extends the cmdq_pkt_write API to support SoCs that do not
have subsys ID mapping by introducing new register write APIs:
- cmdq_pkt_write_pa() and cmdq_pkt_write_subsys() replace
  cmdq_pkt_write()
- cmdq_pkt_write_mask_pa() and cmdq_pkt_write_mask_subsys() replace
  cmdq_pkt_write_mask()

To ensure consistent function pointer interfaces, both
cmdq_pkt_write_pa() and cmdq_pkt_write_subsys() provide subsys and
pa_base parameters. This unifies how register writes are invoked,
regardless of whether subsys ID is supported by the device.

All GCEs support writing registers by PA (with mask) without subsys,
but this requires extra GCE instructions to convert the PA into a GCE
readable format, reducing performance compared to using subsys directly.
Therefore, subsys is preferred for register writes when available.

API documentation and function pointer declarations in cmdq_client_reg
have been updated. The original write APIs will be removed after all
CMDQ users transition to the new interfaces.

Signed-off-by: Jason-JH Lin <jason-jh.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
drivers/soc/mediatek/mtk-cmdq-helper.c
include/linux/soc/mediatek/mtk-cmdq.h