regulator.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. /*
  44. * Events that take a range of numerical values, mostly for voltages
  45. * and so on.
  46. */
  47. DECLARE_EVENT_CLASS(regulator_range,
  48. TP_PROTO(const char *name, int min, int max),
  49. TP_ARGS(name, min, max),
  50. TP_STRUCT__entry(
  51. __string( name, name )
  52. __field( int, min )
  53. __field( int, max )
  54. ),
  55. TP_fast_assign(
  56. __assign_str(name, name);
  57. __entry->min = min;
  58. __entry->max = max;
  59. ),
  60. TP_printk("name=%s (%d-%d)", __get_str(name),
  61. (int)__entry->min, (int)__entry->max)
  62. );
  63. DEFINE_EVENT(regulator_range, regulator_set_voltage,
  64. TP_PROTO(const char *name, int min, int max),
  65. TP_ARGS(name, min, max)
  66. );
  67. /*
  68. * Events that take a single value, mostly for readback and refcounts.
  69. */
  70. DECLARE_EVENT_CLASS(regulator_value,
  71. TP_PROTO(const char *name, unsigned int val),
  72. TP_ARGS(name, val),
  73. TP_STRUCT__entry(
  74. __string( name, name )
  75. __field( unsigned int, val )
  76. ),
  77. TP_fast_assign(
  78. __assign_str(name, name);
  79. __entry->val = val;
  80. ),
  81. TP_printk("name=%s, val=%u", __get_str(name),
  82. (int)__entry->val)
  83. );
  84. DEFINE_EVENT(regulator_value, regulator_set_voltage_complete,
  85. TP_PROTO(const char *name, unsigned int value),
  86. TP_ARGS(name, value)
  87. );
  88. #endif /* _TRACE_POWER_H */
  89. /* This part must be outside protection */
  90. #include <trace/define_trace.h>