max77759_charger: add debug file node to dump all registers
create node:
/d/max77759_chg/registers
/d/max77729_pmic/registers
Also need to add in catch bugreport path for debugging
Bug: 230360103
Signed-off-by: Jenny Ho <[email protected]>
Change-Id: I341882c1844c2639f174454abcddbe306926c0b4
diff --git a/google_bms.h b/google_bms.h
index 5d1522b..c47d53f 100644
--- a/google_bms.h
+++ b/google_bms.h
@@ -90,6 +90,14 @@
#define CHG_EV_ADAPTER_STRING(s) #s
#define _CHG_EV_ADAPTER_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
+#define BATTERY_DEBUG_ATTRIBUTE(name, fn_read, fn_write) \
+static const struct file_operations name = { \
+ .open = simple_open, \
+ .llseek = no_llseek, \
+ .read = fn_read, \
+ .write = fn_write, \
+}
+
/* Enums will start with CHG_EV_ADAPTER_TYPE_ */
#define CHG_EV_ADAPTER_ENUM(e) \
_CHG_EV_ADAPTER_PRIMITIVE_CAT(CHG_EV_ADAPTER_TYPE_,e)