diff options
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/clock.c | 41 | ||||
-rw-r--r-- | arch/arm/plat-omap/gpio.c | 6 | ||||
-rw-r--r-- | arch/arm/plat-omap/mcbsp.c | 12 | ||||
-rw-r--r-- | arch/arm/plat-omap/ocpi.c | 4 |
4 files changed, 15 insertions, 48 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 7ebc5a29db8d..3c2bfc0efdaf 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -34,7 +34,7 @@ DEFINE_SPINLOCK(clockfw_lock); | |||
34 | static struct clk_functions *arch_clock; | 34 | static struct clk_functions *arch_clock; |
35 | 35 | ||
36 | /*------------------------------------------------------------------------- | 36 | /*------------------------------------------------------------------------- |
37 | * Standard clock functions defined in asm/hardware/clock.h | 37 | * Standard clock functions defined in include/linux/clk.h |
38 | *-------------------------------------------------------------------------*/ | 38 | *-------------------------------------------------------------------------*/ |
39 | 39 | ||
40 | struct clk * clk_get(struct device *dev, const char *id) | 40 | struct clk * clk_get(struct device *dev, const char *id) |
@@ -60,12 +60,8 @@ int clk_enable(struct clk *clk) | |||
60 | int ret = 0; | 60 | int ret = 0; |
61 | 61 | ||
62 | spin_lock_irqsave(&clockfw_lock, flags); | 62 | spin_lock_irqsave(&clockfw_lock, flags); |
63 | if (clk->enable) | 63 | if (arch_clock->clk_enable) |
64 | ret = clk->enable(clk); | ||
65 | else if (arch_clock->clk_enable) | ||
66 | ret = arch_clock->clk_enable(clk); | 64 | ret = arch_clock->clk_enable(clk); |
67 | else | ||
68 | printk(KERN_ERR "Could not enable clock %s\n", clk->name); | ||
69 | spin_unlock_irqrestore(&clockfw_lock, flags); | 65 | spin_unlock_irqrestore(&clockfw_lock, flags); |
70 | 66 | ||
71 | return ret; | 67 | return ret; |
@@ -77,41 +73,12 @@ void clk_disable(struct clk *clk) | |||
77 | unsigned long flags; | 73 | unsigned long flags; |
78 | 74 | ||
79 | spin_lock_irqsave(&clockfw_lock, flags); | 75 | spin_lock_irqsave(&clockfw_lock, flags); |
80 | if (clk->disable) | 76 | if (arch_clock->clk_disable) |
81 | clk->disable(clk); | ||
82 | else if (arch_clock->clk_disable) | ||
83 | arch_clock->clk_disable(clk); | 77 | arch_clock->clk_disable(clk); |
84 | else | ||
85 | printk(KERN_ERR "Could not disable clock %s\n", clk->name); | ||
86 | spin_unlock_irqrestore(&clockfw_lock, flags); | 78 | spin_unlock_irqrestore(&clockfw_lock, flags); |
87 | } | 79 | } |
88 | EXPORT_SYMBOL(clk_disable); | 80 | EXPORT_SYMBOL(clk_disable); |
89 | 81 | ||
90 | int clk_use(struct clk *clk) | ||
91 | { | ||
92 | unsigned long flags; | ||
93 | int ret = 0; | ||
94 | |||
95 | spin_lock_irqsave(&clockfw_lock, flags); | ||
96 | if (arch_clock->clk_use) | ||
97 | ret = arch_clock->clk_use(clk); | ||
98 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
99 | |||
100 | return ret; | ||
101 | } | ||
102 | EXPORT_SYMBOL(clk_use); | ||
103 | |||
104 | void clk_unuse(struct clk *clk) | ||
105 | { | ||
106 | unsigned long flags; | ||
107 | |||
108 | spin_lock_irqsave(&clockfw_lock, flags); | ||
109 | if (arch_clock->clk_unuse) | ||
110 | arch_clock->clk_unuse(clk); | ||
111 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
112 | } | ||
113 | EXPORT_SYMBOL(clk_unuse); | ||
114 | |||
115 | int clk_get_usecount(struct clk *clk) | 82 | int clk_get_usecount(struct clk *clk) |
116 | { | 83 | { |
117 | unsigned long flags; | 84 | unsigned long flags; |
@@ -146,7 +113,7 @@ void clk_put(struct clk *clk) | |||
146 | EXPORT_SYMBOL(clk_put); | 113 | EXPORT_SYMBOL(clk_put); |
147 | 114 | ||
148 | /*------------------------------------------------------------------------- | 115 | /*------------------------------------------------------------------------- |
149 | * Optional clock functions defined in asm/hardware/clock.h | 116 | * Optional clock functions defined in include/linux/clk.h |
150 | *-------------------------------------------------------------------------*/ | 117 | *-------------------------------------------------------------------------*/ |
151 | 118 | ||
152 | long clk_round_rate(struct clk *clk, unsigned long rate) | 119 | long clk_round_rate(struct clk *clk, unsigned long rate) |
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index ca3681a824ac..b4d5b9e4bfce 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c | |||
@@ -853,19 +853,19 @@ static int __init _omap_gpio_init(void) | |||
853 | if (IS_ERR(gpio_ick)) | 853 | if (IS_ERR(gpio_ick)) |
854 | printk("Could not get arm_gpio_ck\n"); | 854 | printk("Could not get arm_gpio_ck\n"); |
855 | else | 855 | else |
856 | clk_use(gpio_ick); | 856 | clk_enable(gpio_ick); |
857 | } | 857 | } |
858 | if (cpu_is_omap24xx()) { | 858 | if (cpu_is_omap24xx()) { |
859 | gpio_ick = clk_get(NULL, "gpios_ick"); | 859 | gpio_ick = clk_get(NULL, "gpios_ick"); |
860 | if (IS_ERR(gpio_ick)) | 860 | if (IS_ERR(gpio_ick)) |
861 | printk("Could not get gpios_ick\n"); | 861 | printk("Could not get gpios_ick\n"); |
862 | else | 862 | else |
863 | clk_use(gpio_ick); | 863 | clk_enable(gpio_ick); |
864 | gpio_fck = clk_get(NULL, "gpios_fck"); | 864 | gpio_fck = clk_get(NULL, "gpios_fck"); |
865 | if (IS_ERR(gpio_ick)) | 865 | if (IS_ERR(gpio_ick)) |
866 | printk("Could not get gpios_fck\n"); | 866 | printk("Could not get gpios_fck\n"); |
867 | else | 867 | else |
868 | clk_use(gpio_fck); | 868 | clk_enable(gpio_fck); |
869 | } | 869 | } |
870 | 870 | ||
871 | #ifdef CONFIG_ARCH_OMAP15XX | 871 | #ifdef CONFIG_ARCH_OMAP15XX |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index be0e0f32a598..1cd2cace7e1b 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -190,11 +190,11 @@ static int omap_mcbsp_check(unsigned int id) | |||
190 | static void omap_mcbsp_dsp_request(void) | 190 | static void omap_mcbsp_dsp_request(void) |
191 | { | 191 | { |
192 | if (cpu_is_omap1510() || cpu_is_omap16xx()) { | 192 | if (cpu_is_omap1510() || cpu_is_omap16xx()) { |
193 | clk_use(mcbsp_dsp_ck); | 193 | clk_enable(mcbsp_dsp_ck); |
194 | clk_use(mcbsp_api_ck); | 194 | clk_enable(mcbsp_api_ck); |
195 | 195 | ||
196 | /* enable 12MHz clock to mcbsp 1 & 3 */ | 196 | /* enable 12MHz clock to mcbsp 1 & 3 */ |
197 | clk_use(mcbsp_dspxor_ck); | 197 | clk_enable(mcbsp_dspxor_ck); |
198 | 198 | ||
199 | /* | 199 | /* |
200 | * DSP external peripheral reset | 200 | * DSP external peripheral reset |
@@ -208,9 +208,9 @@ static void omap_mcbsp_dsp_request(void) | |||
208 | static void omap_mcbsp_dsp_free(void) | 208 | static void omap_mcbsp_dsp_free(void) |
209 | { | 209 | { |
210 | if (cpu_is_omap1510() || cpu_is_omap16xx()) { | 210 | if (cpu_is_omap1510() || cpu_is_omap16xx()) { |
211 | clk_unuse(mcbsp_dspxor_ck); | 211 | clk_disable(mcbsp_dspxor_ck); |
212 | clk_unuse(mcbsp_dsp_ck); | 212 | clk_disable(mcbsp_dsp_ck); |
213 | clk_unuse(mcbsp_api_ck); | 213 | clk_disable(mcbsp_api_ck); |
214 | } | 214 | } |
215 | } | 215 | } |
216 | 216 | ||
diff --git a/arch/arm/plat-omap/ocpi.c b/arch/arm/plat-omap/ocpi.c index e40fcc8b43d4..5cc6775c789c 100644 --- a/arch/arm/plat-omap/ocpi.c +++ b/arch/arm/plat-omap/ocpi.c | |||
@@ -88,7 +88,7 @@ static int __init omap_ocpi_init(void) | |||
88 | if (IS_ERR(ocpi_ck)) | 88 | if (IS_ERR(ocpi_ck)) |
89 | return PTR_ERR(ocpi_ck); | 89 | return PTR_ERR(ocpi_ck); |
90 | 90 | ||
91 | clk_use(ocpi_ck); | 91 | clk_enable(ocpi_ck); |
92 | ocpi_enable(); | 92 | ocpi_enable(); |
93 | printk("OMAP OCPI interconnect driver loaded\n"); | 93 | printk("OMAP OCPI interconnect driver loaded\n"); |
94 | 94 | ||
@@ -102,7 +102,7 @@ static void __exit omap_ocpi_exit(void) | |||
102 | if (!cpu_is_omap16xx()) | 102 | if (!cpu_is_omap16xx()) |
103 | return; | 103 | return; |
104 | 104 | ||
105 | clk_unuse(ocpi_ck); | 105 | clk_disable(ocpi_ck); |
106 | clk_put(ocpi_ck); | 106 | clk_put(ocpi_ck); |
107 | } | 107 | } |
108 | 108 | ||