From: Alexandre Belloni Date: Fri, 14 Mar 2014 14:19:09 +0000 (+0100) Subject: pwm: atmel: correct CDTY calculation X-Git-Tag: v3.15-rc1~73^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=916030db4399f9237beef480fee6b11dd83cacd5;p=pandora-kernel.git pwm: atmel: correct CDTY calculation From the datasheet, the actual duty cycle is: (period - (1 / clk) * CDTY) / period This actually correct the polarity of the PWM and solves the issue that pwm-leds exhibits: when setting a duty cycle of 0 and then disabling a channel, the level was wrong (1 when the polarity was normal and 0 when the polarity was inversed). Signed-off-by: Alexandre Belloni Acked-by: Nicolas Ferre Signed-off-by: Thierry Reding --- Reading git-diff-tree failed