Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6980

Interfacing (DSI, CSI, I2C, etc.) • SPI/IIO and AD7380 driver fault

$
0
0
Hi!

I want to use the IIO subsystem driver for the AD7380 chip and used the source from the last analog
Linux repository for the module driver (https://github.com/analogdevicesinc/lin ... ffce563954) and compiled it together with the Rpi Linux kernel branch rpi-6.15.y.

Code:

pi@raspberrypi:~ $ uname  -r6.15.11-v8
Then I adapt the overlay to:

Code:

// SPDX-License-Identifier: GPL-2.0/dts-v1/;/plugin/;/ {        compatible = "brcm,bcm2835";        fragment@0 {                target-path = "/";                __overlay__ {                        supply_3_3V: fixedregulator@0 {                                compatible = "regulator-fixed";                                regulator-name = "fixed-supply";                                regulator-min-microvolt = <3300000>;                                regulator-max-microvolt = <3300000>;                                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 = <8000000>;                                spi-cpol;                                spi-cpha;                                vcc-supply = <&supply_3_3V>;                                vlogic-supply = <&supply_3_3V>;                        };                };        };        fragment@2 {                target = <&spidev0>;                __overlay__ {                        status = "disabled";                };        };};
As I want to use this driver with the AD7386-4 development board. I connect the
SPI interface from the board to the raspberry checking with 'pinout' the correct GPIO pins.

When I boot into the system and checking the logs I get:

Code:

 $ dmesg[    5.830845] ad7380 spi0.0: probe with driver ad7380 failed with error -22
I traced the error with printk in the module to the ad7380_init function when the driver wants to
do a hard reset using the regmap regmap_update_bits.

So, I assume that as the driver wants to write in the register, the SPI data transfer is not working and produces the EINVAL error which shows up
in the log.

Attaching a logic analyzer to the SPI pins on the pin header, running while booting, shows no activity. So it seems to me that
the SPI communication doesn't work and I might have a faulty overlay.

When I remove the fragment@2 part of the overlay above, I get the following errors:

Code:

pi@raspberrypi:/ $ dmesg | grep spi[    5.034339] spi spi0.0: chipselect 0 already in use[    5.034361] spi_master spi0: spi_device register error /soc/spi@7e204000/spidev@0[    5.034385] spi_master spi0: Failed to create SPI device for /soc/spi@7e204000/spidev@0
Which I don't get when I disable spidev0.

Is my overlay still faulty and cannot initiate the correct SPI communication?

Thank you
Jan

Statistics: Posted by janwit — Mon Oct 20, 2025 7:15 pm — Replies 3 — Views 110



Viewing all articles
Browse latest Browse all 6980

Trending Articles