AnsweredAssumed Answered

IMX6 UL ADC in devicetree

Question asked by Daniele Comel on Aug 30, 2017
Latest reply on Dec 3, 2017 by Jeremy Cole-Baker

I would like to use the ADC1 with in1, in2 and in4 channels.

 

On the DeviceTree source (.dts) I wrote:

 

&adc1 {
    vref-supply = <&touch_3v3_regulator>;
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_adc1>;
    clocks = <&clks IMX6UL_CLK_PWM8>,
        <&clks IMX6UL_CLK_PWM8>;
    num-channels = <3>;
    status = "okay";
};

 

  pinctrl_adc1: adc1grp {
            fsl,pins = <
                MX6UL_PAD_GPIO1_IO01__GPIO1_IO01    0x000b0  /* ADC1_IN1  */
                MX6UL_PAD_GPIO1_IO02__GPIO1_IO02    0x000b0  /* ADC1_IN2  */
                MX6UL_PAD_GPIO1_IO04__GPIO1_IO04    0x000b0  /* ADC1_IN4  */
            >;
        };

 

while in the included imx6ul.dtsi (not edited) I have:

 

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 = <2>;
                clock-names = "adc";
                status = "disabled";
                        };

 

When I take a look to the sysfs of my linux distro, I can only see 2 adc channels (in_voltage0_raw and in_voltage1_raw) and if I try to read their values i get the "Connection Timed Out" error.

 

How could I fix it ?

 

Regards.

 

UPDATE: Setting num-channels = <3> in the imx6ul.dtsi file allows to see 3 in_voltageX_raw items in my sysfs.

I supposed the dts file overlayered the included file, so I can't figure it out.

The problem of Connection Timed Our persists.

Outcomes