Hwo to add i2c devices in dts for ipq806x router

Hi, I have an ipq806x router with pcf8563 and lm75 sensors on it.
From the original firmware startup log:

[    0.655232] usbcore: registered new interface driver cdc_wdm
[    0.655763] usbcore: registered new interface driver usbserial
[    0.656044] usbcore: registered new interface driver usbserial_generic
[    0.656263] USB Serial support registered for generic
[    0.656294] usbserial: USB Serial Driver core
[    0.658700] rtc-pcf8563 1-0051: low voltage detected, date/time is not reliable.
[    0.658700] rtc-pcf8563 1-0051: chip found, driver version 0.4.3
[    0.660262] rtc-pcf8563 1-0051: low voltage detected, date/time is not reliable.
[    0.660699] rtc-pcf8563 1-0051: rtc core: registered rtc-pcf8563 as rtc0
[    0.660918] i2c /dev entries driver
[    0.661730] i2c-core: driver [adc121c021_i2c_drvr] using legacy suspend method
[    0.661730] i2c-core: driver [adc121c021_i2c_drvr] using legacy resume method
[    0.662605] lm75 1-0048: hwmon0: sensor 'lm75'

I guess probably write in device tree like this:

	lm75@48 {
		status = "okay";
		compatible = "lm75";
		reg = <0x48>;
	};

	pcf8563: rtc@51 {
		status = "okay";
		compatible = "nxp,pcf8563";
		reg = <0x51>;
	};

But I don't know where to add this code in dts for ipq806x.

Start with enabling i2c controller(s) in the dts-file for your device and installing kmod-i2c-core i2c-tools packages.

Thank you for your guidance, but I don't konw how to enable i2c controller in dts for ipq806x, I try to write from other target devices' dts, and it does not appear on the startup log with "Failed to open rtc device".

Unused controllers have status "disabled", change to "okay".
Example:

			i2c@124a0000 {
				compatible = "qcom,i2c-qup-v1.1.1";
				reg = <0x124a0000 0x1000>;
				interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>;

				clocks = <&gcc GSBI2_QUP_CLK>, <&gcc GSBI2_H_CLK>;
				clock-names = "core", "iface";
				status = "disabled";

				#address-cells = <1>;
				#size-cells = <0>;
			};
1 Like

Thank you very much.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.