From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from saturn.retrosnub.co.uk ([178.18.118.26]:52776 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754372Ab3IOPRR (ORCPT ); Sun, 15 Sep 2013 11:17:17 -0400 Message-ID: <5235DD9A.5040700@kernel.org> Date: Sun, 15 Sep 2013 17:17:30 +0100 From: Jonathan Cameron MIME-Version: 1.0 To: Matthias Kaehlcke , Sebastian Andrzej Siewior , "Patil, Rachna" , Felipe Balbi , Pantelis Antoniou , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] iio: ti_am335x_adc: Take touchscreen channels into account for conversion timeout References: <20130910210228.GC30481@raspi> In-Reply-To: <20130910210228.GC30481@raspi> Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org On 09/10/13 22:02, Matthias Kaehlcke wrote: > The calculation of the old conversion timeout value was based on the number of > channels used by this driver. This doesn't take into account that other channels > can be used by the touchscreen driver. Adjust the timeout value to the maximum > if the touchscreen driver is enabled > > Signed-off-by: Matthias Kaehlcke Hmm... This is a bit of an uggly solution. Can we do anything neater via some callbacks in the underlying mfd? Rachna, any thoughts on this? If not I'm happy to take this as fixing a real problem and we can tidy up later if needed. Jonathan > --- > drivers/iio/adc/ti_am335x_adc.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c > index 3ceac3e..898fc78 100644 > --- a/drivers/iio/adc/ti_am335x_adc.c > +++ b/drivers/iio/adc/ti_am335x_adc.c > @@ -146,7 +146,11 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, > bool found = false; > u32 step_en; > unsigned long timeout = jiffies + usecs_to_jiffies > +#ifdef CONFIG_TOUCHSCREEN_TI_AM335X_TSC > + (IDLE_TIMEOUT * TOTAL_CHANNELS); > +#else > (IDLE_TIMEOUT * adc_dev->channels); > +#endif > step_en = get_adc_step_mask(adc_dev); > am335x_tsc_se_set(adc_dev->mfd_tscadc, step_en); > >