AnsweredAssumed Answered

How to setup ADC2 for imx6ull Linux 4.1.15-2.1.0 driver vf610_adc

Question asked by Johannes Lind on Oct 31, 2017
Latest reply on Oct 31, 2017 by igorpadykov

Hello i'm having some issues setting up ADC2 on our i.MX6ULL custom board.

Below are my .dts and .dtsi configs.

 

DTS:

&adc1 {
    pinctrl-names = "default";
    vref-supply = <&reg_vref_2v5>;
    pinctrl-0 = <&pinctrl_adc1>;
    status = "okay";
};

&adc2 {
    pinctrl-names = "default";
    vref-supply = <&reg_vref_2v5>;
    pinctrl-0 = <&pinctrl_adc2>;
    status = "okay";
};

 

DTSI:

adc1: adc@02198000 {
    compatible = "fsl,imx6ul-adc", "fsl,vf610-adc";
    reg = <0x02198000 0x4000>;
    interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&clks IMX6UL_CLK_ADC1>;
    num-channels = <5>;
    clock-names = "adc";
    status = "disabled";
};

adc2: adc@0219c000 {
    compatible = "fsl,imx6ul-adc", "fsl,vf610-adc";
    reg = <0x0219c000 0x4000>;
    interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&clks IMX6UL_CLK_ADC2>;
    num-channels = <5>;
    clock-names = "adc";
    status = "disabled";
};

 

Using irq 101 for adc2 causes the Linux system to crash trying to read any of the raw imputs.

Also in the boot log one can see "Timeout for adc calibration".


Using irq 102 for adc2 causes timeouts when trying to access raw inputs.

 

All raw inputs can be read for ADC1.

 

The i.MX Linux Reference Manual say:

The ADC pin settings should be done in the ADCx_PCTL register. No other extra
IOMUX settings are required.

But i can find no reference to PCTL in the i.MX 6ULL Applications Processor Reference Manual.

 

Could someone explain to me how you're supposed to setup ADC?
In the end i would like to be able to use

GPIO1_IO00 as ADC2_IN0
GPIO1_IO03 as ADC2_IN3

GPIO1_IO01 as ADC1_IN1
GPIO1_IO04 as ADC1_IN4
GPIO1_IO08 as ADC1_IN8

 

And i just can seem to figure it out.

I apologize for any error in formatting, this is my first question on this forum.

GP

Outcomes