]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
msm: clock: Support dummy clocks
authorStephen Boyd <sboyd@codeaurora.org>
Thu, 24 Mar 2011 23:34:45 +0000 (16:34 -0700)
committerDavid Brown <davidb@codeaurora.org>
Thu, 31 Mar 2011 20:42:26 +0000 (13:42 -0700)
Implement a dummy clock driver and macro in the spirit of
CLK_PCOM(). This is useful on targets where a pclk doesn't exist
and we want to keep drivers sane by providing such clocks.

Reviewed-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
arch/arm/mach-msm/Makefile
arch/arm/mach-msm/clock-dummy.c [new file with mode: 0644]
arch/arm/mach-msm/clock.h

index 9519fd28a025fd415abf9b7a591ac167085dac18..4a1f175490130432a66f2a5d13520a0e41399745 100644 (file)
@@ -1,5 +1,6 @@
 obj-y += io.o idle.o timer.o
 obj-y += clock.o
+obj-y += clock-dummy.o
 obj-$(CONFIG_DEBUG_FS) += clock-debug.o
 
 obj-$(CONFIG_MSM_VIC) += irq-vic.o
diff --git a/arch/arm/mach-msm/clock-dummy.c b/arch/arm/mach-msm/clock-dummy.c
new file mode 100644 (file)
index 0000000..8ae3768
--- /dev/null
@@ -0,0 +1,81 @@
+/* Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#include "clock.h"
+
+static int dummy_clk_enable(unsigned id)
+{
+       return 0;
+}
+
+static void dummy_clk_disable(unsigned id)
+{
+}
+
+static int dummy_clk_reset(unsigned id, enum clk_reset_action action)
+{
+       return 0;
+}
+
+static int dummy_clk_set_rate(unsigned id, unsigned rate)
+{
+       return 0;
+}
+
+static int dummy_clk_set_min_rate(unsigned id, unsigned rate)
+{
+       return 0;
+}
+
+static int dummy_clk_set_max_rate(unsigned id, unsigned rate)
+{
+       return 0;
+}
+
+static int dummy_clk_set_flags(unsigned id, unsigned flags)
+{
+       return 0;
+}
+
+static unsigned dummy_clk_get_rate(unsigned id)
+{
+       return 0;
+}
+
+static unsigned dummy_clk_is_enabled(unsigned id)
+{
+       return 0;
+}
+
+static long dummy_clk_round_rate(unsigned id, unsigned rate)
+{
+       return rate;
+}
+
+static bool dummy_clk_is_local(unsigned id)
+{
+       return true;
+}
+
+struct clk_ops clk_ops_dummy = {
+       .enable = dummy_clk_enable,
+       .disable = dummy_clk_disable,
+       .reset = dummy_clk_reset,
+       .set_rate = dummy_clk_set_rate,
+       .set_min_rate = dummy_clk_set_min_rate,
+       .set_max_rate = dummy_clk_set_max_rate,
+       .set_flags = dummy_clk_set_flags,
+       .get_rate = dummy_clk_get_rate,
+       .is_enabled = dummy_clk_is_enabled,
+       .round_rate = dummy_clk_round_rate,
+       .is_local = dummy_clk_is_local,
+};
index 2c007f606d2921e61d8692bd7a3e288cf08d588b..1e6207463e6d447f476726e7eab73002cec75d2c 100644 (file)
@@ -69,4 +69,15 @@ static inline int __init clock_debug_init(void) { return 0; }
 static inline int __init clock_debug_add(struct clk *clock) { return 0; }
 #endif
 
+extern struct clk_ops clk_ops_dummy;
+
+#define CLK_DUMMY(clk_name, clk_id, clk_dev) { \
+       .con_id = clk_name, \
+       .dev_id = clk_dev, \
+       .clk = &(struct clk){ \
+               .dbg_name = #clk_id, \
+               .ops = &clk_ops_dummy, \
+       }, \
+       }
+
 #endif