lkml.org 
[lkml]   [2014]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 1/3] pwm: make the PWM_POLARITY flag in DTB optional
Hi,

Thierry Reding wrote:
> On Wed, Apr 02, 2014 at 07:53:50AM +0200, Sascha Hauer wrote:
> > On Fri, Mar 28, 2014 at 09:48:58AM +0100, Lothar Waßmann wrote:
> [...]
> > > @@ -183,8 +173,11 @@ static void of_pwmchip_add(struct pwm_chip *chip)
> > > return;
> > >
> > > if (!chip->of_xlate) {
> > > - chip->of_xlate = of_pwm_simple_xlate;
> > > - chip->of_pwm_n_cells = 2;
> > > + chip->of_xlate = of_pwm_xlate;
> > > + if (chip->ops->set_polarity)
> > > + chip->of_pwm_n_cells = 3;
> > > + else
> > > + chip->of_pwm_n_cells = 2;
> >
> > I think the presence of the set_polarity callback shouldn't influence
> > the number of cells the parser expects. As commented on 2/2 this doesn't
> > actually mean the device actually support polarity inversion.
>
> How so? A driver should only implement .set_polarity() if it supports
> changing the polarity.
>
> That said, I agree that the presence of .set_polarity() shouldn't
> determine the number of cells. You could have any number of other flags
> set via the third cell.
>
> > Also, polarity inversion could still be done in software for hardware
> > that doesn't support it.
>
> No. You cannot emulate polarity inversion in software.
>
Why not?

duty_ns = period_ns - duty_ns;


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@karo-electronics.de
___________________________________________________________
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-04-08 07:41    [W:0.100 / U:26.100 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site