Lines Matching refs:dev

40 static int kirin_drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,  in kirin_drm_crtc_init()  argument
50 port = of_get_child_by_name(dev->dev->of_node, "port"); in kirin_drm_crtc_init()
52 DRM_ERROR("no port node found in %pOF\n", dev->dev->of_node); in kirin_drm_crtc_init()
58 ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL, in kirin_drm_crtc_init()
70 static int kirin_drm_plane_init(struct drm_device *dev, struct drm_plane *plane, in kirin_drm_plane_init() argument
76 ret = drm_universal_plane_init(dev, plane, 1, data->plane_funcs, in kirin_drm_plane_init()
90 static void kirin_drm_private_cleanup(struct drm_device *dev) in kirin_drm_private_cleanup() argument
92 struct kirin_drm_private *kirin_priv = dev->dev_private; in kirin_drm_private_cleanup()
95 data = (struct kirin_drm_data *)of_device_get_match_data(dev->dev); in kirin_drm_private_cleanup()
99 devm_kfree(dev->dev, kirin_priv); in kirin_drm_private_cleanup()
100 dev->dev_private = NULL; in kirin_drm_private_cleanup()
103 static int kirin_drm_private_init(struct drm_device *dev, in kirin_drm_private_init() argument
106 struct platform_device *pdev = to_platform_device(dev->dev); in kirin_drm_private_init()
114 kirin_priv = devm_kzalloc(dev->dev, sizeof(*kirin_priv), GFP_KERNEL); in kirin_drm_private_init()
137 ret = kirin_drm_plane_init(dev, &kirin_priv->planes[ch].base, in kirin_drm_private_init()
147 ret = kirin_drm_crtc_init(dev, &kirin_priv->crtc.base, in kirin_drm_private_init()
152 dev->dev_private = kirin_priv; in kirin_drm_private_init()
157 static int kirin_drm_kms_init(struct drm_device *dev, in kirin_drm_kms_init() argument
163 drm_mode_config_init(dev); in kirin_drm_kms_init()
164 dev->mode_config.min_width = 0; in kirin_drm_kms_init()
165 dev->mode_config.min_height = 0; in kirin_drm_kms_init()
166 dev->mode_config.max_width = driver_data->config_max_width; in kirin_drm_kms_init()
167 dev->mode_config.max_height = driver_data->config_max_width; in kirin_drm_kms_init()
168 dev->mode_config.funcs = driver_data->mode_config_funcs; in kirin_drm_kms_init()
171 ret = kirin_drm_private_init(dev, driver_data); in kirin_drm_kms_init()
176 ret = component_bind_all(dev->dev, dev); in kirin_drm_kms_init()
183 ret = drm_vblank_init(dev, dev->mode_config.num_crtc); in kirin_drm_kms_init()
190 drm_mode_config_reset(dev); in kirin_drm_kms_init()
193 drm_kms_helper_poll_init(dev); in kirin_drm_kms_init()
198 component_unbind_all(dev->dev, dev); in kirin_drm_kms_init()
200 kirin_drm_private_cleanup(dev); in kirin_drm_kms_init()
202 drm_mode_config_cleanup(dev); in kirin_drm_kms_init()
206 static int kirin_drm_kms_cleanup(struct drm_device *dev) in kirin_drm_kms_cleanup() argument
208 drm_kms_helper_poll_fini(dev); in kirin_drm_kms_cleanup()
209 kirin_drm_private_cleanup(dev); in kirin_drm_kms_cleanup()
210 drm_mode_config_cleanup(dev); in kirin_drm_kms_cleanup()
215 static int kirin_drm_bind(struct device *dev) in kirin_drm_bind() argument
221 driver_data = (struct kirin_drm_data *)of_device_get_match_data(dev); in kirin_drm_bind()
225 drm_dev = drm_dev_alloc(driver_data->driver, dev); in kirin_drm_bind()
228 dev_set_drvdata(dev, drm_dev); in kirin_drm_bind()
251 static void kirin_drm_unbind(struct device *dev) in kirin_drm_unbind() argument
253 struct drm_device *drm_dev = dev_get_drvdata(dev); in kirin_drm_unbind()
267 struct device *dev = &pdev->dev; in kirin_drm_platform_probe() local
268 struct device_node *np = dev->of_node; in kirin_drm_platform_probe()
276 drm_of_component_match_add(dev, &match, component_compare_of, remote); in kirin_drm_platform_probe()
279 return component_master_add_with_match(dev, &kirin_drm_ops, match); in kirin_drm_platform_probe()
284 component_master_del(&pdev->dev, &kirin_drm_ops); in kirin_drm_platform_remove()