logbuffer: move logbuffer and gvotables to kernel

logbuffers are used from the GBMS and TCPCI code to record internal
state and debug information that don't need (or cannot) be routed
to the standard syslog.

votables are used to arbitrate the access and manage the state of a
shared resource. Also make PMIC voter compat a compile time option

Bug: 166510851
Bug: 166528086
Bug: 164260419
Test: recompile
Signed-off-by: AleX Pelosi <[email protected]>
Change-Id: Idd8752bbd4b5fe7a1145cf2892884050926107dd
diff --git a/google_battery.c b/google_battery.c
index b7424e7..76bf374 100644
--- a/google_battery.c
+++ b/google_battery.c
@@ -32,7 +32,7 @@
 #include "google_bms.h"
 #include "google_psy.h"
 #include "qmath.h"
-#include "logbuffer.h"
+#include <misc/logbuffer.h>
 #include <crypto/hash.h>
 
 #include <linux/debugfs.h>
@@ -3858,7 +3858,7 @@
 			"Couldn't register as power supply, ret=%d\n", ret);
 	}
 
-	batt_drv->ssoc_log = debugfs_logbuffer_register("ssoc");
+	batt_drv->ssoc_log = logbuffer_register("ssoc");
 	if (IS_ERR(batt_drv->ssoc_log)) {
 		ret = PTR_ERR(batt_drv->ssoc_log);
 		dev_err(batt_drv->device,
@@ -3866,7 +3866,7 @@
 		batt_drv->ssoc_log = NULL;
 	}
 
-	batt_drv->ttf_log = debugfs_logbuffer_register("ttf");
+	batt_drv->ttf_log = logbuffer_register("ttf");
 	if (IS_ERR(batt_drv->ttf_log)) {
 		ret = PTR_ERR(batt_drv->ttf_log);
 		dev_err(batt_drv->device,
@@ -3920,9 +3920,9 @@
 		return 0;
 
 	if (batt_drv->ssoc_log)
-		debugfs_logbuffer_unregister(batt_drv->ssoc_log);
+		logbuffer_unregister(batt_drv->ssoc_log);
 	if (batt_drv->ttf_log)
-		debugfs_logbuffer_unregister(batt_drv->ttf_log);
+		logbuffer_unregister(batt_drv->ttf_log);
 	if (batt_drv->tz_dev)
 		thermal_zone_of_sensor_unregister(batt_drv->device,
 				batt_drv->tz_dev);