21 #include <linux/module.h>
25 #include <linux/videodev2.h>
29 #define con_to_imxpd(x) container_of(x, struct imx_parallel_display, connector)
30 #define enc_to_imxpd(x) container_of(x, struct imx_parallel_display, encoder)
77 static int imx_pd_connector_mode_valid(
struct drm_connector *connector,
83 static struct drm_encoder *imx_pd_connector_best_encoder(
132 .detect = imx_pd_connector_detect,
133 .destroy = imx_pd_connector_destroy,
137 .get_modes = imx_pd_connector_get_modes,
138 .best_encoder = imx_pd_connector_best_encoder,
139 .mode_valid = imx_pd_connector_mode_valid,
143 .destroy = imx_pd_encoder_destroy,
147 .dpms = imx_pd_encoder_dpms,
148 .mode_fixup = imx_pd_encoder_mode_fixup,
149 .prepare = imx_pd_encoder_prepare,
150 .commit = imx_pd_encoder_commit,
151 .mode_set = imx_pd_encoder_mode_set,
152 .disable = imx_pd_encoder_disable,
161 imxpd->
connector.funcs = &imx_pd_connector_funcs;
162 imxpd->
encoder.funcs = &imx_pd_encoder_funcs;
167 drm_encoder_helper_add(&imxpd->
encoder, &imx_pd_encoder_helper_funcs);
171 dev_err(imxpd->
dev,
"adding encoder failed with %d\n", ret);
175 drm_connector_helper_add(&imxpd->
connector,
176 &imx_pd_connector_helper_funcs);
182 dev_err(imxpd->
dev,
"adding connector failed with %d\n", ret);
209 if (!
strcmp(fmt,
"rgb24"))
211 else if (!
strcmp(fmt,
"rgb565"))
217 ret = imx_pd_register(imxpd);
223 platform_set_drvdata(pdev, imxpd);
243 { .compatible =
"fsl,imx-parallel-display", },
248 .probe = imx_pd_probe,
251 .of_match_table = imx_pd_dt_ids,
252 .
name =
"imx-parallel-display",