[PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-05 Thread Alban Bedel
Signed-off-by: Alban Bedel --- drivers/pwm/pwm-lpc32xx.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c index adb87f0..a2704b8 100644 --- a/drivers/pwm/pwm-lpc32xx.c +++ b/drivers/pwm/pwm-lpc32xx.c @@ -51,7 +51,1

[PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-07 Thread Alban Bedel
Signed-off-by: Alban Bedel --- drivers/pwm/pwm-lpc32xx.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c index adb87f0..0dc278d 100644 --- a/drivers/pwm/pwm-lpc32xx.c +++ b/drivers/pwm/pwm-lpc32xx.c @@ -51,7 +51,1

[PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-08 Thread Alban Bedel
The duty cycles value goes from 1 (99% HIGH) to 256 (0% HIGH) but it is stored modulo 256 in the register as it is only 8 bits wide. Signed-off-by: Alban Bedel --- drivers/pwm/pwm-lpc32xx.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/pwm/pwm-lpc32xx.c b/dr

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-05 Thread Thierry Reding
Cc'ing Roland and Alexandre. What do you guys think? On Mon, Nov 05, 2012 at 05:48:45PM +0100, Alban Bedel wrote: > Signed-off-by: Alban Bedel > --- > drivers/pwm/pwm-lpc32xx.c |6 +- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-06 Thread Roland Stigge
On 05/11/12 22:03, Thierry Reding wrote: > Cc'ing Roland and Alexandre. What do you guys think? > > On Mon, Nov 05, 2012 at 05:48:45PM +0100, Alban Bedel wrote: >> Signed-off-by: Alban Bedel --- >> drivers/pwm/pwm-lpc32xx.c |6 +- 1 files changed, 5 >> insertions(+), 1 deletions(-) >> >>

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-06 Thread Alban Bedel
On Tue, 6 Nov 2012 07:47:22 -0200 Alexandre Pereira da Silva wrote: > Can you test the 0 and 255 values on actual hardware and see the effective > values? 0 -> 0% 1 -> 99% 128 -> 50% 255 -> 1% So yes 0 mean 256. > It may be handled as the RELOADV where 0 really means 256. If so, you

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-07 Thread Alexandre Pereira da Silva
On Wed, Nov 7, 2012 at 1:25 PM, Alban Bedel wrote: > Signed-off-by: Alban Bedel Acked-by: Alexandre Pereira da Silva > --- > drivers/pwm/pwm-lpc32xx.c |6 +- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c > ind

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-08 Thread Roland Stigge
On 07/11/12 16:25, Alban Bedel wrote: > Signed-off-by: Alban Bedel > --- > drivers/pwm/pwm-lpc32xx.c |6 +- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/pwm-lpc32xx.c > index adb87f0..0dc278d 100644 > --- a/drivers/pwm/pwm-lp

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-08 Thread Alban Bedel
On Thu, 08 Nov 2012 10:51:35 +0100 Roland Stigge wrote: > On 07/11/12 16:25, Alban Bedel wrote: > > Signed-off-by: Alban Bedel > > --- > > drivers/pwm/pwm-lpc32xx.c |6 +- > > 1 files changed, 5 insertions(+), 1 deletions(-) > > > > diff --git a/drivers/pwm/pwm-lpc32xx.c b/drivers/pwm/

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-08 Thread Roland Stigge
On 08/11/12 11:33, Alban Bedel wrote: > On Thu, 08 Nov 2012 10:51:35 +0100 > Roland Stigge wrote: > >> On 07/11/12 16:25, Alban Bedel wrote: >>> Signed-off-by: Alban Bedel >>> --- >>> drivers/pwm/pwm-lpc32xx.c |6 +- >>> 1 files changed, 5 insertions(+), 1 deletions(-) >>> >>> diff --gi

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-08 Thread Alban Bedel
On Thu, 08 Nov 2012 11:44:48 +0100 Roland Stigge wrote: > On 08/11/12 11:33, Alban Bedel wrote: > > On Thu, 08 Nov 2012 10:51:35 +0100 > > Roland Stigge wrote: > > > >> On 07/11/12 16:25, Alban Bedel wrote: > >>> Signed-off-by: Alban Bedel > >>> --- > >>> drivers/pwm/pwm-lpc32xx.c |6

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-08 Thread Roland Stigge
On 08/11/12 12:23, Alban Bedel wrote: >>> It is intended, the formular for duty value in the register is: >>> >>> duty = (256 - 256*duty_ns/period_ns) % 256 >> >> Where does this modulo defined? In the Manual, there is sth. like this >> defined for RELOADV (tables 606+607), but not for DUTY. >> >>

Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity

2012-11-08 Thread Alexandre Pereira da Silva
On Thu, Nov 8, 2012 at 11:12 AM, Roland Stigge wrote: > On 08/11/12 12:23, Alban Bedel wrote: It is intended, the formular for duty value in the register is: duty = (256 - 256*duty_ns/period_ns) % 256 >>> >>> Where does this modulo defined? In the Manual, there is sth. like this >>>