Why do you parse data-lanes property in device tree as u32 instead of as an array?

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do you parse data-lanes property in device tree as u32 instead of as an array?

49 Views
AnthonyZ
Contributor I

driver source: imx8-mipi-csi2-sam.c
kernel version: imx 5.4.70_2.3.0
The data-lanes property is parsed as u32 in imx8-mipi-csi2-sam.c. This very unusual in comparison to many other documented drivers including other imx drivers using this property.
The driver in imx8-media-dev.c e.g. also calls a function "v4l2_fwnode_endpoint_parse" which parses the same property (data-lanes) in a different way.
This does not lead to any error as v4l2 just initializes falsely interpreted data, but it is still not according to the v4l2-framework and may cause unwanted side-effects in the future.

Hence, the question is: Is there any reason for interpreting data-lanes as u32 instead of as an u32_array?

Regards,
Anthony

0 Kudos
1 Reply

39 Views
nxf65025
NXP Employee
NXP Employee

Hi

 

You can see this kernel  wiki https://www.kernel.org/doc/html/v4.18/media/kapi/v4l2-fwnode.html 

The u32_array size is decided by num_data_lanes.

The u32  data-lanes in dts  just numbers of datalanes.

The node of data-lanes is parsed into num_lanes

of_property_read_u32(node, "data-lanes", &state->num_lanes);

So there is no problem

 

BR

Zhiming

0 Kudos