regulator.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM regulator
  4. #if !defined(_TRACE_REGULATOR_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_REGULATOR_H
  6. #include <linux/ktime.h>
  7. #include <linux/tracepoint.h>
  8. /*
  9. * Events which just log themselves and the regulator name for enable/disable
  10. * type tracking.
  11. */
  12. DECLARE_EVENT_CLASS(regulator_basic,
  13. TP_PROTO(const char *name),
  14. TP_ARGS(name),
  15. TP_STRUCT__entry(
  16. __string( name, name )
  17. ),
  18. TP_fast_assign(
  19. __assign_str(name, name);
  20. ),
  21. TP_printk("name=%s", __get_str(name))
  22. );
  23. DEFINE_EVENT(regulator_basic, regulator_enable,
  24. TP_PROTO(const char *name),
  25. TP_ARGS(name)
  26. );
  27. DEFINE_EVENT(regulator_basic, regulator_enable_delay,
  28. TP_PROTO(const char *name),
  29. TP_ARGS(name)
  30. );
  31. DEFINE_EVENT(regulator_basic, regulator_enable_complete,
  32. TP_PROTO(const char *name),
  33. TP_ARGS(name)
  34. );
  35. DEFINE_EVENT(regulator_basic, regulator_disable,
  36. TP_PROTO(const char *name),
  37. TP_ARGS(name)
  38. );
  39. DEFINE_EVENT(regulator_basic, regulator_disable_complete,
  40. TP_PROTO(const char *name),
  41. TP_ARGS(name)
  42. );
  43. DEFINE_EVENT(regulator_basic, regulator_bypass_enable,
  44. TP_PROTO(const char *name),
  45. TP_ARGS(name)
  46. );
  47. DEFINE_EVENT(regulator_basic, regulator_bypass_enable_complete,
  48. TP_PROTO(const char *name),
  49. TP_ARGS(name)
  50. );
  51. DEFINE_EVENT(regulator_basic, regulator_bypass_disable,
  52. TP_PROTO(const char *name),
  53. TP_ARGS(name)
  54. );
  55. DEFINE_EVENT(regulator_basic, regulator_bypass_disable_complete,
  56. TP_PROTO(const char *name),
  57. TP_ARGS(name)
  58. );
  59. /*
  60. * Events that take a range of numerical values, mostly for voltages
  61. * and so on.
  62. */
  63. DECLARE_EVENT_CLASS(regulator_range,
  64. TP_PROTO(const char *name, int min, int max),
  65. TP_ARGS(name, min, max),
  66. TP_STRUCT__entry(
  67. __string( name, name )
  68. __field( int, min )
  69. __field( int, max )
  70. ),
  71. TP_fast_assign(
  72. __assign_str(name, name);
  73. __entry->min = min;
  74. __entry->max = max;
  75. ),
  76. TP_printk("name=%s (%d-%d)", __get_str(name),
  77. (int)__entry->min, (int)__entry->max)
  78. );
  79. DEFINE_EVENT(regulator_range, regulator_set_voltage,
  80. TP_PROTO(const char *name, int min, int max),
  81. TP_ARGS(name, min, max)
  82. );
  83. /*
  84. * Events that take a single value, mostly for readback and refcounts.
  85. */
  86. DECLARE_EVENT_CLASS(regulator_value,
  87. TP_PROTO(const char *name, unsigned int val),
  88. TP_ARGS(name, val),
  89. TP_STRUCT__entry(
  90. __string( name, name )
  91. __field( unsigned int, val )
  92. ),
  93. TP_fast_assign(
  94. __assign_str(name, name);
  95. __entry->val = val;
  96. ),
  97. TP_printk("name=%s, val=%u", __get_str(name),
  98. (int)__entry->val)
  99. );
  100. DEFINE_EVENT(regulator_value, regulator_set_voltage_complete,
  101. TP_PROTO(const char *name, unsigned int value),
  102. TP_ARGS(name, value)
  103. );
  104. #endif /* _TRACE_POWER_H */
  105. /* This part must be outside protection */
  106. #include <trace/define_trace.h>