aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2015-03-03 09:08:42 -0500
committerTero Kristo <t-kristo@ti.com>2015-06-02 05:31:29 -0400
commitd5a04dddf51e234dc89f21e4e4b91e853cf49ff2 (patch)
tree1ebd6aeac7d4e9da903691a5d7360849c3373ac9
parent9f37e90efaf0772b8f98bc347b9db77a3f0c27eb (diff)
clk: ti: omap2430: move clock support code under clock driver
With the legacy clock support gone, this is no longer needed under platform code-base. Thus, move this under the TI clock driver, and remove the exported API from the public header. Signed-off-by: Tero Kristo <t-kristo@ti.com>
-rw-r--r--arch/arm/mach-omap2/Makefile1
-rw-r--r--arch/arm/mach-omap2/clock2430.c57
-rw-r--r--drivers/clk/ti/clkt_iclk.c35
-rw-r--r--drivers/clk/ti/clock.h1
-rw-r--r--include/linux/clk/ti.h1
5 files changed, 36 insertions, 59 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 070526563698..695d58f81ff3 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -185,7 +185,6 @@ obj-$(CONFIG_ARCH_OMAP2) += $(clock-common)
185obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o 185obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpllcore.o
186obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o 186obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_virt_prcm_set.o
187obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o 187obj-$(CONFIG_ARCH_OMAP2) += clkt2xxx_dpll.o
188obj-$(CONFIG_SOC_OMAP2430) += clock2430.o
189obj-$(CONFIG_ARCH_OMAP3) += $(clock-common) 188obj-$(CONFIG_ARCH_OMAP3) += $(clock-common)
190obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o 189obj-$(CONFIG_ARCH_OMAP3) += clock34xx.o clkt34xx_dpll3m2.o
191obj-$(CONFIG_ARCH_OMAP3) += clock3517.o 190obj-$(CONFIG_ARCH_OMAP3) += clock3517.o
diff --git a/arch/arm/mach-omap2/clock2430.c b/arch/arm/mach-omap2/clock2430.c
deleted file mode 100644
index cef0c8d1de52..000000000000
--- a/arch/arm/mach-omap2/clock2430.c
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * clock2430.c - OMAP2430-specific clock integration code
3 *
4 * Copyright (C) 2005-2008 Texas Instruments, Inc.
5 * Copyright (C) 2004-2010 Nokia Corporation
6 *
7 * Contacts:
8 * Richard Woodruff <r-woodruff2@ti.com>
9 * Paul Walmsley
10 *
11 * Based on earlier work by Tuukka Tikkanen, Tony Lindgren,
12 * Gordon McNutt and RidgeRun, Inc.
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License version 2 as
16 * published by the Free Software Foundation.
17 */
18#undef DEBUG
19
20#include <linux/kernel.h>
21#include <linux/clk.h>
22#include <linux/io.h>
23
24#include "soc.h"
25#include "iomap.h"
26#include "clock.h"
27#include "clock2xxx.h"
28#include "cm2xxx.h"
29#include "cm-regbits-24xx.h"
30
31/**
32 * omap2430_clk_i2chs_find_idlest - return CM_IDLEST info for 2430 I2CHS
33 * @clk: struct clk * being enabled
34 * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into
35 * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into
36 * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator
37 *
38 * OMAP2430 I2CHS CM_IDLEST bits are in CM_IDLEST1_CORE, but the
39 * CM_*CLKEN bits are in CM_{I,F}CLKEN2_CORE. This custom function
40 * passes back the correct CM_IDLEST register address for I2CHS
41 * modules. No return value.
42 */
43static void omap2430_clk_i2chs_find_idlest(struct clk_hw_omap *clk,
44 void __iomem **idlest_reg,
45 u8 *idlest_bit,
46 u8 *idlest_val)
47{
48 *idlest_reg = OMAP2430_CM_REGADDR(CORE_MOD, CM_IDLEST);
49 *idlest_bit = clk->enable_bit;
50 *idlest_val = OMAP24XX_CM_IDLEST_VAL;
51}
52
53/* 2430 I2CHS has non-standard IDLEST register */
54const struct clk_hw_omap_ops clkhwops_omap2430_i2chs_wait = {
55 .find_idlest = omap2430_clk_i2chs_find_idlest,
56 .find_companion = omap2_clk_dflt_find_companion,
57};
diff --git a/drivers/clk/ti/clkt_iclk.c b/drivers/clk/ti/clkt_iclk.c
index a03919df00ef..38c36908cf88 100644
--- a/drivers/clk/ti/clkt_iclk.c
+++ b/drivers/clk/ti/clkt_iclk.c
@@ -18,8 +18,12 @@
18#include "clock.h" 18#include "clock.h"
19 19
20/* Register offsets */ 20/* Register offsets */
21#define OMAP24XX_CM_FCLKEN2 0x04
21#define CM_AUTOIDLE 0x30 22#define CM_AUTOIDLE 0x30
22#define CM_ICLKEN 0x10 23#define CM_ICLKEN 0x10
24#define CM_IDLEST 0x20
25
26#define OMAP24XX_CM_IDLEST_VAL 0
23 27
24/* Private functions */ 28/* Private functions */
25 29
@@ -51,6 +55,31 @@ void omap2_clkt_iclk_deny_idle(struct clk_hw_omap *clk)
51 ti_clk_ll_ops->clk_writel(v, r); 55 ti_clk_ll_ops->clk_writel(v, r);
52} 56}
53 57
58/**
59 * omap2430_clk_i2chs_find_idlest - return CM_IDLEST info for 2430 I2CHS
60 * @clk: struct clk * being enabled
61 * @idlest_reg: void __iomem ** to store CM_IDLEST reg address into
62 * @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into
63 * @idlest_val: pointer to a u8 to store the CM_IDLEST indicator
64 *
65 * OMAP2430 I2CHS CM_IDLEST bits are in CM_IDLEST1_CORE, but the
66 * CM_*CLKEN bits are in CM_{I,F}CLKEN2_CORE. This custom function
67 * passes back the correct CM_IDLEST register address for I2CHS
68 * modules. No return value.
69 */
70static void omap2430_clk_i2chs_find_idlest(struct clk_hw_omap *clk,
71 void __iomem **idlest_reg,
72 u8 *idlest_bit,
73 u8 *idlest_val)
74{
75 u32 r;
76
77 r = ((__force u32)clk->enable_reg ^ (OMAP24XX_CM_FCLKEN2 ^ CM_IDLEST));
78 *idlest_reg = (__force void __iomem *)r;
79 *idlest_bit = clk->enable_bit;
80 *idlest_val = OMAP24XX_CM_IDLEST_VAL;
81}
82
54/* Public data */ 83/* Public data */
55 84
56const struct clk_hw_omap_ops clkhwops_iclk = { 85const struct clk_hw_omap_ops clkhwops_iclk = {
@@ -64,3 +93,9 @@ const struct clk_hw_omap_ops clkhwops_iclk_wait = {
64 .find_idlest = omap2_clk_dflt_find_idlest, 93 .find_idlest = omap2_clk_dflt_find_idlest,
65 .find_companion = omap2_clk_dflt_find_companion, 94 .find_companion = omap2_clk_dflt_find_companion,
66}; 95};
96
97/* 2430 I2CHS has non-standard IDLEST register */
98const struct clk_hw_omap_ops clkhwops_omap2430_i2chs_wait = {
99 .find_idlest = omap2430_clk_i2chs_find_idlest,
100 .find_companion = omap2_clk_dflt_find_companion,
101};
diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h
index f21538364588..3652c267cf81 100644
--- a/drivers/clk/ti/clock.h
+++ b/drivers/clk/ti/clock.h
@@ -178,6 +178,7 @@ extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
178extern const struct clk_hw_omap_ops clkhwops_wait; 178extern const struct clk_hw_omap_ops clkhwops_wait;
179extern const struct clk_hw_omap_ops clkhwops_iclk; 179extern const struct clk_hw_omap_ops clkhwops_iclk;
180extern const struct clk_hw_omap_ops clkhwops_iclk_wait; 180extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
181extern const struct clk_hw_omap_ops clkhwops_omap2430_i2chs_wait;
181 182
182int omap2_dflt_clk_enable(struct clk_hw *hw); 183int omap2_dflt_clk_enable(struct clk_hw *hw);
183void omap2_dflt_clk_disable(struct clk_hw *hw); 184void omap2_dflt_clk_disable(struct clk_hw *hw);
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index 81a913edffa7..440ace33ea35 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -333,7 +333,6 @@ void ti_clk_setup_features(struct ti_clk_features *features);
333const struct ti_clk_features *ti_clk_get_features(void); 333const struct ti_clk_features *ti_clk_get_features(void);
334 334
335extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll; 335extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll;
336extern const struct clk_hw_omap_ops clkhwops_omap2430_i2chs_wait;
337extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait; 336extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;
338extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait; 337extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;
339extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait; 338extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait;