From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>,
Ludovic Desroches <ludovic.desroches@atmel.com>,
jic23@kernel.org, linux-arm-kernel@lists.infradead.org,
Josh Wu <josh.wu@atmel.com>,
leupold@rsi-elektrotechnik.de, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: at91_adc: allow to use full range of startup time
Date: Thu, 18 Jun 2015 16:02:32 +0200 [thread overview]
Message-ID: <20150618140232.GE27492@piout.net> (raw)
In-Reply-To: <1434558096-10619-1-git-send-email-nicolas.ferre@atmel.com>
On 17/06/2015 at 18:21:36 +0200, Nicolas Ferre wrote :
> From: Jan Leupold <leupold@rsi-elektrotechnik.de>
>
> The DT-Property "atmel,adc-startup-time" is stored in an u8 for a microsecond
> value. When trying to increase the value of STARTUP in Register AT91_ADC_MR
> some higher values can't be reached.
>
> Change the type in function parameter and private structure field from u8 to
> u32.
>
> Signed-off-by: Jan Leupold <leupold@rsi-elektrotechnik.de>
> [nicolas.ferre@atmel.com: change commit message, increase u16 to u32 for startup time]
> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
> drivers/iio/adc/at91_adc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
> index 8a0eb4a04fb5..7b40925dd4ff 100644
> --- a/drivers/iio/adc/at91_adc.c
> +++ b/drivers/iio/adc/at91_adc.c
> @@ -182,7 +182,7 @@ struct at91_adc_caps {
> u8 ts_pen_detect_sensitivity;
>
> /* startup time calculate function */
> - u32 (*calc_startup_ticks)(u8 startup_time, u32 adc_clk_khz);
> + u32 (*calc_startup_ticks)(u32 startup_time, u32 adc_clk_khz);
>
> u8 num_channels;
> struct at91_adc_reg_desc registers;
> @@ -201,7 +201,7 @@ struct at91_adc_state {
> u8 num_channels;
> void __iomem *reg_base;
> struct at91_adc_reg_desc *registers;
> - u8 startup_time;
> + u32 startup_time;
> u8 sample_hold_time;
> bool sleep_mode;
> struct iio_trigger **trig;
> @@ -779,7 +779,7 @@ ret:
> return ret;
> }
>
> -static u32 calc_startup_ticks_9260(u8 startup_time, u32 adc_clk_khz)
> +static u32 calc_startup_ticks_9260(u32 startup_time, u32 adc_clk_khz)
> {
> /*
> * Number of ticks needed to cover the startup time of the ADC
> @@ -790,7 +790,7 @@ static u32 calc_startup_ticks_9260(u8 startup_time, u32 adc_clk_khz)
> return round_up((startup_time * adc_clk_khz / 1000) - 1, 8) / 8;
> }
>
> -static u32 calc_startup_ticks_9x5(u8 startup_time, u32 adc_clk_khz)
> +static u32 calc_startup_ticks_9x5(u32 startup_time, u32 adc_clk_khz)
> {
> /*
> * For sama5d3x and at91sam9x5, the formula changes to:
> --
> 2.1.3
>
--
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2015-06-18 14:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-17 16:21 [PATCH] iio: adc: at91_adc: allow to use full range of startup time Nicolas Ferre
2015-06-18 14:02 ` Alexandre Belloni [this message]
2015-06-21 13:07 ` Jonathan Cameron
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=20150618140232.GE27492@piout.net \
--to=alexandre.belloni@free-electrons.com \
--cc=jic23@kernel.org \
--cc=josh.wu@atmel.com \
--cc=leupold@rsi-elektrotechnik.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@atmel.com \
--cc=maxime.ripard@free-electrons.com \
--cc=nicolas.ferre@atmel.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