drm/bridge: tc358775: Convert to drm_of_get_data_lanes_count_ep
Convert driver to use this new helper to standardize OF "data-lanes" parsing. Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Andrzej Hajda <andrzej.hajda@intel.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Maxime Ripard <maxime@cerno.tech> Cc: Robert Foss <robert.foss@linaro.org> Cc: Sam Ravnborg <sam@ravnborg.org> To: dri-devel@lists.freedesktop.org Link: https://patchwork.freedesktop.org/patch/msgid/20220524010522.528569-7-marex@denx.de
This commit is contained in:
parent
d8609fd1e0
commit
56426faa14
1 changed files with 5 additions and 16 deletions
|
@ -529,8 +529,7 @@ static int tc358775_parse_dt(struct device_node *np, struct tc_data *tc)
|
||||||
struct device_node *endpoint;
|
struct device_node *endpoint;
|
||||||
struct device_node *parent;
|
struct device_node *parent;
|
||||||
struct device_node *remote;
|
struct device_node *remote;
|
||||||
struct property *prop;
|
int dsi_lanes;
|
||||||
int len = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To get the data-lanes of dsi, we need to access the dsi0_out of port1
|
* To get the data-lanes of dsi, we need to access the dsi0_out of port1
|
||||||
|
@ -544,25 +543,15 @@ static int tc358775_parse_dt(struct device_node *np, struct tc_data *tc)
|
||||||
of_node_put(endpoint);
|
of_node_put(endpoint);
|
||||||
if (parent) {
|
if (parent) {
|
||||||
/* dsi0 port 1 */
|
/* dsi0 port 1 */
|
||||||
endpoint = of_graph_get_endpoint_by_regs(parent, 1, -1);
|
dsi_lanes = drm_of_get_data_lanes_count_ep(parent, 1, -1, 1, 4);
|
||||||
of_node_put(parent);
|
of_node_put(parent);
|
||||||
if (endpoint) {
|
|
||||||
prop = of_find_property(endpoint, "data-lanes",
|
|
||||||
&len);
|
|
||||||
of_node_put(endpoint);
|
|
||||||
if (!prop) {
|
|
||||||
dev_err(tc->dev,
|
|
||||||
"failed to find data lane\n");
|
|
||||||
return -EPROBE_DEFER;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tc->num_dsi_lanes = len / sizeof(u32);
|
if (dsi_lanes < 0)
|
||||||
|
return dsi_lanes;
|
||||||
|
|
||||||
if (tc->num_dsi_lanes < 1 || tc->num_dsi_lanes > 4)
|
tc->num_dsi_lanes = dsi_lanes;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
tc->host_node = of_graph_get_remote_node(np, 0, 0);
|
tc->host_node = of_graph_get_remote_node(np, 0, 0);
|
||||||
if (!tc->host_node)
|
if (!tc->host_node)
|
||||||
|
|
Loading…
Add table
Reference in a new issue