Hello Uwe,
On Sun, Jan 17, 2021 at 07:45:56PM +0100, Uwe Kleine-König wrote:
quoted
quoted
quoted
+ pwm_gpio->output = pwm_gpio->state ^ pwm_gpio->cur.invert;
So far I understood also only comment. What wasn't obvious immediately
is the state member.
Would it become clear enough by adding: "state is the logical PWM output; the actual PIN output level is inverted by XORing with cur.invert when the latter is true" ?
quoted
Would it be ok to cancel the timer first and then "return
pwmchip_remove(...)"?
No. The PWM must stay functional until pwmchip_remove() returns.
Could you please clarify what I should do when pwmchip_remove returns non-zero? In my original implementation
- if pwmchip_remove returns a non-zero error code, I return it to the caller and do not cancel the timer.
- if pwmchip_remove returns zero, I cancel the timer and return zero to the caller
So under no circumstance I return a different code from what pwmchip_remove does...
Best regards,
Nicola