hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/cpufreq/s3c24xx-cpufreq.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2006-2008 Simtec Electronics
34 * http://armlinux.simtec.co.uk/
45 * Ben Dooks <ben@simtec.co.uk>
56 *
67 * S3C24XX CPU Frequency scaling
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License version 2 as
10
- * published by the Free Software Foundation.
118 */
129
1310 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -24,17 +21,13 @@
2421 #include <linux/device.h>
2522 #include <linux/sysfs.h>
2623 #include <linux/slab.h>
24
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
25
+#include <linux/soc/samsung/s3c-pm.h>
2726
2827 #include <asm/mach/arch.h>
2928 #include <asm/mach/map.h>
3029
31
-#include <plat/cpu.h>
32
-#include <plat/cpu-freq-core.h>
33
-
34
-#include <mach/regs-clock.h>
35
-
3630 /* note, cpufreq support deals in kHz, no Hz */
37
-
3831 static struct cpufreq_driver s3c24xx_driver;
3932 static struct s3c_cpufreq_config cpu_cur;
4033 static struct s3c_iotimings s3c24xx_iotiming;
....@@ -71,7 +64,7 @@
7164 cfg->freq.pclk = pclk = clk_get_rate(clk_pclk);
7265 cfg->freq.armclk = armclk = clk_get_rate(clk_arm);
7366
74
- cfg->pll.driver_data = __raw_readl(S3C2410_MPLLCON);
67
+ cfg->pll.driver_data = s3c24xx_read_mpllcon();
7568 cfg->pll.frequency = fclk;
7669
7770 cfg->freq.hclk_tns = 1000000000 / (cfg->freq.hclk / 10);
....@@ -389,7 +382,7 @@
389382 static int s3c_cpufreq_suspend(struct cpufreq_policy *policy)
390383 {
391384 suspend_pll.frequency = clk_get_rate(_clk_mpll);
392
- suspend_pll.driver_data = __raw_readl(S3C2410_MPLLCON);
385
+ suspend_pll.driver_data = s3c24xx_read_mpllcon();
393386 suspend_freq = clk_get_rate(clk_arm);
394387
395388 return 0;
....@@ -550,7 +543,7 @@
550543 val |= calc_locktime(rate, cpu_cur.info->locktime_m);
551544
552545 pr_info("%s: new locktime is 0x%08x\n", __func__, val);
553
- __raw_writel(val, S3C2410_LOCKTIME);
546
+ s3c24xx_write_locktime(val);
554547 }
555548
556549 static int s3c_cpufreq_build_freq(void)