* [PATCH 1/1] PWM-atmel: Fixed a bug which set the pwm clock prescaler incorrectly. In the defect code the prescaler was always one more than expected value, which resulted in the pwm output with wrong frequency and duty cycle. @ 2014-09-10 21:35 hachyang 2014-09-25 7:55 ` Thierry Reding 0 siblings, 1 reply; 3+ messages in thread From: hachyang @ 2014-09-10 21:35 UTC (permalink / raw) To: thierry.reding, linux-pwm; +Cc: linux-kernel, ryang From: ryang <ryang@hach.com> Signed-off-by: ryang <ryang@hach.com> --- drivers/pwm/pwm-atmel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c index 6e700a5..2dca0bf 100644 --- a/drivers/pwm/pwm-atmel.c +++ b/drivers/pwm/pwm-atmel.c @@ -128,7 +128,8 @@ static int atmel_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, return -EINVAL; } } - + /* Need to reduce the prescaler by 1 */ + pres--; /* Calculate the duty cycles */ prd = div; div *= duty_ns; -- 1.9.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] PWM-atmel: Fixed a bug which set the pwm clock prescaler incorrectly. In the defect code the prescaler was always one more than expected value, which resulted in the pwm output with wrong frequency and duty cycle. 2014-09-10 21:35 [PATCH 1/1] PWM-atmel: Fixed a bug which set the pwm clock prescaler incorrectly. In the defect code the prescaler was always one more than expected value, which resulted in the pwm output with wrong frequency and duty cycle hachyang @ 2014-09-25 7:55 ` Thierry Reding 2014-09-25 14:44 ` Yang, Robert 0 siblings, 1 reply; 3+ messages in thread From: Thierry Reding @ 2014-09-25 7:55 UTC (permalink / raw) To: hachyang; +Cc: linux-pwm, linux-kernel, ryang, Nikolaus Voss [-- Attachment #1: Type: text/plain, Size: 953 bytes --] On Wed, Sep 10, 2014 at 03:35:19PM -0600, hachyang@gmail.com wrote: > From: ryang <ryang@hach.com> > > Signed-off-by: ryang <ryang@hach.com> > --- > drivers/pwm/pwm-atmel.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c > index 6e700a5..2dca0bf 100644 > --- a/drivers/pwm/pwm-atmel.c > +++ b/drivers/pwm/pwm-atmel.c > @@ -128,7 +128,8 @@ static int atmel_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, > return -EINVAL; > } > } > - > + /* Need to reduce the prescaler by 1 */ > + pres--; > /* Calculate the duty cycles */ > prd = div; > div *= duty_ns; > -- > 1.9.1 I think this was fixed by a different patch by Nikolaus in a more direct way, see: https://lkml.org/lkml/2014/9/24/28 I've pushed that patch to the for-next branch of the PWM tree. Can you verify that the issue you were seeing is gone? Thierry [-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH 1/1] PWM-atmel: Fixed a bug which set the pwm clock prescaler incorrectly. In the defect code the prescaler was always one more than expected value, which resulted in the pwm output with wrong frequency and duty cycle. 2014-09-25 7:55 ` Thierry Reding @ 2014-09-25 14:44 ` Yang, Robert 0 siblings, 0 replies; 3+ messages in thread From: Yang, Robert @ 2014-09-25 14:44 UTC (permalink / raw) To: Thierry Reding, hachyang@gmail.com Cc: linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org, Nikolaus Voss Hi Thierry, I agree Nikolaus's fix is more efficient and works too. Robert -----Original Message----- From: Thierry Reding [mailto:thierry.reding@gmail.com] Sent: Thursday, September 25, 2014 1:55 AM To: hachyang@gmail.com Cc: linux-pwm@vger.kernel.org; linux-kernel@vger.kernel.org; Yang, Robert; Nikolaus Voss Subject: Re: [PATCH 1/1] PWM-atmel: Fixed a bug which set the pwm clock prescaler incorrectly. In the defect code the prescaler was always one more than expected value, which resulted in the pwm output with wrong frequency and duty cycle. On Wed, Sep 10, 2014 at 03:35:19PM -0600, hachyang@gmail.com wrote: > From: ryang <ryang@hach.com> > > Signed-off-by: ryang <ryang@hach.com> > --- > drivers/pwm/pwm-atmel.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/pwm/pwm-atmel.c b/drivers/pwm/pwm-atmel.c index > 6e700a5..2dca0bf 100644 > --- a/drivers/pwm/pwm-atmel.c > +++ b/drivers/pwm/pwm-atmel.c > @@ -128,7 +128,8 @@ static int atmel_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, > return -EINVAL; > } > } > - > + /* Need to reduce the prescaler by 1 */ > + pres--; > /* Calculate the duty cycles */ > prd = div; > div *= duty_ns; > -- > 1.9.1 I think this was fixed by a different patch by Nikolaus in a more direct way, see: https://lkml.org/lkml/2014/9/24/28 I've pushed that patch to the for-next branch of the PWM tree. Can you verify that the issue you were seeing is gone? Thierry Please be advised that this email may contain confidential information. If you are not the intended recipient, please notify us by email by replying to the sender and delete this message. The sender disclaims that the content of this email constitutes an offer to enter into, or the acceptance of, any agreement; provided that the foregoing does not invalidate the binding effect of any digital or other electronic reproduction of a manual signature that is included in any attachment. ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-09-25 15:00 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-09-10 21:35 [PATCH 1/1] PWM-atmel: Fixed a bug which set the pwm clock prescaler incorrectly. In the defect code the prescaler was always one more than expected value, which resulted in the pwm output with wrong frequency and duty cycle hachyang 2014-09-25 7:55 ` Thierry Reding 2014-09-25 14:44 ` Yang, Robert
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox