From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752803AbbFUNHT (ORCPT ); Sun, 21 Jun 2015 09:07:19 -0400 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:43727 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752012AbbFUNHN (ORCPT ); Sun, 21 Jun 2015 09:07:13 -0400 Message-ID: <5586B6F8.9020806@kernel.org> Date: Sun, 21 Jun 2015 14:07:04 +0100 From: Jonathan Cameron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Alexandre Belloni , Nicolas Ferre CC: Maxime Ripard , Ludovic Desroches , linux-arm-kernel@lists.infradead.org, Josh Wu , leupold@rsi-elektrotechnik.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: adc: at91_adc: allow to use full range of startup time References: <1434558096-10619-1-git-send-email-nicolas.ferre@atmel.com> <20150618140232.GE27492@piout.net> In-Reply-To: <20150618140232.GE27492@piout.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/06/15 15:02, Alexandre Belloni wrote: > On 17/06/2015 at 18:21:36 +0200, Nicolas Ferre wrote : >> From: Jan Leupold >> >> 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 >> [nicolas.ferre@atmel.com: change commit message, increase u16 to u32 for startup time] >> Signed-off-by: Nicolas Ferre > Acked-by: Alexandre Belloni Applied to the fixes-togreg branch of iio.git and marked for stable. Probably won't now go upstream until post merge window. Thanks, Jonathan > >> --- >> 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:Acked-by: Alexandre Belloni >> 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 >> > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: jic23@kernel.org (Jonathan Cameron) Date: Sun, 21 Jun 2015 14:07:04 +0100 Subject: [PATCH] iio: adc: at91_adc: allow to use full range of startup time In-Reply-To: <20150618140232.GE27492@piout.net> References: <1434558096-10619-1-git-send-email-nicolas.ferre@atmel.com> <20150618140232.GE27492@piout.net> Message-ID: <5586B6F8.9020806@kernel.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 18/06/15 15:02, Alexandre Belloni wrote: > On 17/06/2015 at 18:21:36 +0200, Nicolas Ferre wrote : >> From: Jan Leupold >> >> 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 >> [nicolas.ferre at atmel.com: change commit message, increase u16 to u32 for startup time] >> Signed-off-by: Nicolas Ferre > Acked-by: Alexandre Belloni Applied to the fixes-togreg branch of iio.git and marked for stable. Probably won't now go upstream until post merge window. Thanks, Jonathan > >> --- >> 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:Acked-by: Alexandre Belloni >> 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 >> >