From patchwork Thu Feb 15 00:49:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Kuang Hu X-Patchwork-Id: 201216 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp86156dyb; Wed, 14 Feb 2024 16:52:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVdXXWwhy4uRhcBHSSKAnQM8Ho4DmWLc/6lELAZrgKW5myL5sGdD7uoeQQ7D8ZEtnPFSdOvb7J+7Hg5sknAoDUdZCa3iw== X-Google-Smtp-Source: AGHT+IG20+NoCYESYt6znv47W1yeeyT8tNtF4BYX7UEtAMxIj0U8UwaVAB7K9KmaGLkNppjaxsbu X-Received: by 2002:a9d:73d0:0:b0:6e2:d9d9:5500 with SMTP id m16-20020a9d73d0000000b006e2d9d95500mr206475otk.24.1707958341503; Wed, 14 Feb 2024 16:52:21 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958341; cv=pass; d=google.com; s=arc-20160816; b=x4pNHhunMxeftrMvN4an2VG+R5uyJmsk/FXSoKOyUyYC9htYpN9PxYI95cxEs8LQGc 6pSznNmHiH11uHVm7q4DKIiZO65LGX9k2LNrZGXKOA3/hZKCk4DL0zs7x8aPOJzKQDh4 0e4PfgOYAZ9fiMr0KcvX3zNG5qrlQXx3YRy/YhpcHRWMgQv9vFlTTBYTJpCwQKFBkFwd ykBu6b8+Bga5J9HxrmutOynnhYAB7dU340gDFYCzlgJxD/am+qJPLQT3J6NEQMbZLR9w Ndb2LjABCI5TD2klWRR2HCTpuR6E8jaUE0hqNTVitlyg8RaGX7xXFFxiFigm5dm1hDOa xQwQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=pqZ/kgKDACXdPeK9sM637WSqPrRbymAx6Sooj6UWiLQ=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=sOyw7LbnYT/3Yjk+AOlv6hLySg0jPLAnE9VsEOueZVD2GRf0WUaawT3Yvc38TdL3wa ty2/0KEDIwsJet2oAe1MbC9u9hnR8JEd5+xO1wYQ05hPnW8njTR8zR0uA6GFeIVwt9q1 4xHrdGu9MK28IvMWNE7AEEqdQgmYKUy4lvEXMjsDXm7WXMZrppIJsSV3NmP/MAO2Xq2s QM30j2oOqXibLSuW6xWexAQOuqIbKRSjo4Yvb+hmt/5wZFsDHCf4leuRFUbpwRBp6eBm /ID4qUUjMyTE4d8d24e43pKHdvZVrHRiVF2AOZ/T4w4HGAFGo2fZJRgifGgxhKX5YCBW iYxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Oxx40D/8"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66202-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66202-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h25-20020a633859000000b005dc47dd5dccsi82138pgn.893.2024.02.14.16.52.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:52:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66202-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Oxx40D/8"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66202-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66202-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 43A8E284F86 for ; Thu, 15 Feb 2024 00:52:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A24915A4; Thu, 15 Feb 2024 00:50:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Oxx40D/8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 9EE9EE566; Thu, 15 Feb 2024 00:50:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958218; cv=none; b=Bnx740eJMBOokPSvkt1pbHrKRclDkZdfCB5aBX97/sx/M/Gf+PVpqSdRmnJSBk8p9yUhNwnFiWUK8y8xiU8nTbk6Qasy7dqQ8uiZNfb9IJdKlgc/sXt/fMC0mtLTtIvZrjsdvzBYXi8jDo4z537xiOFoRoC+QKWC/udSEKRJuRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958218; c=relaxed/simple; bh=dPziziTO31/IgvG01QjFF6q9F9Ksbkg3Q8cm4HNP0Sk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RkDMwIIzAmqJK+kmp1GGqk3z/WKzcTAV8R93zNMYI/wWtUcCA0l+rK6KGghgPzxbCqDmx68ZSQsvPzr/t2ZalOCduY9ec/se11zuN79fq2iztGer/TFUwV66hy4sMRf60vOOvE40bekMmMh2bsNz1Aq7gsNEFqBW9ZlBaSA+YUc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Oxx40D/8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25994C433B2; Thu, 15 Feb 2024 00:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958218; bh=dPziziTO31/IgvG01QjFF6q9F9Ksbkg3Q8cm4HNP0Sk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Oxx40D/89a6FlorbWuMzZEYV6v9l4FbG9HoWoWtIQbtV0NtDuB5wgcHL//ag4s+4q TCgrMKpr9bn4NrblZK2iJsOfLDeRcdTEYJRC2DUXD8GbOcf9BOM19ThwxHzCpbFfuE 65xCCK7+1IzuOQtm+JmczPhYQDYwqoX1zUs9rjTRff+hT2qWQA5wIp5raLibyOslrK W66bvZknkAFeqPjeIwe4oM+WfWh0ej8sF8ipaeoZvmhEBD6BVuF5yPoRV4+LpVIp0N ZQB560i4SHwe2FD+b6LfJMoLQJA+i8Yv892a1KyZs/9f+7+/vZcM01+jdy6vCwR892 y1Y4ICvyDigvw== From: Chun-Kuang Hu To: Matthias Brugger , AngeloGioacchino Del Regno , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Chun-Kuang Hu Subject: [PATCH 7/9] soc: mediatek: cmdq: Remove cmdq_pkt_finalize() helper function Date: Thu, 15 Feb 2024 00:49:29 +0000 Message-Id: <20240215004931.3808-8-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240215004931.3808-1-chunkuang.hu@kernel.org> References: <20240215004931.3808-1-chunkuang.hu@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790924125814416020 X-GMAIL-MSGID: 1790924125814416020 Because client driver has the information of struct cmdq_client, so it's not necessary to store struct cmdq_client in struct cmdq_pkt. cmdq_pkt_finalize() use struct cmdq_client in struct cmdq_pkt, so client driver use cmdq_pkt_eoc() and cmdq_pkt_nop() to replace cmdq_pkt_finalize() and this function could be removed. Signed-off-by: Chun-Kuang Hu --- drivers/soc/mediatek/mtk-cmdq-helper.c | 22 ---------------------- include/linux/soc/mediatek/mtk-cmdq.h | 13 ------------- 2 files changed, 35 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index 1be950b4ec7f..9b937db7398c 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -380,26 +380,4 @@ int cmdq_pkt_nop(struct cmdq_pkt *pkt, u8 shift_pa) } EXPORT_SYMBOL(cmdq_pkt_nop); -int cmdq_pkt_finalize(struct cmdq_pkt *pkt) -{ - struct cmdq_instruction inst = { {0} }; - int err; - - /* insert EOC and generate IRQ for each command iteration */ - inst.op = CMDQ_CODE_EOC; - inst.value = CMDQ_EOC_IRQ_EN; - err = cmdq_pkt_append_command(pkt, inst); - if (err < 0) - return err; - - /* JUMP to end */ - inst.op = CMDQ_CODE_JUMP; - inst.value = CMDQ_JUMP_PASS >> - cmdq_get_shift_pa(((struct cmdq_client *)pkt->cl)->chan); - err = cmdq_pkt_append_command(pkt, inst); - - return err; -} -EXPORT_SYMBOL(cmdq_pkt_finalize); - MODULE_LICENSE("GPL v2"); diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 8179ba5238f9..f1d571475b52 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -266,14 +266,6 @@ int cmdq_pkt_eoc(struct cmdq_pkt *pkt); */ int cmdq_pkt_nop(struct cmdq_pkt *pkt, u8 shift_pa); -/** - * cmdq_pkt_finalize() - Append EOC and jump command to pkt. - * @pkt: the CMDQ packet - * - * Return: 0 for success; else the error code is returned - */ -int cmdq_pkt_finalize(struct cmdq_pkt *pkt); - #else /* IS_ENABLED(CONFIG_MTK_CMDQ) */ static inline int cmdq_dev_get_client_reg(struct device *dev, @@ -377,11 +369,6 @@ static inline int cmdq_pkt_nop(struct cmdq_pkt *pkt, u8 shift_pa) return -EINVAL; } -static inline int cmdq_pkt_finalize(struct cmdq_pkt *pkt) -{ - return -EINVAL; -} - #endif /* IS_ENABLED(CONFIG_MTK_CMDQ) */ #endif /* __MTK_CMDQ_H__ */