hansemro / kc1-linux

Documentation of mainline Linux on First Generation Kindle Fire
GNU General Public License v2.0
4 stars 0 forks source link

Add temperature sensor support to device tree #8

Closed hansemro closed 3 years ago

hansemro commented 3 years ago

Reference:

National Semiconductor/TI LM75 ~ TI TMP105

arch/arm/boot/dts/omap4-kc1.dts:

&i2c4 {
    ...
    tmp@49 {
        compatible = "ti,tmp105";
        reg = <0x49>;
        status = "okay";
    };
    ...
};
hansemro commented 3 years ago

Kernel log:

[    3.680664] lm75 3-0049: supply vs not found, using dummy regulator
[    3.721069] lm75: probe of 3-0049 failed with error -121
hansemro commented 3 years ago

Device tree fix: Use register 0x48 instead of 0x49

&i2c4 {
    ...
    tmp@48 {
        compatible = "ti,tmp105";
        reg = <0x48>;
        status = "okay";
    };
    ...
};

Kernel log:

[    3.669189] lm75 3-0048: supply vs not found, using dummy regulator
[    3.700195] lm75 3-0048: hwmon2: sensor 'tmp105'

sysfs:

amazon-otter:~# ls /sys/class/hwmon/hwmon2
device  of_node  subsystem    temp1_max       uevent
name    power    temp1_input  temp1_max_hyst  update_interval
amazon-otter:~# cat /sys/class/hwmon/hwmon2/name 
tmp105
amazon-otter:~# cat /sys/class/hwmon/hwmon2/temp1_max
72000
amazon-otter:~# cat /sys/class/hwmon/hwmon2/temp1_max_hyst 
70000
amazon-otter:~# cat /sys/class/hwmon/hwmon2/temp1_input 
30562
hansemro commented 3 years ago

Added to dtb_dev (commit 6383856e7fc67974ec5624cbae6d4233445c8caa)

hansemro commented 3 years ago

Merged to main (relevant pull request: #14)