Lines Matching +full:mdss +full:- +full:dsi +full:- +full:ctrl

1 // SPDX-License-Identifier: GPL-2.0-only
6 #include "dsi.h"
11 unsigned long host_flags = msm_dsi_host_get_mode_flags(msm_dsi->host); in msm_dsi_is_cmd_mode()
18 return msm_dsi_host_get_dsc_config(msm_dsi->host); in msm_dsi_get_dsc_config()
23 struct platform_device *pdev = msm_dsi->pdev; in dsi_get_phy()
27 phy_node = of_parse_phandle(pdev->dev.of_node, "phys", 0); in dsi_get_phy()
29 DRM_DEV_ERROR(&pdev->dev, "cannot find phy device\n"); in dsi_get_phy()
30 return -ENXIO; in dsi_get_phy()
35 msm_dsi->phy = platform_get_drvdata(phy_pdev); in dsi_get_phy()
36 msm_dsi->phy_dev = &phy_pdev->dev; in dsi_get_phy()
42 DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__); in dsi_get_phy()
43 return -EPROBE_DEFER; in dsi_get_phy()
45 if (!msm_dsi->phy) { in dsi_get_phy()
46 put_device(&phy_pdev->dev); in dsi_get_phy()
47 DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__); in dsi_get_phy()
48 return -EPROBE_DEFER; in dsi_get_phy()
61 if (msm_dsi->phy_dev) { in dsi_destroy()
62 put_device(msm_dsi->phy_dev); in dsi_destroy()
63 msm_dsi->phy = NULL; in dsi_destroy()
64 msm_dsi->phy_dev = NULL; in dsi_destroy()
67 if (msm_dsi->host) { in dsi_destroy()
68 msm_dsi_host_destroy(msm_dsi->host); in dsi_destroy()
69 msm_dsi->host = NULL; in dsi_destroy()
72 platform_set_drvdata(msm_dsi->pdev, NULL); in dsi_destroy()
81 return ERR_PTR(-ENXIO); in dsi_init()
83 msm_dsi = devm_kzalloc(&pdev->dev, sizeof(*msm_dsi), GFP_KERNEL); in dsi_init()
85 return ERR_PTR(-ENOMEM); in dsi_init()
86 DBG("dsi probed=%p", msm_dsi); in dsi_init()
88 msm_dsi->id = -1; in dsi_init()
89 msm_dsi->pdev = pdev; in dsi_init()
92 /* Init dsi host */ in dsi_init()
97 /* GET dsi PHY */ in dsi_init()
102 /* Register to dsi manager */ in dsi_init()
119 priv->dsi[msm_dsi->id] = msm_dsi; in dsi_bind()
130 priv->dsi[msm_dsi->id] = NULL; in dsi_unbind()
140 return component_add(&pdev->dev, &dsi_ops); in dsi_dev_attach()
145 component_del(&pdev->dev, &dsi_ops); in dsi_dev_detach()
155 /* Don't fail the bind if the dsi port is not connected */ in dsi_dev_probe()
156 if (PTR_ERR(msm_dsi) == -ENODEV) in dsi_dev_probe()
176 { .compatible = "qcom,mdss-dsi-ctrl", .data = NULL /* autodetect cfg */ },
177 { .compatible = "qcom,dsi-ctrl-6g-qcm2290", .data = &qcm2290_dsi_cfg_handler },
218 return -EINVAL; in msm_dsi_modeset_init()
220 priv = dev->dev_private; in msm_dsi_modeset_init()
222 if (priv->num_bridges == ARRAY_SIZE(priv->bridges)) { in msm_dsi_modeset_init()
223 DRM_DEV_ERROR(dev->dev, "too many bridges\n"); in msm_dsi_modeset_init()
224 return -ENOSPC; in msm_dsi_modeset_init()
227 msm_dsi->dev = dev; in msm_dsi_modeset_init()
229 ret = msm_dsi_host_modeset_init(msm_dsi->host, dev); in msm_dsi_modeset_init()
231 DRM_DEV_ERROR(dev->dev, "failed to modeset init host: %d\n", ret); in msm_dsi_modeset_init()
239 * Just skip creating encoder/connector for the slave-DSI. in msm_dsi_modeset_init()
244 msm_dsi->encoder = encoder; in msm_dsi_modeset_init()
246 msm_dsi->bridge = msm_dsi_manager_bridge_init(msm_dsi->id); in msm_dsi_modeset_init()
247 if (IS_ERR(msm_dsi->bridge)) { in msm_dsi_modeset_init()
248 ret = PTR_ERR(msm_dsi->bridge); in msm_dsi_modeset_init()
249 DRM_DEV_ERROR(dev->dev, "failed to create dsi bridge: %d\n", ret); in msm_dsi_modeset_init()
250 msm_dsi->bridge = NULL; in msm_dsi_modeset_init()
254 ret = msm_dsi_manager_ext_bridge_init(msm_dsi->id); in msm_dsi_modeset_init()
256 DRM_DEV_ERROR(dev->dev, in msm_dsi_modeset_init()
257 "failed to create dsi connector: %d\n", ret); in msm_dsi_modeset_init()
261 priv->bridges[priv->num_bridges++] = msm_dsi->bridge; in msm_dsi_modeset_init()
266 if (msm_dsi->bridge) { in msm_dsi_modeset_init()
267 msm_dsi_manager_bridge_destroy(msm_dsi->bridge); in msm_dsi_modeset_init()
268 msm_dsi->bridge = NULL; in msm_dsi_modeset_init()
276 msm_dsi_host_snapshot(disp_state, msm_dsi->host); in msm_dsi_snapshot()
277 msm_dsi_phy_snapshot(disp_state, msm_dsi->phy); in msm_dsi_snapshot()