From 1d638c2d90ff9aed92977f14491ffd8ebdf33b0b Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 11 Sep 2012 13:40:14 +0800 Subject: [PATCH] rk30: move clock.h/clock.c to plat-rk --- arch/arm/mach-rk30/Makefile | 2 +- arch/arm/mach-rk30/clock_data-rk3066b.c | 2 +- arch/arm/mach-rk30/clock_data.c | 2 +- arch/arm/mach-rk30/dvfs.c | 1 - arch/arm/mach-rk30/include/mach/clock.h | 82 +------------------ arch/arm/{mach-rk30 => plat-rk}/clock.c | 1 - .../include/plat}/clock.h | 65 +++++++++++++-- 7 files changed, 64 insertions(+), 91 deletions(-) rename arch/arm/{mach-rk30 => plat-rk}/clock.c (99%) rename arch/arm/{mach-rk30 => plat-rk/include/plat}/clock.h (55%) diff --git a/arch/arm/mach-rk30/Makefile b/arch/arm/mach-rk30/Makefile index 11b2f7fe594a..71a2aa7ef01b 100755 --- a/arch/arm/mach-rk30/Makefile +++ b/arch/arm/mach-rk30/Makefile @@ -1,6 +1,6 @@ EXTRA_CFLAGS += -Os ifneq ($(CONFIG_RK_FPGA),y) -obj-y += clock.o +obj-y += ../plat-rk/clock.o obj-$(CONFIG_ARCH_RK30XX) += clock_data.o obj-$(CONFIG_ARCH_RK3066B) += clock_data-rk3066b.o endif diff --git a/arch/arm/mach-rk30/clock_data-rk3066b.c b/arch/arm/mach-rk30/clock_data-rk3066b.c index e0b57663173e..70c0671d23d7 100644 --- a/arch/arm/mach-rk30/clock_data-rk3066b.c +++ b/arch/arm/mach-rk30/clock_data-rk3066b.c @@ -23,7 +23,7 @@ #include #include #include -#include "clock.h" +#include #include #include #include diff --git a/arch/arm/mach-rk30/clock_data.c b/arch/arm/mach-rk30/clock_data.c index fe432f068cee..7b9e563e45ec 100755 --- a/arch/arm/mach-rk30/clock_data.c +++ b/arch/arm/mach-rk30/clock_data.c @@ -23,7 +23,7 @@ #include #include #include -#include "clock.h" +#include #include #include #include diff --git a/arch/arm/mach-rk30/dvfs.c b/arch/arm/mach-rk30/dvfs.c index 4bc6752ca626..ebe038dd92cf 100755 --- a/arch/arm/mach-rk30/dvfs.c +++ b/arch/arm/mach-rk30/dvfs.c @@ -20,7 +20,6 @@ #include #include #include -#include "clock.h" #include #include #include diff --git a/arch/arm/mach-rk30/include/mach/clock.h b/arch/arm/mach-rk30/include/mach/clock.h index a94d6c851e3d..94b35428fd3c 100755 --- a/arch/arm/mach-rk30/include/mach/clock.h +++ b/arch/arm/mach-rk30/include/mach/clock.h @@ -1,81 +1 @@ -/* arch/arm/mach-rk29/include/mach/clock.h - * - * Copyright (C) 2011 ROCKCHIP, Inc. - * - * This software is licensed under the terms of the GNU General Public - * License version 2, as published by the Free Software Foundation, and - * may be copied, distributed, and modified under those terms. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef __ASM_ARCH_RK30_CLOCK_H -#define __ASM_ARCH_RK30_CLOCK_H - -/** - * struct clk_notifier_data - rate data to pass to the notifier callback - * @clk: struct clk * being changed - * @old_rate: previous rate of this clock - * @new_rate: new rate of this clock - * - * For a pre-notifier, old_rate is the clock's rate before this rate - * change, and new_rate is what the rate will be in the future. For a - * post-notifier, old_rate and new_rate are both set to the clock's - * current rate (this was done to optimize the implementation). - */ -struct clk_notifier_data { - struct clk *clk; - unsigned long old_rate; - unsigned long new_rate; -}; - -/* - * Clk notifier callback types - * - * Since the notifier is called with interrupts disabled, any actions - * taken by callbacks must be extremely fast and lightweight. - * - * CLK_PRE_RATE_CHANGE - called after all callbacks have approved the - * rate change, immediately before the clock rate is changed, to - * indicate that the rate change will proceed. Drivers must - * immediately terminate any operations that will be affected by - * the rate change. Callbacks must always return NOTIFY_DONE. - * - * CLK_ABORT_RATE_CHANGE: called if the rate change failed for some - * reason after CLK_PRE_RATE_CHANGE. In this case, all registered - * notifiers on the clock will be called with - * CLK_ABORT_RATE_CHANGE. Callbacks must always return - * NOTIFY_DONE. - * - * CLK_POST_RATE_CHANGE - called after the clock rate change has - * successfully completed. Callbacks must always return - * NOTIFY_DONE. - * - */ -#define CLK_PRE_RATE_CHANGE 1 -#define CLK_POST_RATE_CHANGE 2 -#define CLK_ABORT_RATE_CHANGE 3 - -#define CLK_PRE_ENABLE 4 -#define CLK_POST_ENABLE 5 -#define CLK_ABORT_ENABLE 6 - -#define CLK_PRE_DISABLE 7 -#define CLK_POST_DISABLE 8 -#define CLK_ABORT_DISABLE 9 - -struct notifier_block; - -extern int clk_notifier_register(struct clk *clk, struct notifier_block *nb); -extern int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); - -#endif - - - - - +#include diff --git a/arch/arm/mach-rk30/clock.c b/arch/arm/plat-rk/clock.c similarity index 99% rename from arch/arm/mach-rk30/clock.c rename to arch/arm/plat-rk/clock.c index a763cc74e953..42f2c7f97350 100755 --- a/arch/arm/mach-rk30/clock.c +++ b/arch/arm/plat-rk/clock.c @@ -22,7 +22,6 @@ #include #include #include -#include "clock.h" #include #include diff --git a/arch/arm/mach-rk30/clock.h b/arch/arm/plat-rk/include/plat/clock.h similarity index 55% rename from arch/arm/mach-rk30/clock.h rename to arch/arm/plat-rk/include/plat/clock.h index fdecd15d4975..09286d43ff84 100644 --- a/arch/arm/mach-rk30/clock.h +++ b/arch/arm/plat-rk/include/plat/clock.h @@ -1,5 +1,5 @@ -#ifndef __MACH_CLOCK_H__ -#define __MACH_CLOCK_H__ +#ifndef __PLAT_CLOCK_H__ +#define __PLAT_CLOCK_H__ #ifndef CONFIG_ARCH_RK30 #define RK30_CLK_OFFBOARD_TEST @@ -91,9 +91,64 @@ struct clk_dump_ops { void clk_register_dump_ops(struct clk_dump_ops *ops); #else -static void clk_register_dump_ops(struct clk_dump_ops *ops){ -} - +static inline void clk_register_dump_ops(struct clk_dump_ops *ops) {} #endif +/** + * struct clk_notifier_data - rate data to pass to the notifier callback + * @clk: struct clk * being changed + * @old_rate: previous rate of this clock + * @new_rate: new rate of this clock + * + * For a pre-notifier, old_rate is the clock's rate before this rate + * change, and new_rate is what the rate will be in the future. For a + * post-notifier, old_rate and new_rate are both set to the clock's + * current rate (this was done to optimize the implementation). + */ +struct clk_notifier_data { + struct clk *clk; + unsigned long old_rate; + unsigned long new_rate; +}; + +/* + * Clk notifier callback types + * + * Since the notifier is called with interrupts disabled, any actions + * taken by callbacks must be extremely fast and lightweight. + * + * CLK_PRE_RATE_CHANGE - called after all callbacks have approved the + * rate change, immediately before the clock rate is changed, to + * indicate that the rate change will proceed. Drivers must + * immediately terminate any operations that will be affected by + * the rate change. Callbacks must always return NOTIFY_DONE. + * + * CLK_ABORT_RATE_CHANGE: called if the rate change failed for some + * reason after CLK_PRE_RATE_CHANGE. In this case, all registered + * notifiers on the clock will be called with + * CLK_ABORT_RATE_CHANGE. Callbacks must always return + * NOTIFY_DONE. + * + * CLK_POST_RATE_CHANGE - called after the clock rate change has + * successfully completed. Callbacks must always return + * NOTIFY_DONE. + * + */ +#define CLK_PRE_RATE_CHANGE 1 +#define CLK_POST_RATE_CHANGE 2 +#define CLK_ABORT_RATE_CHANGE 3 + +#define CLK_PRE_ENABLE 4 +#define CLK_POST_ENABLE 5 +#define CLK_ABORT_ENABLE 6 + +#define CLK_PRE_DISABLE 7 +#define CLK_POST_DISABLE 8 +#define CLK_ABORT_DISABLE 9 + +struct notifier_block; + +extern int clk_notifier_register(struct clk *clk, struct notifier_block *nb); +extern int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); + #endif -- 2.34.1