lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140407113339.GD26985@ulmo>
Date:	Mon, 7 Apr 2014 13:33:40 +0200
From:	Thierry Reding <thierry.reding@...il.com>
To:	Alexandre Belloni <alexandre.belloni@...e-electrons.com>
Cc:	Bryan Wu <cooloney@...il.com>, Richard Purdie <rpurdie@...ys.net>,
	Linux LED Subsystem <linux-leds@...r.kernel.org>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] leds: pwm: set polarity on non DT platforms

On Wed, Mar 19, 2014 at 12:09:46AM +0100, Alexandre Belloni wrote:
> On 18/03/2014 at 16:02:51 -0700, Bryan Wu wrote :
> > On Mon, Mar 17, 2014 at 11:38 AM, Alexandre Belloni
> > <alexandre.belloni@...e-electrons.com> wrote:
> > > Set inversed polarity when .active_low is set in the platform_data. With device
> > > tree, this is taken care of by of_pwm_xlate_with_flags(), called from
> > > of_pwm_get().
> > >
> > > Signed-off-by: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
> > > ---
> > >  drivers/leds/leds-pwm.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
> > > index 605047428b5a..09681556a6aa 100644
> > > --- a/drivers/leds/leds-pwm.c
> > > +++ b/drivers/leds/leds-pwm.c
> > > @@ -180,6 +180,11 @@ static int led_pwm_probe(struct platform_device *pdev)
> > >                         led_dat->cdev.max_brightness = cur_led->max_brightness;
> > >                         led_dat->cdev.flags |= LED_CORE_SUSPENDRESUME;
> > >
> > > +                       if (led_dat->active_low)
> > 
> > Why .active_low needs to inverse PWM polarity? In
> > of_pwm_xlate_with_flags(), it checked with PWM_POLARITY_INVERSED in
> > args. Moreover in of_pwm_simple_xlate() and pxa_pwm_of_xlate(), we
> > didn't inverse PWM polarity at all.
> > 
> 
> Yeah, exactly, there is no issue when using device tree. What I'm trying
> to fix here is th non-DT case where of_pwm_xlate_with_flags() is not
> called.

The goal here would be to move to a common interface, irrespective of
whether DT or platform code was used to instantiate a device. So like I
mentioned in a reply to another patch of yours, I think a better
approach would be to provide a mechanism to specify the PWMs polarity
within the PWM lookup table.

Thierry

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ