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
Bug: 381974812

Signed-off-by: Xiaopeng Bai <xiaopeng.bai@unisoc.com>
Change-Id: I9a6651f07a048ffebd5c2d8e369a4e7b374bc182
(cherry picked from commit 53e342c183af58f03bd1445838a3f499e7fbd191)
(cherry picked from commit 8726a2d930a815066b7a0ed8a4d4c560fbc4d114)
Signed-off-by: Cixi Geng <cixi.geng1@unisoc.com>
This commit is contained in:
Xiaopeng Bai
2022-04-14 16:22:43 +08:00
committed by Todd Kjos
parent 44301f95d9
commit a9e1381ec8
3 changed files with 28 additions and 0 deletions
+2
View File
@@ -51,6 +51,7 @@
#include <trace/hooks/futex.h>
#include <trace/hooks/bug.h>
#include <trace/hooks/logbuf.h>
#include <trace/hooks/regmap.h>
/*
* Export tracepoints that act as a bare tracehook (ie: have no trace event
@@ -185,3 +186,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_report_bug);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_logbuf);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_logbuf_pr_cont);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_calc_alloc_flags);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_regmap_update);
+2
View File
@@ -24,6 +24,7 @@
#include <linux/reset.h>
#include <linux/mfd/syscon.h>
#include <linux/slab.h>
#include <trace/hooks/regmap.h>
static struct platform_driver syscon_driver;
@@ -141,6 +142,7 @@ static struct syscon *of_syscon_register(struct device_node *np, bool check_res)
goto err_reset;
}
trace_android_vh_regmap_update(&syscon_config, regmap);
syscon->regmap = regmap;
syscon->np = np;
+24
View File
@@ -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 <trace/hooks/vendor_hooks.h>
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 <trace/define_trace.h>