Dear Team,
I am using AD7689 power monitoring ADC on the T1024rdb processor(powerpc-based architecture), and I cannot get node iio in rootfs (/sys/bus/).
I have enabled iio related configuration in menuconfig, attached for reference.
Will iio node in /sys/bus/ be created in PowerPC architecture ?
Thanks in advance,
Kasturi.
Solved! Go to Solution.
Please upgrade Linux Kernel to version 5.0 or above which includes AD7949 driver.
Please refer to Documentation/devicetree/bindings/iio/adc/ad7949.txt for dts definition.
For example:
spi@110000 {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = "adi,ad7689";
reg = <0x3>;
spi-max-frequency = <16000000>;
};
};
In Linux Kernel configuration file, please define CONFIG_AD7949.
Thanks yipingwang for your quick response.
DTS is configured as below,
Kconfig is configured as below,
Enabled it in menuconfig as below,
But still not able to get iio node in rootfs(/sys/bus)
Please let me know if anything else has to be configured.
Thanks in advance,
Kasturi.
Would you please provide your Linux Kernel booting up log and dts file?
Please modify the following in dts file.
ad7949@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "adi,ad7689";
reg = <0x3>;
spi-max-frequency = <16000000>;
};
Modify to:
ad7949@1 {
#address-cells = <1>;
#size-cells = <1>;
compatible = "adi,ad7689";
reg = <0x1>;
spi-max-frequency = <16000000>;
};
Please check the following on your target board.
cat /sys/bus/spi/devices/spi32766.1/of_node/compatible
Please check your Linux Kernel source code drivers/iio/adc/ad7949.c whether "adi,ad7689" is valid.
Hello yipingwang,
In linux Kernel source code drivers/iio/adc/ad7949.c , "adi,ad7689" is valid.
Attaching the driver source code for your reference.
Thank you.
Please check the following on your target board.
cat /sys/bus/spi/devices/spi32766.1/of_node/compatible
Below is the log.
root@t1024rdb:/sys/firmware/devicetree/base/soc@ffe000000/spi@110000/ad7949@1# cat compatible
adi,ad7689
root@t1024rdb:/sys/firmware/devicetree/base/soc@ffe000000/spi@110000/ad7949@1# cat name
ad7949
When I build the driver as a module and try to insert it in the kernel, I get the below error.
==============================================================
root@t1024rdb:~# modprobe ad7949.ko
modprobe: module ad7949.ko not found in modules.dep
root@t1024rdb:~# insmod ad7949.ko
[ 184.015140] ad7949: Unknown symbol devm_iio_device_alloc (err 0)
[ 184.021239] ad7949: Unknown symbol iio_device_unregister (err 0)
[ 184.027274] ad7949: Unknown symbol iio_device_register (err 0)
insmod: can't insert 'ad7949.ko': unknown symbol in module, or unknown parameter
root@t1024rdb:~#
=============================================================
Would you please check whether following and let me know the result?
cat /sys/bus/spi/devices/spi32766.1/of_node/compatible
Please run the following command in Linux and let me know the result.
zcat /proc/config.gz | grep CONFIG_AD7949
In your booting up log, it seems that your Linux Kernel image is built on 2019-12-26.
Hello yipingwang,
I could get the below output,
**********************************************************
root@t1024rdb:~# zcat /proc/config.gz | grep CONFIG_AD7949
CONFIG_AD7949=m
**********************************************************
The image does not boot completely when the module is built with the image. Attached is the boot log for the same. So built it as a module and tried to modprobe it. That shows the "module ad7949.ko not found in modules. dep" error.
For Information:
The Kernel version that I am using is 4.1.
But the AD7949 driver support was found from kernel version 5.0 and above.
Will that be the reason, it is not working straightforwardly?
Do I need to include any dependencies?
Please upgrade Linux Kernel to version 5.0 or above which includes AD7949 driver.