diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2024-04-15 07:35:57 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2024-04-16 12:10:05 +0200 |
commit | c5ae8eb5ef72385556c0665cf9fe0247219d83f6 (patch) | |
tree | 31608e727a343018c72face2cab8bc5eb22681df /include | |
parent | 29e00152bb73fcc59a6313f45649a12afd0c79c7 (diff) | |
download | barebox-c5ae8eb5ef72385556c0665cf9fe0247219d83f6.tar.gz barebox-c5ae8eb5ef72385556c0665cf9fe0247219d83f6.tar.xz |
PWM: align struct pwm_state member names with Linux
This introduces no functional change, but removes some churn of porting
Linux drivers by aligning the naming of the frequently used struct
pwm_state.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20240415053600.370622-5-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/pwm.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/include/pwm.h b/include/pwm.h index 876a242289..e8b0f2c962 100644 --- a/include/pwm.h +++ b/include/pwm.h @@ -12,16 +12,16 @@ struct device; /* * struct pwm_state - state of a PWM channel - * @period_ns: PWM period (in nanoseconds) - * @duty_ns: PWM duty cycle (in nanoseconds) + * @period: PWM period (in nanoseconds) + * @duty_cycle: PWM duty cycle (in nanoseconds) * @polarity: PWM polarity - * @p_enable: PWM enabled status + * @enabled: PWM enabled status */ struct pwm_state { - unsigned int period_ns; - unsigned int duty_ns; + unsigned int period; + unsigned int duty_cycle; unsigned int polarity; - unsigned int p_enable; + unsigned int enabled; }; void pwm_print(void); @@ -91,9 +91,9 @@ pwm_set_relative_duty_cycle(struct pwm_state *state, unsigned int duty_cycle, if (!scale || duty_cycle > scale) return -EINVAL; - state->duty_ns = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * - state->period_ns, - scale); + state->duty_cycle = DIV_ROUND_CLOSEST_ULL((u64)duty_cycle * + state->period, + scale); return 0; } |