Junjie Wu | 8deb790 | 2013-07-05 22:31:56 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2011,2013, The Linux Foundation. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
Matt Wagantall | 33d01f5 | 2012-02-23 23:27:44 -0800 | [diff] [blame] | 13 | #include <mach/clk-provider.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 14 | |
| 15 | static int dummy_clk_reset(struct clk *clk, enum clk_reset_action action) |
| 16 | { |
| 17 | return 0; |
| 18 | } |
| 19 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 20 | static int dummy_clk_set_rate(struct clk *clk, unsigned long rate) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 21 | { |
Junjie Wu | 8deb790 | 2013-07-05 22:31:56 -0700 | [diff] [blame] | 22 | clk->rate = rate; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 23 | return 0; |
| 24 | } |
| 25 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 26 | static int dummy_clk_set_max_rate(struct clk *clk, unsigned long rate) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 27 | { |
| 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | static int dummy_clk_set_flags(struct clk *clk, unsigned flags) |
| 32 | { |
| 33 | return 0; |
| 34 | } |
| 35 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 36 | static unsigned long dummy_clk_get_rate(struct clk *clk) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 37 | { |
Junjie Wu | 8deb790 | 2013-07-05 22:31:56 -0700 | [diff] [blame] | 38 | return clk->rate; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 39 | } |
| 40 | |
Matt Wagantall | 9de3bfb | 2011-11-03 20:13:12 -0700 | [diff] [blame] | 41 | static long dummy_clk_round_rate(struct clk *clk, unsigned long rate) |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 42 | { |
| 43 | return rate; |
| 44 | } |
| 45 | |
Junjie Wu | 8deb790 | 2013-07-05 22:31:56 -0700 | [diff] [blame] | 46 | struct clk_ops clk_ops_dummy = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 47 | .reset = dummy_clk_reset, |
| 48 | .set_rate = dummy_clk_set_rate, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 49 | .set_max_rate = dummy_clk_set_max_rate, |
| 50 | .set_flags = dummy_clk_set_flags, |
| 51 | .get_rate = dummy_clk_get_rate, |
| 52 | .round_rate = dummy_clk_round_rate, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | struct clk dummy_clk = { |
| 56 | .dbg_name = "dummy_clk", |
| 57 | .ops = &clk_ops_dummy, |
| 58 | CLK_INIT(dummy_clk), |
| 59 | }; |