summaryrefslogtreecommitdiff
path: root/drivers/pwm
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>2024-09-20 10:58:00 +0200
committerUwe Kleine-König <ukleinek@kernel.org>2024-09-28 15:13:56 +0200
commit1afd01db1a76cdd1d96696e3790d66c79621784c (patch)
tree4c7ef68d0735ae30893a0420fcdfae0c07cd1b73 /drivers/pwm
parent6c5126c6406d1c31e91f5b925c621c1c785366be (diff)
downloadlwn-1afd01db1a76cdd1d96696e3790d66c79621784c.tar.gz
lwn-1afd01db1a76cdd1d96696e3790d66c79621784c.zip
pwm: Add tracing for waveform callbacks
This adds trace events for the recently introduced waveform callbacks. With the introduction of some helper macros consistency among the different events is ensured. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Link: https://lore.kernel.org/r/1d71879b0de3bf01459c7a9d0f040d43eb5ace56.1726819463.git.u.kleine-koenig@baylibre.com Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/core.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
index 038f17dd2757..c3bdebf4cf6e 100644
--- a/drivers/pwm/core.c
+++ b/drivers/pwm/core.c
@@ -164,30 +164,46 @@ static int __pwm_round_waveform_tohw(struct pwm_chip *chip, struct pwm_device *p
const struct pwm_waveform *wf, void *wfhw)
{
const struct pwm_ops *ops = chip->ops;
+ int ret;
+
+ ret = ops->round_waveform_tohw(chip, pwm, wf, wfhw);
+ trace_pwm_round_waveform_tohw(pwm, wf, wfhw, ret);
- return ops->round_waveform_tohw(chip, pwm, wf, wfhw);
+ return ret;
}
static int __pwm_round_waveform_fromhw(struct pwm_chip *chip, struct pwm_device *pwm,
const void *wfhw, struct pwm_waveform *wf)
{
const struct pwm_ops *ops = chip->ops;
+ int ret;
+
+ ret = ops->round_waveform_fromhw(chip, pwm, wfhw, wf);
+ trace_pwm_round_waveform_fromhw(pwm, wfhw, wf, ret);
- return ops->round_waveform_fromhw(chip, pwm, wfhw, wf);
+ return ret;
}
static int __pwm_read_waveform(struct pwm_chip *chip, struct pwm_device *pwm, void *wfhw)
{
const struct pwm_ops *ops = chip->ops;
+ int ret;
+
+ ret = ops->read_waveform(chip, pwm, wfhw);
+ trace_pwm_read_waveform(pwm, wfhw, ret);
- return ops->read_waveform(chip, pwm, wfhw);
+ return ret;
}
static int __pwm_write_waveform(struct pwm_chip *chip, struct pwm_device *pwm, const void *wfhw)
{
const struct pwm_ops *ops = chip->ops;
+ int ret;
+
+ ret = ops->write_waveform(chip, pwm, wfhw);
+ trace_pwm_write_waveform(pwm, wfhw, ret);
- return ops->write_waveform(chip, pwm, wfhw);
+ return ret;
}
#define WFHWSIZE 20