pwm: atmel: Switch to atomic PWM
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 22 Mar 2017 13:29:34 +0000 (15:29 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 6 Apr 2017 15:45:02 +0000 (17:45 +0200)
commit1a722aad587967985f927e4ec2650ca64632c3e1
tree1a9998faf3c23bbffa68f7d48c6300b126781355
parentf9bb9da7c09d76f00c9abdf34cbeaec65e50d78b
pwm: atmel: Switch to atomic PWM

The currently Atmel PWM controllers supported by this driver could
change period or duty factor without channel disable, for regular
channels (sama5d3 support this by using period or duty factor update
registers, sam9rl support this by writing channel update register and
select the corresponding update: period or duty factor). The chip
doesn't support run time changings of signal polarity. To take advantage
of atomic PWM framework and let controller works without glitches, in
this patch only the duty factor could be changed without disabling PWM
channel. For period and signal polarity the atomic PWM is simulated by
disabling + enabling the right PWM channel.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-atmel.c