On Mon, Apr 07, 2014 at 04:20:24PM +0200, Alexandre Belloni wrote: > Point taken. I'm still a bit afraid about people then setting both the > inverted polarity on the PWM and active-low. Or not knowing when to > choose which one. I would expect that inverting the PWM is still the > better choice as it allows to disable the PWM. That depends. Consider the case that I have - a LED connected between supply and the PWM output. The PWM controller, when disabled, sets the output to ground. When when the PWM controller supports output inversion, when the controller is disabled, it still sets the output to ground. That's the root of my problem - the iMX6 "inversion" isn't a real inversion of the output itself, it's a change in the way the logic inside the PWM works. The design appears to be: 1. A counter which resets to zero, and then increments to a programmable maximum value. 2. A comparitor which compares the counter output with the sample value. 3. A set-reset flip flop on the output 4. Muxes on the set and reset input to select which signals are routed to the flip-flop. What this means is that when the counter is reset to zero, the output flip flop can be either set or cleared. When the counter reaches the sample value, the output can be either cleared or set. While the PWM is running, this results in apparant polarity changes as per the description in linux/pwm.h. However, when disabled, the output is always forced to zero. What is not clearly specified is what happens at enable time. The documentations use of "the output pin is set to start a new period" is rather ambiguous when they've already shown that there's a set-reset latch - does it mean that a pulse is always sent to the 'set' input causing the output to go high when the PWM is enabled... which would mean it would end up remaining high until the end of the first period. -- FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it. -- To unsubscribe from this list: send the line "unsubscribe linux-leds" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html