I'm attempting to modify my pi device tree to detect the mcp9808 temperature sensor. Ihave successfully done the procedure manually as follows:
Jc42 driver is a module, so modprobe it:
Code: Select all
modprobe jc42
Code: Select all
echo jc42 0x18 > /sys/bus/i2c/devices/i2c-0/new_device
Code: Select all
[ 116.054090] i2c i2c-0: new_device: Instantiated device jc42 at 0x18
i2cdetect -y 0
Code: Select all
# i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- 64 -- -- -- -- UU -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Code: Select all
cat /sys/devices/platform/soc/3f205000.i2c/i2c-0/0-0018/hwmon/hwmon0/temp1_input
So I'd like to get my device tree to do this for me automagically on boot. I need an entry in my device tree which makes it compatible with the microchip mcp9808
jc42 does have this device and can recognise it by name but I'm not sure what my tree entry should be, my effort is as follows:
Code: Select all
/dts-v1/;
/ {
compatible = "brcm,bcm2708";
[email protected] {
target = <0xffffffff>;
__overlay__ {
#address-cells = <0x1>;
#size-cells = <0x0>;
status = "okay";
[email protected] {
compatible = "microchip,mcp9808";
reg = <0x18>;
};
};
};
};
Cheers,
Chris.