From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Andrzej Siewior Subject: Re: [PATCH 4/4] iio: ti_am335x_adc: Add continuous sampling and trigger support Date: Fri, 16 Aug 2013 16:59:49 +0200 Message-ID: <20130816145949.GE1263@linutronix.de> References: <1376424303-22740-1-git-send-email-zubair.lutfullah@gmail.com> <1376424303-22740-5-git-send-email-zubair.lutfullah@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from www.linutronix.de ([62.245.132.108]:39922 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751880Ab3HPO7v convert rfc822-to-8bit (ORCPT ); Fri, 16 Aug 2013 10:59:51 -0400 Content-Disposition: inline In-Reply-To: <1376424303-22740-5-git-send-email-zubair.lutfullah@gmail.com> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Zubair Lutfullah Cc: jic23@cam.ac.uk, dmitry.torokhov@gmail.com, linux-iio@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, Russ.Dill@ti.com * Zubair Lutfullah | 2013-08-13 21:05:03 [+0100]: >diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am33= 5x_adc.c >index 3ceac3e..0d7e313 100644 >--- a/drivers/iio/adc/ti_am335x_adc.c >+++ b/drivers/iio/adc/ti_am335x_adc.c =E2=80=A6 >+static int tiadc_buffer_postdisable(struct iio_dev *indio_dev) >+{ >+ struct tiadc_device *adc_dev =3D iio_priv(indio_dev); >+ int config; >+ >+ tiadc_step_config(indio_dev); >+ if (adc_dev->mfd_tscadc->tsc_cell =3D=3D -1) { >+ config =3D tiadc_readl(adc_dev, REG_CTRL); >+ tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB)); >+ } This kind of check is bad. The tsc cell may have been created but the driver not enabled or loaded. Further you should document why you need to enable / disable the ADC in this places and only if the TSC part is not active. Sebastian -- To unsubscribe from this list: send the line "unsubscribe linux-input" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html