Firefly Open Source Community

Title: How to add I2C device in device tree file? [Print This Page]

Author: mhacla    Time: 8/25/2016 17:24
Title: How to add I2C device in device tree file?
Hi,

I am trying to connect 3 serial devices to the I2C0 of FirePrime:

Device 1: I2C address at 60H
Device 2: I2C address at 64H
Device 3: I2C address at 44H

how do I add this to the device tree? rk3128-fireprime.dts has this definition by default:

&i2c0 {
        status = "okay";
        rtc@51 {
                compatible = "rtc,hym8563";
                reg = <0x51>;
                irq_gpio = <&gpio0 GPIO_D4 IRQ_TYPE_EDGE_FALLING>;
        };
                ts@41 {
                        compatible = "tchip,gsl3680";
                        reg = <0x41>;
                        touch-gpio = <&gpio1 GPIO_B4 IRQ_TYPE_EDGE_RISING>;
                        //reset-gpio = <&gpio8 GPIO_A6 GPIO_ACTIVE_LOW>;
                        max-x = <1280>;
                        max-y = <800>;
                };
};

Why are the nodes rtc@51 and ts@41 defined by default?
Author: isle    Time: 9/2/2016 09:38
Hi whacla
    the nodes defined here because there were some devices connect to I2C0,
If you don't need it ,just remove them .
     And,  you can add your device like this:
   
    devices@60 {
                compatible = "devices,name";
                reg = <0x60>;
        };
   




Welcome Firefly Open Source Community (https://bbs.t-firefly.com/) Powered by Discuz! X3.1