mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 07:03:37 +02:00
rk30: move clock.h/clock.c to plat-rk
This commit is contained in:
parent
c4ee5b4b27
commit
1d638c2d90
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include <linux/hardirq.h>
|
||||
#include <mach/cru.h>
|
||||
#include <mach/iomux.h>
|
||||
#include "clock.h"
|
||||
#include <mach/clock.h>
|
||||
#include <mach/pmu.h>
|
||||
#include <mach/dvfs.h>
|
||||
#include <mach/ddr.h>
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include <linux/hardirq.h>
|
||||
#include <mach/cru.h>
|
||||
#include <mach/iomux.h>
|
||||
#include "clock.h"
|
||||
#include <mach/clock.h>
|
||||
#include <mach/pmu.h>
|
||||
#include <mach/dvfs.h>
|
||||
#include <mach/ddr.h>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
#include <linux/slab.h>
|
||||
#include <linux/clk.h>
|
||||
#include <linux/cpufreq.h>
|
||||
#include "clock.h"
|
||||
#include <mach/dvfs.h>
|
||||
#include <mach/clock.h>
|
||||
#include <linux/regulator/consumer.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 <plat/clock.h>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#include <linux/hardirq.h>
|
||||
#include <linux/delay.h>
|
||||
#include <mach/clock.h>
|
||||
#include "clock.h"
|
||||
#include <mach/dvfs.h>
|
||||
#include <linux/delay.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
|
||||
Loading…
Reference in New Issue
Block a user