Lines Matching refs:p2d

53 	struct imx8qxp_pxl2dpi *p2d = bridge->driver_private;  in imx8qxp_pxl2dpi_bridge_attach()  local
56 DRM_DEV_ERROR(p2d->dev, in imx8qxp_pxl2dpi_bridge_attach()
62 p2d->next_bridge, bridge, in imx8qxp_pxl2dpi_bridge_attach()
72 struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; in imx8qxp_pxl2dpi_bridge_atomic_check() local
74 p2d->in_bus_format = bridge_state->input_bus_cfg.format; in imx8qxp_pxl2dpi_bridge_atomic_check()
75 p2d->out_bus_format = bridge_state->output_bus_cfg.format; in imx8qxp_pxl2dpi_bridge_atomic_check()
85 struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; in imx8qxp_pxl2dpi_bridge_mode_set() local
89 ret = pm_runtime_get_sync(p2d->dev); in imx8qxp_pxl2dpi_bridge_mode_set()
91 DRM_DEV_ERROR(p2d->dev, in imx8qxp_pxl2dpi_bridge_mode_set()
94 ret = imx_sc_misc_set_control(p2d->ipc_handle, p2d->sc_resource, in imx8qxp_pxl2dpi_bridge_mode_set()
95 IMX_SC_C_PXL_LINK_SEL, p2d->pl_sel); in imx8qxp_pxl2dpi_bridge_mode_set()
97 DRM_DEV_ERROR(p2d->dev, in imx8qxp_pxl2dpi_bridge_mode_set()
99 p2d->pl_sel, ret); in imx8qxp_pxl2dpi_bridge_mode_set()
101 switch (p2d->out_bus_format) { in imx8qxp_pxl2dpi_bridge_mode_set()
103 regmap_write(p2d->regmap, PXL2DPI_CTRL, CFG_24BIT); in imx8qxp_pxl2dpi_bridge_mode_set()
106 regmap_write(p2d->regmap, PXL2DPI_CTRL, CFG2_18BIT); in imx8qxp_pxl2dpi_bridge_mode_set()
109 DRM_DEV_ERROR(p2d->dev, in imx8qxp_pxl2dpi_bridge_mode_set()
111 p2d->out_bus_format); in imx8qxp_pxl2dpi_bridge_mode_set()
114 if (p2d->companion) { in imx8qxp_pxl2dpi_bridge_mode_set()
115 companion_p2d = bridge_to_p2d(p2d->companion); in imx8qxp_pxl2dpi_bridge_mode_set()
117 companion_p2d->in_bus_format = p2d->in_bus_format; in imx8qxp_pxl2dpi_bridge_mode_set()
118 companion_p2d->out_bus_format = p2d->out_bus_format; in imx8qxp_pxl2dpi_bridge_mode_set()
120 p2d->companion->funcs->mode_set(p2d->companion, mode, in imx8qxp_pxl2dpi_bridge_mode_set()
129 struct imx8qxp_pxl2dpi *p2d = bridge->driver_private; in imx8qxp_pxl2dpi_bridge_atomic_disable() local
132 ret = pm_runtime_put(p2d->dev); in imx8qxp_pxl2dpi_bridge_atomic_disable()
134 DRM_DEV_ERROR(p2d->dev, "failed to put runtime PM: %d\n", ret); in imx8qxp_pxl2dpi_bridge_atomic_disable()
136 if (p2d->companion) in imx8qxp_pxl2dpi_bridge_atomic_disable()
137 p2d->companion->funcs->atomic_disable(p2d->companion, in imx8qxp_pxl2dpi_bridge_atomic_disable()
220 imx8qxp_pxl2dpi_get_available_ep_from_port(struct imx8qxp_pxl2dpi *p2d, in imx8qxp_pxl2dpi_get_available_ep_from_port() argument
226 port = of_graph_get_port_by_id(p2d->dev->of_node, port_id); in imx8qxp_pxl2dpi_get_available_ep_from_port()
228 DRM_DEV_ERROR(p2d->dev, "failed to get port@%u\n", port_id); in imx8qxp_pxl2dpi_get_available_ep_from_port()
234 DRM_DEV_ERROR(p2d->dev, "no available endpoints of port@%u\n", in imx8qxp_pxl2dpi_get_available_ep_from_port()
239 DRM_DEV_ERROR(p2d->dev, in imx8qxp_pxl2dpi_get_available_ep_from_port()
248 DRM_DEV_ERROR(p2d->dev, in imx8qxp_pxl2dpi_get_available_ep_from_port()
260 imx8qxp_pxl2dpi_find_next_bridge(struct imx8qxp_pxl2dpi *p2d) in imx8qxp_pxl2dpi_find_next_bridge() argument
266 ep = imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 1); in imx8qxp_pxl2dpi_find_next_bridge()
274 DRM_DEV_ERROR(p2d->dev, "no available remote\n"); in imx8qxp_pxl2dpi_find_next_bridge()
278 DRM_DEV_ERROR(p2d->dev, "remote parent is not available\n"); in imx8qxp_pxl2dpi_find_next_bridge()
295 static int imx8qxp_pxl2dpi_set_pixel_link_sel(struct imx8qxp_pxl2dpi *p2d) in imx8qxp_pxl2dpi_set_pixel_link_sel() argument
301 ep = imx8qxp_pxl2dpi_get_available_ep_from_port(p2d, 0); in imx8qxp_pxl2dpi_set_pixel_link_sel()
307 DRM_DEV_ERROR(p2d->dev, in imx8qxp_pxl2dpi_set_pixel_link_sel()
312 p2d->pl_sel = endpoint.id; in imx8qxp_pxl2dpi_set_pixel_link_sel()
319 static int imx8qxp_pxl2dpi_parse_dt_companion(struct imx8qxp_pxl2dpi *p2d) in imx8qxp_pxl2dpi_parse_dt_companion() argument
322 struct device *dev = p2d->dev; in imx8qxp_pxl2dpi_parse_dt_companion()
351 p2d->companion = of_drm_find_bridge(companion); in imx8qxp_pxl2dpi_parse_dt_companion()
352 if (!p2d->companion) { in imx8qxp_pxl2dpi_parse_dt_companion()
354 DRM_DEV_DEBUG_DRIVER(p2d->dev, in imx8qxp_pxl2dpi_parse_dt_companion()
360 companion_p2d = bridge_to_p2d(p2d->companion); in imx8qxp_pxl2dpi_parse_dt_companion()
368 port1 = of_graph_get_port_by_id(p2d->next_bridge->of_node, 1); in imx8qxp_pxl2dpi_parse_dt_companion()
391 struct imx8qxp_pxl2dpi *p2d; in imx8qxp_pxl2dpi_bridge_probe() local
396 p2d = devm_kzalloc(dev, sizeof(*p2d), GFP_KERNEL); in imx8qxp_pxl2dpi_bridge_probe()
397 if (!p2d) in imx8qxp_pxl2dpi_bridge_probe()
400 p2d->regmap = syscon_node_to_regmap(np->parent); in imx8qxp_pxl2dpi_bridge_probe()
401 if (IS_ERR(p2d->regmap)) { in imx8qxp_pxl2dpi_bridge_probe()
402 ret = PTR_ERR(p2d->regmap); in imx8qxp_pxl2dpi_bridge_probe()
408 ret = imx_scu_get_handle(&p2d->ipc_handle); in imx8qxp_pxl2dpi_bridge_probe()
416 p2d->dev = dev; in imx8qxp_pxl2dpi_bridge_probe()
418 ret = of_property_read_u32(np, "fsl,sc-resource", &p2d->sc_resource); in imx8qxp_pxl2dpi_bridge_probe()
424 p2d->next_bridge = imx8qxp_pxl2dpi_find_next_bridge(p2d); in imx8qxp_pxl2dpi_bridge_probe()
425 if (IS_ERR(p2d->next_bridge)) { in imx8qxp_pxl2dpi_bridge_probe()
426 ret = PTR_ERR(p2d->next_bridge); in imx8qxp_pxl2dpi_bridge_probe()
433 ret = imx8qxp_pxl2dpi_set_pixel_link_sel(p2d); in imx8qxp_pxl2dpi_bridge_probe()
437 ret = imx8qxp_pxl2dpi_parse_dt_companion(p2d); in imx8qxp_pxl2dpi_bridge_probe()
441 platform_set_drvdata(pdev, p2d); in imx8qxp_pxl2dpi_bridge_probe()
444 p2d->bridge.driver_private = p2d; in imx8qxp_pxl2dpi_bridge_probe()
445 p2d->bridge.funcs = &imx8qxp_pxl2dpi_bridge_funcs; in imx8qxp_pxl2dpi_bridge_probe()
446 p2d->bridge.of_node = np; in imx8qxp_pxl2dpi_bridge_probe()
448 drm_bridge_add(&p2d->bridge); in imx8qxp_pxl2dpi_bridge_probe()
455 struct imx8qxp_pxl2dpi *p2d = platform_get_drvdata(pdev); in imx8qxp_pxl2dpi_bridge_remove() local
457 drm_bridge_remove(&p2d->bridge); in imx8qxp_pxl2dpi_bridge_remove()