qcom_haptics.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #undef TRACE_SYSTEM
  6. #define TRACE_SYSTEM qcom_haptics
  7. #if !defined(_TRACE_QCOM_HAPTICS_H) || defined(TRACE_HEADER_MULTI_READ)
  8. #define _TRACE_QCOM_HAPTICS_H
  9. #include <linux/tracepoint.h>
  10. TRACE_EVENT(qcom_haptics_fifo_hw_status,
  11. TP_PROTO(u32 filled, u32 available, bool full, bool empty),
  12. TP_ARGS(filled, available, full, empty),
  13. TP_STRUCT__entry(
  14. __field(u32, filled)
  15. __field(u32, available)
  16. __field(bool, full)
  17. __field(bool, empty)
  18. ),
  19. TP_fast_assign(
  20. __entry->filled = filled;
  21. __entry->available = available;
  22. __entry->full = full;
  23. __entry->empty = empty;
  24. ),
  25. TP_printk("FIFO HW status: filled = %u, available = %u, full = %d, empty = %d\n",
  26. __entry->filled, __entry->available, __entry->full, __entry->empty)
  27. );
  28. TRACE_EVENT(qcom_haptics_fifo_prgm_status,
  29. TP_PROTO(u32 total, u32 written, u32 num_bytes),
  30. TP_ARGS(total, written, num_bytes),
  31. TP_STRUCT__entry(
  32. __field(u32, total)
  33. __field(u32, written)
  34. __field(u32, num_bytes)
  35. ),
  36. TP_fast_assign(
  37. __entry->total = total;
  38. __entry->written = written;
  39. __entry->num_bytes = num_bytes;
  40. ),
  41. TP_printk("FIFO program status: writing %u bytes, written %u bytes, total %u bytes\n",
  42. __entry->num_bytes, __entry->written, __entry->total)
  43. );
  44. TRACE_EVENT(qcom_haptics_play,
  45. TP_PROTO(bool enable),
  46. TP_ARGS(enable),
  47. TP_STRUCT__entry(
  48. __field(bool, enable)
  49. ),
  50. TP_fast_assign(
  51. __entry->enable = enable;
  52. ),
  53. TP_printk("play enable: %d\n", __entry->enable)
  54. );
  55. TRACE_EVENT(qcom_haptics_status,
  56. TP_PROTO(const char *name, u8 msb, u8 lsb),
  57. TP_ARGS(name, msb, lsb),
  58. TP_STRUCT__entry(
  59. __string(id_name, name)
  60. __field(u8, msb)
  61. __field(u8, lsb)
  62. ),
  63. TP_fast_assign(
  64. __assign_str(id_name, name);
  65. __entry->msb = msb;
  66. __entry->lsb = lsb;
  67. ),
  68. TP_printk("haptics %s status: MSB %#x, LSB %#x\n", __get_str(id_name),
  69. __entry->msb, __entry->lsb)
  70. );
  71. #endif /* _TRACE_QCOM_HAPTICS_H */
  72. #include <trace/define_trace.h>