From 5c881d9ae9480171f01921585e1893863d7ab421 Mon Sep 17 00:00:00 2001 From: Shiraz Hashim Date: Wed, 16 Feb 2011 07:40:32 +0100 Subject: ARM: 6737/1: SPEAr: formalized timer support Move platform specific timer initialization code is moved into platform specific files. Reviewed-by: Jamie Iles Reviewed-by: Stanley Miao Signed-off-by: Shiraz Hashim Signed-off-by: Rajeev Kumar Signed-off-by: Viresh Kumar Signed-off-by: Russell King --- arch/arm/plat-spear/time.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'arch/arm/plat-spear/time.c') diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c index 839c88d..100672f 100644 --- a/arch/arm/plat-spear/time.c +++ b/arch/arm/plat-spear/time.c @@ -1,7 +1,7 @@ /* * arch/arm/plat-spear/time.c * - * Copyright (C) 2009 ST Microelectronics + * Copyright (C) 2010 ST Microelectronics * Shiraz Hashim * * This file is licensed under the terms of the GNU General Public @@ -211,7 +211,7 @@ static void __init spear_clockevent_init(void) void __init spear_setup_timer(void) { - struct clk *pll3_clk; + int ret; if (!request_mem_region(SPEAR_GPT0_BASE, SZ_1K, "gpt0")) { pr_err("%s:cannot get IO addr\n", __func__); @@ -230,26 +230,21 @@ void __init spear_setup_timer(void) goto err_iomap; } - pll3_clk = clk_get(NULL, "pll3_48m_clk"); - if (!pll3_clk) { - pr_err("%s:couldn't get PLL3 as parent for gpt\n", __func__); - goto err_iomap; + ret = clk_enable(gpt_clk); + if (ret < 0) { + pr_err("%s:couldn't enable gpt clock\n", __func__); + goto err_clk; } - clk_set_parent(gpt_clk, pll3_clk); - spear_clockevent_init(); spear_clocksource_init(); return; +err_clk: + clk_put(gpt_clk); err_iomap: iounmap(gpt_base); - err_mem: release_mem_region(SPEAR_GPT0_BASE, SZ_1K); } - -struct sys_timer spear_sys_timer = { - .init = spear_setup_timer, -}; -- cgit v1.1 From 410782beba6aa75744881810ec0cdff4c66ca777 Mon Sep 17 00:00:00 2001 From: viresh kumar Date: Mon, 7 Mar 2011 05:57:01 +0100 Subject: ARM: 6787/1: SPEAr: Reorder #includes in .h & .c files. Order of inclusion of .h files must be: , , , . This patch corrects this ordering whereever it is not followed. Signed-off-by: Viresh Kumar Signed-off-by: Russell King --- arch/arm/plat-spear/time.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/plat-spear/time.c') diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c index 100672f..de0a81b 100644 --- a/arch/arm/plat-spear/time.c +++ b/arch/arm/plat-spear/time.c @@ -20,10 +20,10 @@ #include #include #include -#include +#include #include +#include #include -#include /* * We would use TIMER0 and TIMER1 as clockevent and clocksource. -- cgit v1.1 From 02aa06bc49fdb1749f350649c46b74da50290414 Mon Sep 17 00:00:00 2001 From: viresh kumar Date: Mon, 7 Mar 2011 05:57:02 +0100 Subject: ARM: 6788/1: SPEAr: Include mach/hardware.h instead of mach/spear.h This patch makes inclusion of hardware.h and spear.h consistent over all spear variants. Now we will include hardware.h, wherever we need to use hardware macros. spear.h will be automatically included by hardware.h Signed-off-by: Viresh Kumar Signed-off-by: Russell King --- arch/arm/plat-spear/time.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/plat-spear/time.c') diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c index de0a81b..dbb6e4f 100644 --- a/arch/arm/plat-spear/time.c +++ b/arch/arm/plat-spear/time.c @@ -23,7 +23,6 @@ #include #include #include -#include /* * We would use TIMER0 and TIMER1 as clockevent and clocksource. -- cgit v1.1