^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define TRACE_SYSTEM pwm
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #if !defined(_TRACE_PWM_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define _TRACE_PWM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/pwm.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) DECLARE_EVENT_CLASS(pwm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) TP_PROTO(struct pwm_device *pwm, const struct pwm_state *state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) TP_ARGS(pwm, state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) __field(struct pwm_device *, pwm)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) __field(u64, period)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) __field(u64, duty_cycle)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) __field(enum pwm_polarity, polarity)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) __field(bool, enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) __entry->pwm = pwm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) __entry->period = state->period;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) __entry->duty_cycle = state->duty_cycle;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) __entry->polarity = state->polarity;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) __entry->enabled = state->enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) TP_printk("%p: period=%llu duty_cycle=%llu polarity=%d enabled=%d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) __entry->pwm, __entry->period, __entry->duty_cycle,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) __entry->polarity, __entry->enabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) DEFINE_EVENT(pwm, pwm_apply,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) TP_PROTO(struct pwm_device *pwm, const struct pwm_state *state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) TP_ARGS(pwm, state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) DEFINE_EVENT(pwm, pwm_get,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) TP_PROTO(struct pwm_device *pwm, const struct pwm_state *state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) TP_ARGS(pwm, state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #endif /* _TRACE_PWM_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #include <trace/define_trace.h>