[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251017065028.1676930-17-jason-jh.lin@mediatek.com>
Date: Fri, 17 Oct 2025 14:44:41 +0800
From: Jason-JH Lin <jason-jh.lin@...iatek.com>
To: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>, Jassi Brar <jassisinghbrar@...il.com>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>, AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>, Mauro Carvalho Chehab
<mchehab@...nel.org>
CC: Matthias Brugger <matthias.bgg@...il.com>, Nicolas Dufresne
<nicolas@...fresne.ca>, Jason-JH Lin <jason-jh.lin@...iatek.com>, Nancy Lin
<nancy.lin@...iatek.com>, Singo Chang <singo.chang@...iatek.com>, "Paul-PL
Chen" <paul-pl.chen@...iatek.com>, Moudy Ho <moudy.ho@...iatek.com>,
"Xiandong Wang" <xiandong.wang@...iatek.com>, Sirius Wang
<sirius.wang@...iatek.com>, Fei Shao <fshao@...omium.org>, Chen-yu Tsai
<wenst@...omium.org>, <Project_Global_Chrome_Upstream_Group@...iatek.com>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<dri-devel@...ts.freedesktop.org>, <linux-mediatek@...ts.infradead.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-media@...r.kernel.org>
Subject: [PATCH v8 16/20] soc: mediatek: mtk-cmdq: Remove shift_pa parameter from cmdq_pkt_jump()
Since shift_pa will be stored in the cmdq_mbox_priv structure within
cmdq_pkt, all shift_pa parameters in CMDQ helper APIs can be removed.
Remove the shift_pa parameters from cmdq_pkt_jump(), cmdq_pkt_jump_abs(),
and cmdq_pkt_jump_rel().
Signed-off-by: Jason-JH Lin <jason-jh.lin@...iatek.com>
---
drivers/soc/mediatek/mtk-cmdq-helper.c | 6 +++---
include/linux/soc/mediatek/mtk-cmdq.h | 20 ++++++++------------
2 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c
index 1b4d4a1e2984..0ab87eb04614 100644
--- a/drivers/soc/mediatek/mtk-cmdq-helper.c
+++ b/drivers/soc/mediatek/mtk-cmdq-helper.c
@@ -562,7 +562,7 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value)
}
EXPORT_SYMBOL(cmdq_pkt_assign);
-int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
+int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr)
{
struct cmdq_instruction inst = {
.op = CMDQ_CODE_JUMP,
@@ -573,11 +573,11 @@ int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
}
EXPORT_SYMBOL(cmdq_pkt_jump_abs);
-int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt, s32 offset, u8 shift_pa)
+int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt, s32 offset)
{
struct cmdq_instruction inst = {
.op = CMDQ_CODE_JUMP,
- .value = (u32)offset >> shift_pa
+ .value = (u32)offset >> pkt->priv.shift_pa
};
return cmdq_pkt_append_command(pkt, inst);
}
diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h
index f6dc43c036bd..af66410b06d1 100644
--- a/include/linux/soc/mediatek/mtk-cmdq.h
+++ b/include/linux/soc/mediatek/mtk-cmdq.h
@@ -411,17 +411,15 @@ int cmdq_pkt_poll_addr(struct cmdq_pkt *pkt, dma_addr_t addr, u32 value, u32 mas
* contains more instruction.
* @pkt: the CMDQ packet
* @addr: absolute physical address of target instruction buffer
- * @shift_pa: shift bits of physical address in CMDQ instruction. This value
- * is got by cmdq_get_shift_pa().
*
* Return: 0 for success; else the error code is returned
*/
-int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa);
+int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr);
/* This wrapper has to be removed after all users migrated to jump_abs */
-static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
+static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr)
{
- return cmdq_pkt_jump_abs(pkt, addr, shift_pa);
+ return cmdq_pkt_jump_abs(pkt, addr);
}
/**
@@ -431,12 +429,10 @@ static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_
* target address should contains more instruction.
* @pkt: the CMDQ packet
* @offset: relative offset of target instruction buffer from current PC.
- * @shift_pa: shift bits of physical address in CMDQ instruction. This value
- * is got by cmdq_get_shift_pa().
*
* Return: 0 for success; else the error code is returned
*/
-int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt, s32 offset, u8 shift_pa);
+int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt, s32 offset);
/**
* cmdq_pkt_jump_rel_temp() - Temporary wrapper for new CMDQ helper API
@@ -453,7 +449,7 @@ int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt, s32 offset, u8 shift_pa);
*/
static inline int cmdq_pkt_jump_rel_temp(struct cmdq_pkt *pkt, s32 offset, u8 shift_pa)
{
- return cmdq_pkt_jump_rel(pkt, offset, shift_pa);
+ return cmdq_pkt_jump_rel(pkt, offset);
}
/**
@@ -595,17 +591,17 @@ static inline int cmdq_pkt_poll_addr(struct cmdq_pkt *pkt, dma_addr_t addr, u32
return -EINVAL;
}
-static inline int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
+static inline int cmdq_pkt_jump_abs(struct cmdq_pkt *pkt, dma_addr_t addr)
{
return -EINVAL;
}
-static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa)
+static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr)
{
return -EINVAL;
}
-static inline int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt, s32 offset, u8 shift_pa)
+static inline int cmdq_pkt_jump_rel(struct cmdq_pkt *pkt, s32 offset)
{
return -EINVAL;
}
--
2.43.0
Powered by blists - more mailing lists