Hi,
I tried to interface the AD7386-4 with the Kuiper Linux and modified the rpi-ad738x-overlay.dts like:
/dts-v1/;
/plugin/;
/ {
compatible = "brcm,bcm2708";
fragment@0 {
target-path = "/";
__overlay__ {
adc_vref: fixedregulator@0 {
compatible = "regulator-fixed";
regulator-name = "fixed-supply";
regulator-min-microvolt = <2500000>;
regulator-max-microvolt = <2500000>;
regulator-boot-on;
};
};
};
fragment@1 {
target = <&spi0>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
ad7386-4@0 {
compatible = "adi,ad7386-4";
reg = <0>;
spi-max-frequency = <1000000>;
spi-cpol;
vref-supply = <&adc_vref>;
};
};
};
};
it works half and the driver loads but when I look at the device info with iio_info it displays
only 4 channels. I know the -4 version has a MUX in front of 4 channels but I dont know how
to include this in the overlay.
root@analog:/boot/overlays# iio_info
iio_info version: 0.26 (git tag:5e1e9cb5)
Libiio version: 0.26 (git tag: 5e1e9cb) backends: local xml ip usb serial
IIO context created with local backend.
Backend version: 0.26 (git tag: 5e1e9cb)
Backend description string: Linux analog 6.1.54-v7l+ #1 SMP Mon Dec 2 10:56:39 UTC 2024 armv7l
IIO context has 4 attributes:
hw_carrier: Raspberry Pi 4 Model B Rev 1.4
dtoverlay: vc4-kms-v3d,dwc2,rpi-ad7386-4
local,kernel: 6.1.54-v7l+
uri: local:
IIO context has 3 devices:
hwmon0: cpu_thermal
1 channels found:
temp1: (input)
2 channel-specific attributes found:
attr 0: crit value: 110000
attr 1: input value: 38459
No trigger on this device
hwmon1: rpi_volt
1 channels found:
in0: (input)
1 channel-specific attributes found:
attr 0: lcrit_alarm value: 0
No trigger on this device
iio:device0: ad7386-4 (buffer capable)
4 channels found:
voltage0: (input, index: 0, format: be:S16/16>>0)
2 channel-specific attributes found:
attr 0: raw value: 0
attr 1: scale value: 0.076293945
voltage1: (input, index: 1, format: be:S16/16>>0)
2 channel-specific attributes found:
attr 0: raw value: 0
attr 1: scale value: 0.076293945
voltage2: (input, index: 2, format: be:S16/16>>0)
2 channel-specific attributes found:
attr 0: raw value: 0
attr 1: scale value: 0.076293945
voltage3: (input, index: 3, format: be:S16/16>>0)
2 channel-specific attributes found:
attr 0: raw value: 0
attr 1: scale value: 0.076293945
1 device-specific attributes found:
attr 0: waiting_for_supplier value: 0
2 buffer-specific attributes found:
attr 0: data_available value: 0
attr 1: direction value: in
1 debug attributes found:
debug attr 0: direct_reg_access value: 0x0
ERROR: checking for trigger : Input/output error (5)
Can you provide me some guidance how to enable all channels and deactivate triggering?
/Jan