public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Boris BREZILLON <b.brezillon@overkiz.com>,
	Thierry Reding <thierry.reding@gmail.com>
Cc: <linux-pwm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] pwm: atmel-tcb: fix max time computation for slow clk source
Date: Thu, 19 Sep 2013 09:24:52 +0200	[thread overview]
Message-ID: <523AA6C4.6000305@atmel.com> (raw)
In-Reply-To: <1379516781-23379-1-git-send-email-b.brezillon@overkiz.com>

On 18/09/2013 17:06, Boris BREZILLON :
> Use the the tcb counter width to compute the maximum time that can be
> represented using the slow clock source instead of the static 16 bit width.
>
> Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com>

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>

> ---
>   drivers/pwm/pwm-atmel-tcb.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c
> index 0266969..f3dcd02 100644
> --- a/drivers/pwm/pwm-atmel-tcb.c
> +++ b/drivers/pwm/pwm-atmel-tcb.c
> @@ -307,7 +307,7 @@ static int atmel_tcb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
>   		i = slowclk;
>   		rate = 32768;
>   		min = div_u64(NSEC_PER_SEC, rate);
> -		max = min << 16;
> +		max = min << tc->tcb_config->counter_width;
>
>   		/* If period is too big return ERANGE error */
>   		if (max < period_ns)
>


-- 
Nicolas Ferre

  reply	other threads:[~2013-09-19  7:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-18 15:05 [PATCH 0/2] pwm: atmel-tcb: config fixes Boris BREZILLON
2013-09-18 15:06 ` [PATCH 1/2] pwm: atmel-tcb: add missing clk source config Boris BREZILLON
2013-09-19  7:24   ` Nicolas Ferre
2013-09-18 15:06 ` [PATCH 2/2] pwm: atmel-tcb: fix max time computation for slow clk source Boris BREZILLON
2013-09-19  7:24   ` Nicolas Ferre [this message]
2013-09-19 12:06 ` [PATCH 0/2] pwm: atmel-tcb: config fixes Thierry Reding
2013-09-19 12:11   ` boris brezillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=523AA6C4.6000305@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=b.brezillon@overkiz.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox