Post Go back to editing

AD7904 returns "Input/Output Error" for all connected voltage lines (Using AD7923 Driver)

I've been spending a few days trying to get this kernel module hooked up properly, and I'm running out of options on the software front.

Here is the output from the command line. I get "Invalid argument" for scale, and "Input/Output Error" for all the adc lines except voltage0 returns 0 but that line isn't hooked up to anything.

:~# cat /sys/bus/iio/devices/iio\:device0/name
ad7904
:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage_scale
cat: '/sys/bus/iio/devices/iio:device0/in_voltage_scale': Invalid argument
:~# cat /sys/bus/iio/devices/iio\:device0/
buffer/                  dev                      in_voltage1_raw          in_voltage3_raw          name                     power/                   subsystem/               uevent
current_timestamp_clock  in_voltage0_raw          in_voltage2_raw          in_voltage_scale         of_node/                 scan_elements/           trigger/
:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
0
:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage1_raw
cat: '/sys/bus/iio/devices/iio:device0/in_voltage1_raw': Input/output error
:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage2_raw
cat: '/sys/bus/iio/devices/iio:device0/in_voltage2_raw': Input/output error
:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage3_raw
cat: '/sys/bus/iio/devices/iio:device0/in_voltage3_raw': Input/output error

This is my device tree:

&quad_spi {
	#address-cells = <2>;
	#size-cells = <0>;

	gpiom2: gpio@0 {
			compatible = "microchip,mcp23s17";
			gpio-controller;
			#gpio-cells = <2>;
			microchip,spi-present-mask = <0x02>;
			reg = <0>;
			spi-max-frequency = <1000000>;
		};

	adc_supply: fixedregulator {
		compatible = "regulator-fixed";
		regulator-name = "fixed-supply";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};

	adc_vref: fixedregulator {
		compatible = "regulator-fixed";
		regulator-name = "fixed-supply";
		regulator-min-microvolt = <2500000>;
		regulator-max-microvolt = <2500000>;
	};

	ad7904: ad7904@1 {
			compatible = "adi,ad7904";
			reg = <1>;
			spi-max-frequency = <1000000>;
			spi-cpha;
			spi-cpol;
			vcc-supply = <&adc_supply>;
			vref-supply = <&adc_vref>;
		};
};

This is my first time dealing with device tree. The gpioe works already and this ADC is on the same spi bus.

The AD7904 uses the AD7923 driver, but there is no documentation for this one, only a git source. I've been looking at other drivers similar and trying to make the device tree properly.

Any and all advice would be appreciated. I'm asking our EE if there is a line I can probe easily for chip-select and will update on whether its toggling.

Parents Reply Children