Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2b0e264 authored by Heiko Stuebner's avatar Heiko Stuebner Committed by Andrzej Hajda
Browse files

drm/bridge/synopsys: dsi: don't call __dw_mipi_dsi_probe from dw_mipi_dsi_bind



__dw_mipi_dsi_probe() does all the grabbing of resources and does it using
devm-helpers. So this is happening on each try of master bringup possibly
slowing down things a lot.

Drivers using the component framework may instead want to call
dw_mipi_dsi_probe separately in their probe function to setup resources
early. That way the dsi bus also gets created earlier and also not
recreated on each bind-try, so that attached panels can load their modules
and be probed way before the bridge-attach in the bind call.

So drop the call to __dw_mipi_dsi_probe and modify the function to take
a struct dw_mipi_dsi instead of the platform-device.

Signed-off-by: default avatarHeiko Stuebner <heiko@sntech.de>
Reviewed-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181001123845.11818-3-heiko@sntech.de
parent 4b6e21c3
Loading
Loading
Loading
Loading
+3 −12
Original line number Original line Diff line number Diff line
@@ -966,31 +966,22 @@ EXPORT_SYMBOL_GPL(dw_mipi_dsi_remove);
/*
/*
 * Bind/unbind API, used from platforms based on the component framework.
 * Bind/unbind API, used from platforms based on the component framework.
 */
 */
struct dw_mipi_dsi *
int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder)
dw_mipi_dsi_bind(struct platform_device *pdev, struct drm_encoder *encoder,
		 const struct dw_mipi_dsi_plat_data *plat_data)
{
{
	struct dw_mipi_dsi *dsi;
	int ret;
	int ret;


	dsi = __dw_mipi_dsi_probe(pdev, plat_data);
	if (IS_ERR(dsi))
		return dsi;

	ret = drm_bridge_attach(encoder, &dsi->bridge, NULL);
	ret = drm_bridge_attach(encoder, &dsi->bridge, NULL);
	if (ret) {
	if (ret) {
		dw_mipi_dsi_remove(dsi);
		DRM_ERROR("Failed to initialize bridge with drm\n");
		DRM_ERROR("Failed to initialize bridge with drm\n");
		return ERR_PTR(ret);
		return ret;
	}
	}


	return dsi;
	return ret;
}
}
EXPORT_SYMBOL_GPL(dw_mipi_dsi_bind);
EXPORT_SYMBOL_GPL(dw_mipi_dsi_bind);


void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi)
void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi)
{
{
	__dw_mipi_dsi_remove(dsi);
}
}
EXPORT_SYMBOL_GPL(dw_mipi_dsi_unbind);
EXPORT_SYMBOL_GPL(dw_mipi_dsi_unbind);


+1 −4
Original line number Original line Diff line number Diff line
@@ -35,10 +35,7 @@ struct dw_mipi_dsi *dw_mipi_dsi_probe(struct platform_device *pdev,
				      const struct dw_mipi_dsi_plat_data
				      const struct dw_mipi_dsi_plat_data
				      *plat_data);
				      *plat_data);
void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi);
void dw_mipi_dsi_remove(struct dw_mipi_dsi *dsi);
struct dw_mipi_dsi *dw_mipi_dsi_bind(struct platform_device *pdev,
int dw_mipi_dsi_bind(struct dw_mipi_dsi *dsi, struct drm_encoder *encoder);
				     struct drm_encoder *encoder,
				     const struct dw_mipi_dsi_plat_data
				     *plat_data);
void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi);
void dw_mipi_dsi_unbind(struct dw_mipi_dsi *dsi);


#endif /* __DW_MIPI_DSI__ */
#endif /* __DW_MIPI_DSI__ */