From patchwork Fri Apr 25 09:28:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason-JH Lin X-Patchwork-Id: 885208 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D706223D2A5; Fri, 25 Apr 2025 09:32:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745573571; cv=none; b=COtlEVTFHDpNbvefARI8ZAfGA0x2N1R1yefC8ADOw9Q2LHgJ7cuwid4+hKa5o69Q4BXUVQLVqBg6+XcaQ3U42NZojNfUFlh+jjP81Eb4S4VRpbfbIiGeZ8+QuZHc61J/xBfP+xREt+7XbX/V/NGiXHDZhZK71yeIC4jCfHGmw1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745573571; c=relaxed/simple; bh=Kt0qv1sLvb+q1sniH6Zgn5KvTt72TyIIdNa4MQ0zKSQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EJD7cBXZp0iOo0EjfoK+zRND7V08Z+IFagQhteksmlhCfBDA1PFCFCgWvXOTnTNTFSE4OSmQaEb3kETTEPOjyM1o07U+arNMKhi7JM2sL3SJT1xTpa1xuxX6uN7uoVssVeiYHUbLXRHk0MoEvgRGiX9aLIQRkg/MhJklqJ1XwU4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=BRSejOPY; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="BRSejOPY" X-UUID: 3b838d0621b811f09b6713c7f6bde12e-20250425 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=k2kAnr/rDtN9bEn+nMeXwAS2lV4DpQj7+1ksUkX70CA=; b=BRSejOPYXoVIrRByXk1xmrE5JHY93p2WLzhJq6AwBineaSW58UH6TfIQaZU9APhiB9bbYs+7l6hCmsjuL5vYrc6FkIgFEwcefSDot1Ax+wUwKY3B6bC/+aYB364bZdNidiVFKPD5BVx1+84+9+8Dfi0cGvcVdnlCAkgd2gq1Qkg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.2.1, REQID:728b8294-a2ab-4dc0-9660-0b3ad2ce4a57, IP:0, UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:0 X-CID-META: VersionHash:0ef645f, CLOUDID:87c7dd6f-e08c-41ab-89e8-3ba0a33da853, B ulkID:nil,BulkQuantity:0,Recheck:0,SF:81|82|102,TC:nil,Content:0|50,EDM:-3 ,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV :0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 3b838d0621b811f09b6713c7f6bde12e-20250425 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 406917238; Fri, 25 Apr 2025 17:32:40 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.39; Fri, 25 Apr 2025 17:32:38 +0800 Received: from mtksitap99.mediatek.inc (10.233.130.16) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1258.39 via Frontend Transport; Fri, 25 Apr 2025 17:32:38 +0800 From: Jason-JH Lin To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jassi Brar , Chun-Kuang Hu , AngeloGioacchino Del Regno , Mauro Carvalho Chehab CC: Matthias Brugger , Jason-JH Lin , Nancy Lin , Singo Chang , Paul-PL Chen , Moudy Ho , Xavier Chang , Xiandong Wang , Sirius Wang , Fei Shao , Chen-yu Tsai , , , , , , , Subject: [PATCH v5 07/19] soc: mediatek: mtk-cmdq: Remove shift_pa parameter from cmdq_pkt_jump() Date: Fri, 25 Apr 2025 17:28:39 +0800 Message-ID: <20250425093237.1543918-8-jason-jh.lin@mediatek.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250425093237.1543918-1-jason-jh.lin@mediatek.com> References: <20250425093237.1543918-1-jason-jh.lin@mediatek.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MTK: N 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(). Fixes: ade176534112 ("soc: mediatek: cmdq: Add parameter shift_pa to cmdq_pkt_jump()") Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 8 ++++---- include/linux/soc/mediatek/mtk-cmdq.h | 20 ++++++++------------ 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index 8feeaa320359..a40919555d4d 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -494,22 +494,22 @@ 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, .offset = CMDQ_JUMP_ABSOLUTE, - .value = addr >> shift_pa + .value = addr >> pkt->priv.shift_pa }; return cmdq_pkt_append_command(pkt, inst); } 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 67fd0924747b..ee4ec64a7322 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -350,17 +350,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); } /** @@ -370,17 +368,15 @@ 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); /* This wrapper has to be removed after all users migrated to jump_rel */ static int cmdq_pkt_jump_rel_temp(struct cmdq_pkt *pkt, s32 offset, u8 shift_pa) { - return cmdq_pkt_jump_rel(pkt, addr, shift_pa); + return cmdq_pkt_jump_rel(pkt, addr); } /** @@ -497,17 +493,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; }