[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140124064254.0369084d@ipc1.ka-ro>
Date: Fri, 24 Jan 2014 06:42:54 +0100
From: Lothar Waßmann <LW@...O-electronics.de>
To: Russell King - ARM Linux <linux@....linux.org.uk>
Cc: Sascha Hauer <s.hauer@...gutronix.de>,
Mark Rutland <mark.rutland@....com>, linux-pwm@...r.kernel.org,
Pawel Moll <pawel.moll@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
linux-kernel@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Rob Landley <rob@...dley.net>,
Kumar Gala <galak@...eaurora.org>,
Shawn Guo <shawn.guo@...aro.org>,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/2] PWM: let of_xlate handlers check args count
Hi,
Russell King - ARM Linux wrote:
> On Thu, Jan 23, 2014 at 04:53:50PM +0000, Russell King - ARM Linux wrote:
> > On Thu, Jan 23, 2014 at 12:04:44PM +0100, Sascha Hauer wrote:
> > > On Thu, Jan 23, 2014 at 11:56:32AM +0100, Lothar Waßmann wrote:
> > > > Hi,
> > > >
> > > > Sascha Hauer wrote:
> > > > > of_pwm_n_cells for the of_xlate handler is stored in struct pwm_chip,
> > > > > but it is only ever used by the of_xlate handler itsel. Remove
> > > > > of_pwm_n_cells from struct pwm_chip and let the handler do the argument
> > > > > count checking to simplify the code.
> > > > >
> > > > This still does not make the PWM_POLARITY flag in the pwms node
> > > > optional as was the goal because of_parse_phandle_with_args() requires
> > > > at least #pwm-cells arguments in the node.
> > > >
> > > > So, with a DT configuration like:
> > > > pwm0: pwm@0 {
> > > > #pwm-cells = <3>;
> > > > };
> > > > backlight {
> > > > pwms = <&pwm0 0 100000>;
> > > > };
> > >
> > > We misunderstood each other. My goal was to allow the driver to also
> > > work with old devicetrees which specify #pwm-cells = <2>, not to allow
> > > inconsistent devicetrees like the snippet above.
> >
> > In which case, the patch I've posted seems to do that job too... I'm
> > just about to test out the three-cell version.
>
> Okay, this works, but there's a problem with pwm-leds.
>
> When the duty cycle is set to zero (when you set the brightness to zero)
> pwm-leds decides to disable the PWM after configuring it. This causes
> the PWM output to be driven low, causing the LED to go to maximum
> brightness.
>
> So, using the inversion at PWM level doesn't work.
>
The problem is that the driver calls pwm_disable() when the duty cycle is 0.
This sets the PWM output low independent from the output polarity setting.
> To make this work correctly, we really need pwm-leds to do the inversion
> rather than setting the inversion bit in hardware.
>
The same holds for the pwm-backlight driver.
The easiest fix would be not to call pwm_disable() even for a zero duty
cycle.
Lothar Waßmann
--
___________________________________________________________
Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996
www.karo-electronics.de | info@...o-electronics.de
___________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists