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