mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 06:03:36 -04:00
clk: add/modify debugfs support for clocks
Update clock debugfs to support the below functionalities. - Allow enabling/disabling a clock. - Allow calling set_rate on a clock. - Display the list of enabled_clocks along with prepare_count, enable_count and rate. - Add a trace_clocks node to dump the current state of all clocks in the ftrace logs. Change-Id: Ib67b3a3409c9e7d8adb710bb524f54f543abf712 Signed-off-by: Taniya Das <tdas@codeaurora.org> Signed-off-by: David Dai <daidavid1@codeaurora.org> Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
This commit is contained in:
parent
ec6b9bfbe0
commit
fd4adb4c8c
5 changed files with 289 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM clk
|
||||
|
|
@ -220,6 +220,42 @@ DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle_complete,
|
|||
TP_ARGS(core, duty)
|
||||
);
|
||||
|
||||
DECLARE_EVENT_CLASS(clk_state_dump,
|
||||
|
||||
TP_PROTO(const char *name, unsigned int prepare_count,
|
||||
unsigned int enable_count, unsigned long rate, unsigned int vdd_level),
|
||||
|
||||
TP_ARGS(name, prepare_count, enable_count, rate, vdd_level),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__string(name, name)
|
||||
__field(unsigned int, prepare_count)
|
||||
__field(unsigned int, enable_count)
|
||||
__field(unsigned long, rate)
|
||||
__field(unsigned int, vdd_level)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
__assign_str(name, name);
|
||||
__entry->prepare_count = prepare_count;
|
||||
__entry->enable_count = enable_count;
|
||||
__entry->rate = rate;
|
||||
__entry->vdd_level = vdd_level;
|
||||
),
|
||||
|
||||
TP_printk("%s\tprepare:enable cnt [%u:%u]\trate: vdd_level [%lu:%u]",
|
||||
__get_str(name), __entry->prepare_count, __entry->enable_count,
|
||||
__entry->rate, __entry->vdd_level)
|
||||
);
|
||||
|
||||
DEFINE_EVENT(clk_state_dump, clk_state,
|
||||
|
||||
TP_PROTO(const char *name, unsigned int prepare_count,
|
||||
unsigned int enable_count, unsigned long rate, unsigned int vdd_level),
|
||||
|
||||
TP_ARGS(name, prepare_count, enable_count, rate, vdd_level)
|
||||
);
|
||||
|
||||
#endif /* _TRACE_CLK_H */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
|
|
|||
Loading…
Reference in a new issue