Commit 333f3460f855abd02c7e7eefcb692740ecd9c662

Authored by Patil, Rachna
1 parent 1be244a840

MFD: ti_tscadc: ADC Clock check not required

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>

Showing 2 changed files with 0 additions and 6 deletions Side-by-side Diff

drivers/mfd/ti_tscadc.c
... ... @@ -131,11 +131,6 @@
131 131 clock_rate = clk_get_rate(clk);
132 132 clk_put(clk);
133 133 clk_value = clock_rate / ADC_CLK;
134   - if (clk_value < MAX_CLK_DIV) {
135   - dev_err(&pdev->dev, "clock input less than min clock requirement\n");
136   - err = -EINVAL;
137   - goto err_fail;
138   - }
139 134 /* TSCADC_CLKDIV needs to be configured to the value minus 1 */
140 135 clk_value = clk_value - 1;
141 136 tscadc_writel(tscadc, TSCADC_REG_CLKDIV, clk_value);
include/linux/mfd/ti_tscadc.h
... ... @@ -127,7 +127,6 @@
127 127 #define TSCADC_SEQ_STATUS BIT(5)
128 128  
129 129 #define ADC_CLK 3000000
130   -#define MAX_CLK_DIV 7
131 130 #define TOTAL_STEPS 16
132 131 #define TOTAL_CHANNELS 8
133 132 #define FIFO1_THRESHOLD 19