Re: [V3, 4/4] media: platform: dwc: Add MIPI CSI-2 controller driver

From: Eugen.Hristev
Date: Mon Dec 10 2018 - 07:39:59 EST




On 19.10.2018 15:52, Luis Oliveira wrote:
> Add the Synopsys MIPI CSI-2 controller driver. This
> controller driver is divided in platform dependent functions
> and core functions. It also includes a platform for future
> DesignWare drivers.
>
> Signed-off-by: Luis Oliveira <lolivei@xxxxxxxxxxxx>
> ---
> Changelog
> v2-V3
> - exposed IPI settings to userspace
> - fixed headers
[...]

snip


> +
> +static int
> +dw_mipi_csi_parse_dt(struct platform_device *pdev, struct mipi_csi_dev *dev)
> +{
> + struct device_node *node = pdev->dev.of_node;
> + struct v4l2_fwnode_endpoint endpoint;

Hello Luis,

I believe you have to initialize "endpoint" here correctly, otherwise
the parsing mechanism (fwnode_endpoint_parse) will consider you have a
specific mbus type and fail to probe the endpoint: bail out with debug
message "expecting bus type not found "

(namely, initialize to zero which is the UNKNOWN mbus type, or , to a
specific mbus (from DT or whatever source))

Eugen


> + int ret;
> +
> + node = of_graph_get_next_endpoint(node, NULL);
> + if (!node) {
> + dev_err(&pdev->dev, "No port node at %s\n",
> + pdev->dev.of_node->full_name);
> + return -EINVAL;
> + }
> +
> + ret = v4l2_fwnode_endpoint_parse(of_fwnode_handle(node), &endpoint);
> + if (ret)
> + goto err;
> +
> + dev->index = endpoint.base.port - 1;
> + if (dev->index >= CSI_MAX_ENTITIES) {
> + ret = -ENXIO;
> + goto err;
> + }
> + dev->hw.num_lanes = endpoint.bus.mipi_csi2.num_data_lanes;
> +
> +err:
> + of_node_put(node);
> + return ret;
> +}
> +

snip