linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zubair Lutfullah <zubair.lutfullah@gmail.com>
To: sameo@linux.intel.com, lee.jones@linaro.org
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org, koen@dominion.thruhere.net
Subject: [PATCH 3/4] MFD: ti_tscadc: ADC Clock check not required
Date: Sat, 20 Jul 2013 17:27:35 +0100	[thread overview]
Message-ID: <1374337656-6393-4-git-send-email-zubair.lutfullah@gmail.com> (raw)
In-Reply-To: <1374337656-6393-1-git-send-email-zubair.lutfullah@gmail.com>

From: "Patil, Rachna" <rachna@ti.com>

ADC is ideally expected to work at a frequency of 3MHz.
The present code had a check, which returned error if the frequency
went below the threshold  value. But since AM335x supports various
working frequencies, this check is not required.
Now the code just uses the internal ADC clock divider to set the ADC
frequency w.r.t the sys clock.

Signed-off-by: Patil, Rachna <rachna@ti.com>
Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com>
---
 drivers/mfd/ti_am335x_tscadc.c       |    6 +-----
 include/linux/mfd/ti_am335x_tscadc.h |    1 -
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index d72001c..cd74d59 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -197,11 +197,7 @@ static	int ti_tscadc_probe(struct platform_device *pdev)
 	clock_rate = clk_get_rate(clk);
 	clk_put(clk);
 	clk_value = clock_rate / ADC_CLK;
-	if (clk_value < MAX_CLK_DIV) {
-		dev_err(&pdev->dev, "clock input less than min clock requirement\n");
-		err = -EINVAL;
-		goto err_disable_clk;
-	}
+
 	/* TSCADC_CLKDIV needs to be configured to the value minus 1 */
 	clk_value = clk_value - 1;
 	tscadc_writel(tscadc, REG_CLKDIV, clk_value);
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index db1791b..25f2c61 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -121,7 +121,6 @@
 #define SEQ_STATUS BIT(5)
 
 #define ADC_CLK			3000000
-#define	MAX_CLK_DIV		7
 #define TOTAL_STEPS		16
 #define TOTAL_CHANNELS		8
 
-- 
1.7.9.5


  parent reply	other threads:[~2013-07-20 16:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20 16:27 [PATCH 0/4] mfd: iio: ti_am335x_tscadc: fixes adc sampling, TSC config and a typo Zubair Lutfullah
2013-07-20 16:27 ` [PATCH 1/4] iio: ti_am335x_adc: Fix wrong samples received on 1st read Zubair Lutfullah
2013-07-21 17:28   ` Jonathan Cameron
2013-07-20 16:27 ` [PATCH 2/4] MFD: ti_tscadc: disable TSC config registers in adc mode Zubair Lutfullah
2013-07-22  8:37   ` Lee Jones
2013-07-20 16:27 ` Zubair Lutfullah [this message]
2013-07-22  8:36   ` [PATCH 3/4] MFD: ti_tscadc: ADC Clock check not required Lee Jones
2013-07-20 16:27 ` [PATCH 4/4] mfd: input: arm: dts: doc: ti_am335x: typo fixes (coordiante -> coordinate) Zubair Lutfullah
2013-07-22  8:25   ` Lee Jones

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=1374337656-6393-4-git-send-email-zubair.lutfullah@gmail.com \
    --to=zubair.lutfullah@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=koen@dominion.thruhere.net \
    --cc=lee.jones@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.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;
as well as URLs for NNTP newsgroup(s).