Lines Matching +full:disable +full:- +full:dc
1 // SPDX-License-Identifier: GPL-2.0+
8 #include <linux/media-bus-format.h>
18 #include <dt-bindings/firmware/imx/rsrc.h>
20 #define DRIVER_NAME "imx8qxp-display-pixel-link"
43 ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, in imx8qxp_pixel_link_enable_mst_en()
44 pl->mst_en_ctrl, true); in imx8qxp_pixel_link_enable_mst_en()
46 DRM_DEV_ERROR(pl->dev, in imx8qxp_pixel_link_enable_mst_en()
47 "failed to enable DC%u stream%u pixel link mst_en: %d\n", in imx8qxp_pixel_link_enable_mst_en()
48 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_enable_mst_en()
55 ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, in imx8qxp_pixel_link_enable_mst_vld()
56 pl->mst_vld_ctrl, true); in imx8qxp_pixel_link_enable_mst_vld()
58 DRM_DEV_ERROR(pl->dev, in imx8qxp_pixel_link_enable_mst_vld()
59 "failed to enable DC%u stream%u pixel link mst_vld: %d\n", in imx8qxp_pixel_link_enable_mst_vld()
60 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_enable_mst_vld()
67 ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, in imx8qxp_pixel_link_enable_sync()
68 pl->sync_ctrl, true); in imx8qxp_pixel_link_enable_sync()
70 DRM_DEV_ERROR(pl->dev, in imx8qxp_pixel_link_enable_sync()
71 "failed to enable DC%u stream%u pixel link sync: %d\n", in imx8qxp_pixel_link_enable_sync()
72 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_enable_sync()
79 ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, in imx8qxp_pixel_link_disable_mst_en()
80 pl->mst_en_ctrl, false); in imx8qxp_pixel_link_disable_mst_en()
82 DRM_DEV_ERROR(pl->dev, in imx8qxp_pixel_link_disable_mst_en()
83 "failed to disable DC%u stream%u pixel link mst_en: %d\n", in imx8qxp_pixel_link_disable_mst_en()
84 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_disable_mst_en()
93 ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, in imx8qxp_pixel_link_disable_mst_vld()
94 pl->mst_vld_ctrl, false); in imx8qxp_pixel_link_disable_mst_vld()
96 DRM_DEV_ERROR(pl->dev, in imx8qxp_pixel_link_disable_mst_vld()
97 "failed to disable DC%u stream%u pixel link mst_vld: %d\n", in imx8qxp_pixel_link_disable_mst_vld()
98 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_disable_mst_vld()
107 ret = imx_sc_misc_set_control(pl->ipc_handle, pl->sink_rsc, in imx8qxp_pixel_link_disable_sync()
108 pl->sync_ctrl, false); in imx8qxp_pixel_link_disable_sync()
110 DRM_DEV_ERROR(pl->dev, in imx8qxp_pixel_link_disable_sync()
111 "failed to disable DC%u stream%u pixel link sync: %d\n", in imx8qxp_pixel_link_disable_sync()
112 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_disable_sync()
121 ret = imx_sc_misc_set_control(pl->ipc_handle, in imx8qxp_pixel_link_set_mst_addr()
122 pl->sink_rsc, pl->mst_addr_ctrl, in imx8qxp_pixel_link_set_mst_addr()
123 pl->mst_addr); in imx8qxp_pixel_link_set_mst_addr()
125 DRM_DEV_ERROR(pl->dev, in imx8qxp_pixel_link_set_mst_addr()
126 "failed to set DC%u stream%u pixel link mst addr(%u): %d\n", in imx8qxp_pixel_link_set_mst_addr()
127 pl->dc_id, pl->stream_id, pl->mst_addr, ret); in imx8qxp_pixel_link_set_mst_addr()
133 struct imx8qxp_pixel_link *pl = bridge->driver_private; in imx8qxp_pixel_link_bridge_attach()
136 DRM_DEV_ERROR(pl->dev, in imx8qxp_pixel_link_bridge_attach()
138 return -EINVAL; in imx8qxp_pixel_link_bridge_attach()
141 return drm_bridge_attach(bridge->encoder, in imx8qxp_pixel_link_bridge_attach()
142 pl->next_bridge, bridge, in imx8qxp_pixel_link_bridge_attach()
151 struct imx8qxp_pixel_link *pl = bridge->driver_private; in imx8qxp_pixel_link_bridge_mode_set()
160 struct imx8qxp_pixel_link *pl = bridge->driver_private; in imx8qxp_pixel_link_bridge_atomic_enable()
171 struct imx8qxp_pixel_link *pl = bridge->driver_private; in imx8qxp_pixel_link_bridge_atomic_disable()
263 struct device_node *np = pl->dev->of_node; in imx8qxp_pixel_link_find_next_bridge()
287 DRM_DEV_ERROR(pl->dev, "no available output port\n"); in imx8qxp_pixel_link_find_next_bridge()
288 return ERR_PTR(-ENODEV); in imx8qxp_pixel_link_find_next_bridge()
296 if (!of_device_is_available(remote->parent)) { in imx8qxp_pixel_link_find_next_bridge()
297 DRM_DEV_DEBUG(pl->dev, in imx8qxp_pixel_link_find_next_bridge()
307 return ERR_PTR(-EPROBE_DEFER); in imx8qxp_pixel_link_find_next_bridge()
311 if (of_property_present(remote, "fsl,companion-pxl2dpi")) in imx8qxp_pixel_link_find_next_bridge()
319 pl->mst_addr = port_id - 1; in imx8qxp_pixel_link_find_next_bridge()
327 struct device *dev = &pdev->dev; in imx8qxp_pixel_link_bridge_probe()
328 struct device_node *np = dev->of_node; in imx8qxp_pixel_link_bridge_probe()
333 return -ENOMEM; in imx8qxp_pixel_link_bridge_probe()
335 ret = imx_scu_get_handle(&pl->ipc_handle); in imx8qxp_pixel_link_bridge_probe()
337 if (ret != -EPROBE_DEFER) in imx8qxp_pixel_link_bridge_probe()
343 ret = of_property_read_u8(np, "fsl,dc-id", &pl->dc_id); in imx8qxp_pixel_link_bridge_probe()
345 DRM_DEV_ERROR(dev, "failed to get DC index: %d\n", ret); in imx8qxp_pixel_link_bridge_probe()
349 ret = of_property_read_u8(np, "fsl,dc-stream-id", &pl->stream_id); in imx8qxp_pixel_link_bridge_probe()
351 DRM_DEV_ERROR(dev, "failed to get DC stream index: %d\n", ret); in imx8qxp_pixel_link_bridge_probe()
355 pl->dev = dev; in imx8qxp_pixel_link_bridge_probe()
357 pl->sink_rsc = pl->dc_id ? IMX_SC_R_DC_1 : IMX_SC_R_DC_0; in imx8qxp_pixel_link_bridge_probe()
359 if (pl->stream_id == 0) { in imx8qxp_pixel_link_bridge_probe()
360 pl->mst_addr_ctrl = IMX_SC_C_PXL_LINK_MST1_ADDR; in imx8qxp_pixel_link_bridge_probe()
361 pl->mst_en_ctrl = IMX_SC_C_PXL_LINK_MST1_ENB; in imx8qxp_pixel_link_bridge_probe()
362 pl->mst_vld_ctrl = IMX_SC_C_PXL_LINK_MST1_VLD; in imx8qxp_pixel_link_bridge_probe()
363 pl->sync_ctrl = IMX_SC_C_SYNC_CTRL0; in imx8qxp_pixel_link_bridge_probe()
365 pl->mst_addr_ctrl = IMX_SC_C_PXL_LINK_MST2_ADDR; in imx8qxp_pixel_link_bridge_probe()
366 pl->mst_en_ctrl = IMX_SC_C_PXL_LINK_MST2_ENB; in imx8qxp_pixel_link_bridge_probe()
367 pl->mst_vld_ctrl = IMX_SC_C_PXL_LINK_MST2_VLD; in imx8qxp_pixel_link_bridge_probe()
368 pl->sync_ctrl = IMX_SC_C_SYNC_CTRL1; in imx8qxp_pixel_link_bridge_probe()
371 /* disable all controls to POR default */ in imx8qxp_pixel_link_bridge_probe()
376 pl->next_bridge = imx8qxp_pixel_link_find_next_bridge(pl); in imx8qxp_pixel_link_bridge_probe()
377 if (IS_ERR(pl->next_bridge)) { in imx8qxp_pixel_link_bridge_probe()
378 ret = PTR_ERR(pl->next_bridge); in imx8qxp_pixel_link_bridge_probe()
379 if (ret != -EPROBE_DEFER) in imx8qxp_pixel_link_bridge_probe()
387 pl->bridge.driver_private = pl; in imx8qxp_pixel_link_bridge_probe()
388 pl->bridge.funcs = &imx8qxp_pixel_link_bridge_funcs; in imx8qxp_pixel_link_bridge_probe()
389 pl->bridge.of_node = np; in imx8qxp_pixel_link_bridge_probe()
391 drm_bridge_add(&pl->bridge); in imx8qxp_pixel_link_bridge_probe()
400 drm_bridge_remove(&pl->bridge); in imx8qxp_pixel_link_bridge_remove()
404 { .compatible = "fsl,imx8qm-dc-pixel-link", },
405 { .compatible = "fsl,imx8qxp-dc-pixel-link", },