Skip to content
Advertisement

Linux device tree (AD5628)

I am trying to use AD5628 Digital to analog converter on my raspberry Pi 3 board . I have enabled the driver for that (http://lxr.free-electrons.com/source/drivers/iio/dac/ad5064.c) in the Yocto kernel .

But when i opened the path /sys/bus/iio/devices/

Mentioned in (https://wiki.analog.com/resources/tools-software/linux-drivers/iio-dac/ad5446) i am not getting any device0. I got to know that it is a Device tree issue , So i refereed some web sites (https://patchwork.kernel.org/patch/7374261/) and came to know that i need to add the following Device tree details

ad5628-1@4 {
compatible = "adi,ad5628-1";
        reg = <4>;
        spi-max-frequency = <10000000>;
        adi,use-external-reference; 
           };

But i am not able to find where to add this information in the linux kernel . and how to enable the device tree for this so that my DAC device should be detected by Linux .

Any help regarding this issue will be greatly appreciated

Advertisement

Answer

How is the DAC connected to your RPi board ? (SPI/i2c.. ??), so you need to add the dac as part of that device.

For example, in the link which you mentioned the dac is connected to the SPI, so similarly on those lines you need add the DT nodes and also enable the driver in the kernel.

   axi_spi_1: spi@42040000 {
          #address-cells = <1>;
          #size-cells = <0>;
          compatible = "xlnx,axi-spi-1.02.a", "xlnx,xps-spi-2.00.a";
           ...
          ad5446@0 {
                 compatible = "adi,ad5446";
                 reg = <0>;
                 spi-max-frequency = <1000000>;
                 spi-cpha;
                 spi-cpol;
                 vcc-supply = <&dac_vcc>;
          };
    };
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement