Using IIO driver as a Loadable kernel module

Hello

I want use ti-ads8688 iio driver as a kernel module. I am using Beaglebone Black.

I wrote below Makefile for this work.

obj-m+=ti-ads8688.o
all:
    make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) modules
clean:
    make -C /lib/modules/$(shell uname -r)/build/ M=$(PWD) clean

ti-ads8688.ko file correctly generated and i load it with insmod command. But there is not module in iio devices, as you can see in below:

debian@beaglebone:~/work/phase1$ ls /sys/bus/iio/devices/iio\:device0
buffer           in_voltage1_raw  in_voltage4_raw  in_voltage7_raw  power          uevent
dev              in_voltage2_raw  in_voltage5_raw  name             scan_elements
in_voltage0_raw  in_voltage3_raw  in_voltage6_raw  of_node          subsystem

am i miss something? I also add in my devicetree below unit:

adc@0 {
    compatible = "ti,ads8688";
    reg = <0>;
    spi-cpha;
    spi-max-frequency = <100000>;
};


I think the problem is with my device tree, but I don't know how fix it.

this is the device tree recommendation of texas instrument.
when i add below devicetree to a dtb_overlay tree:

adc@0 {
    compatible = "ti,ads8688";
    reg = <0>;
    spi-cpha;
    spi-max-frequency = <100000>;
};

the board crash. when i change it to below:

adc@2 {
    compatible = "ti,ads8688";
    reg = <0>;
    spi-cpha;
    spi-max-frequency = <100000>;
};

the board don’t crash but the iio problem in first post still there.

Solution was easy!
First disable default ADC overlay in uEnv.txt (optional)
then change my device tree to a better one!
related section of my device tree is below:

`
fragment@2 {
target = <&spi0>;
overlay {
status = “okay”;
adc@0 {
compatible = “ti,ads8688”;
reg = <0>;
spi-max-frequency = <1000000>;
};

};
`

Because the ads8688 use spi for communication. I must introduce it to spi interface!