Lines Matching +full:hdmi +full:- +full:bridge

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
4 * derived from imx-hdmi.c(renamed to bridge/dw_hdmi.c now)
9 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
14 #include <video/imx-ipu-v3.h>
16 #include <drm/bridge/dw_hdmi.h>
25 #include "imx-drm.h"
31 struct imx_hdmi *hdmi; member
36 struct drm_bridge *bridge; member
37 struct dw_hdmi *hdmi; member
43 return container_of(e, struct imx_hdmi_encoder, encoder)->hdmi; in enc_to_imx_hdmi()
112 struct imx_hdmi *hdmi = enc_to_imx_hdmi(encoder); in dw_hdmi_imx_encoder_enable() local
113 int mux = drm_of_encoder_active_port_id(hdmi->dev->of_node, encoder); in dw_hdmi_imx_encoder_enable()
115 regmap_update_bits(hdmi->regmap, IOMUXC_GPR3, in dw_hdmi_imx_encoder_enable()
126 imx_crtc_state->bus_format = MEDIA_BUS_FMT_RGB888_1X24; in dw_hdmi_imx_atomic_check()
127 imx_crtc_state->di_hsync_pin = 2; in dw_hdmi_imx_atomic_check()
128 imx_crtc_state->di_vsync_pin = 3; in dw_hdmi_imx_atomic_check()
139 imx6q_hdmi_mode_valid(struct dw_hdmi *hdmi, void *data, in imx6q_hdmi_mode_valid() argument
143 if (mode->clock < 13500) in imx6q_hdmi_mode_valid()
146 if (mode->clock > 216000) in imx6q_hdmi_mode_valid()
153 imx6dl_hdmi_mode_valid(struct dw_hdmi *hdmi, void *data, in imx6dl_hdmi_mode_valid() argument
157 if (mode->clock < 13500) in imx6dl_hdmi_mode_valid()
160 if (mode->clock > 216000) in imx6dl_hdmi_mode_valid()
181 { .compatible = "fsl,imx6q-hdmi",
184 .compatible = "fsl,imx6dl-hdmi",
204 hdmi_encoder->hdmi = dev_get_drvdata(dev); in dw_hdmi_imx_bind()
205 encoder = &hdmi_encoder->encoder; in dw_hdmi_imx_bind()
207 ret = imx_drm_encoder_parse_of(drm, encoder, dev->of_node); in dw_hdmi_imx_bind()
213 return drm_bridge_attach(encoder, hdmi_encoder->hdmi->bridge, NULL, 0); in dw_hdmi_imx_bind()
222 struct device_node *np = pdev->dev.of_node; in dw_hdmi_imx_probe()
224 struct imx_hdmi *hdmi; in dw_hdmi_imx_probe() local
227 hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL); in dw_hdmi_imx_probe()
228 if (!hdmi) in dw_hdmi_imx_probe()
229 return -ENOMEM; in dw_hdmi_imx_probe()
231 platform_set_drvdata(pdev, hdmi); in dw_hdmi_imx_probe()
232 hdmi->dev = &pdev->dev; in dw_hdmi_imx_probe()
234 hdmi->regmap = syscon_regmap_lookup_by_phandle(np, "gpr"); in dw_hdmi_imx_probe()
235 if (IS_ERR(hdmi->regmap)) { in dw_hdmi_imx_probe()
236 dev_err(hdmi->dev, "Unable to get gpr\n"); in dw_hdmi_imx_probe()
237 return PTR_ERR(hdmi->regmap); in dw_hdmi_imx_probe()
240 hdmi->hdmi = dw_hdmi_probe(pdev, match->data); in dw_hdmi_imx_probe()
241 if (IS_ERR(hdmi->hdmi)) in dw_hdmi_imx_probe()
242 return PTR_ERR(hdmi->hdmi); in dw_hdmi_imx_probe()
244 hdmi->bridge = of_drm_find_bridge(np); in dw_hdmi_imx_probe()
245 if (!hdmi->bridge) { in dw_hdmi_imx_probe()
246 dev_err(hdmi->dev, "Unable to find bridge\n"); in dw_hdmi_imx_probe()
247 dw_hdmi_remove(hdmi->hdmi); in dw_hdmi_imx_probe()
248 return -ENODEV; in dw_hdmi_imx_probe()
251 ret = component_add(&pdev->dev, &dw_hdmi_imx_ops); in dw_hdmi_imx_probe()
253 dw_hdmi_remove(hdmi->hdmi); in dw_hdmi_imx_probe()
260 struct imx_hdmi *hdmi = platform_get_drvdata(pdev); in dw_hdmi_imx_remove() local
262 component_del(&pdev->dev, &dw_hdmi_imx_ops); in dw_hdmi_imx_remove()
263 dw_hdmi_remove(hdmi->hdmi); in dw_hdmi_imx_remove()
270 .name = "dwhdmi-imx",
277 MODULE_AUTHOR("Andy Yan <andy.yan@rock-chips.com>");
278 MODULE_AUTHOR("Yakir Yang <ykk@rock-chips.com>");
279 MODULE_DESCRIPTION("IMX6 Specific DW-HDMI Driver Extension");
281 MODULE_ALIAS("platform:dwhdmi-imx");