From patchwork Thu Feb 15 00:49:23 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: 201222 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:b825:b0:106:860b:bbdd with SMTP id da37csp95024dyb; Wed, 14 Feb 2024 17:11:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVxL+a8IAGNtyDyerp6V6PVBxBfPnbOgr59r1UbArlR3xL7a+LpKrAbycojyf4x/f98SKmyfBOx9Ujb198WiBrVPH+MXA== X-Google-Smtp-Source: AGHT+IFIXIGupY4npRXio85VKAyv8N9zjpIaibpiRJGzsO+4ceXtdnZhqHx+tmF0M3SQVWsHx/8B X-Received: by 2002:a17:902:d4c1:b0:1da:232:df37 with SMTP id o1-20020a170902d4c100b001da0232df37mr439661plg.36.1707959502109; Wed, 14 Feb 2024 17:11:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707959502; cv=pass; d=google.com; s=arc-20160816; b=ZDolHuQDeg9ChA8fymDViM/kpql7sHNygYWoRb7MSZQOsXzZC+rSLO4zJyL2mY+9eb AVshkNSENxtcdQEJDIrsMXyheOww8SQwtwce2igjOocRc3ZTcE61grgsQACZifGIC5Iq iZliB9OeCBep1u2JBge2vG+PUaOMacRCLe4MyzvUu8jng77g7Kl34nglPAhcgm1Ey1d4 RFJqblaqjrt4iMBqq66S965bq6dE6L8XEZY9Ay0VI+eKnepK0GjD//LFqlipoku43dJg N7hyAGLZvGAPNsVTj+dN0mcd/dWjdZPTRZTxo9Yf7anUfLyvm8tkjcczx6zWtwMSdRdP mm+Q== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66196-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lw16-20020a1709032ad000b001db45a4224dsi117718plb.601.2024.02.14.17.11.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 17:11:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-66196-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-66196-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 04D35B27B19 for ; Thu, 15 Feb 2024 00:50:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B8174A07; Thu, 15 Feb 2024 00:50:07 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790925342711789712 X-GMAIL-MSGID: 1790925342711789712 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__ */