From patchwork Thu Oct 10 20:30:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 175877 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2818868ill; Thu, 10 Oct 2019 13:54:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyTC75ruikKXTmIMSHkEORT66I3wUXptg0camCgk0jITkGfj4p5aj5bue2cd31HE16jx7Me X-Received: by 2002:a17:906:7fd3:: with SMTP id r19mr10366236ejs.46.1570740840661; Thu, 10 Oct 2019 13:54:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570740840; cv=none; d=google.com; s=arc-20160816; b=yK+S7MNpVW7ikEb6/9wTEmTEya5pvebT+i24t+W1yNYGVJoNBMaZrwyrtj1pEwinN7 FMNZ5o3MGz9x2SvxqgogR4d9c4stR1Wn6+gyn9sch72cez/wvXSXYRlROm/yllARbW+8 RqTp6WPQqsKCgvFTAsRZCi2BVubdRq3y0WttVjLZ2pL35EiAL/PUJ1F8Ejzuq11UlgFZ xXP25PuCzI5ICVzLabW4KasuGUBoq1InRR52g3YCa6EVmORJwKrAy6R6vs+u+tI7LvZn 0i/HjnpdrmGUXQ3pyp059JE+vUzrUajdkBX01edRl7qQzaP6hYnfx79HpEOqGfQgIX0m jpKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=20dfKuBngVf8VVRJcdsYhV33NNh1dVNL5Y+rVoCMzpI=; b=XzKS84X98H4QyKcIdj1V3iVMmCClme8VZhzQoHRaw0cywRPHIItPNIK4SsUmWFPx77 orvGxDMqlpBZwbVe6Rhd8r04rSfqvH0QY9yGILA6r8YRcugcN7HItgpOwkimSMvAL2kR 9LbAFtDKzQG0PNrAVuxPqnHAESSn6vP0vAh43s21lmZzOAXb44jBWYcxFlS44N/B1NUQ iVqQCLzSJ0bDUnQpyt5ot+fOif2szDtmkZfQy1+LYPnRkzTvDlB400JcgkneMdKv/TH9 EopB3CkiE0g+fakjscB8kulgbIt4UkTTVObnoGKXlCRyXauEY/bb6177uu5VIw/RSo4j 5d5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a30si4630828eda.39.2019.10.10.13.54.00; Thu, 10 Oct 2019 13:54:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726935AbfJJUyA (ORCPT + 3 others); Thu, 10 Oct 2019 16:54:00 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:56517 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbfJJUyA (ORCPT ); Thu, 10 Oct 2019 16:54:00 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MHmuE-1iLR8L2rMU-00EtUy; Thu, 10 Oct 2019 22:53:51 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , "Rafael J. Wysocki" , Viresh Kumar Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.walleij@linaro.org, Arnd Bergmann , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 31/36] ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh Date: Thu, 10 Oct 2019 22:30:15 +0200 Message-Id: <20191010203043.1241612-31-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Fqr+3CFSJ3z4nTjJP8VvOYDnXO9EX8g1sytJseiBmwVd5rPpq97 9sruTvvZ87o0fdD7Cb5YJZoyiUwUQ2d20fjsnrZ2/ti0eYbj94X/VXq060K27XIYEuUjcn6 evrUWDq66oQbd8FaGR7d/8oiFeD55KCF/Nb9Hvd7zZcx9COJsqf+8pLR+bTu3F/RE4wig8M bL1N+gwAQac2r4xR8sQsw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:I4aXG3I2BlQ=:WzAJmAR6TpeAp6EuftPE/X G3vu9wKCdQh+X+DtHXLsSX9uM+cjh88bct9q5yhn5vuuMLMgdE3sLrpUc/JVj/kRZdRCP8SO0 ZKXiJ7MO0FqsYjgjjlsh1L+JaI+qp/FLi53fjDEWQBGWcI75qofK/YGNBjIqUMj57RMNGRnqN 7+rn+u6/IOwjeqta8QTy2XB12OibL1hQ0MzblW5y19TTqC6vR/w7yGbDVFmDFUEE264k7yMlH Dm11HWnMYWAL92rFyR3nPFm/mK7mpFGRq2qHeLBvlLUOmC+KS3SQgfhU17mmDtXWvr1X0Ea3L IuHcsi9nNRVRC9Bg65Ry9nPskAhZi+id0hJNMsVAjYgPICbS1OZgDbH3viSZYTrEy4G5OY1L+ kqNU7mMyDuNyC45HX3xIvfpNr3dM/87I/bRDa5cBnc10UwXI0wTMP2tOG8xcFVNptjWqsc/ps IdlQAV8J37riuHqYb4ZrqyE5uNyfazEn/z0CPNZnDc6drOWgTdw2bbXaSlhm4b70tQKBYfFkx 4KmdS2rSSE7w8a7mVNf6SiCDQNLHA9GPf9aqPCsIJdB5PsDOddoIRC6cc96yITIBuMKLfwqO4 3+WhQudP1iFmGo/CA3TgHH2YzP2hpmpYXy1QMX/RNVBvKgdmNyEiR/yGX1Nal/tMrpLfYMa3Q EDHGD9KLQ/akRINDWbJga9ZSoU4ksWC1BPTk7i7Y2uTvWEmJYMJJAbEMFFucUm6VVV92+bJoj /0fntlkd9YT6tdXyEcBZrbBzOI+sg7spN+zTq8+Kf24a/8k5J0Gzke7kPc+ASlnwsWwnYBM7Z zDcq+Bu2brWvxhzIOAxKtUI1GD47uapI1T0wZxEldPhUU2yWT00FBQMklj84IehO5EzwKQ7BY wi5YZxTT79iCz0e2t4sw== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org There are two identical copies of the s3c2412_cpufreq_setrefresh function: a static one in the cpufreq driver and a global version in iotiming-s3c2412.c. As the function requires the use of a hardcoded register address from a header that we want to not be visible to drivers, just move the existing global function and add a declaration in one of the cpufreq header files. Signed-off-by: Arnd Bergmann --- drivers/cpufreq/s3c2412-cpufreq.c | 23 -------------------- include/linux/soc/samsung/s3c-cpufreq-core.h | 1 + 2 files changed, 1 insertion(+), 23 deletions(-) -- 2.20.0 diff --git a/drivers/cpufreq/s3c2412-cpufreq.c b/drivers/cpufreq/s3c2412-cpufreq.c index 38dc9e6db633..a77c63e92e1a 100644 --- a/drivers/cpufreq/s3c2412-cpufreq.c +++ b/drivers/cpufreq/s3c2412-cpufreq.c @@ -25,8 +25,6 @@ #include #include -#include - #include #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR) @@ -156,27 +154,6 @@ static void s3c2412_cpufreq_setdivs(struct s3c_cpufreq_config *cfg) clk_set_parent(armclk, cfg->divs.dvs ? hclk : fclk); } -static void s3c2412_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg) -{ - struct s3c_cpufreq_board *board = cfg->board; - unsigned long refresh; - - s3c_freq_dbg("%s: refresh %u ns, hclk %lu\n", __func__, - board->refresh, cfg->freq.hclk); - - /* Reduce both the refresh time (in ns) and the frequency (in MHz) - * by 10 each to ensure that we do not overflow 32 bit numbers. This - * should work for HCLK up to 133MHz and refresh period up to 30usec. - */ - - refresh = (board->refresh / 10); - refresh *= (cfg->freq.hclk / 100); - refresh /= (1 * 1000 * 1000); /* 10^6 */ - - s3c_freq_dbg("%s: setting refresh 0x%08lx\n", __func__, refresh); - __raw_writel(refresh, S3C2412_REFRESH); -} - /* set the default cpu frequency information, based on an 200MHz part * as we have no other way of detecting the speed rating in software. */ diff --git a/include/linux/soc/samsung/s3c-cpufreq-core.h b/include/linux/soc/samsung/s3c-cpufreq-core.h index 4d22be1031b9..eca942559014 100644 --- a/include/linux/soc/samsung/s3c-cpufreq-core.h +++ b/include/linux/soc/samsung/s3c-cpufreq-core.h @@ -246,6 +246,7 @@ extern int s3c2412_iotiming_calc(struct s3c_cpufreq_config *cfg, extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg, struct s3c_iotimings *iot); +extern void s3c2412_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg); #else #define s3c2412_iotiming_debugfs NULL #define s3c2412_iotiming_calc NULL