[PATCH 0/2] media: imx6: Support complex external topologies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

This small patch series adds support to the i.MX6 IPU CSI driver for
external (on-board) devices that exhibit complex topologies. My use case
is a CSI-2 camera sensor that has a single DT node (as an I2C device)
and creates two V4L2 subdevs. "Complex" may thus be a bit of an
exageration, but the series nonetheless makes such a sensor usable with
the driver.

There are two issues, fixed by two patches. Patch 1/2 removes the
assumption that OF port ids and pad indices are equivalent. This holds
true in many cases, but is incorrect in my case, with the topology being

+------------+       +--------------+       +---------------------+
|  Sensor   _|       |_   Sensor   _|       |_                    |
| Subdev A |0| ----> |0| Subdev B |1| ----> |0| imx6-mipi-csi2 ...|
|           ¯|       |¯            ¯|       |¯                    |
+------------+       +--------------+       +---------------------+

while the sensor has a single DT node with a single port. The IPU CSI
driver then tries to connect 'Sensor Subdev B':0 to 'imx6-mipi-csi2':0,
which isn't right.

The fix isn't perfect, as we ideally need media entity operations to
handle the translation between port ids and pad indices. Nonetheless,
the heuristic in patch 1/2 should cover most, if not all, use cases and
is in my opinion a good way forward.

Patch 2/2 then stops creating links between external entities. The IPU
CSI driver iterates over the list of subdevs registered with the V4L2
device, and creates links based on the OF graph for all of them. That's
fine for devices internal to the i.MX6, but is oversteps the driver's
responsibility as links between external entities are supposed to be
handled by their respective driver. In my use case, the driver attempts
to link 'Sensor Subdev A' by checking OF graph connections in DT, which
results in 'Sensor Subdev A':0 being linked to 'imx6-mipi-csi2':0. The
patch skips external entities for link creation, which fixes the issue.
The link between the closest external entities and the internal entities
are still created by the IPU CSI driver as part of link creation for all
internal entities.

Laurent Pinchart (2):
  media: staging/imx: Don't assume OF port id equals pad index
  media: staging/imx: Don't create links between external entities

 drivers/staging/media/imx/imx-media-csi.c     | 29 ++++++++++-
 .../staging/media/imx/imx-media-dev-common.c  |  7 +--
 drivers/staging/media/imx/imx-media-of.c      | 52 ++++++++++++++++---
 drivers/staging/media/imx/imx-media.h         |  1 +
 4 files changed, 75 insertions(+), 14 deletions(-)

-- 
Regards,

Laurent Pinchart




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux