Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp2043465pxb; Mon, 13 Sep 2021 10:40:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOcrszlXLx2yfyPwQpE3AsgsLIQi1Uc93yddFddem/eRxOTIGhU2ogdvDB8HI2I2h9kBOL X-Received: by 2002:a17:907:628d:: with SMTP id nd13mr14241358ejc.7.1631554847534; Mon, 13 Sep 2021 10:40:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631554847; cv=none; d=google.com; s=arc-20160816; b=Gs9efVN4s1cAw0Z9FpCMpFI0yo0C83SCnnlq5vNv2N5EGF7TeAlFwoO4wY/DVfR39x snbSaK3JiTsCeGVC07a7EtE2UrrovmZS2yZET8zdjNpnwdNHZnn4vrOLwUou2wNSM7zv dkL0Y7sLhssQCY7l18il1smQJ2qWiJsTlaXxKOPbFiWwhCfARwZG4tvRuASp594PbGsB etDPu8pnIGyUTcPcZMZbyVfySYe3KvXnow5jKiGaI3s4GPbG0YmCIIGyYWfalel8/2Yh +RdGwBxBq9M+U5krhfnUjvfxMS/fTOJQ+TYwRqEjmj3lUzqNBOmH3GP/REUJ5AokJQ2o 2dsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=bCRVoVEL9wrrwAfPUVosh58KUSpx97lTsdWTBl0PSTw=; b=asRbP156AA3dgvNAT9iqkQ2+8EEcakxGgKjGjfR34/bQ0Fy+2GTm2vAQE+KDjJ+bMl 32HEe2YTfjvmTnai2MJzB8QtysOBF193E6XzO5nLwjCUvGnwcsd1jFmHBrs8y4cPbmFj Jkcei2znVsR+i9+ktq8gXA3qKfTPonhScgewt/hIrKaUyT0MP/0xxWDDPZ+Hv8qwak/c glgjHts/ltYdHjK7ko0fb1PqVU5psxb4Ek+vVoNTSUZ++av6nrhnv3Us64KkIfT/dZoR fihZB+b1bY1sx5YhQOGOhe9yGKmt0mnhTB3Pr2JRW/+vS2+0kCp1T984vbIyV0mhuBG/ SYFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si9509771edu.306.2021.09.13.10.40.23; Mon, 13 Sep 2021 10:40:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343845AbhIMRj7 (ORCPT + 99 others); Mon, 13 Sep 2021 13:39:59 -0400 Received: from inva020.nxp.com ([92.121.34.13]:43904 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244910AbhIMRjt (ORCPT ); Mon, 13 Sep 2021 13:39:49 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 101E11A0396; Mon, 13 Sep 2021 19:38:32 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0261E1A0393; Mon, 13 Sep 2021 19:38:32 +0200 (CEST) Received: from fsr-ub1664-175.ea.freescale.net (fsr-ub1664-175.ea.freescale.net [10.171.82.40]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 34AC320363; Mon, 13 Sep 2021 19:38:31 +0200 (CEST) From: Abel Vesa To: Rob Herring , Dong Aisheng , Shawn Guo , Sascha Hauer , Fabio Estevam , "catalin.marinas@arm.com" , Will Deacon , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Georgi Djakov , Adrian Hunter , Ulf Hansson , Ahmad Fatoum Cc: Pengutronix Kernel Team , linux-serial@vger.kernel.org, NXP Linux Team , Linux Kernel Mailing List , devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Abel Vesa Subject: [RFC 11/19] interconnect: imx: Add imx_icc_get_bw and imx_icc_aggregate functions Date: Mon, 13 Sep 2021 20:38:06 +0300 Message-Id: <1631554694-9599-12-git-send-email-abel.vesa@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> References: <1631554694-9599-1-git-send-email-abel.vesa@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The aggregate function will return whatever is the highest rate for that specific node. The imx_icc_get_bw sets the initial avg and peak to 0 in order to avoid setting them to INT_MAX by the interconnect core. Signed-off-by: Abel Vesa --- drivers/interconnect/imx/imx.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/interconnect/imx/imx.c b/drivers/interconnect/imx/imx.c index db048df80011..5cc1ce55406c 100644 --- a/drivers/interconnect/imx/imx.c +++ b/drivers/interconnect/imx/imx.c @@ -25,6 +25,23 @@ struct imx_icc_node { struct dev_pm_qos_request qos_req; }; +static int imx_icc_get_bw(struct icc_node *node, u32 *avg, u32 *peak) +{ + *avg = 0; + *peak = 0; + + return 0; +} + +static int imx_icc_aggregate(struct icc_node *node, u32 tag, u32 avg_bw, + u32 peak_bw, u32 *agg_avg, u32 *agg_peak) +{ + *agg_avg = max(*agg_avg, avg_bw); + *agg_peak = max(*agg_peak, peak_bw); + + return 0; +} + static int imx_icc_node_set(struct icc_node *node) { struct device *dev = node->provider->dev; @@ -233,7 +250,8 @@ int imx_icc_register(struct platform_device *pdev, if (!provider) return -ENOMEM; provider->set = imx_icc_set; - provider->aggregate = icc_std_aggregate; + provider->get_bw = imx_icc_get_bw; + provider->aggregate = imx_icc_aggregate; provider->xlate = of_icc_xlate_onecell; provider->data = data; provider->dev = dev; -- 2.31.1