From 8726a2d930a815066b7a0ed8a4d4c560fbc4d114 Mon Sep 17 00:00:00 2001 From: Xiaopeng Bai Date: Thu, 14 Apr 2022 16:22:43 +0800 Subject: [PATCH] ANDROID: GKI: regmap: Add regmap vendor hook for of_syscon_register For global registers access, UNISOC have one special method called set/clear mechanism that would avoid using hardware spinlock. But now regmap framework does not support our set/clear mechanism, so add vendor hook to support this feature. Bug: 228907258 Signed-off-by: Xiaopeng Bai Change-Id: I9a6651f07a048ffebd5c2d8e369a4e7b374bc182 (cherry picked from commit 53e342c183af58f03bd1445838a3f499e7fbd191) --- drivers/android/vendor_hooks.c | 2 ++ drivers/mfd/syscon.c | 2 ++ include/trace/hooks/regmap.h | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 include/trace/hooks/regmap.h diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index badd371e142df..482830505f1b9 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -66,6 +66,7 @@ #include #include #include +#include /* * Export tracepoints that act as a bare tracehook (ie: have no trace event @@ -310,3 +311,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_post_image_save); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_madvise_cold_pageout_skip); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rmqueue_smallest_bypass); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_one_page_bypass); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_regmap_update); diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c index bdb2ce7ff03b9..0871c97ae51af 100644 --- a/drivers/mfd/syscon.c +++ b/drivers/mfd/syscon.c @@ -22,6 +22,7 @@ #include #include #include +#include static struct platform_driver syscon_driver; @@ -128,6 +129,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_clk) } } + trace_android_vh_regmap_update(&syscon_config, regmap); syscon->regmap = regmap; syscon->np = np; diff --git a/include/trace/hooks/regmap.h b/include/trace/hooks/regmap.h new file mode 100644 index 0000000000000..cb6fc43d34720 --- /dev/null +++ b/include/trace/hooks/regmap.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#undef TRACE_SYSTEM +#define TRACE_SYSTEM regmap +#undef TRACE_INCLUDE_PATH +#define TRACE_INCLUDE_PATH trace/hooks + +#if !defined(_TRACE_HOOK_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ) +#define _TRACE_HOOK_REGMAP_H +#include + +struct regmap_config; +struct regmap; + +/* + * Following tracepoints are not exported in tracefs and provide a + * mechanism for vendor modules to hook and extend functionality + */ +DECLARE_HOOK(android_vh_regmap_update, + TP_PROTO(const struct regmap_config *config, struct regmap *map), + TP_ARGS(config, map)); + +#endif /* _TRACE_HOOK_REGMAP_H */ +/* This part must be outside protection */ +#include