Hi Hans, On Wed, 2017-09-20 at 15:12 +0200, Hans Verkuil wrote: [...] > I don't like it :-) > > Currently g_mbus_config returns (and I quote from v4l2-mediabus.h): "How > many lanes the client can use". I.e. the capabilities of the HW. > > If we are going to use this to communicate how many lines are currently > in use, then I would propose that we add a lane mask, i.e. something like > this: > > /* Number of lanes in use, 0 == use all available lanes (default) */ > #define V4L2_MBUS_CSI2_LANE_MASK (3 << 10) > > And add comments along the lines that this is a temporary fix. > > I would feel a lot happier (or a lot less unhappy) if we'd do it this way. > Rather than re-interpreting bits that are not quite what they should be. > > I'd also add a comment that all other flags must be 0 if the device tree is > used. This to avoid mixing the two. I would like to try this. Currently the driver sets the V4L2_MBUS_CSI2_[1-4]_LANE bits according to csi_lanes_in_use, which is wrong as you say. After moving the csi_lanes_in_use info into a new V4L2_MBUS_CSI2_LANE_MASK bitfield, the V4L2_MBUS_CSI2_[1-4]_LANE bits could be either set to zero or to the really connected lanes as configured in the device tree (csi->bus.num_data_lanes) in the DT case. What would the bits be set to in the pdata case, though? Should a lane count setting be added to tc358743_platform_data with, defaulting to all bits set? regards Philipp