-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: pwm: nrfx: add global hsfll request for fast PWM #82133
drivers: pwm: nrfx: add global hsfll request for fast PWM #82133
Conversation
e94eb66
to
1e59406
Compare
@bjarki-andreasen You can have a look |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
98008da
to
89e31f4
Compare
189c159
7e65732
to
189c159
Compare
189c159
to
6f113f8
Compare
6f113f8
to
c4118a1
Compare
5b88b7e
c4118a1
to
5b88b7e
Compare
drivers/pwm/pwm_nrfx.c
Outdated
@@ -248,6 +283,20 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, | |||
* until another playback is requested (new values will be | |||
* loaded then) or the PWM peripheral is stopped. | |||
*/ | |||
#if PWM_NRFX_USE_CLOCK_CONTROL | |||
if (!data->clock_requested && config->clk_dev) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: with config->clk_dev && !data->clock_requested
you could avoid clock_requested
being checked for instances that don't need to request clock anyway
drivers/pwm/pwm_nrfx.c
Outdated
@@ -229,6 +252,18 @@ static int pwm_nrfx_set_cycles(const struct device *dev, uint32_t channel, | |||
* ensure it is stopped before starting the next playback. | |||
*/ | |||
nrfx_pwm_stop(&config->pwm, false); | |||
#if PWM_NRFX_USE_CLOCK_CONTROL | |||
if (data->clock_requested && config->clk_dev) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking of config->clk_dev
is redundant here.
Same piece of code for stopping the PWM and releasing the clock is used in pwm_suspend()
. How about using a helper function for this to avoid duplication?
Added clock control api for global hsfll used in fast PWM120 driver. Signed-off-by: Michał Stasiak <[email protected]>
06d88a4
5b88b7e
to
06d88a4
Compare
Added clock control api for global hsfll used in fast PWM120 driver.