cf-ad9361-dds-core-lpc initialize failed with code -2

Hi,

I'm trying to apply ad9361(fmcomms2) on my custom board. But the cf-ad9361-dds-core-lpc didn't initialize successfully.

Here is my dmesg:

root@pclab-dev:~# dmesg | grep ad9361
[ 1.055645] ad9361 spi1.0: ad9361_probe : enter (ad9361)
[ 1.060894] ad9361 spi1.0: No GPIOs defined for ext band ctrl
[ 1.313076] ad9361 spi1.0: ad9361_probe : AD936x Rev 2 successfully initialized
[ 1.333188] cf_axi_dds: probe of 79024000.cf-ad9361-dds-core-lpc failed with error -2
[ 2.235987] ad9361 spi1.0: ad9361_dig_tune_delay: Tuning TX FAILED!
[ 2.241571] cf_axi_adc: probe of 79020000.cf-ad9361-lpc failed with error -5

The linux errno for -2 is 'No such file or directory' and the actual point where the drive probe function exit is

st->clk = devm_clk_get(&pdev->dev, "sampl_clk");
if (IS_ERR(st->clk)) {
ret = PTR_ERR(st->clk);
printk("CLK init failed, err = %d\n", ret);
goto err_iio_device_free;
}
// (from cf_axi_dds.c, line ~1330, in function cf_axi_dds_probe)
So I think it's a clock related problem. I configured the clock just as the fmcomms2.dtsi said, here is part of my device tree:
clocks {
ad9361_clkin: clock@0 {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <40000000>;
clock-output-names = "ad9361_ext_refclk";
};
};
adc0_ad9361: ad9361-phy@0 {
compatible = "adi,ad9361";
reg = <0>;
/* Clocks */
clocks = <&ad9361_clkin 0>;
clock-names = "ad9361_ext_refclk";
clock-output-names = "rx_sampl_clk", "tx_sampl_clk";
#clock-cells = <1>;
...
};
cf-ad9361-dds-core-lpc@79024000 {
compatible = "adi,axi-ad9361-dds-6.00.a";
reg = <0x79024000 0x1000>;
clocks = <&adc0_ad9361 0xd>;
clock_names = "sampl_clk";
dmas = <&dac_dma 0>;
dma-names = "tx";
adi,axi-dds-rate = <0x1>;
adi,axi-dds-1-rf-channel;
};
 
Besides of that, I also don't know why the clocks of cf-ad9361-dds-core-lpc is <&adc0_ad9361 0xd>, I think it should be 0x1 for there are only two clock outputs from ad9361-phy.
Thanks a lot for any help.
Parents Reply Children
No Data