asoc.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM asoc
  3. #if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_ASOC_H
  5. #include <linux/ktime.h>
  6. #include <linux/tracepoint.h>
  7. struct snd_soc_jack;
  8. struct snd_soc_codec;
  9. struct snd_soc_card;
  10. struct snd_soc_dapm_widget;
  11. /*
  12. * Log register events
  13. */
  14. DECLARE_EVENT_CLASS(snd_soc_reg,
  15. TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
  16. unsigned int val),
  17. TP_ARGS(codec, reg, val),
  18. TP_STRUCT__entry(
  19. __string( name, codec->name )
  20. __field( int, id )
  21. __field( unsigned int, reg )
  22. __field( unsigned int, val )
  23. ),
  24. TP_fast_assign(
  25. __assign_str(name, codec->name);
  26. __entry->id = codec->id;
  27. __entry->reg = reg;
  28. __entry->val = val;
  29. ),
  30. TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name),
  31. (int)__entry->id, (unsigned int)__entry->reg,
  32. (unsigned int)__entry->val)
  33. );
  34. DEFINE_EVENT(snd_soc_reg, snd_soc_reg_write,
  35. TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
  36. unsigned int val),
  37. TP_ARGS(codec, reg, val)
  38. );
  39. DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read,
  40. TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
  41. unsigned int val),
  42. TP_ARGS(codec, reg, val)
  43. );
  44. DECLARE_EVENT_CLASS(snd_soc_card,
  45. TP_PROTO(struct snd_soc_card *card, int val),
  46. TP_ARGS(card, val),
  47. TP_STRUCT__entry(
  48. __string( name, card->name )
  49. __field( int, val )
  50. ),
  51. TP_fast_assign(
  52. __assign_str(name, card->name);
  53. __entry->val = val;
  54. ),
  55. TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val)
  56. );
  57. DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start,
  58. TP_PROTO(struct snd_soc_card *card, int val),
  59. TP_ARGS(card, val)
  60. );
  61. DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done,
  62. TP_PROTO(struct snd_soc_card *card, int val),
  63. TP_ARGS(card, val)
  64. );
  65. DECLARE_EVENT_CLASS(snd_soc_dapm_basic,
  66. TP_PROTO(struct snd_soc_card *card),
  67. TP_ARGS(card),
  68. TP_STRUCT__entry(
  69. __string( name, card->name )
  70. ),
  71. TP_fast_assign(
  72. __assign_str(name, card->name);
  73. ),
  74. TP_printk("card=%s", __get_str(name))
  75. );
  76. DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start,
  77. TP_PROTO(struct snd_soc_card *card),
  78. TP_ARGS(card)
  79. );
  80. DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done,
  81. TP_PROTO(struct snd_soc_card *card),
  82. TP_ARGS(card)
  83. );
  84. DECLARE_EVENT_CLASS(snd_soc_dapm_widget,
  85. TP_PROTO(struct snd_soc_dapm_widget *w, int val),
  86. TP_ARGS(w, val),
  87. TP_STRUCT__entry(
  88. __string( name, w->name )
  89. __field( int, val )
  90. ),
  91. TP_fast_assign(
  92. __assign_str(name, w->name);
  93. __entry->val = val;
  94. ),
  95. TP_printk("widget=%s val=%d", __get_str(name),
  96. (int)__entry->val)
  97. );
  98. DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power,
  99. TP_PROTO(struct snd_soc_dapm_widget *w, int val),
  100. TP_ARGS(w, val)
  101. );
  102. DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start,
  103. TP_PROTO(struct snd_soc_dapm_widget *w, int val),
  104. TP_ARGS(w, val)
  105. );
  106. DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done,
  107. TP_PROTO(struct snd_soc_dapm_widget *w, int val),
  108. TP_ARGS(w, val)
  109. );
  110. TRACE_EVENT(snd_soc_jack_irq,
  111. TP_PROTO(const char *name),
  112. TP_ARGS(name),
  113. TP_STRUCT__entry(
  114. __string( name, name )
  115. ),
  116. TP_fast_assign(
  117. __assign_str(name, name);
  118. ),
  119. TP_printk("%s", __get_str(name))
  120. );
  121. TRACE_EVENT(snd_soc_jack_report,
  122. TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
  123. TP_ARGS(jack, mask, val),
  124. TP_STRUCT__entry(
  125. __string( name, jack->jack->name )
  126. __field( int, mask )
  127. __field( int, val )
  128. ),
  129. TP_fast_assign(
  130. __assign_str(name, jack->jack->name);
  131. __entry->mask = mask;
  132. __entry->val = val;
  133. ),
  134. TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val,
  135. (int)__entry->mask)
  136. );
  137. TRACE_EVENT(snd_soc_jack_notify,
  138. TP_PROTO(struct snd_soc_jack *jack, int val),
  139. TP_ARGS(jack, val),
  140. TP_STRUCT__entry(
  141. __string( name, jack->jack->name )
  142. __field( int, val )
  143. ),
  144. TP_fast_assign(
  145. __assign_str(name, jack->jack->name);
  146. __entry->val = val;
  147. ),
  148. TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
  149. );
  150. TRACE_EVENT(snd_soc_cache_sync,
  151. TP_PROTO(struct snd_soc_codec *codec, const char *type,
  152. const char *status),
  153. TP_ARGS(codec, type, status),
  154. TP_STRUCT__entry(
  155. __string( name, codec->name )
  156. __string( status, status )
  157. __string( type, type )
  158. __field( int, id )
  159. ),
  160. TP_fast_assign(
  161. __assign_str(name, codec->name);
  162. __assign_str(status, status);
  163. __assign_str(type, type);
  164. __entry->id = codec->id;
  165. ),
  166. TP_printk("codec=%s.%d type=%s status=%s", __get_str(name),
  167. (int)__entry->id, __get_str(type), __get_str(status))
  168. );
  169. #endif /* _TRACE_ASOC_H */
  170. /* This part must be outside protection */
  171. #include <trace/define_trace.h>