| Alessandro Rubini | 28ad94e | 2009-07-02 19:06:47 +0100 | [diff] [blame] | 1 | /* | 
|  | 2 | *  linux/arch/arm/mach-nomadik/clock.c | 
|  | 3 | * | 
|  | 4 | *  Copyright (C) 2009 Alessandro Rubini | 
|  | 5 | */ | 
|  | 6 | #include <linux/kernel.h> | 
|  | 7 | #include <linux/module.h> | 
|  | 8 | #include <linux/errno.h> | 
|  | 9 | #include <linux/clk.h> | 
|  | 10 | #include <asm/clkdev.h> | 
|  | 11 | #include "clock.h" | 
|  | 12 |  | 
|  | 13 | /* | 
|  | 14 | * The nomadik board uses generic clocks, but the serial pl011 file | 
|  | 15 | * calls clk_enable(), clk_disable(), clk_get_rate(), so we provide them | 
|  | 16 | */ | 
|  | 17 | unsigned long clk_get_rate(struct clk *clk) | 
|  | 18 | { | 
|  | 19 | return clk->rate; | 
|  | 20 | } | 
|  | 21 | EXPORT_SYMBOL(clk_get_rate); | 
|  | 22 |  | 
|  | 23 | /* enable and disable do nothing */ | 
|  | 24 | int clk_enable(struct clk *clk) | 
|  | 25 | { | 
|  | 26 | return 0; | 
|  | 27 | } | 
|  | 28 | EXPORT_SYMBOL(clk_enable); | 
|  | 29 |  | 
|  | 30 | void clk_disable(struct clk *clk) | 
|  | 31 | { | 
|  | 32 | } | 
|  | 33 | EXPORT_SYMBOL(clk_disable); | 
|  | 34 |  | 
|  | 35 | /* Create a clock structure with the given name */ | 
|  | 36 | int nmdk_clk_create(struct clk *clk, const char *dev_id) | 
|  | 37 | { | 
|  | 38 | struct clk_lookup *clkdev; | 
|  | 39 |  | 
|  | 40 | clkdev = clkdev_alloc(clk, NULL, dev_id); | 
|  | 41 | if (!clkdev) | 
|  | 42 | return -ENOMEM; | 
|  | 43 | clkdev_add(clkdev); | 
|  | 44 | return 0; | 
|  | 45 | } |