From nobody Wed Oct 1 20:34:01 2025 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (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 A4523352098; Wed, 27 Aug 2025 11:40:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756294827; cv=none; b=czO7JibNkbibanYxZSFb85IgTCVMvDWLxPZJMNSS8NkVKK5AusAKgsnX6tO0B94NSqJ4zntR2PNenPKASxEdekh96OqS0aNqBDqEMD3Vd/2wxfKEYzuiWK2rqeIbR8c8hgjPnOCIBrRkQ9nMRibBgN8DLfuVcY4O/7Kg7AfeqB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756294827; c=relaxed/simple; bh=cXmqpQ2zVMpAk5TOXk5ulNe5nKFWFV8jUE90oXY/TUk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gpDyj6GdfKAgEFCMfer69eiyozCRR8tze4U+sf1pOjijPV1oCUxP6sEmBIdWOCzdqHM+nQqKX/a7gBETRp1dO604eotdUDoImiVJgHyucNSf5/xpXlvRjMZp+H776jIxRpv0lsfrc9VlzuN46IJL+wB3p7BwhIediIwQ1yhtydM= 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=Rr5AW5Nk; arc=none smtp.client-ip=60.244.123.138 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="Rr5AW5Nk" X-UUID: 97640a7c833a11f0bd5779446731db89-20250827 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=6VbUAEeV39eL80nnS9lHM6fAPeFr3119Wt/l0LVAUKA=; b=Rr5AW5NkBPRXdfCNVWhx6HTMrDId4h26O97uQKXBbm3KCHItHbzdMZh2fBRBBii2C+yrMH56IDZ4HIsbKBwgYybjK6MhX9Cm+prP8HPryEycmopxQjfd+OWdEsOTX87ElZG1z9Vgsl/yqd//9Qf5Bi3CwRAvyEOe9MU/jsBuKw8=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.3,REQID:e86d6e81-1fac-4b99-af9f-579030280fd2,IP:0,UR L:0,TC:0,Content:41,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:41 X-CID-META: VersionHash:f1326cf,CLOUDID:080f957a-966c-41bd-96b5-7d0b3c22e782,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:81|82|102,TC:-5,Content:4|15|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: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 97640a7c833a11f0bd5779446731db89-20250827 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1766807970; Wed, 27 Aug 2025 19:40:11 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by MTKMBS09N2.mediatek.inc (172.21.101.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.39; Wed, 27 Aug 2025 19:40:10 +0800 Received: from mtksitap99.mediatek.inc (10.233.130.16) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1258.39 via Frontend Transport; Wed, 27 Aug 2025 19:40:10 +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 , Nicolas Dufresne , Jason-JH Lin , Nancy Lin , Singo Chang , Paul-PL Chen , Moudy Ho , Xiandong Wang , Sirius Wang , Fei Shao , Chen-yu Tsai , , , , , , , Subject: [PATCH v7 19/20] soc: mediatek: mtk-cmdq: Remove cmdq_pkt_write() and cmdq_pkt_write_mask() Date: Wed, 27 Aug 2025 19:37:51 +0800 Message-ID: <20250827114006.3310175-20-jason-jh.lin@mediatek.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250827114006.3310175-1-jason-jh.lin@mediatek.com> References: <20250827114006.3310175-1-jason-jh.lin@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MTK: N Content-Type: text/plain; charset="utf-8" The original cmdq_pkt_write() and cmdq_pkt_write_mask() only supported generating GCE instructions with subsys ID. They have been replaced by cmdq_pkt_write_pa(), cmdq_pkt_write_subsys(), cmdq_pkt_write_mask_pa() and cmdq_pkt_write_mask_subsys(). These 2 functions can now be removed as they are no longer in use. Signed-off-by: Jason-JH Lin --- drivers/soc/mediatek/mtk-cmdq-helper.c | 49 ++++++++++---------------- include/linux/soc/mediatek/mtk-cmdq.h | 35 ------------------ 2 files changed, 18 insertions(+), 66 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/= mtk-cmdq-helper.c index 0a718ffa5f3b..5822a3d13bda 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -201,18 +201,6 @@ static int cmdq_pkt_mask(struct cmdq_pkt *pkt, u32 mas= k) return cmdq_pkt_append_command(pkt, inst); } =20 -int cmdq_pkt_write(struct cmdq_pkt *pkt, u8 subsys, u16 offset, u32 value) -{ - struct cmdq_instruction inst =3D { - .op =3D CMDQ_CODE_WRITE, - .value =3D value, - .offset =3D offset, - .subsys =3D subsys - }; - return cmdq_pkt_append_command(pkt, inst); -} -EXPORT_SYMBOL(cmdq_pkt_write); - int cmdq_pkt_write_pa(struct cmdq_pkt *pkt, u8 subsys /*unused*/, u32 pa_b= ase, u16 offset, u32 value) { @@ -229,27 +217,16 @@ EXPORT_SYMBOL(cmdq_pkt_write_pa); int cmdq_pkt_write_subsys(struct cmdq_pkt *pkt, u8 subsys, u32 pa_base /*u= nused*/, u16 offset, u32 value) { - return cmdq_pkt_write(pkt, subsys, offset, value); + struct cmdq_instruction inst =3D { + .op =3D CMDQ_CODE_WRITE, + .value =3D value, + .offset =3D offset, + .subsys =3D subsys + }; + return cmdq_pkt_append_command(pkt, inst); } EXPORT_SYMBOL(cmdq_pkt_write_subsys); =20 -int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys, - u16 offset, u32 value, u32 mask) -{ - u16 offset_mask =3D offset; - int err; - - if (mask !=3D GENMASK(31, 0)) { - err =3D cmdq_pkt_mask(pkt, mask); - if (err < 0) - return err; - - offset_mask |=3D CMDQ_WRITE_ENABLE_MASK; - } - return cmdq_pkt_write(pkt, subsys, offset_mask, value); -} -EXPORT_SYMBOL(cmdq_pkt_write_mask); - int cmdq_pkt_write_mask_pa(struct cmdq_pkt *pkt, u8 subsys /*unused*/, u32= pa_base, u16 offset, u32 value, u32 mask) { @@ -267,7 +244,17 @@ EXPORT_SYMBOL(cmdq_pkt_write_mask_pa); int cmdq_pkt_write_mask_subsys(struct cmdq_pkt *pkt, u8 subsys, u32 pa_bas= e /*unused*/, u16 offset, u32 value, u32 mask) { - return cmdq_pkt_write_mask(pkt, subsys, offset, value, mask); + u16 offset_mask =3D offset; + int err; + + if (mask !=3D GENMASK(31, 0)) { + err =3D cmdq_pkt_mask(pkt, mask); + if (err < 0) + return err; + + offset_mask |=3D CMDQ_WRITE_ENABLE_MASK; + } + return cmdq_pkt_write_subsys(pkt, subsys, pa_base, offset_mask, value); } EXPORT_SYMBOL(cmdq_pkt_write_mask_subsys); =20 diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/medi= atek/mtk-cmdq.h index 4a2acceb8581..f4663fbfb5a0 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -113,17 +113,6 @@ int cmdq_pkt_create(struct cmdq_client *client, struct= cmdq_pkt *pkt, size_t siz */ void cmdq_pkt_destroy(struct cmdq_client *client, struct cmdq_pkt *pkt); =20 -/** - * cmdq_pkt_write() - append write command to the CMDQ packet - * @pkt: the CMDQ packet - * @subsys: the CMDQ sub system code - * @offset: register offset from CMDQ sub system - * @value: the specified target register value - * - * Return: 0 for success; else the error code is returned - */ -int cmdq_pkt_write(struct cmdq_pkt *pkt, u8 subsys, u16 offset, u32 value); - /** * cmdq_pkt_write_pa() - append write command to the CMDQ packet with pa_b= ase * @pkt: the CMDQ packet @@ -150,19 +139,6 @@ int cmdq_pkt_write_pa(struct cmdq_pkt *pkt, u8 subsys = /*unused*/, int cmdq_pkt_write_subsys(struct cmdq_pkt *pkt, u8 subsys, u32 pa_base /*unused*/, u16 offset, u32 value); =20 -/** - * cmdq_pkt_write_mask() - append write command with mask to the CMDQ pack= et - * @pkt: the CMDQ packet - * @subsys: the CMDQ sub system code - * @offset: register offset from CMDQ sub system - * @value: the specified target register value - * @mask: the specified target register mask - * - * Return: 0 for success; else the error code is returned - */ -int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys, - u16 offset, u32 value, u32 mask); - /** * cmdq_pkt_write_mask_pa() - append write command with mask to the CMDQ p= acket with pa * @pkt: the CMDQ packet @@ -460,11 +436,6 @@ static inline int cmdq_pkt_create(struct cmdq_client *= client, struct cmdq_pkt *p =20 static inline void cmdq_pkt_destroy(struct cmdq_client *client, struct cmd= q_pkt *pkt) { } =20 -static inline int cmdq_pkt_write(struct cmdq_pkt *pkt, u8 subsys, u16 offs= et, u32 value) -{ - return -ENOENT; -} - static inline int cmdq_pkt_write_pa(struct cmdq_pkt *pkt, u8 subsys /*unus= ed*/, u32 pa_base, u16 offset, u32 value) { @@ -477,12 +448,6 @@ static inline int cmdq_pkt_write_subsys(struct cmdq_pk= t *pkt, u8 subsys, return -ENOENT; } =20 -static inline int cmdq_pkt_write_mask(struct cmdq_pkt *pkt, u8 subsys, - u16 offset, u32 value, u32 mask) -{ - return -ENOENT; -} - static inline int cmdq_pkt_write_mask_pa(struct cmdq_pkt *pkt, u8 subsys /= *unused*/, u32 pa_base, u16 offset, u32 value, u32 mask) { --=20 2.43.0