Message ID | 20220519112657.62283-2-marex@denx.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [01/11] drm: of: Add drm_of_get_data_lanes and drm_of_get_data_lanes_ep | expand |
On 19.05.2022 13:26, Marek Vasut wrote: > Convert driver to use this new helper to standardize > OF "data-lanes" parsing. > > 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> > Cc: Xin Ji <xji@analogixsemi.com> > To: dri-devel@lists.freedesktop.org > --- > drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c > index e92eb4a407452..87d7658b92fac 100644 > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > @@ -1637,16 +1637,16 @@ static int anx7625_parse_dt(struct device *dev, > if (of_property_read_u32(ep0, "bus-type", &bus_type)) > bus_type = 0; > > - mipi_lanes = of_property_count_u32_elems(ep0, "data-lanes"); > + mipi_lanes = drm_of_get_data_lanes(ep0, 1, MAX_LANES_SUPPORT); > of_node_put(ep0); > } > > if (bus_type == V4L2_FWNODE_BUS_TYPE_PARALLEL) /* bus type is Parallel(DSI) */ > pdata->is_dpi = 0; > > - pdata->mipi_lanes = mipi_lanes; > - if (pdata->mipi_lanes > MAX_LANES_SUPPORT || pdata->mipi_lanes <= 0) > - pdata->mipi_lanes = MAX_LANES_SUPPORT; > + pdata->mipi_lanes = MAX_LANES_SUPPORT; > + if (mipi_lanes > 0) > + pdata->mipi_lanes = mipi_lanes; Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Regards Andrzej > > if (pdata->is_dpi) > DRM_DEV_DEBUG_DRIVER(dev, "found MIPI DPI host node.\n");
diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index e92eb4a407452..87d7658b92fac 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -1637,16 +1637,16 @@ static int anx7625_parse_dt(struct device *dev, if (of_property_read_u32(ep0, "bus-type", &bus_type)) bus_type = 0; - mipi_lanes = of_property_count_u32_elems(ep0, "data-lanes"); + mipi_lanes = drm_of_get_data_lanes(ep0, 1, MAX_LANES_SUPPORT); of_node_put(ep0); } if (bus_type == V4L2_FWNODE_BUS_TYPE_PARALLEL) /* bus type is Parallel(DSI) */ pdata->is_dpi = 0; - pdata->mipi_lanes = mipi_lanes; - if (pdata->mipi_lanes > MAX_LANES_SUPPORT || pdata->mipi_lanes <= 0) - pdata->mipi_lanes = MAX_LANES_SUPPORT; + pdata->mipi_lanes = MAX_LANES_SUPPORT; + if (mipi_lanes > 0) + pdata->mipi_lanes = mipi_lanes; if (pdata->is_dpi) DRM_DEV_DEBUG_DRIVER(dev, "found MIPI DPI host node.\n");
Convert driver to use this new helper to standardize OF "data-lanes" parsing. 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> Cc: Xin Ji <xji@analogixsemi.com> To: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/bridge/analogix/anx7625.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)