Lines Matching refs:msm_dsi

8 struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi)  in msm_dsi_get_encoder()  argument
10 if (!msm_dsi || !msm_dsi_device_connected(msm_dsi)) in msm_dsi_get_encoder()
13 return msm_dsi->encoder; in msm_dsi_get_encoder()
16 static int dsi_get_phy(struct msm_dsi *msm_dsi) in dsi_get_phy() argument
18 struct platform_device *pdev = msm_dsi->pdev; in dsi_get_phy()
30 msm_dsi->phy = platform_get_drvdata(phy_pdev); in dsi_get_phy()
34 if (!phy_pdev || !msm_dsi->phy) { in dsi_get_phy()
39 msm_dsi->phy_dev = get_device(&phy_pdev->dev); in dsi_get_phy()
44 static void dsi_destroy(struct msm_dsi *msm_dsi) in dsi_destroy() argument
46 if (!msm_dsi) in dsi_destroy()
49 msm_dsi_manager_unregister(msm_dsi); in dsi_destroy()
51 if (msm_dsi->phy_dev) { in dsi_destroy()
52 put_device(msm_dsi->phy_dev); in dsi_destroy()
53 msm_dsi->phy = NULL; in dsi_destroy()
54 msm_dsi->phy_dev = NULL; in dsi_destroy()
57 if (msm_dsi->host) { in dsi_destroy()
58 msm_dsi_host_destroy(msm_dsi->host); in dsi_destroy()
59 msm_dsi->host = NULL; in dsi_destroy()
62 platform_set_drvdata(msm_dsi->pdev, NULL); in dsi_destroy()
65 static struct msm_dsi *dsi_init(struct platform_device *pdev) in dsi_init()
67 struct msm_dsi *msm_dsi; in dsi_init() local
73 msm_dsi = devm_kzalloc(&pdev->dev, sizeof(*msm_dsi), GFP_KERNEL); in dsi_init()
74 if (!msm_dsi) in dsi_init()
76 DBG("dsi probed=%p", msm_dsi); in dsi_init()
78 msm_dsi->id = -1; in dsi_init()
79 msm_dsi->pdev = pdev; in dsi_init()
80 platform_set_drvdata(pdev, msm_dsi); in dsi_init()
83 ret = msm_dsi_host_init(msm_dsi); in dsi_init()
88 ret = dsi_get_phy(msm_dsi); in dsi_init()
93 ret = msm_dsi_manager_register(msm_dsi); in dsi_init()
97 return msm_dsi; in dsi_init()
100 dsi_destroy(msm_dsi); in dsi_init()
109 struct msm_dsi *msm_dsi; in dsi_bind() local
112 msm_dsi = dsi_init(pdev); in dsi_bind()
113 if (IS_ERR(msm_dsi)) { in dsi_bind()
115 if (PTR_ERR(msm_dsi) == -ENODEV) in dsi_bind()
118 return PTR_ERR(msm_dsi); in dsi_bind()
121 priv->dsi[msm_dsi->id] = msm_dsi; in dsi_bind()
131 struct msm_dsi *msm_dsi = dev_get_drvdata(dev); in dsi_unbind() local
132 int id = msm_dsi->id; in dsi_unbind()
135 dsi_destroy(msm_dsi); in dsi_unbind()
190 int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, in msm_dsi_modeset_init() argument
197 if (WARN_ON(!encoder) || WARN_ON(!msm_dsi) || WARN_ON(!dev)) in msm_dsi_modeset_init()
201 msm_dsi->dev = dev; in msm_dsi_modeset_init()
203 ret = msm_dsi_host_modeset_init(msm_dsi->host, dev); in msm_dsi_modeset_init()
209 if (!msm_dsi_manager_validate_current_config(msm_dsi->id)) in msm_dsi_modeset_init()
212 msm_dsi->encoder = encoder; in msm_dsi_modeset_init()
214 msm_dsi->bridge = msm_dsi_manager_bridge_init(msm_dsi->id); in msm_dsi_modeset_init()
215 if (IS_ERR(msm_dsi->bridge)) { in msm_dsi_modeset_init()
216 ret = PTR_ERR(msm_dsi->bridge); in msm_dsi_modeset_init()
218 msm_dsi->bridge = NULL; in msm_dsi_modeset_init()
228 ext_bridge = msm_dsi_host_get_bridge(msm_dsi->host); in msm_dsi_modeset_init()
231 msm_dsi->connector = in msm_dsi_modeset_init()
232 msm_dsi_manager_ext_bridge_init(msm_dsi->id); in msm_dsi_modeset_init()
234 msm_dsi->connector = in msm_dsi_modeset_init()
235 msm_dsi_manager_connector_init(msm_dsi->id); in msm_dsi_modeset_init()
237 if (IS_ERR(msm_dsi->connector)) { in msm_dsi_modeset_init()
238 ret = PTR_ERR(msm_dsi->connector); in msm_dsi_modeset_init()
241 msm_dsi->connector = NULL; in msm_dsi_modeset_init()
245 msm_dsi_manager_setup_encoder(msm_dsi->id); in msm_dsi_modeset_init()
247 priv->bridges[priv->num_bridges++] = msm_dsi->bridge; in msm_dsi_modeset_init()
248 priv->connectors[priv->num_connectors++] = msm_dsi->connector; in msm_dsi_modeset_init()
253 if (msm_dsi->bridge) { in msm_dsi_modeset_init()
254 msm_dsi_manager_bridge_destroy(msm_dsi->bridge); in msm_dsi_modeset_init()
255 msm_dsi->bridge = NULL; in msm_dsi_modeset_init()
259 if (msm_dsi->connector && !msm_dsi->external_bridge) in msm_dsi_modeset_init()
260 msm_dsi->connector->funcs->destroy(msm_dsi->connector); in msm_dsi_modeset_init()
262 msm_dsi->connector = NULL; in msm_dsi_modeset_init()