Lines Matching refs:pl
39 static void imx8qxp_pixel_link_enable_mst_en(struct imx8qxp_pixel_link *pl) in imx8qxp_pixel_link_enable_mst_en() argument
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()
48 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_enable_mst_en()
51 static void imx8qxp_pixel_link_enable_mst_vld(struct imx8qxp_pixel_link *pl) in imx8qxp_pixel_link_enable_mst_vld() argument
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()
60 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_enable_mst_vld()
63 static void imx8qxp_pixel_link_enable_sync(struct imx8qxp_pixel_link *pl) in imx8qxp_pixel_link_enable_sync() argument
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()
72 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_enable_sync()
75 static int imx8qxp_pixel_link_disable_mst_en(struct imx8qxp_pixel_link *pl) in imx8qxp_pixel_link_disable_mst_en() argument
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()
84 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_disable_mst_en()
89 static int imx8qxp_pixel_link_disable_mst_vld(struct imx8qxp_pixel_link *pl) in imx8qxp_pixel_link_disable_mst_vld() argument
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()
98 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_disable_mst_vld()
103 static int imx8qxp_pixel_link_disable_sync(struct imx8qxp_pixel_link *pl) in imx8qxp_pixel_link_disable_sync() argument
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()
112 pl->dc_id, pl->stream_id, ret); in imx8qxp_pixel_link_disable_sync()
117 static void imx8qxp_pixel_link_set_mst_addr(struct imx8qxp_pixel_link *pl) in imx8qxp_pixel_link_set_mst_addr() argument
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()
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() local
136 DRM_DEV_ERROR(pl->dev, in imx8qxp_pixel_link_bridge_attach()
142 DRM_DEV_ERROR(pl->dev, "missing encoder\n"); in imx8qxp_pixel_link_bridge_attach()
147 pl->next_bridge, bridge, in imx8qxp_pixel_link_bridge_attach()
156 struct imx8qxp_pixel_link *pl = bridge->driver_private; in imx8qxp_pixel_link_bridge_mode_set() local
158 imx8qxp_pixel_link_set_mst_addr(pl); in imx8qxp_pixel_link_bridge_mode_set()
165 struct imx8qxp_pixel_link *pl = bridge->driver_private; in imx8qxp_pixel_link_bridge_atomic_enable() local
167 imx8qxp_pixel_link_enable_mst_en(pl); in imx8qxp_pixel_link_bridge_atomic_enable()
168 imx8qxp_pixel_link_enable_mst_vld(pl); in imx8qxp_pixel_link_bridge_atomic_enable()
169 imx8qxp_pixel_link_enable_sync(pl); in imx8qxp_pixel_link_bridge_atomic_enable()
176 struct imx8qxp_pixel_link *pl = bridge->driver_private; in imx8qxp_pixel_link_bridge_atomic_disable() local
178 imx8qxp_pixel_link_disable_mst_en(pl); in imx8qxp_pixel_link_bridge_atomic_disable()
179 imx8qxp_pixel_link_disable_mst_vld(pl); in imx8qxp_pixel_link_bridge_atomic_disable()
180 imx8qxp_pixel_link_disable_sync(pl); in imx8qxp_pixel_link_bridge_atomic_disable()
250 static int imx8qxp_pixel_link_disable_all_controls(struct imx8qxp_pixel_link *pl) in imx8qxp_pixel_link_disable_all_controls() argument
254 ret = imx8qxp_pixel_link_disable_mst_en(pl); in imx8qxp_pixel_link_disable_all_controls()
258 ret = imx8qxp_pixel_link_disable_mst_vld(pl); in imx8qxp_pixel_link_disable_all_controls()
262 return imx8qxp_pixel_link_disable_sync(pl); in imx8qxp_pixel_link_disable_all_controls()
266 imx8qxp_pixel_link_find_next_bridge(struct imx8qxp_pixel_link *pl) in imx8qxp_pixel_link_find_next_bridge() argument
268 struct device_node *np = pl->dev->of_node; in imx8qxp_pixel_link_find_next_bridge()
292 DRM_DEV_ERROR(pl->dev, "no available output port\n"); in imx8qxp_pixel_link_find_next_bridge()
302 DRM_DEV_DEBUG(pl->dev, in imx8qxp_pixel_link_find_next_bridge()
324 pl->mst_addr = port_id - 1; in imx8qxp_pixel_link_find_next_bridge()
331 struct imx8qxp_pixel_link *pl; in imx8qxp_pixel_link_bridge_probe() local
336 pl = devm_kzalloc(dev, sizeof(*pl), GFP_KERNEL); in imx8qxp_pixel_link_bridge_probe()
337 if (!pl) in imx8qxp_pixel_link_bridge_probe()
340 ret = imx_scu_get_handle(&pl->ipc_handle); in imx8qxp_pixel_link_bridge_probe()
348 ret = of_property_read_u8(np, "fsl,dc-id", &pl->dc_id); in imx8qxp_pixel_link_bridge_probe()
354 ret = of_property_read_u8(np, "fsl,dc-stream-id", &pl->stream_id); in imx8qxp_pixel_link_bridge_probe()
360 pl->dev = dev; in imx8qxp_pixel_link_bridge_probe()
362 pl->sink_rsc = pl->dc_id ? IMX_SC_R_DC_1 : IMX_SC_R_DC_0; in imx8qxp_pixel_link_bridge_probe()
364 if (pl->stream_id == 0) { in imx8qxp_pixel_link_bridge_probe()
365 pl->mst_addr_ctrl = IMX_SC_C_PXL_LINK_MST1_ADDR; in imx8qxp_pixel_link_bridge_probe()
366 pl->mst_en_ctrl = IMX_SC_C_PXL_LINK_MST1_ENB; in imx8qxp_pixel_link_bridge_probe()
367 pl->mst_vld_ctrl = IMX_SC_C_PXL_LINK_MST1_VLD; in imx8qxp_pixel_link_bridge_probe()
368 pl->sync_ctrl = IMX_SC_C_SYNC_CTRL0; in imx8qxp_pixel_link_bridge_probe()
370 pl->mst_addr_ctrl = IMX_SC_C_PXL_LINK_MST2_ADDR; in imx8qxp_pixel_link_bridge_probe()
371 pl->mst_en_ctrl = IMX_SC_C_PXL_LINK_MST2_ENB; in imx8qxp_pixel_link_bridge_probe()
372 pl->mst_vld_ctrl = IMX_SC_C_PXL_LINK_MST2_VLD; in imx8qxp_pixel_link_bridge_probe()
373 pl->sync_ctrl = IMX_SC_C_SYNC_CTRL1; in imx8qxp_pixel_link_bridge_probe()
377 ret = imx8qxp_pixel_link_disable_all_controls(pl); in imx8qxp_pixel_link_bridge_probe()
381 pl->next_bridge = imx8qxp_pixel_link_find_next_bridge(pl); in imx8qxp_pixel_link_bridge_probe()
382 if (IS_ERR(pl->next_bridge)) { in imx8qxp_pixel_link_bridge_probe()
383 ret = PTR_ERR(pl->next_bridge); in imx8qxp_pixel_link_bridge_probe()
390 platform_set_drvdata(pdev, pl); in imx8qxp_pixel_link_bridge_probe()
392 pl->bridge.driver_private = pl; in imx8qxp_pixel_link_bridge_probe()
393 pl->bridge.funcs = &imx8qxp_pixel_link_bridge_funcs; in imx8qxp_pixel_link_bridge_probe()
394 pl->bridge.of_node = np; in imx8qxp_pixel_link_bridge_probe()
396 drm_bridge_add(&pl->bridge); in imx8qxp_pixel_link_bridge_probe()
403 struct imx8qxp_pixel_link *pl = platform_get_drvdata(pdev); in imx8qxp_pixel_link_bridge_remove() local
405 drm_bridge_remove(&pl->bridge); in imx8qxp_pixel_link_bridge_remove()