This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3358: ADC sampling speed

Part Number: AM3358

Tool/software: Linux

Hi,

According to AM335X TRM, the ADC clock can be set at 24MHz maxmum, however in TI Linux sdk driver, the ADC clock is set at only 3MHz.

So if there any special consideration for this ADC clock frequency reduction?

I checked AM335X errata, didn't find anything related to the ADC clock.

static     int ti_tscadc_probe(struct platform_device *pdev)

{

………………………………

               /*

               * The TSC_ADC_Subsystem has 2 clock domains

               * OCP_CLK and ADC_CLK.

               * The ADC clock is expected to run at target of 3MHz,

               * and expected to capture 12-bit data at a rate of 200 KSPS.

               * The TSC_ADC_SS controller design assumes the OCP clock is

               * at least 6x faster than the ADC clock.

               */

               clk = devm_clk_get(&pdev->dev, "adc_tsc_fck");

               if (IS_ERR(clk)) {

                              dev_err(&pdev->dev, "failed to get TSC fck\n");

                              err = PTR_ERR(clk);

                              goto err_disable_clk;

               }

               clock_rate = clk_get_rate(clk);

               tscadc->clk_div = clock_rate / ADC_CLK;

 

               /* TSCADC_CLKDIV needs to be configured to the value minus 1 */

               tscadc->clk_div--;

               regmap_write(tscadc->regmap, REG_CLKDIV, tscadc->clk_div);

……………………………………

}