Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp163657rdb; Wed, 14 Feb 2024 16:51:45 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUXgct8wXiYGnSuuUmNpYYGgCxIRy7ZAgdzw5AcL17bikrOfJDay93HTO6ZEwe3b1CW3CPuk9kkFQFwZOm2A9z3bQej08z6bj79tPGjmg== X-Google-Smtp-Source: AGHT+IGtypoaqyr87I7nmHLxdzYgioLSAOOTsMHQs6Tg1pBK3puEBhtxzB+NsOkBZJnh3dv+kOwi X-Received: by 2002:a05:6214:23c8:b0:68c:bcc4:f312 with SMTP id hr8-20020a05621423c800b0068cbcc4f312mr348907qvb.61.1707958305041; Wed, 14 Feb 2024 16:51:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958305; cv=pass; d=google.com; s=arc-20160816; b=oAC4b8xC0boiW+xYL39p9M/ENrF/Fv1hU6PKMKyTdRsPWIjby1f+SCqPUD/U8hn3Y6 5Zqmn30kf017M33CAj++IpzFsvnNUnHh4jaq8x1SRUzvzGcM/yQM7RqeTv5dLof5kC05 I6ei+VRA1qAk34MUnkCF5XbBWI0U0Og3gLHFGXurzuDmVdouHSOBPrF4rU1QPzRJYDIr Wri0aV7teChPxfIXqmolM6JjqKHqbBZKL+FHodyo5QTSkcx44wuomdrLSO+6IpqNh5BR hqd1deMJeiidhY1Qm0qeNPVVKxJ55qt0LCkuj0dJSp5xcl4Uz26136M3TtC+AY19dwxM YAXg== 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=wktiZ7HUtb2+Q2NhWcelGAYCc1x/knQvGbZ7CeUFnZM=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=Hx9n3htMA2sVkr+RtW6ga6Ni1knDfrdzwel+Ge6IXTVjgnO6n9AUVyuY2rrT+wCDJ8 1M6toR32ssiqeHg/NuGZbIsEoa6FnM5djWezVY5lNwrOmGEvaeqDnIQafihSmTigxQgy vFTRjZFseViX6q5kljzTH+EZm2RHSgWaaaua4uBHQjnlmyPt3T0rE9Nk918CEAtNpfLm ap9ITB1vQy7rPstl08Nr9C/6WU1okE9D4brgu3fY8+y04IFWYB3GyB+kQbhs+m636vkM zffwsZ4px/3MTcGrgdA2vq5hw71rPBJ/e1+ic6gev+20DfCcwWisa+r2CJHnZI2aKUsx QJIg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EdY468GL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66198-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66198-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gw15-20020a0562140f0f00b0068cb23ed4f8si298786qvb.316.2024.02.14.16.51.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:51:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66198-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EdY468GL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66198-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66198-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EDD7B1C29E3F for ; Thu, 15 Feb 2024 00:51:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A98979CD; Thu, 15 Feb 2024 00:50:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EdY468GL" 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 B576A611B; Thu, 15 Feb 2024 00:50:08 +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=1707958208; cv=none; b=MlIcA3xBWUWVYT+HygqZkSXoOeTUVeWbqM6TWJXD6Y1Ir3zYfP/V8LyNI/o2of2gUlfLK9SjA1l29tqTYGRZkugUSL932O9VEVMclXW57UgQOXRY+Lv+1lNenR1vECLuQEo06cheX0yF6oqjQKdWsDAQmEqjqhyzFxJbM/YBIC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958208; c=relaxed/simple; bh=RwnPPmbshIPrHAhqt6nvIojZaFpX1mNKJof+jE1wWoo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=flUBZrbKQo9IUMwby5yvGVXv0AZvrV5aQpKM/MMN6+dSLBLLe8FwC0KInxlq9/9uDhZjy9KLdcg1Irj/C2eC7v5ngk/KXI7YOliNE0fAVxh6b91mxGllOkMkO9kHu1lD3KEX527eT8n1r1BjYsTkpzTVZxSZjxXBOrNuSsNV0QY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EdY468GL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAE18C43390; Thu, 15 Feb 2024 00:50:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958208; bh=RwnPPmbshIPrHAhqt6nvIojZaFpX1mNKJof+jE1wWoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EdY468GL32M/G+gwv+w8ZLQRt22cvdi4p+clmYR7lBpR8Hz6COfk4WHL1LBt7E4pm rCoGXVDTvlEr0RmzBpPCzDXjLkU7MWi0a0FBD494UymBcfDtsylmYnXgy6pa+HhaOo V0+5zDNIK+lNekTH0wRZ5oUasQf9nGNaIAviARu649+NmdxAck0HrDrZtN49YYFtSf XdvvPIENaud4rOP+MiXn+TpoEobLUoG/FseG+mML8ErNSHc8qcUXpmoknhmTS+T9by azP5czVyz3ekp1ybTf1gJBsffPFcxUaYjVqhxx/udbcNPmsjkvOC5yLjv0CQvhzt5z SQ+VXFjLwmO/A== 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 3/9] soc: mediatek: cmdq: Add cmdq_pkt_eoc() helper function Date: Thu, 15 Feb 2024 00:49:25 +0000 Message-Id: <20240215004931.3808-4-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 Content-Transfer-Encoding: 8bit cmdq_pkt_eoc() append eoc command to CMDQ packet. eoc command would ask GCE to generate IRQ. It's usually appended to the end of packet to notify all command in the packet is done. Signed-off-by: Chun-Kuang Hu --- drivers/soc/mediatek/mtk-cmdq-helper.c | 10 ++++++++++ include/linux/soc/mediatek/mtk-cmdq.h | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index ed4ef95adf5b..e982997117c2 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -359,6 +359,16 @@ int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa) } EXPORT_SYMBOL(cmdq_pkt_jump); +int cmdq_pkt_eoc(struct cmdq_pkt *pkt) +{ + struct cmdq_instruction inst = { {0} }; + + inst.op = CMDQ_CODE_EOC; + inst.value = CMDQ_EOC_IRQ_EN; + return cmdq_pkt_append_command(pkt, inst); +} +EXPORT_SYMBOL(cmdq_pkt_eoc); + int cmdq_pkt_finalize(struct cmdq_pkt *pkt) { struct cmdq_instruction inst = { {0} }; diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 6215191a328d..a67f719dec0b 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -245,6 +245,16 @@ int cmdq_pkt_assign(struct cmdq_pkt *pkt, u16 reg_idx, u32 value); */ int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_pa); +/** + * cmdq_pkt_eoc() - Append eoc command to the CMDQ packet, ask GCE + * to generate IRQ. It's usually appended to the end of + * packet to notify that all command in the packet is done. + * @pkt: the CMDQ packet + * + * Return: 0 for success; else the error code is returned + */ +int cmdq_pkt_eoc(struct cmdq_pkt *pkt); + /** * cmdq_pkt_finalize() - Append EOC and jump command to pkt. * @pkt: the CMDQ packet @@ -346,6 +356,11 @@ static inline int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr, u8 shift_ return -EINVAL; } +static inline int cmdq_pkt_eoc(struct cmdq_pkt *pkt) +{ + return -EINVAL; +} + static inline int cmdq_pkt_finalize(struct cmdq_pkt *pkt) { return -EINVAL; -- 2.34.1