Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #undef TRACE_SYSTEM
0003 #define TRACE_SYSTEM regulator
0004 
0005 #if !defined(_TRACE_REGULATOR_H) || defined(TRACE_HEADER_MULTI_READ)
0006 #define _TRACE_REGULATOR_H
0007 
0008 #include <linux/ktime.h>
0009 #include <linux/tracepoint.h>
0010 
0011 /*
0012  * Events which just log themselves and the regulator name for enable/disable
0013  * type tracking.
0014  */
0015 DECLARE_EVENT_CLASS(regulator_basic,
0016 
0017     TP_PROTO(const char *name),
0018 
0019     TP_ARGS(name),
0020 
0021     TP_STRUCT__entry(
0022         __string(   name,   name    )
0023     ),
0024 
0025     TP_fast_assign(
0026         __assign_str(name, name);
0027     ),
0028 
0029     TP_printk("name=%s", __get_str(name))
0030 
0031 );
0032 
0033 DEFINE_EVENT(regulator_basic, regulator_enable,
0034 
0035     TP_PROTO(const char *name),
0036 
0037     TP_ARGS(name)
0038 
0039 );
0040 
0041 DEFINE_EVENT(regulator_basic, regulator_enable_delay,
0042 
0043     TP_PROTO(const char *name),
0044 
0045     TP_ARGS(name)
0046 
0047 );
0048 
0049 DEFINE_EVENT(regulator_basic, regulator_enable_complete,
0050 
0051     TP_PROTO(const char *name),
0052 
0053     TP_ARGS(name)
0054 
0055 );
0056 
0057 DEFINE_EVENT(regulator_basic, regulator_disable,
0058 
0059     TP_PROTO(const char *name),
0060 
0061     TP_ARGS(name)
0062 
0063 );
0064 
0065 DEFINE_EVENT(regulator_basic, regulator_disable_complete,
0066 
0067     TP_PROTO(const char *name),
0068 
0069     TP_ARGS(name)
0070 
0071 );
0072 
0073 DEFINE_EVENT(regulator_basic, regulator_bypass_enable,
0074 
0075     TP_PROTO(const char *name),
0076 
0077     TP_ARGS(name)
0078 
0079 );
0080 
0081 DEFINE_EVENT(regulator_basic, regulator_bypass_enable_complete,
0082 
0083     TP_PROTO(const char *name),
0084 
0085     TP_ARGS(name)
0086 
0087 );
0088 
0089 DEFINE_EVENT(regulator_basic, regulator_bypass_disable,
0090 
0091     TP_PROTO(const char *name),
0092 
0093     TP_ARGS(name)
0094 
0095 );
0096 
0097 DEFINE_EVENT(regulator_basic, regulator_bypass_disable_complete,
0098 
0099     TP_PROTO(const char *name),
0100 
0101     TP_ARGS(name)
0102 
0103 );
0104 
0105 /*
0106  * Events that take a range of numerical values, mostly for voltages
0107  * and so on.
0108  */
0109 DECLARE_EVENT_CLASS(regulator_range,
0110 
0111     TP_PROTO(const char *name, int min, int max),
0112 
0113     TP_ARGS(name, min, max),
0114 
0115     TP_STRUCT__entry(
0116         __string(   name,       name        )
0117         __field(        int,            min             )
0118         __field(        int,            max             )
0119     ),
0120 
0121     TP_fast_assign(
0122         __assign_str(name, name);
0123         __entry->min  = min;
0124         __entry->max  = max;
0125     ),
0126 
0127     TP_printk("name=%s (%d-%d)", __get_str(name),
0128           (int)__entry->min, (int)__entry->max)
0129 );
0130 
0131 DEFINE_EVENT(regulator_range, regulator_set_voltage,
0132 
0133     TP_PROTO(const char *name, int min, int max),
0134 
0135     TP_ARGS(name, min, max)
0136 
0137 );
0138 
0139 
0140 /*
0141  * Events that take a single value, mostly for readback and refcounts.
0142  */
0143 DECLARE_EVENT_CLASS(regulator_value,
0144 
0145     TP_PROTO(const char *name, unsigned int val),
0146 
0147     TP_ARGS(name, val),
0148 
0149     TP_STRUCT__entry(
0150         __string(   name,       name        )
0151         __field(        unsigned int,   val             )
0152     ),
0153 
0154     TP_fast_assign(
0155         __assign_str(name, name);
0156         __entry->val  = val;
0157     ),
0158 
0159     TP_printk("name=%s, val=%u", __get_str(name),
0160           (int)__entry->val)
0161 );
0162 
0163 DEFINE_EVENT(regulator_value, regulator_set_voltage_complete,
0164 
0165     TP_PROTO(const char *name, unsigned int value),
0166 
0167     TP_ARGS(name, value)
0168 
0169 );
0170 
0171 #endif /* _TRACE_POWER_H */
0172 
0173 /* This part must be outside protection */
0174 #include <trace/define_trace.h>