Commit c38758e3 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Krzysztof Kozlowski
Browse files

cpufreq: s3c24xx: move low-level clk reg access into platform code



Rather than have the cpufreq drivers touch include the
common headers to get the constants, add a small indirection.
This is still not the proper way that would do this through
the common clk API, but it lets us kill off the header file
usage.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/r/20200806182059.2431-37-krzk@kernel.org


[krzk: Rebase and fix -Wold-style-definition]
Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parent 44c01f5c
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -132,13 +132,6 @@ config S3C2410_IOTIMING
	  Internal node to select io timing code that is common to the s3c2410
	  and s3c2440/s3c2442 cpu frequency support.

config S3C2410_CPUFREQ_UTILS
       bool
       depends on ARM_S3C24XX_CPUFREQ
       help
         Internal node to select timing code that is common to the s3c2410
         and s3c2440/s3c244 cpu frequency support.

# cpu frequency support common to s3c2412, s3c2413 and s3c2442

config S3C2412_IOTIMING
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ obj-$(CONFIG_PM_SLEEP) += irq-pm.o sleep.o

# common code

obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += cpufreq-utils.o
obj-$(CONFIG_ARM_S3C24XX_CPUFREQ) += cpufreq-utils.o

obj-$(CONFIG_S3C2410_IOTIMING)	+= iotiming-s3c2410.o
obj-$(CONFIG_S3C2412_IOTIMING)	+= iotiming-s3c2412.o
+32 −0
Original line number Diff line number Diff line
@@ -60,3 +60,35 @@ void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg)
	if (!IS_ERR(cfg->mpll))
		clk_set_rate(cfg->mpll, cfg->pll.frequency);
}

#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442)
u32 s3c2440_read_camdivn(void)
{
	return __raw_readl(S3C2440_CAMDIVN);
}

void s3c2440_write_camdivn(u32 camdiv)
{
	__raw_writel(camdiv, S3C2440_CAMDIVN);
}
#endif

u32 s3c24xx_read_clkdivn(void)
{
	return __raw_readl(S3C2410_CLKDIVN);
}

void s3c24xx_write_clkdivn(u32 clkdiv)
{
	__raw_writel(clkdiv, S3C2410_CLKDIVN);
}

u32 s3c24xx_read_mpllcon(void)
{
	return __raw_readl(S3C2410_MPLLCON);
}

void s3c24xx_write_locktime(u32 locktime)
{
	return __raw_writel(locktime, S3C2410_LOCKTIME);
}
+0 −2
Original line number Diff line number Diff line
@@ -196,7 +196,6 @@ config ARM_S3C24XX_CPUFREQ_DEBUGFS
config ARM_S3C2410_CPUFREQ
	bool
	depends on ARM_S3C24XX_CPUFREQ && CPU_S3C2410
	select S3C2410_CPUFREQ_UTILS
	help
	  CPU Frequency scaling support for S3C2410

@@ -233,7 +232,6 @@ config ARM_S3C2416_CPUFREQ_VCORESCALE
config ARM_S3C2440_CPUFREQ
	bool "S3C2440/S3C2442 CPU Frequency scaling support"
	depends on ARM_S3C24XX_CPUFREQ && (CPU_S3C2440 || CPU_S3C2442)
	select S3C2410_CPUFREQ_UTILS
	default y
	help
	  CPU Frequency scaling support for S3C2440 and S3C2442 SoC CPUs.
+1 −7
Original line number Diff line number Diff line
@@ -22,12 +22,6 @@
#include <asm/mach/arch.h>
#include <asm/mach/map.h>

#include <mach/map.h>

#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)

#define S3C2410_CLKDIVN	    S3C2410_CLKREG(0x14)

#define S3C2410_CLKDIVN_PDIVN	     (1<<0)
#define S3C2410_CLKDIVN_HDIVN	     (1<<1)

@@ -43,7 +37,7 @@ static void s3c2410_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
	if (cfg->divs.p_divisor != cfg->divs.h_divisor)
		clkdiv |= S3C2410_CLKDIVN_PDIVN;

	__raw_writel(clkdiv, S3C2410_CLKDIVN);
	s3c24xx_write_clkdivn(clkdiv);
}

static int s3c2410_cpufreq_calcdivs(struct s3c_cpufreq_config *cfg)
Loading