clock.h 1.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 * linux/arch/arm/mach-w90x900/clock.h
 *
 * Copyright (c) 2008 Nuvoton technology corporation
 *
 * Wan ZongShun <mcuos.com@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License.
 */

#include <asm/clkdev.h>

15 16
void nuc900_clk_enable(struct clk *clk, int enable);
void nuc900_subclk_enable(struct clk *clk, int enable);
17 18 19 20 21 22 23 24 25 26
void clks_register(struct clk_lookup *clks, size_t num);

struct clk {
	unsigned long		cken;
	unsigned int		enabled;
	void			(*enable)(struct clk *, int enable);
};

#define DEFINE_CLK(_name, _ctrlbit)			\
struct clk clk_##_name = {				\
27
		.enable	= nuc900_clk_enable,		\
28 29 30
		.cken	= (1 << _ctrlbit),		\
	}

31 32
#define DEFINE_SUBCLK(_name, _ctrlbit)			\
struct clk clk_##_name = {				\
33
		.enable	= nuc900_subclk_enable,	\
34 35 36 37
		.cken	= (1 << _ctrlbit),		\
	}


38 39 40 41 42 43 44
#define DEF_CLKLOOK(_clk, _devname, _conname)		\
	{						\
		.clk		= _clk,			\
		.dev_id		= _devname,		\
		.con_id		= _conname,		\
	}