drivers: power: report battery voltage in AOSP compatible format
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / kernel / notifier.c
index 2d5cc4ccff7f4b79f734bf12ea769fb14a2346b2..8bc63f2a91b092f5e25088711ac4309eff5f95a6 100644 (file)
@@ -5,6 +5,12 @@
 #include <linux/rcupdate.h>
 #include <linux/vmalloc.h>
 #include <linux/reboot.h>
+/*******************************************************************************
+* 20131225 marc.huang                                                          *
+* CPU Hotplug debug mechanism                                                  *
+*******************************************************************************/
+#include <linux/mtk_ram_console.h>
+/******************************************************************************/
 
 /*
  *     Notifier list for kernel code which wants to be called
@@ -77,6 +83,15 @@ static int __kprobes notifier_call_chain(struct notifier_block **nl,
 {
        int ret = NOTIFY_DONE;
        struct notifier_block *nb, *next_nb;
+/*******************************************************************************
+* 20131225 marc.huang                                                          *
+* CPU Hotplug debug mechanism                                                  *
+*******************************************************************************/
+#if defined(CONFIG_SMP) && (defined(MTK_CPU_HOTPLUG_DEBUG_1) || defined(MTK_CPU_HOTPLUG_DEBUG_2))
+       int index = 0;
+       extern struct raw_notifier_head cpu_chain;
+#endif //#if defined(CONFIG_SMP) && (defined(MTK_CPU_HOTPLUG_DEBUG_1) || defined(MTK_CPU_HOTPLUG_DEBUG_2))
+/******************************************************************************/
 
        nb = rcu_dereference_raw(*nl);
 
@@ -90,6 +105,25 @@ static int __kprobes notifier_call_chain(struct notifier_block **nl,
                        continue;
                }
 #endif
+
+/*******************************************************************************
+* 20131225 marc.huang                                                          *
+* CPU Hotplug debug mechanism                                                  *
+*******************************************************************************/
+#if defined(CONFIG_SMP) && (defined(MTK_CPU_HOTPLUG_DEBUG_1) || defined(MTK_CPU_HOTPLUG_DEBUG_2))
+               if (nl == &cpu_chain.head)
+               {
+               #if defined(MTK_CPU_HOTPLUG_DEBUG_1)
+                       printk(KERN_DEBUG "[cpu_ntf] %02lx_%02d, %p\n", val, index, nb->notifier_call);
+               #endif //#if defined(MTK_CPU_HOTPLUG_DEBUG_1)
+               #if defined(MTK_CPU_HOTPLUG_DEBUG_2)
+                       aee_rr_rec_hotplug(0, val & 0xff, index & 0xff, (unsigned long)nb->notifier_call);
+               #endif //#if defined(MTK_CPU_HOTPLUG_DEBUG_2)
+                       ++index;
+               }
+#endif //#if defined(CONFIG_SMP) && (defined(MTK_CPU_HOTPLUG_DEBUG_1) || defined(MTK_CPU_HOTPLUG_DEBUG_2))
+/******************************************************************************/
+
                ret = nb->notifier_call(nb, val, v);
 
                if (nr_calls)
@@ -100,6 +134,23 @@ static int __kprobes notifier_call_chain(struct notifier_block **nl,
                nb = next_nb;
                nr_to_call--;
        }
+/*******************************************************************************
+* 20131225 marc.huang                                                          *
+* CPU Hotplug debug mechanism                                                  *
+*******************************************************************************/
+#if defined(CONFIG_SMP) && (defined(MTK_CPU_HOTPLUG_DEBUG_1) || defined(MTK_CPU_HOTPLUG_DEBUG_2))
+       if (nl == &cpu_chain.head)
+       {
+       #if defined(MTK_CPU_HOTPLUG_DEBUG_1)
+               printk(KERN_DEBUG "[cpu_ntf] %02lx_%02d, %p\n", val, index, 0);
+       #endif //#if defined(MTK_CPU_HOTPLUG_DEBUG_1)
+       #if defined(MTK_CPU_HOTPLUG_DEBUG_2)
+               //aee_rr_rec_hoplug(0, val & 0xff, index & 0xff);
+               aee_rr_rec_hotplug(0, val & 0xff, index & 0xff, 0);
+       #endif //#if defined(MTK_CPU_HOTPLUG_DEBUG_2)
+       }
+#endif //#if defined(CONFIG_SMP) && (defined(MTK_CPU_HOTPLUG_DEBUG_1) || defined(MTK_CPU_HOTPLUG_DEBUG_2))
+/******************************************************************************/
        return ret;
 }