This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Using Kernel Module for ADS1051 on AM5728

Part Number: AM5728
Other Parts Discussed in Thread: ADS1015

Tool/software: Linux

I'm on SDK 4.02 on a custom AM5728 (Kernel 4.14).

I've added ADS1015 ADC to my device tree:

&i2c5 {
        status = "okay";
        clock-frequency = <400000>;
        pinctrl-names="default";
        pinctrl-0 = <&i2c5_pins_default>;

        ads1051: ads1051@49 {
                status = "okay";
                compatible = "ti,ads1051";
                reg = <0x49>;
                #address-cells = <1>;
                #size-cells = <0>;

                channel@4 {
                        reg = <4>;
                        ti,gain = <2>;
                        ti,datarate = <4>;
                };
        };
};

The device is detected on i2cdetect:

# i2cdetect -r 4                                                                                                                                                                                                                                       
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-4 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] 
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- 48 49 -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 

I can manually load the module:

# lsmod
Module Size Used by
ads1015 16384 0

I see it under sys/bus/i2c:

# ls /sys/bus/i2c/devices/i2c-4
4-0049 delete_device device i2c-dev name new_device of_node power subsystem uevent

But nothing under /sys/bus/iio/devices where I'd expect to query the ADC readings.

Question 1. Shouldn't my kernel module load automatically since the device tree node is marked "okay"?

Question 2. After loading the module, I expected to see a log in "dmesg" or a new directory structure in /sys/bus/iio. I don't see anything! What's expected?

Thanks

  • Hello Adam,

    1) Linux SDK 4.02 uses kernel 4.9, could you confirm what version of software you are using?
    2) Please attach a full command line output so we can see if something is going on during bootup

    Regards,
    Nick
  • Ah, I must have updated my SDK. It's 5.0.

    Here is my boot log - paste.ubuntu.com/.../

  • I feel so stupid - the device name should have been ads1015, not ads1051.

    &i2c5 {
            status = "okay";
            clock-frequency = <400000>;
            pinctrl-names="default";
            pinctrl-0 = <&i2c5_pins_default>;
            ads1051: ads1051@49 {
                    status = "okay";
                    compatible = "ti,ads1051";
                    reg = <0x49>;
                    #address-cells = <1>;
                    #size-cells = <0>;
                    channel@4 {
                            reg = <4>;
                            ti,gain = <2>;
                            ti,datarate = <4>;
                    };
            };
    };