How do I enable VF61 ADC driver in device tree file?

Dear Community,

we would like to use AI0 and AI1 of the Colibri VF61 as analog input channels. I want to make them available in Linux filesystem. But I don’t get any entries in /sys/bus/iio/devices/.
In the Linux kernel configuration I activated:

Device drivers → Industrial I/O support → Analog to digital converters → Freescale VF610 ADC driver

In my device tree file I set adc0 and adc1 status to okay. This is my device tree file looks like:

#include "vf610-colibri.dtsi"
#include "vf-colibri-eval-v3.dtsi"

/ {
	model = "Toradex Colibri VF61 on Colibri Evaluation Board";
	compatible = "toradex,vf610-colibri_vf61-on-eval", "toradex,vf610-colibri_vf61", "fsl,vf610";
};

&iomuxc {
	vf610-colibri {
		pinctrl_additionalgpio: additionalgpios {
			fsl,pins = <
				VF610_PAD_PTB8__GPIO_30		0x22ed
				VF610_PAD_PTB9__GPIO_31		0x22ed
				VF610_PAD_PTB21__GPIO_43	0x22ed
				VF610_PAD_PTB22__GPIO_44	0x22ed
				VF610_PAD_PTD1__GPIO_80		0x22ed
				VF610_PAD_PTD2__GPIO_81		0x22ed
				VF610_PAD_PTD3__GPIO_82		0x22ed
				VF610_PAD_PTD4__GPIO_83		0x22ed
				VF610_PAD_PTD5__GPIO_84		0x22ed
				VF610_PAD_PTE2__GPIO_107	0x22ed
				VF610_PAD_PTE4__GPIO_109	0x22ed
				VF610_PAD_PTE7__GPIO_112	0x22ed
				VF610_PAD_PTE11__GPIO_116	0x22ed
				VF610_PAD_PTE12__GPIO_117	0x22ed
				VF610_PAD_PTE18__GPIO_123	0x22ed
			>;
		};

		pinctrl_dspi1: dspi1grp {
			fsl,pins = <
				VF610_PAD_PTD5__DSPI1_CS0		0x33e2
				VF610_PAD_PTD2__DSPI1_CS3       0x33e2
				VF610_PAD_PTD6__DSPI1_SIN		0x33e1
				VF610_PAD_PTD7__DSPI1_SOUT		0x33e2
				VF610_PAD_PTD8__DSPI1_SCK		0x33e2
			>;
		};

	};
};


&dspi1 {

	mcp2515can: can@0 {
		status = "disabled";
	};

	at25@3 {
		status = "okay";
		compatible = "atmel,at25";
		reg = <3>;
		spi-max-frequency = <5000000>;
		pagesize = <32>;
		size = <65536>;
		address-width = <16>;
	};

};


&can0 {
       status = "okay";
};

&can1 {
       status = "okay";
};
 
&i2c0 {
       status = "disabled";
};

&uart2 {
	status = "disabled";
};

&esdhc1 {
	cd-inverted;
};

&adc0 {
	status = "okay";
};

&adc1 {
	status = "okay";
};

Could you please help?

Since the Colibri standard ADC channels are connected to the two ADC controller of Vybrid already, we enable the two ADC controllers by default in the module level device tree in arch/arm/boot/dts/vf-colibri.dtsi (see also our ADC developer article).

In our standard BSP the IIO devices really should already be there…

root@colibri-vf:~# ls /sys/bus/iio/devices/
iio:device0        iio:device1        iio_sysfs_trigger

Do you use other kernel/device tree customization which might cause the issue? Can you post the full kernel log output (e.g. dmesg > kernel.log).

Hallo,

indeed we use buildroot r2015.11 to create Linux and our root filesystem. In Linux kernel I deactivated Device Drivers → Voltage and Current Regulator Support → Fixed voltage regulator support. Activating Fixed voltage regulator support made the adc devices beome available.
I deactivated this driver because for some reason PTD4/SPI1-CS1 is not available as GPIO if the Fixed voltage regulator support is activated. And this is pin is in use on our custom board. Is this worth creating a new question? Otherwise we will change our layout.

Hallo,

In our Linux kernel configuration Device Drivers → Voltage and Current Regulator Support → Fixed voltage regulator support was deactivated. Activating Fixed voltage regulator support made the adc devices beome available.

Thanks for the update! Yeah it makes sense that this prevented the ADC from loading since the vdd supply for ADC is a fixed regulator…