All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
	linux-leds@vger.kernel.org
Subject: Re: [PATCH 4/5] leds: leds-pwm: implement PWM inversion
Date: Mon, 7 Apr 2014 11:28:03 +0200	[thread overview]
Message-ID: <20140407092803.GT30127@piout.net> (raw)
In-Reply-To: <20140407085245.GT7528@n2100.arm.linux.org.uk>

On 07/04/2014 at 09:52:45 +0100, Russell King - ARM Linux wrote :
> On Mon, Apr 07, 2014 at 10:46:51AM +0200, Alexandre Belloni wrote:
> > 
> > This will conflict with my patch (which is still lacking proper review)
> > there:
> > http://thread.gmane.org/gmane.linux.leds/482
> > 
> > I would say that it is better to hide the polarity inversion in the PWM
> > driver for your specific PWM. Else we will end up with all the drivers
> > using PWMs trying to detect whether the PWM supports inversion and if it
> > is not the case, calculating the inverted duty cycle.
> > 
> > So, I would go for my patch which is adding the missing polarity
> > inversion setting when using platform data and then implement software
> > polarity inversion in your underlying PWM driver. That also avoids patch
> > 5/5 and I believe not adding a DT property is always a good idea.
> > 
> > What is your PWM that is not supporting polarity inversion ?
> 
> Did you read the commit message properly, particularly the last sentence
> of the first paragraph which refers to the problem with your approach?
> 

If disabling the PWM is putting the output low, I would then enable the
channel on pwm_request() and disable it on pwm_free() because anyway,
you'll have to let it run continuously to get the correct result.
However, Thierry seems to believe that there is an other underlying
issue in the PWM driver when this happens.

Going with your approach will end up with all the drivers trying to use
PWMs having to use the same logic and I'm sure a lot of people will get
confused between polarity inversion and using active_low...

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-04-07  9:28 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-06 22:18 [PATCH 0/5] Fix various issues with leds-pwm Russell King - ARM Linux
2014-04-06 22:20 ` [PATCH 1/5] leds: leds-pwm: properly clean up after probe failure Russell King
2014-04-06 22:20 ` [PATCH 2/5] leds: leds-pwm: provide a common function to setup a single led-pwm device Russell King
2014-04-06 22:20 ` [PATCH 3/5] leds: leds-pwm: convert OF parsing code to use led_pwm_add() Russell King
2014-04-06 22:20 ` [PATCH 4/5] leds: leds-pwm: implement PWM inversion Russell King
2014-04-07  8:46   ` Alexandre Belloni
2014-04-07  8:52     ` Russell King - ARM Linux
2014-04-07  9:28       ` Alexandre Belloni [this message]
2014-04-07  9:42         ` Russell King - ARM Linux
2014-04-07 11:10     ` Thierry Reding
2014-04-07 11:35       ` Russell King - ARM Linux
2014-04-07 12:01         ` Thierry Reding
2014-04-07 12:37           ` Russell King - ARM Linux
2014-04-07 13:37             ` Thierry Reding
2014-04-07 14:20               ` Alexandre Belloni
2014-04-07 15:01                 ` Russell King - ARM Linux
2014-04-06 22:20 ` [PATCH 5/5] leds: leds-pwm: add DT support for LEDs wired to supply Russell King
2014-04-07 21:31 ` [PATCH 0/5] Fix various issues with leds-pwm Bryan Wu
2014-04-07 21:33   ` Russell King - ARM Linux
2014-04-07 21:36     ` Bryan Wu
2014-06-12 17:12       ` Russell King - ARM Linux
2014-06-12 17:37         ` Bryan Wu
2014-06-12 17:56           ` Alexandre Belloni
2014-06-12 18:01             ` Bryan Wu
2014-06-12 18:03           ` Russell King - ARM Linux
2014-06-12 18:16             ` Bryan Wu
2014-06-12 18:21               ` Russell King - ARM Linux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140407092803.GT30127@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=cooloney@gmail.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rpurdie@rpsys.net \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.