How to select ADC channels on Verdin

Hello,
I’m reading the binding doc of the ads1015 driver used for the TL2404 on the Verdin SOM ads1015.txt « adc « iio « bindings « devicetree « Documentation - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules and it’s not clear how to select the proper channels. I would like to use all 4 channels referred to ground. the TLA2404 datasheet reports a MUX[2:0] register which is not accessible with ads1015 driver.
how can I do that?

Regards,
Rocco

Hey @RoccoBr,

Are you referring to adjusting the programmable gain amplifier? This would be set via the device tree.

adc@49 {
	compatible = "ti,ads1015";
	reg = <0x49>;
	#address-cells = <1>;
	#size-cells = <0>;

	/* Verdin I2C_1 (ADC_4 - ADC_3) */
	channel@0 {
		reg = <0>;
		ti,datarate = <4>;
		ti,gain = <2>;
	};

	/* Verdin I2C_1 (ADC_4 - ADC_1) */
	channel@1 {
		reg = <1>;
		ti,datarate = <4>;
		ti,gain = <2>;
	};

And you can access these channels via the sysfs Here is our writeup for Linux , and here for TorizonCore

-Eric

hi @eric.tx ,
as you can see from the verdin device tree, 8 channels are set, 4 differential and 4 single-ended (referred to ground).

how can I select to use only the single-ended channels? I just read from them (via sysfs) and ignore the differential ones? my concern is that according to the TLA2404 datasheet the default value of the MUX register is 0, which mean the ADC output is always the differential value AIN0-AIN1 (channel 3 in the device tree)

Hey @RoccoBr,

Apologies for the delayed response. I was out of the office. Were you able to resolve this issue?

It doesn’t look like the driver has support for writing to the configuration register, but this is what would need to be done via 8.5.2.2 and https://www.ti.com/lit/ds/symlink/tla2024.pdf?ts=1689138664652

There may be the default configuration that is already set for single-ended. Were you able to see this?

-Eric

hi @eric.tx ,
that might work, I could set the configuration register at startup. I’ll try and I’ll let you know

Regards,
Rocco

Hi @RoccoBr ,

were you succesful?

Best Regards
Kevin