~ubuntu-branches/ubuntu/precise/linux-linaro-u8500/precise

« back to all changes in this revision

Viewing changes to arch/arm/plat-spear/time.c

  • Committer: Bazaar Package Importer
  • Author(s): John Rigby, Upstream Fixes, Andy Green, John Rigby
  • Date: 2011-04-14 12:16:06 UTC
  • Revision ID: james.westby@ubuntu.com-20110414121606-b77podkyqgr2oix7
Tags: 2.6.38-1002.3
[ Upstream Fixes ]

* MUSB: shutdown: Make sure block is awake before doing shutdown
  - LP: #745737
* Fixed gpio polarity of gpio USB-phy reset.
  - LP: #747639

[ Andy Green ]

* LINARO: SAUCE: disable CONFIG_OMAP_RESET_CLOCKS
  - LP: #752900

[ John Rigby ]

* Rebase to new upstreams:
  Linux v2.6.38.1
  linaro-linux-2.6.38-upstream-29Mar2011
  Ubuntu-2.6.38-7.35
* SAUCE: OMAP4: clock: wait for module to become accessible on
  a clk enable
  - LP: #745737
* Rebase to new upstreams:
  Linux v2.6.38.2
  linaro-linux-2.6.38-upstream-5Apr2011
  Ubuntu-2.6.38-8.41
  - LP: #732842
* Update configs for device tree, dvfs and lttng
* LINARO: add building of dtb's
* LINARO: SAUCE: Disable lowest operating freqs on omap34xx
  - LP: #732912

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * arch/arm/plat-spear/time.c
3
3
 *
4
 
 * Copyright (C) 2009 ST Microelectronics
 
4
 * Copyright (C) 2010 ST Microelectronics
5
5
 * Shiraz Hashim<shiraz.hashim@st.com>
6
6
 *
7
7
 * This file is licensed under the terms of the GNU General Public
20
20
#include <linux/time.h>
21
21
#include <linux/irq.h>
22
22
#include <asm/mach/time.h>
 
23
#include <mach/generic.h>
 
24
#include <mach/hardware.h>
23
25
#include <mach/irqs.h>
24
 
#include <mach/hardware.h>
25
 
#include <mach/spear.h>
26
 
#include <mach/generic.h>
27
26
 
28
27
/*
29
28
 * We would use TIMER0 and TIMER1 as clockevent and clocksource.
211
210
 
212
211
void __init spear_setup_timer(void)
213
212
{
214
 
        struct clk *pll3_clk;
 
213
        int ret;
215
214
 
216
215
        if (!request_mem_region(SPEAR_GPT0_BASE, SZ_1K, "gpt0")) {
217
216
                pr_err("%s:cannot get IO addr\n", __func__);
230
229
                goto err_iomap;
231
230
        }
232
231
 
233
 
        pll3_clk = clk_get(NULL, "pll3_48m_clk");
234
 
        if (!pll3_clk) {
235
 
                pr_err("%s:couldn't get PLL3 as parent for gpt\n", __func__);
236
 
                goto err_iomap;
 
232
        ret = clk_enable(gpt_clk);
 
233
        if (ret < 0) {
 
234
                pr_err("%s:couldn't enable gpt clock\n", __func__);
 
235
                goto err_clk;
237
236
        }
238
237
 
239
 
        clk_set_parent(gpt_clk, pll3_clk);
240
 
 
241
238
        spear_clockevent_init();
242
239
        spear_clocksource_init();
243
240
 
244
241
        return;
245
242
 
 
243
err_clk:
 
244
        clk_put(gpt_clk);
246
245
err_iomap:
247
246
        iounmap(gpt_base);
248
 
 
249
247
err_mem:
250
248
        release_mem_region(SPEAR_GPT0_BASE, SZ_1K);
251
249
}
252
 
 
253
 
struct sys_timer spear_sys_timer = {
254
 
        .init = spear_setup_timer,
255
 
};