SPRACD8 June 2019 DRA710 , DRA712 , DRA714 , DRA716 , DRA718 , DRA722 , DRA724 , DRA725 , DRA726 , DRA745 , DRA746 , DRA74P , DRA750 , DRA756 , DRA75P , DRA76P , DRA77P , DRA780 , DRA781 , DRA782 , DRA783 , DRA786 , DRA787 , DRA790 , DRA791 , DRA793 , DRA797 , TDA2EG-17 , TDA2HF , TDA2HG , TDA2HV , TDA2LF , TDA2P-ABZ , TDA2P-ACD , TDA2SA , TDA2SG , TDA2SX
The following example demonstrates device node structure for a camera connected using FPDlink3 ser/des. Here, the deserializer and serializer are connected only via the LVDS link. The camera is connected on the serializer I2C bus. The serializer and camera are not connected to the system I2C bus, but it can be accessed from the system I2C bus. The deserializer maps each of the remote slave onto the system I2C bus and acts as a bridge to transfer any messages addressed to the remote devices.
+-------+
|I2C bus|
+-------+
|
|0x60<real> +------------+
+-----------|Deserializer|0x60
| +------------+
| X
| X
| X <LVDS link>
| X
| X
| +----------+
| | Remote |
| | i2c bus |
| +----------+
| |
|0x74<alias> | +----------+
| <- - - - +------|Serializer| 0x58
| | +----------+
| |
|0x38<alias> | +---------+
| <- - - - +------|OV Camera| 0x30
| | +---------+
|
|
The topology in the example above can be described in the device tree as shown below. Note that the i2cbus here is a local I2C bus connected to the SoC. The lvds_des is just a virtual I2C bus representing the I2C bus at the remote end. That is the reason why the camera is described under the virtual bus.
i2cbus {
lvds_des: deserializer@60 {
compatible = "ti,ds90ub914aq";
reg = <0x60>;
gpio-controller;
#gpio-cells=1;
i2c-bus-num = <5>;
};
};
&lvds_des {
ranges = <0x58 0x74>,
<0x38 0x30>;
lvds_ser: serializer@58 {
compatible = "ti,ds90ub913aq";
reg = <0x58>;
remote-device = <&lvds_des>;
gpio-controller;
#gpio-cells=1;
slave-mode;
};
lvds_cam: camera@30 {
compatible = "ov10635";
reg = <0x30>;
gpios = <&lvds_ser 0>;
/* power pin controlled by serializer local gpio */
};
};
Also, note that the range property decides the address mapping from one bus to other. Address referred to as 0x74 on the remote bus will be aliased on address 0x58 on the local bus.
The advantage with this kind of device modeling is that the kernel driver controlling the camera need not know about the aliases, serializer and de-serializer. Once the Serdes link is ready and aliases are setup, the camera driver works independently without even noticing the I2C transactions getting rerouted. The same driver works on a both cameras connected directly or connected through a Serdes pair.