regulator.h 2.4 KB

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