Hi Carsten,

On Wednesday, 4 April 2018 11:41:05 EEST Carsten Behling wrote:
> > Hi,
> > 
> > I would like to write a DRM bridge driver that is an I2C device and a DRM
> > MIPI DSI device.
> > 
> > It looks like that both - 'i2c-core.c: of_i2c_register_devices' and
> > 'drm_mipi_dsi.c: mipi_dsi_host_register'  are registering their devices by
> > iterating over devicetree child nodes with
> > for_each_available_child_of_node.
> > 
> > Since I can't make the bridge a child node of both, I don't know how to
> > resolve it.
> 
> Found the answer myself. adv7533 driver is a good example. Devicetree
> exists for qcom apq8016-sbc. No need to make the bridge a MIPI DSI child
> node.

This is an issue that has largely been ignored so far in Linux. Both DT and 
the Linux kernel device model organize devices in a tree structure based on 
the control buses. Devices that are connected to multiple control buses 
haven't been taken into account in the design and are thus hard to support.

As you may know, DSI can work in command mode or data mode. In data mode the 
DSI bus is only use to transfer video data, while in command mode it is also 
used to control the device (reading and writing registers).

A DSI device operating in data mode and controlled through I2C isn't a 
problem, as there's a single control bus in that case. The device should be a 
child of the I2C controller in DT, and will be instantiated through 
of_i2c_register_devices(). A DSI device operating in command mode without any 
other control bus isn't a problem either, it will be a child of the DSI master 
in DT, and will bee instantiated through mipi_dsi_host_register().

A DSI device operating in command mode that also require configuration through 
a separate control bus (such as I2C, but also SPI) is much more problematic to 
support. Fortunately those devices are rare. Hopefully your device won't fall 
in this category. If it does, we can discuss how to best support it.

-- 
Regards,

Laurent Pinchart



_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to