Thread (16 messages) 16 messages, 7 authors, 2024-01-28

Re: [PATCH v2 1/2] pwm: pwm-gpio: New driver

From: Nicola Di Lieto <hidden>
Date: 2021-01-17 21:07:23
Also in: linux-pwm

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help