[omap]: refresh/rename patches
[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 --- a/arch/arm/mach-omap2/opp.c
18 +++ b/arch/arm/mach-omap2/opp.c
19 @@ -17,6 +17,7 @@
20   * GNU General Public License for more details.
21   */
22  #include <linux/module.h>
23 +#include <linux/of.h>
24  #include <linux/opp.h>
25  #include <linux/cpu.h>
26  
27 @@ -40,6 +41,9 @@ int __init omap_init_opp_table(struct om
28  {
29         int i, r;
30  
31 +       if (of_have_populated_dt())
32 +               return -EINVAL;
33 +
34         if (!opp_def || !opp_def_size) {
35                 pr_err("%s: invalid params!\n", __func__);
36                 return -EINVAL;