48bd156632a0acb09113579eb68116a567e45dca
[openwrt.git] / target / linux / omap / patches-3.12 / 802-ARM_OMAP3plus_do_not register_non-dt_OPP_tables_for_device_tree_boot.patch
1 From 92d51856d7405fa55bcf3d6f20d7e97e0bf2656c Mon Sep 17 00:00:00 2001
2 From: Nishanth Menon <nm@ti.com>
3 Date: Wed, 16 Oct 2013 15:39:01 +0000
4 Subject: ARM: OMAP3+: do not register non-dt OPP tables for device tree boot
5
6 OMAP3+ supports both device tree and non-device tree boot.
7 Device tree bindings for OMAP3+ is supposed to be added via dts following:
8 Documentation/devicetree/bindings/power/opp.txt
9
10 Since we now have device tree entries for OMAP3+ cpu OPPs,
11 The current code wrongly adds duplicate OPPs. So, dont register OPPs
12 when booting using device tree.
13
14 Signed-off-by: Nishanth Menon <nm@ti.com>
15 Signed-off-by: Tony Lindgren <tony@atomide.com>
16 ---
17 diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c
18 index bd41d59..82fd8c7 100644
19 --- a/arch/arm/mach-omap2/opp.c
20 +++ b/arch/arm/mach-omap2/opp.c
21 @@ -17,6 +17,7 @@
22   * GNU General Public License for more details.
23   */
24  #include <linux/module.h>
25 +#include <linux/of.h>
26  #include <linux/opp.h>
27  #include <linux/cpu.h>
28  
29 @@ -40,6 +41,9 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def,
30  {
31         int i, r;
32  
33 +       if (of_have_populated_dt())
34 +               return -EINVAL;
35 +
36         if (!opp_def || !opp_def_size) {
37                 pr_err("%s: invalid params!\n", __func__);
38                 return -EINVAL;
39 --
40 cgit v0.9.2