From patchwork Thu Jan 18 20:02:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 10174003 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CE05603B5 for ; Thu, 18 Jan 2018 20:04:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F28B2847D for ; Thu, 18 Jan 2018 20:04:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53D5828484; Thu, 18 Jan 2018 20:04:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA5102847D for ; Thu, 18 Jan 2018 20:04:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755141AbeARUER (ORCPT ); Thu, 18 Jan 2018 15:04:17 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:38066 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754318AbeARUEP (ORCPT ); Thu, 18 Jan 2018 15:04:15 -0500 Received: by mail-wr0-f195.google.com with SMTP id x1so19675935wrb.5; Thu, 18 Jan 2018 12:04:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=VAKLmh7vj0IbFH5dMTWqe6zaAIp9M3l1XR/SnNiGdVQ=; b=JUz7UsATQMdKfrrrTGxz405/oEnURZHoKXkqgLMpuNkjHODbO281sVAfnfRA0zUdoo utrCsM1JYuLIb8SepFjOvY7wl8UhmEeGAO9HYW38xT0o27EsWQBiDtUXgmj8v/YXEWM1 qAnemAUS0xrUmyUQkLxJ0cUImZsxqC9k6chjve+uxtIwi63lS3ARWx8RJ5GTghlpcRm6 cpKu1zmPAE9zWsLgiSTDKFSVf4HW5VyZURuXm+FU0AUH36fsq6iimDS2KPpz4RvqvRW5 eXW9urpHsj6/QehgP9siO9KEn7wwVWxgIXNVT4xK7YK7MzBjr5TG7x05JNF69WQWHaZh 0o+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VAKLmh7vj0IbFH5dMTWqe6zaAIp9M3l1XR/SnNiGdVQ=; b=XxmFfW/im6Bf7KIk8tXVnnpPa62v/kGG5SJkGDo3N8lPcmTRTIjfAr29t2XhcMeqay qrJtBR1Lwv6zAmpe4Ji5p2iZfKZ2kWaA8Jo2uaKfIhLez/UXSPi80gtgtSAIRHYOd+Xw abNcxZnji+9y/0mVvuLjTuqogZqSrZzTDEsABIYvw5yXq0I0o5l4quHyyOIYf5/nGBPB SyJtUHDtcrdKKBG8XrOioZqAqtgBaNz1dsvwM1dtUrOEaEj1iqcGXIClqOj70R9jUMmG oG6qolCz9wQTKXFU95yeWcaoCwycGJmxnB6uRZjuMrZA/9G+heO6x9Z4flRHTleJUU6J 8E2A== X-Gm-Message-State: AKwxytfOhZhoUyq5WRC6AAhjrY0NnjrhQM14LHEaMRqzMftA5+yNgu4o I7AnWN6ZzYlOFxpKTKNJJ6M= X-Google-Smtp-Source: ACJfBos4COGv1ufAkud1AMUPgqSov/DJABSy98lXxe/fHGTAK2ywC3a2Bp+UyOOuqkLwfoRSYPytsw== X-Received: by 10.223.134.85 with SMTP id 21mr7777995wrw.283.1516305853647; Thu, 18 Jan 2018 12:04:13 -0800 (PST) Received: from Red.local (LFbn-MAR-1-494-174.w2-15.abo.wanadoo.fr. [2.15.82.174]) by smtp.googlemail.com with ESMTPSA id v17sm5150872wrd.57.2018.01.18.12.04.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 12:04:13 -0800 (PST) From: Corentin Labbe To: rjw@rjwysocki.net, viresh.kumar@linaro.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Corentin Labbe Subject: [PATCH] cpufreq: remove at32ap-cpufreq Date: Thu, 18 Jan 2018 21:02:02 +0100 Message-Id: <20180118200202.11883-1-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.6 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since AVR32 arch was removed, at32ap-cpufreq is useless. Remove this driver. Signed-off-by: Corentin Labbe Acked-by: Viresh Kumar --- drivers/cpufreq/Kconfig | 10 --- drivers/cpufreq/Makefile | 1 - drivers/cpufreq/at32ap-cpufreq.c | 127 --------------------------------------- 3 files changed, 138 deletions(-) delete mode 100644 drivers/cpufreq/at32ap-cpufreq.c diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index d8addbce40bc..608af20a3494 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -239,16 +239,6 @@ if PPC32 || PPC64 source "drivers/cpufreq/Kconfig.powerpc" endif -if AVR32 -config AVR32_AT32AP_CPUFREQ - bool "CPU frequency driver for AT32AP" - depends on PLATFORM_AT32AP - default n - help - This enables the CPU frequency driver for AT32AP processors. - If in doubt, say N. -endif - if IA64 config IA64_ACPI_CPUFREQ tristate "ACPI Processor P-States driver" diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile index e07715ce8844..c60c1e141d9d 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -100,7 +100,6 @@ obj-$(CONFIG_POWERNV_CPUFREQ) += powernv-cpufreq.o ################################################################################## # Other platform drivers -obj-$(CONFIG_AVR32_AT32AP_CPUFREQ) += at32ap-cpufreq.o obj-$(CONFIG_BFIN_CPU_FREQ) += blackfin-cpufreq.o obj-$(CONFIG_BMIPS_CPUFREQ) += bmips-cpufreq.o obj-$(CONFIG_CRIS_MACH_ARTPEC3) += cris-artpec3-cpufreq.o diff --git a/drivers/cpufreq/at32ap-cpufreq.c b/drivers/cpufreq/at32ap-cpufreq.c deleted file mode 100644 index 7b612c8bb09e..000000000000 --- a/drivers/cpufreq/at32ap-cpufreq.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (C) 2004-2007 Atmel Corporation - * - * Based on MIPS implementation arch/mips/kernel/time.c - * Copyright 2001 MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ - -/*#define DEBUG*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static struct cpufreq_frequency_table *freq_table; - -static unsigned int ref_freq; -static unsigned long loops_per_jiffy_ref; - -static int at32_set_target(struct cpufreq_policy *policy, unsigned int index) -{ - unsigned int old_freq, new_freq; - - old_freq = policy->cur; - new_freq = freq_table[index].frequency; - - if (!ref_freq) { - ref_freq = old_freq; - loops_per_jiffy_ref = boot_cpu_data.loops_per_jiffy; - } - - if (old_freq < new_freq) - boot_cpu_data.loops_per_jiffy = cpufreq_scale( - loops_per_jiffy_ref, ref_freq, new_freq); - clk_set_rate(policy->clk, new_freq * 1000); - if (new_freq < old_freq) - boot_cpu_data.loops_per_jiffy = cpufreq_scale( - loops_per_jiffy_ref, ref_freq, new_freq); - - return 0; -} - -static int at32_cpufreq_driver_init(struct cpufreq_policy *policy) -{ - unsigned int frequency, rate, min_freq; - struct clk *cpuclk; - int retval, steps, i; - - if (policy->cpu != 0) - return -EINVAL; - - cpuclk = clk_get(NULL, "cpu"); - if (IS_ERR(cpuclk)) { - pr_debug("cpufreq: could not get CPU clk\n"); - retval = PTR_ERR(cpuclk); - goto out_err; - } - - min_freq = (clk_round_rate(cpuclk, 1) + 500) / 1000; - frequency = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; - policy->cpuinfo.transition_latency = 0; - - /* - * AVR32 CPU frequency rate scales in power of two between maximum and - * minimum, also add space for the table end marker. - * - * Further validate that the frequency is usable, and append it to the - * frequency table. - */ - steps = fls(frequency / min_freq) + 1; - freq_table = kzalloc(steps * sizeof(struct cpufreq_frequency_table), - GFP_KERNEL); - if (!freq_table) { - retval = -ENOMEM; - goto out_err_put_clk; - } - - for (i = 0; i < (steps - 1); i++) { - rate = clk_round_rate(cpuclk, frequency * 1000) / 1000; - - if (rate != frequency) - freq_table[i].frequency = CPUFREQ_ENTRY_INVALID; - else - freq_table[i].frequency = frequency; - - frequency /= 2; - } - - policy->clk = cpuclk; - freq_table[steps - 1].frequency = CPUFREQ_TABLE_END; - - retval = cpufreq_table_validate_and_show(policy, freq_table); - if (!retval) { - printk("cpufreq: AT32AP CPU frequency driver\n"); - return 0; - } - - kfree(freq_table); -out_err_put_clk: - clk_put(cpuclk); -out_err: - return retval; -} - -static struct cpufreq_driver at32_driver = { - .name = "at32ap", - .init = at32_cpufreq_driver_init, - .verify = cpufreq_generic_frequency_table_verify, - .target_index = at32_set_target, - .get = cpufreq_generic_get, - .flags = CPUFREQ_STICKY, -}; - -static int __init at32_cpufreq_init(void) -{ - return cpufreq_register_driver(&at32_driver); -} -late_initcall(at32_cpufreq_init);