]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: lpc18xx-sct: Don't reconfigure PWM in .request and .free
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 16 Nov 2018 06:52:08 +0000 (07:52 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Fri, 16 Nov 2018 10:02:47 +0000 (11:02 +0100)
commit9d7c6e53c87327b513adfa59dbf6b2f4f96f69b7
tree542dacf632e6b6ec2818b6a1bc7831e42e6e6fa7
parenta9e80a095d95d1159b26f73bd6d9c2fadc7fb411
pwm: lpc18xx-sct: Don't reconfigure PWM in .request and .free

Regarding the .request case: The consumer might be interested in taking
over the configured state from the boot loader. So the initially
configured state should be retained.

For the free case the PWM consumer is responsible for disabling the PWM
before calling pwm_put() and there are three subcases to consider:

 a) The PWM is already off. Then there is no gain in disabling the PWM
    once more.
 b) The PWM is still running and there is a good reason for that. (Not
    sure this is a valid case, I cannot imagine such a good reason.)
    Then it is counterproductive to disable the PWM.
 c) The PWM is still running because the consumer failed to disable the
    PWM. Then the consumer needs fixing and there is little incentive to
    paper over the problem in the backend driver.

This aligns the lpc18xx-sct driver to the other PWM drivers that also
don't reconfigure the hardware in .request and .free.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-lpc18xx-sct.c