This source file includes following definitions.
- arcpgu_drm_hdmi_init
1
2
3
4
5
6
7
8 #include <drm/drm_crtc.h>
9 #include <drm/drm_encoder.h>
10 #include <drm/drm_device.h>
11
12 #include "arcpgu.h"
13
14 static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = {
15 .destroy = drm_encoder_cleanup,
16 };
17
18 int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np)
19 {
20 struct drm_encoder *encoder;
21 struct drm_bridge *bridge;
22
23 int ret = 0;
24
25 encoder = devm_kzalloc(drm->dev, sizeof(*encoder), GFP_KERNEL);
26 if (encoder == NULL)
27 return -ENOMEM;
28
29
30 bridge = of_drm_find_bridge(np);
31 if (!bridge)
32 return -EPROBE_DEFER;
33
34 encoder->possible_crtcs = 1;
35 encoder->possible_clones = 0;
36 ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs,
37 DRM_MODE_ENCODER_TMDS, NULL);
38 if (ret)
39 return ret;
40
41
42 ret = drm_bridge_attach(encoder, bridge, NULL);
43 if (ret)
44 drm_encoder_cleanup(encoder);
45
46 return ret;
47 }