在kernel 内 make menuconfig 加入相关选项
Device Drivers --->
<*> Hardware Monitoring support --->
<*> National Semiconductor LM75 and compatibles
493 &i2c2 {
494 pinctrl-names = "default";
495 pinctrl-0 = <&i2c2_pins>;
496
497 status = "okay";
498 clock-frequency = <100000>;
499
500 tmpx75@4c {
501 compatible = "tmp75";
502 reg = <0x4c>;
503 status = "okay";
504 };
505
506 };
// 开机的时候将 tmpx75模块插入 I2C2 接口中。
// 在文件系统中能看到
/sys/bus/i2c/devices/2-004c/hwmon/hwmon0/temp1_input
cat /sys/bus/i2c/devices/2-004c/hwmon/hwmon0/temp1_input