Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

abb virtual consumer

By: a guest on May 2nd, 2013  |  syntax: None  |  size: 3.25 KB  |  hits: 50  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. From 3cb6b77143d9a17f5d412f33de6cd98db11ba3b4 Mon Sep 17 00:00:00 2001
  2. From: Nishanth Menon <nm@ti.com>
  3. Date: Fri, 26 Apr 2013 02:21:55 -0500
  4. Subject: [PATCH] TESTING HACKHACK: add dummy virt-consumer for OMAP3/4/5
  5.  
  6. Set CONFIG_REGULATOR_VIRTUAL_CONSUMER=y to use
  7.  
  8. OMAP3630(beagle-XM):
  9. MPU :
  10. REG=/sys/class/regulator/regulator.9
  11. CONS=/sys/devices/platform/reg-virt-consumer.0
  12.  
  13. for V in 1012500 1200000 1325000 1375000
  14. do
  15.         echo -n "$V">$CONS/min_microvolts
  16.         echo -n "$V">$CONS/max_microvolts
  17.         echo "Tried $V, Voltage =" `cat $REG/microvolts`
  18. done
  19.  
  20. OMAP4460(Panda-ES): MPU: http://pastebin.com/TKPPZDQ1
  21. REG=/sys/class/regulator/regulator.1
  22. CONS=/sys/devices/platform/reg-virt-consumer.0
  23.  
  24. for V in 1025000 1200000 1313000 1375000 1389000
  25. do
  26.         echo -n "$V">$CONS/min_microvolts
  27.         echo -n "$V">$CONS/max_microvolts
  28.         echo "Tried $V, Voltage =" `cat $REG/microvolts`
  29. done
  30.  
  31. IVA:
  32. REG=/sys/class/regulator/regulator.2
  33. CONS=/sys/devices/platform/reg-virt-consumer.1
  34.  
  35. for V in 950000 1140000 1291000 1375000 1376000
  36.  
  37. do
  38.         echo -n "$V">$CONS/min_microvolts
  39.         echo -n "$V">$CONS/max_microvolts
  40.         echo "Tried $V, Voltage =" `cat $REG/microvolts`
  41. done
  42.  
  43. OMAP5: Similarly
  44.  
  45. Signed-off-by: Nishanth Menon <nm@ti.com>
  46. ---
  47.  arch/arm/mach-omap2/pm.c |   53 ++++++++++++++++++++++++++++++++++++++++++++++
  48.  1 file changed, 53 insertions(+)
  49.  
  50. diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
  51. index 6cf95160..635f40b 100644
  52. --- a/arch/arm/mach-omap2/pm.c
  53. +++ b/arch/arm/mach-omap2/pm.c
  54. @@ -265,6 +265,57 @@ static void __init omap4_init_voltages(void)
  55.         omap2_set_init_voltage("iva", "dpll_iva_m5x2_ck", "iva");
  56.  }
  57.  
  58. +static inline void dummy_consumers_for_abb_test(void)
  59. +{
  60. +       if (cpu_is_omap34xx()) {
  61. +               char name1[] = "abb_mpu_iva";
  62. +               struct platform_device_info devinfo1 = {
  63. +                               .name = "reg-virt-consumer",
  64. +                               .data = name1,
  65. +                               .size_data = sizeof(name1),
  66. +               };
  67. +               platform_device_register_full(&devinfo1);
  68. +       }
  69. +
  70. +       if (cpu_is_omap44xx()) {
  71. +               char name1[] = "abb_mpu";
  72. +               char name2[] = "abb_iva";
  73. +               struct platform_device_info devinfo1 = {
  74. +                               .name = "reg-virt-consumer",
  75. +                               .id = 0,
  76. +                               .data = name1,
  77. +                               .size_data = sizeof(name1),
  78. +               };
  79. +               struct platform_device_info devinfo2 = {
  80. +                               .name = "reg-virt-consumer",
  81. +                               .id = 1,
  82. +                               .data = name2,
  83. +                               .size_data = sizeof(name2),
  84. +               };
  85. +               platform_device_register_full(&devinfo1);
  86. +               platform_device_register_full(&devinfo2);
  87. +       }
  88. +
  89. +       if (soc_is_omap54xx()) {
  90. +               char name1[] = "abb_mpu";
  91. +               char name2[] = "abb_mm";
  92. +               struct platform_device_info devinfo1 = {
  93. +                               .name = "reg-virt-consumer",
  94. +                               .id = 0,
  95. +                               .data = name1,
  96. +                               .size_data = sizeof(name1),
  97. +               };
  98. +               struct platform_device_info devinfo2 = {
  99. +                               .name = "reg-virt-consumer",
  100. +                               .id = 1,
  101. +                               .data = name2,
  102. +                               .size_data = sizeof(name2),
  103. +               };
  104. +               platform_device_register_full(&devinfo1);
  105. +               platform_device_register_full(&devinfo2);
  106. +       }
  107. +}
  108. +
  109.  static inline void omap_init_cpufreq(void)
  110.  {
  111.         struct platform_device_info devinfo = { };
  112. @@ -310,6 +361,8 @@ int __init omap2_common_pm_late_init(void)
  113.         /* cpufreq dummy device instantiation */
  114.         omap_init_cpufreq();
  115.  
  116. +       dummy_consumers_for_abb_test();
  117. +
  118.  #ifdef CONFIG_SUSPEND
  119.         suspend_set_ops(&omap_pm_ops);
  120.  #endif
  121. --
  122. 1.7.9.5