Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp163590rdb; Wed, 14 Feb 2024 16:51:29 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXu4cEXa5KVThk1x+sJiaDpmJrkL3J2cAJzC8D0/1x/IILfYLvqX2hfW8Rvf9GNrFnR7yaUShDkBYlGPYleXW5rsHMvEEfuDs20zBXIWg== X-Google-Smtp-Source: AGHT+IGOF/tGMT8Skt/32SwmHI9l6jH3ApQM0CUeNpBalVSH8zXn4qYqsoCkxN4D5kCkPVewrW2A X-Received: by 2002:a05:622a:255:b0:42c:5f4d:1e5a with SMTP id c21-20020a05622a025500b0042c5f4d1e5amr555110qtx.11.1707958289560; Wed, 14 Feb 2024 16:51:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707958289; cv=pass; d=google.com; s=arc-20160816; b=k5scAIKF3KBGkzRAjXiS4CCtKloQrkVHkKXcJl5eR7v+cPfEqysRzAAZORZSZlP6V2 bcoiPXY93dWpefmooztSv0WHiqMEUFu/zA/X6ug2IwtiOVLk8xrq5Ozk+NBJFx8ETH7b o/Eg11gAWX9YwCtQ9mhVtnQEAZcq5VGfoOwH56kG/6rUga8UpEk3tf1Z4VIaQBR0ZCv3 cahstr2DcmaTbVB7B/sXHTWzSwcyAj7wXXSB++B96odgQgch1lwsWLnQO2DWNs142At1 9uEzfvx4WF0uokUSViSZSyQn27NpvgXdmG7GFO9XREW50gZIJ6q3rJPgo19Jefr4BSB0 LNCw== 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=TZGzN7ubTR177376omnKYws6LluzZVJncHmcsyGwrDg=; fh=5fJ5HuOhQ8tDYrJs098Y1CAol/Fv56LtamixBAqCzME=; b=fBDjRVrTWWJYypThuVf5I3qOwDJw1HgvhUnB47so6F5kG9oo+gP9QQcybuJ1QYicQ4 72HVb/g+nzJNSUGPDUreMukiJ6M9+VhAWPEJSupz9sqN9qmCmyJ+tDzg1o5xZl8NS0HF Hs+xjnuPNScx1gV9TsRpJrTT3wdlt9HKcN67D6gSIqp8OKRolEjo6B5iTmxDJhAumZe9 mC4qa8EsCbMLoJ3W4p+OI7EGk85OG1DFyoSJAyCtd3lPnbyY8VUwCt4a/5XlZ+n+nDAE thBt1gyPi38aMoBjdNBP5NKb1h6PiQ5rOAKRLQUDLeTxeHjmO8tWlY2FImQ0/Y9sLRVN SddA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ag2V3tuA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66196-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. [147.75.199.223]) by mx.google.com with ESMTPS id t19-20020ac85893000000b0042c572ba1efsi241061qta.559.2024.02.14.16.51.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 16:51:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Ag2V3tuA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-66196-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66196-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 2AB631C286EE for ; Thu, 15 Feb 2024 00:50:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54F9A3C39; Thu, 15 Feb 2024 00:50:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Ag2V3tuA" 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 6903315D1; Thu, 15 Feb 2024 00:50:04 +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=1707958204; cv=none; b=ravJYCQkEK+x9V4zYyVSAMIxlpQgneWgXPTVpHMIgoSypbf5hivSTy6tGoVICwYunlMLRtCvQGTJ1BItA3nCJQyN1l+3C47PB4Tre2EoMXqrihRNs6RBcyx+I/DFYPTgfBt8U+kV8/SYd2pCpIoWXJgwrWLfar1Hc9+kCDZV/HQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707958204; c=relaxed/simple; bh=oUOUUVVZ6ZE4H6VaL1Zw1wSnRwLVun/8c8sWOEB2D/g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=m0SUTkOf64dszpqc1WObep/mLRHShfVm7jUG2YHYd3uWXARAhWvd9rnk1mlHw0LPIU8mQSiWQg8bsaHCAK9ceC5dpATUYxYEOvMIimQvYI9/xVua77NGdBs2sxbA4CUaKRo7DYgDP79R86pBNxCCmW+c1PNVzZd95hg2TPzLZiE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ag2V3tuA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3283C433C7; Thu, 15 Feb 2024 00:50:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707958203; bh=oUOUUVVZ6ZE4H6VaL1Zw1wSnRwLVun/8c8sWOEB2D/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ag2V3tuALPT3VgSFUAo0/klHrjQ1WrIxAcOnBaBzhTzZNXXmzIBi8I57TIRA+X+f6 DZ4WhHkUDXfc9y+xKp8iuiAK3VRfZoWcd5vdiBzBlxguWE/Mi1WBf06pLgdFHZXME5 fMdHBlzoNgRzeNGcbWJH305rIsF4lhWzo6GUAoT6ZLLZx1QMVxNeXCHSheR/LEieWj qXowmJgTqmuADgl3uczYo9+kOUVGepiC+M2XGGG+ntsuCdgM4FOBy+KK5hHrebpFTE MN1qK1AdRLMQkLsvVVljZAbgOfW8kiPU1MesybPiIgXTwXAqIA0YOZ+RMrrqIsHq1j cpskpba95MXew== 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 1/9] soc: mediatek: cmdq: Remove unused helper funciton Date: Thu, 15 Feb 2024 00:49:23 +0000 Message-Id: <20240215004931.3808-2-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_create(), cmdq_pkt_destroy(), and cmdq_pkt_flush_async() are not used by all client drivers (MediaTek drm driver and MediaTek mdp3 driver), so remove them. Signed-off-by: Chun-Kuang Hu --- drivers/soc/mediatek/mtk-cmdq-helper.c | 59 -------------------------- include/linux/soc/mediatek/mtk-cmdq.h | 40 ----------------- 2 files changed, 99 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index b0cd071c4719..67e17974d1e6 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -105,50 +105,6 @@ void cmdq_mbox_destroy(struct cmdq_client *client) } EXPORT_SYMBOL(cmdq_mbox_destroy); -struct cmdq_pkt *cmdq_pkt_create(struct cmdq_client *client, size_t size) -{ - struct cmdq_pkt *pkt; - struct device *dev; - dma_addr_t dma_addr; - - pkt = kzalloc(sizeof(*pkt), GFP_KERNEL); - if (!pkt) - return ERR_PTR(-ENOMEM); - pkt->va_base = kzalloc(size, GFP_KERNEL); - if (!pkt->va_base) { - kfree(pkt); - return ERR_PTR(-ENOMEM); - } - pkt->buf_size = size; - pkt->cl = (void *)client; - - dev = client->chan->mbox->dev; - dma_addr = dma_map_single(dev, pkt->va_base, pkt->buf_size, - DMA_TO_DEVICE); - if (dma_mapping_error(dev, dma_addr)) { - dev_err(dev, "dma map failed, size=%u\n", (u32)(u64)size); - kfree(pkt->va_base); - kfree(pkt); - return ERR_PTR(-ENOMEM); - } - - pkt->pa_base = dma_addr; - - return pkt; -} -EXPORT_SYMBOL(cmdq_pkt_create); - -void cmdq_pkt_destroy(struct cmdq_pkt *pkt) -{ - struct cmdq_client *client = (struct cmdq_client *)pkt->cl; - - dma_unmap_single(client->chan->mbox->dev, pkt->pa_base, pkt->buf_size, - DMA_TO_DEVICE); - kfree(pkt->va_base); - kfree(pkt); -} -EXPORT_SYMBOL(cmdq_pkt_destroy); - static int cmdq_pkt_append_command(struct cmdq_pkt *pkt, struct cmdq_instruction inst) { @@ -426,19 +382,4 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt) } EXPORT_SYMBOL(cmdq_pkt_finalize); -int cmdq_pkt_flush_async(struct cmdq_pkt *pkt) -{ - int err; - struct cmdq_client *client = (struct cmdq_client *)pkt->cl; - - err = mbox_send_message(client->chan, pkt); - if (err < 0) - return err; - /* We can send next packet immediately, so just call txdone. */ - mbox_client_txdone(client->chan, 0); - - return 0; -} -EXPORT_SYMBOL(cmdq_pkt_flush_async); - MODULE_LICENSE("GPL v2"); diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 649955d2cf5c..6c42d817d368 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -59,21 +59,6 @@ struct cmdq_client *cmdq_mbox_create(struct device *dev, int index); */ void cmdq_mbox_destroy(struct cmdq_client *client); -/** - * cmdq_pkt_create() - create a CMDQ packet - * @client: the CMDQ mailbox client - * @size: required CMDQ buffer size - * - * Return: CMDQ packet pointer - */ -struct cmdq_pkt *cmdq_pkt_create(struct cmdq_client *client, size_t size); - -/** - * cmdq_pkt_destroy() - destroy the CMDQ packet - * @pkt: the CMDQ packet - */ -void cmdq_pkt_destroy(struct cmdq_pkt *pkt); - /** * cmdq_pkt_write() - append write command to the CMDQ packet * @pkt: the CMDQ packet @@ -266,19 +251,6 @@ int cmdq_pkt_jump(struct cmdq_pkt *pkt, dma_addr_t addr); */ int cmdq_pkt_finalize(struct cmdq_pkt *pkt); -/** - * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the CMDQ - * packet and call back at the end of done packet - * @pkt: the CMDQ packet - * - * Return: 0 for success; else the error code is returned - * - * Trigger CMDQ to asynchronously execute the CMDQ packet and call back - * at the end of done packet. Note that this is an ASYNC function. When the - * function returned, it may or may not be finished. - */ -int cmdq_pkt_flush_async(struct cmdq_pkt *pkt); - #else /* IS_ENABLED(CONFIG_MTK_CMDQ) */ static inline int cmdq_dev_get_client_reg(struct device *dev, @@ -294,13 +266,6 @@ static inline struct cmdq_client *cmdq_mbox_create(struct device *dev, int index static inline void cmdq_mbox_destroy(struct cmdq_client *client) { } -static inline struct cmdq_pkt *cmdq_pkt_create(struct cmdq_client *client, size_t size) -{ - return ERR_PTR(-EINVAL); -} - -static inline void cmdq_pkt_destroy(struct cmdq_pkt *pkt) { } - static inline int cmdq_pkt_write(struct cmdq_pkt *pkt, u8 subsys, u16 offset, u32 value) { return -ENOENT; @@ -384,11 +349,6 @@ static inline int cmdq_pkt_finalize(struct cmdq_pkt *pkt) return -EINVAL; } -static inline int cmdq_pkt_flush_async(struct cmdq_pkt *pkt) -{ - return -EINVAL; -} - #endif /* IS_ENABLED(CONFIG_MTK_CMDQ) */ #endif /* __MTK_CMDQ_H__ */ -- 2.34.1