From patchwork Fri Oct 21 15:49:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 6810 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp779145wrr; Fri, 21 Oct 2022 09:06:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6SFfHxOKA7ZdMadF4nyqaUmkS8YEkEK9EEza2UZ+akq+6BO1jBpTIeUCYjAaOapH9sATn+ X-Received: by 2002:a17:907:2bdb:b0:78d:cf5a:210e with SMTP id gv27-20020a1709072bdb00b0078dcf5a210emr16238205ejc.747.1666368417234; Fri, 21 Oct 2022 09:06:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666368417; cv=none; d=google.com; s=arc-20160816; b=xptevqnfLEKEmfrn4Z0xRcYJRazAvbNuyNKHc1EJ0POfw45dUNALCq7sq08f6KN1Tv e4ggZ4qPuTvvjjriFmc60SFXh6PiaW3HIJBa2UtH3cj82ZBr7G2EdapE4LckVho6KSIq zue+INywwVhNn3oW2btO4FyhYWs+vTGDmb3mGNmxhrg8dLWKH8le17CLcUAq7B0EgVCv m6prJNjqi7F4UwfFyiPDmpxUpfo2Peupil2BJ6lmjzI41nKipxYsXgxffbfMhbmA5F6m ZrSPk73BXBTV2LuOgkjFqzOpps/QfeWACERe4gui1zsM6WWwJP4lkX3vO55SnrzMCAC9 RXFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aGyBQMNcpBCQ2ilzSzjCmWM8mQyFZB2QCGAnRLN5Ey8=; b=V5HC8EMVEo7o/K4qXHPYxiVOd3k+jKM/ZrN5EirVXayz9wYYNZ7io4hu9FS32gSKsG 0jBTaTvlychbEDXNVE4x+oSXW7+5slQD+ds8QimKVVjhpTJH9cCLepu89SkDqiv2C7z9 egPjXtDaYBpmQStxXpiL+AeWbX8oUjMpPt2dyGOKsEkKyTfVR+C+H1rHRdw23LX6o8qT 2JgyWQZaNso1Zne4kAkaSVQNTkr64pDcJIAfapWYVbxx99mUja37avNuxXlgZIpFGnZN 0haegumHxhZCDcIEH5hd00jvhoJkJLQ60E2qRplMVCQg+xfJwgVkuccEJZxsAl2Plp/g cMpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=drcj45CM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a50eac2000000b004513a465ec6si18713842edp.94.2022.10.21.09.06.27; Fri, 21 Oct 2022 09:06:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=drcj45CM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230078AbiJUPzJ (ORCPT + 99 others); Fri, 21 Oct 2022 11:55:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbiJUPzF (ORCPT ); Fri, 21 Oct 2022 11:55:05 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF3FCBE532; Fri, 21 Oct 2022 08:54:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6C60361F0B; Fri, 21 Oct 2022 15:54:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD80EC433B5; Fri, 21 Oct 2022 15:54:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666367684; bh=GmW53LJo22UqZsQom5RVQJUjOo34/GKH+2iN7vYTsKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=drcj45CMGOdbT6gQ7oc6iW0maJ/F4A7aDDG3q8CMEUhMj6kHZJ9TzcuZBMSDTN47W /54pExNenZQ0rlYMSkbga6w/tEfFQKMteBBLKQ8IgUBT1dklhQWW3E9v6R512FZsyE GWCAW56Tc0yN6RZcsY/UIsSP1QyAtGPO4aG5U4Lqee4KTUpkaMVDIfcTsofxqBaKR8 s47f0CnF7bAqcFO+XjQ2+B56unnlcrnE7L1H8LYHTPY1DuTj+NeW+5zHYC6NCP826O PxvCwATnD5UsQq29ILBSrcboSsjitMId+xf5CN+5FDgqG8nUeSNvgxo8qPOZizDCJa MExojCoKO5byQ== From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org, Russell King , Linus Walleij , Lubomir Rintel , "Rafael J. Wysocki" , Viresh Kumar Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , linux-pm@vger.kernel.org Subject: [PATCH 04/11] ARM: sa1100: make cpufreq driver build standalone Date: Fri, 21 Oct 2022 17:49:34 +0200 Message-Id: <20221021155000.4108406-5-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20221021155000.4108406-1-arnd@kernel.org> References: <20221021155000.4108406-1-arnd@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747313929477836865?= X-GMAIL-MSGID: =?utf-8?q?1747313929477836865?= From: Arnd Bergmann Commit 59a2e613d07f ("cpufreq: sa11x0: move cpufreq driver to drivers/cpufreq") added an unnecessary reference to mach/generic.h. Just remove it again after moving the code into the corresponding driver. Signed-off-by: Arnd Bergmann Acked-by: Viresh Kumar --- arch/arm/mach-sa1100/generic.c | 32 --------------------- arch/arm/mach-sa1100/generic.h | 4 --- arch/arm/mach-sa1100/include/mach/generic.h | 1 - drivers/cpufreq/sa1110-cpufreq.c | 32 +++++++++++++++++++++ 4 files changed, 32 insertions(+), 37 deletions(-) delete mode 100644 arch/arm/mach-sa1100/include/mach/generic.h diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 6c21f214cd60..424f08eece20 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c @@ -39,38 +39,6 @@ #include "generic.h" #include -#define NR_FREQS 16 - -/* - * This table is setup for a 3.6864MHz Crystal. - */ -struct cpufreq_frequency_table sa11x0_freq_table[NR_FREQS+1] = { - { .frequency = 59000, /* 59.0 MHz */}, - { .frequency = 73700, /* 73.7 MHz */}, - { .frequency = 88500, /* 88.5 MHz */}, - { .frequency = 103200, /* 103.2 MHz */}, - { .frequency = 118000, /* 118.0 MHz */}, - { .frequency = 132700, /* 132.7 MHz */}, - { .frequency = 147500, /* 147.5 MHz */}, - { .frequency = 162200, /* 162.2 MHz */}, - { .frequency = 176900, /* 176.9 MHz */}, - { .frequency = 191700, /* 191.7 MHz */}, - { .frequency = 206400, /* 206.4 MHz */}, - { .frequency = 221200, /* 221.2 MHz */}, - { .frequency = 235900, /* 235.9 MHz */}, - { .frequency = 250700, /* 250.7 MHz */}, - { .frequency = 265400, /* 265.4 MHz */}, - { .frequency = 280200, /* 280.2 MHz */}, - { .frequency = CPUFREQ_TABLE_END, }, -}; - -unsigned int sa11x0_getspeed(unsigned int cpu) -{ - if (cpu) - return 0; - return sa11x0_freq_table[PPCR & 0xf].frequency; -} - /* * Default power-off for SA1100 */ diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h index 158a4fd5ca24..cc891c57d306 100644 --- a/arch/arm/mach-sa1100/generic.h +++ b/arch/arm/mach-sa1100/generic.h @@ -4,7 +4,6 @@ * * Author: Nicolas Pitre */ -#include #include extern void sa1100_timer_init(void); @@ -21,9 +20,6 @@ extern void sa11x0_init_late(void); extern void sa1110_mb_enable(void); extern void sa1110_mb_disable(void); -extern struct cpufreq_frequency_table sa11x0_freq_table[]; -extern unsigned int sa11x0_getspeed(unsigned int cpu); - struct flash_platform_data; struct resource; diff --git a/arch/arm/mach-sa1100/include/mach/generic.h b/arch/arm/mach-sa1100/include/mach/generic.h deleted file mode 100644 index 665542e0c9e2..000000000000 --- a/arch/arm/mach-sa1100/include/mach/generic.h +++ /dev/null @@ -1 +0,0 @@ -#include "../../generic.h" diff --git a/drivers/cpufreq/sa1110-cpufreq.c b/drivers/cpufreq/sa1110-cpufreq.c index bb7f591a8b05..ce636c1147a6 100644 --- a/drivers/cpufreq/sa1110-cpufreq.c +++ b/drivers/cpufreq/sa1110-cpufreq.c @@ -29,6 +29,38 @@ #undef DEBUG +#define NR_FREQS 16 + +/* + * This table is setup for a 3.6864MHz Crystal. + */ +static struct cpufreq_frequency_table sa11x0_freq_table[NR_FREQS+1] = { + { .frequency = 59000, /* 59.0 MHz */}, + { .frequency = 73700, /* 73.7 MHz */}, + { .frequency = 88500, /* 88.5 MHz */}, + { .frequency = 103200, /* 103.2 MHz */}, + { .frequency = 118000, /* 118.0 MHz */}, + { .frequency = 132700, /* 132.7 MHz */}, + { .frequency = 147500, /* 147.5 MHz */}, + { .frequency = 162200, /* 162.2 MHz */}, + { .frequency = 176900, /* 176.9 MHz */}, + { .frequency = 191700, /* 191.7 MHz */}, + { .frequency = 206400, /* 206.4 MHz */}, + { .frequency = 221200, /* 221.2 MHz */}, + { .frequency = 235900, /* 235.9 MHz */}, + { .frequency = 250700, /* 250.7 MHz */}, + { .frequency = 265400, /* 265.4 MHz */}, + { .frequency = 280200, /* 280.2 MHz */}, + { .frequency = CPUFREQ_TABLE_END, }, +}; + +static unsigned int sa11x0_getspeed(unsigned int cpu) +{ + if (cpu) + return 0; + return sa11x0_freq_table[PPCR & 0xf].frequency; +} + struct sdram_params { const char name[20]; u_char rows; /* bits */