2 * Freescale i.MX drm driver
4 * Copyright (C) 2011 Sascha Hauer, Pengutronix
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
17 #include <linux/device.h>
18 #include <linux/platform_device.h>
20 #include <drm/drm_fb_helper.h>
21 #include <drm/drm_crtc_helper.h>
23 #include <linux/module.h>
24 #include <drm/drm_gem_cma_helper.h>
25 #include <drm/drm_fb_cma_helper.h>
34 struct list_head list
;
37 struct imx_drm_device
{
38 struct drm_device
*drm
;
40 struct list_head crtc_list
;
41 struct list_head encoder_list
;
42 struct list_head connector_list
;
46 struct drm_fbdev_cma
*fbhelper
;
50 struct drm_crtc
*crtc
;
51 struct list_head list
;
52 struct imx_drm_device
*imxdrm
;
54 struct imx_drm_crtc_helper_funcs imx_drm_helper_funcs
;
56 struct crtc_cookie cookie
;
59 struct imx_drm_encoder
{
60 struct drm_encoder
*encoder
;
61 struct list_head list
;
63 struct list_head possible_crtcs
;
66 struct imx_drm_connector
{
67 struct drm_connector
*connector
;
68 struct list_head list
;
72 static int imx_drm_driver_firstopen(struct drm_device
*drm
)
74 if (!imx_drm_device_get())
80 static void imx_drm_driver_lastclose(struct drm_device
*drm
)
82 struct imx_drm_device
*imxdrm
= drm
->dev_private
;
85 drm_fbdev_cma_restore_mode(imxdrm
->fbhelper
);
90 static int imx_drm_driver_unload(struct drm_device
*drm
)
92 struct imx_drm_device
*imxdrm
= drm
->dev_private
;
94 drm_mode_config_cleanup(imxdrm
->drm
);
95 drm_kms_helper_poll_fini(imxdrm
->drm
);
101 * We don't care at all for crtc numbers, but the core expects the
102 * crtcs to be numbered
104 static struct imx_drm_crtc
*imx_drm_crtc_by_num(struct imx_drm_device
*imxdrm
,
107 struct imx_drm_crtc
*imx_drm_crtc
;
109 list_for_each_entry(imx_drm_crtc
, &imxdrm
->crtc_list
, list
)
110 if (imx_drm_crtc
->pipe
== num
)
115 int imx_drm_crtc_panel_format(struct drm_crtc
*crtc
, u32 encoder_type
,
116 u32 interface_pix_fmt
)
118 struct imx_drm_device
*imxdrm
= crtc
->dev
->dev_private
;
119 struct imx_drm_crtc
*imx_crtc
;
120 struct imx_drm_crtc_helper_funcs
*helper
;
122 mutex_lock(&imxdrm
->mutex
);
124 list_for_each_entry(imx_crtc
, &imxdrm
->crtc_list
, list
)
125 if (imx_crtc
->crtc
== crtc
)
128 mutex_unlock(&imxdrm
->mutex
);
132 mutex_unlock(&imxdrm
->mutex
);
134 helper
= &imx_crtc
->imx_drm_helper_funcs
;
135 if (helper
->set_interface_pix_fmt
)
136 return helper
->set_interface_pix_fmt(crtc
,
137 encoder_type
, interface_pix_fmt
);
140 EXPORT_SYMBOL_GPL(imx_drm_crtc_panel_format
);
142 int imx_drm_crtc_vblank_get(struct imx_drm_crtc
*imx_drm_crtc
)
144 return drm_vblank_get(imx_drm_crtc
->imxdrm
->drm
, imx_drm_crtc
->pipe
);
146 EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_get
);
148 void imx_drm_crtc_vblank_put(struct imx_drm_crtc
*imx_drm_crtc
)
150 drm_vblank_put(imx_drm_crtc
->imxdrm
->drm
, imx_drm_crtc
->pipe
);
152 EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_put
);
154 void imx_drm_handle_vblank(struct imx_drm_crtc
*imx_drm_crtc
)
156 drm_handle_vblank(imx_drm_crtc
->imxdrm
->drm
, imx_drm_crtc
->pipe
);
158 EXPORT_SYMBOL_GPL(imx_drm_handle_vblank
);
160 static int imx_drm_enable_vblank(struct drm_device
*drm
, int crtc
)
162 struct imx_drm_device
*imxdrm
= drm
->dev_private
;
163 struct imx_drm_crtc
*imx_drm_crtc
;
166 imx_drm_crtc
= imx_drm_crtc_by_num(imxdrm
, crtc
);
170 if (!imx_drm_crtc
->imx_drm_helper_funcs
.enable_vblank
)
173 ret
= imx_drm_crtc
->imx_drm_helper_funcs
.enable_vblank(
179 static void imx_drm_disable_vblank(struct drm_device
*drm
, int crtc
)
181 struct imx_drm_device
*imxdrm
= drm
->dev_private
;
182 struct imx_drm_crtc
*imx_drm_crtc
;
184 imx_drm_crtc
= imx_drm_crtc_by_num(imxdrm
, crtc
);
188 if (!imx_drm_crtc
->imx_drm_helper_funcs
.disable_vblank
)
191 imx_drm_crtc
->imx_drm_helper_funcs
.disable_vblank(imx_drm_crtc
->crtc
);
194 static const struct file_operations imx_drm_driver_fops
= {
195 .owner
= THIS_MODULE
,
197 .release
= drm_release
,
198 .unlocked_ioctl
= drm_ioctl
,
199 .mmap
= drm_gem_cma_mmap
,
201 .fasync
= drm_fasync
,
203 .llseek
= noop_llseek
,
206 static struct imx_drm_device
*imx_drm_device
;
208 static struct imx_drm_device
*__imx_drm_device(void)
210 return imx_drm_device
;
213 struct drm_device
*imx_drm_device_get(void)
215 struct imx_drm_device
*imxdrm
= __imx_drm_device();
216 struct imx_drm_encoder
*enc
;
217 struct imx_drm_connector
*con
;
218 struct imx_drm_crtc
*crtc
;
220 mutex_lock(&imxdrm
->mutex
);
222 list_for_each_entry(enc
, &imxdrm
->encoder_list
, list
) {
223 if (!try_module_get(enc
->owner
)) {
224 dev_err(imxdrm
->dev
, "could not get module %s\n",
225 module_name(enc
->owner
));
230 list_for_each_entry(con
, &imxdrm
->connector_list
, list
) {
231 if (!try_module_get(con
->owner
)) {
232 dev_err(imxdrm
->dev
, "could not get module %s\n",
233 module_name(con
->owner
));
238 list_for_each_entry(crtc
, &imxdrm
->crtc_list
, list
) {
239 if (!try_module_get(crtc
->owner
)) {
240 dev_err(imxdrm
->dev
, "could not get module %s\n",
241 module_name(crtc
->owner
));
246 imxdrm
->references
++;
248 mutex_unlock(&imxdrm
->mutex
);
253 list_for_each_entry_continue_reverse(crtc
, &imxdrm
->crtc_list
, list
)
254 module_put(crtc
->owner
);
256 list_for_each_entry_continue_reverse(con
, &imxdrm
->connector_list
, list
)
257 module_put(con
->owner
);
259 list_for_each_entry_continue_reverse(enc
, &imxdrm
->encoder_list
, list
)
260 module_put(enc
->owner
);
262 mutex_unlock(&imxdrm
->mutex
);
267 EXPORT_SYMBOL_GPL(imx_drm_device_get
);
269 void imx_drm_device_put(void)
271 struct imx_drm_device
*imxdrm
= __imx_drm_device();
272 struct imx_drm_encoder
*enc
;
273 struct imx_drm_connector
*con
;
274 struct imx_drm_crtc
*crtc
;
276 mutex_lock(&imxdrm
->mutex
);
278 list_for_each_entry(crtc
, &imxdrm
->crtc_list
, list
)
279 module_put(crtc
->owner
);
281 list_for_each_entry(con
, &imxdrm
->connector_list
, list
)
282 module_put(con
->owner
);
284 list_for_each_entry(enc
, &imxdrm
->encoder_list
, list
)
285 module_put(enc
->owner
);
287 imxdrm
->references
--;
289 mutex_unlock(&imxdrm
->mutex
);
291 EXPORT_SYMBOL_GPL(imx_drm_device_put
);
293 static int drm_mode_group_reinit(struct drm_device
*dev
)
295 struct drm_mode_group
*group
= &dev
->primary
->mode_group
;
296 uint32_t *id_list
= group
->id_list
;
299 ret
= drm_mode_group_init_legacy_group(dev
, group
);
308 * register an encoder to the drm core
310 static int imx_drm_encoder_register(struct imx_drm_encoder
*imx_drm_encoder
)
312 struct imx_drm_device
*imxdrm
= __imx_drm_device();
314 INIT_LIST_HEAD(&imx_drm_encoder
->possible_crtcs
);
316 drm_encoder_init(imxdrm
->drm
, imx_drm_encoder
->encoder
,
317 imx_drm_encoder
->encoder
->funcs
,
318 imx_drm_encoder
->encoder
->encoder_type
);
320 drm_mode_group_reinit(imxdrm
->drm
);
326 * unregister an encoder from the drm core
328 static void imx_drm_encoder_unregister(struct imx_drm_encoder
331 struct imx_drm_device
*imxdrm
= __imx_drm_device();
333 drm_encoder_cleanup(imx_drm_encoder
->encoder
);
335 drm_mode_group_reinit(imxdrm
->drm
);
339 * register a connector to the drm core
341 static int imx_drm_connector_register(
342 struct imx_drm_connector
*imx_drm_connector
)
344 struct imx_drm_device
*imxdrm
= __imx_drm_device();
346 drm_connector_init(imxdrm
->drm
, imx_drm_connector
->connector
,
347 imx_drm_connector
->connector
->funcs
,
348 imx_drm_connector
->connector
->connector_type
);
349 drm_mode_group_reinit(imxdrm
->drm
);
351 return drm_sysfs_connector_add(imx_drm_connector
->connector
);
355 * unregister a connector from the drm core
357 static void imx_drm_connector_unregister(
358 struct imx_drm_connector
*imx_drm_connector
)
360 struct imx_drm_device
*imxdrm
= __imx_drm_device();
362 drm_sysfs_connector_remove(imx_drm_connector
->connector
);
363 drm_connector_cleanup(imx_drm_connector
->connector
);
365 drm_mode_group_reinit(imxdrm
->drm
);
369 * register a crtc to the drm core
371 static int imx_drm_crtc_register(struct imx_drm_crtc
*imx_drm_crtc
)
373 struct imx_drm_device
*imxdrm
= __imx_drm_device();
376 drm_crtc_init(imxdrm
->drm
, imx_drm_crtc
->crtc
,
377 imx_drm_crtc
->imx_drm_helper_funcs
.crtc_funcs
);
378 ret
= drm_mode_crtc_set_gamma_size(imx_drm_crtc
->crtc
, 256);
382 drm_crtc_helper_add(imx_drm_crtc
->crtc
,
383 imx_drm_crtc
->imx_drm_helper_funcs
.crtc_helper_funcs
);
385 drm_mode_group_reinit(imxdrm
->drm
);
391 * Called by the CRTC driver when all CRTCs are registered. This
392 * puts all the pieces together and initializes the driver.
393 * Once this is called no more CRTCs can be registered since
394 * the drm core has hardcoded the number of crtcs in several
397 static int imx_drm_driver_load(struct drm_device
*drm
, unsigned long flags
)
399 struct imx_drm_device
*imxdrm
= __imx_drm_device();
404 drm
->dev_private
= imxdrm
;
407 * enable drm irq mode.
408 * - with irq_enabled = 1, we can use the vblank feature.
410 * P.S. note that we wouldn't use drm irq handler but
411 * just specific driver own one instead because
412 * drm framework supports only one irq handler and
413 * drivers can well take care of their interrupts
415 drm
->irq_enabled
= 1;
417 drm_mode_config_init(drm
);
418 imx_drm_mode_config_init(drm
);
420 mutex_lock(&imxdrm
->mutex
);
422 drm_kms_helper_poll_init(imxdrm
->drm
);
424 /* setup the grouping for the legacy output */
425 ret
= drm_mode_group_init_legacy_group(imxdrm
->drm
,
426 &imxdrm
->drm
->primary
->mode_group
);
430 ret
= drm_vblank_init(imxdrm
->drm
, MAX_CRTC
);
435 * with vblank_disable_allowed = 1, vblank interrupt will be disabled
436 * by drm timer once a current process gives up ownership of
437 * vblank event.(after drm_vblank_put function is called)
439 imxdrm
->drm
->vblank_disable_allowed
= 1;
444 mutex_unlock(&imxdrm
->mutex
);
449 static void imx_drm_update_possible_crtcs(void)
451 struct imx_drm_device
*imxdrm
= __imx_drm_device();
452 struct imx_drm_crtc
*imx_drm_crtc
;
453 struct imx_drm_encoder
*enc
;
454 struct crtc_cookie
*cookie
;
456 list_for_each_entry(enc
, &imxdrm
->encoder_list
, list
) {
457 u32 possible_crtcs
= 0;
459 list_for_each_entry(cookie
, &enc
->possible_crtcs
, list
) {
460 list_for_each_entry(imx_drm_crtc
, &imxdrm
->crtc_list
, list
) {
461 if (imx_drm_crtc
->cookie
.cookie
== cookie
->cookie
&&
462 imx_drm_crtc
->cookie
.id
== cookie
->id
) {
463 possible_crtcs
|= 1 << imx_drm_crtc
->pipe
;
467 enc
->encoder
->possible_crtcs
= possible_crtcs
;
468 enc
->encoder
->possible_clones
= possible_crtcs
;
473 * imx_drm_add_crtc - add a new crtc
475 * The return value if !NULL is a cookie for the caller to pass to
476 * imx_drm_remove_crtc later.
478 int imx_drm_add_crtc(struct drm_crtc
*crtc
,
479 struct imx_drm_crtc
**new_crtc
,
480 const struct imx_drm_crtc_helper_funcs
*imx_drm_helper_funcs
,
481 struct module
*owner
, void *cookie
, int id
)
483 struct imx_drm_device
*imxdrm
= __imx_drm_device();
484 struct imx_drm_crtc
*imx_drm_crtc
;
485 const struct drm_crtc_funcs
*crtc_funcs
;
488 mutex_lock(&imxdrm
->mutex
);
490 if (imxdrm
->references
) {
495 imx_drm_crtc
= kzalloc(sizeof(*imx_drm_crtc
), GFP_KERNEL
);
501 imx_drm_crtc
->imx_drm_helper_funcs
= *imx_drm_helper_funcs
;
502 imx_drm_crtc
->pipe
= imxdrm
->pipes
++;
503 imx_drm_crtc
->cookie
.cookie
= cookie
;
504 imx_drm_crtc
->cookie
.id
= id
;
506 crtc_funcs
= imx_drm_helper_funcs
->crtc_funcs
;
508 imx_drm_crtc
->crtc
= crtc
;
509 imx_drm_crtc
->imxdrm
= imxdrm
;
511 imx_drm_crtc
->owner
= owner
;
513 list_add_tail(&imx_drm_crtc
->list
, &imxdrm
->crtc_list
);
515 *new_crtc
= imx_drm_crtc
;
517 ret
= imx_drm_crtc_register(imx_drm_crtc
);
521 imx_drm_update_possible_crtcs();
523 mutex_unlock(&imxdrm
->mutex
);
531 mutex_unlock(&imxdrm
->mutex
);
534 EXPORT_SYMBOL_GPL(imx_drm_add_crtc
);
537 * imx_drm_remove_crtc - remove a crtc
539 int imx_drm_remove_crtc(struct imx_drm_crtc
*imx_drm_crtc
)
541 struct imx_drm_device
*imxdrm
= imx_drm_crtc
->imxdrm
;
543 mutex_lock(&imxdrm
->mutex
);
545 drm_crtc_cleanup(imx_drm_crtc
->crtc
);
547 list_del(&imx_drm_crtc
->list
);
549 drm_mode_group_reinit(imxdrm
->drm
);
551 mutex_unlock(&imxdrm
->mutex
);
557 EXPORT_SYMBOL_GPL(imx_drm_remove_crtc
);
560 * imx_drm_add_encoder - add a new encoder
562 int imx_drm_add_encoder(struct drm_encoder
*encoder
,
563 struct imx_drm_encoder
**newenc
, struct module
*owner
)
565 struct imx_drm_device
*imxdrm
= __imx_drm_device();
566 struct imx_drm_encoder
*imx_drm_encoder
;
569 mutex_lock(&imxdrm
->mutex
);
571 if (imxdrm
->references
) {
576 imx_drm_encoder
= kzalloc(sizeof(*imx_drm_encoder
), GFP_KERNEL
);
577 if (!imx_drm_encoder
) {
582 imx_drm_encoder
->encoder
= encoder
;
583 imx_drm_encoder
->owner
= owner
;
585 ret
= imx_drm_encoder_register(imx_drm_encoder
);
587 kfree(imx_drm_encoder
);
592 list_add_tail(&imx_drm_encoder
->list
, &imxdrm
->encoder_list
);
594 *newenc
= imx_drm_encoder
;
596 mutex_unlock(&imxdrm
->mutex
);
601 kfree(imx_drm_encoder
);
604 mutex_unlock(&imxdrm
->mutex
);
608 EXPORT_SYMBOL_GPL(imx_drm_add_encoder
);
610 int imx_drm_encoder_add_possible_crtcs(
611 struct imx_drm_encoder
*imx_drm_encoder
,
612 struct device_node
*np
)
614 struct imx_drm_device
*imxdrm
= __imx_drm_device();
615 struct of_phandle_args args
;
616 struct crtc_cookie
*c
;
620 if (!list_empty(&imx_drm_encoder
->possible_crtcs
))
623 for (i
= 0; !ret
; i
++) {
624 ret
= of_parse_phandle_with_args(np
, "crtcs",
625 "#crtc-cells", i
, &args
);
629 c
= kzalloc(sizeof(*c
), GFP_KERNEL
);
631 of_node_put(args
.np
);
636 c
->id
= args
.args_count
> 0 ? args
.args
[0] : 0;
638 of_node_put(args
.np
);
640 mutex_lock(&imxdrm
->mutex
);
642 list_add_tail(&c
->list
, &imx_drm_encoder
->possible_crtcs
);
644 mutex_unlock(&imxdrm
->mutex
);
647 imx_drm_update_possible_crtcs();
651 EXPORT_SYMBOL_GPL(imx_drm_encoder_add_possible_crtcs
);
653 int imx_drm_encoder_get_mux_id(struct imx_drm_encoder
*imx_drm_encoder
,
654 struct drm_crtc
*crtc
)
656 struct imx_drm_device
*imxdrm
= __imx_drm_device();
657 struct imx_drm_crtc
*imx_crtc
;
660 mutex_lock(&imxdrm
->mutex
);
662 list_for_each_entry(imx_crtc
, &imxdrm
->crtc_list
, list
) {
663 if (imx_crtc
->crtc
== crtc
)
668 mutex_unlock(&imxdrm
->mutex
);
672 mutex_unlock(&imxdrm
->mutex
);
678 * imx_drm_remove_encoder - remove an encoder
680 int imx_drm_remove_encoder(struct imx_drm_encoder
*imx_drm_encoder
)
682 struct imx_drm_device
*imxdrm
= __imx_drm_device();
683 struct crtc_cookie
*c
, *tmp
;
685 mutex_lock(&imxdrm
->mutex
);
687 imx_drm_encoder_unregister(imx_drm_encoder
);
689 list_del(&imx_drm_encoder
->list
);
691 list_for_each_entry_safe(c
, tmp
, &imx_drm_encoder
->possible_crtcs
,
695 mutex_unlock(&imxdrm
->mutex
);
697 kfree(imx_drm_encoder
);
701 EXPORT_SYMBOL_GPL(imx_drm_remove_encoder
);
704 * imx_drm_add_connector - add a connector
706 int imx_drm_add_connector(struct drm_connector
*connector
,
707 struct imx_drm_connector
**new_con
,
708 struct module
*owner
)
710 struct imx_drm_device
*imxdrm
= __imx_drm_device();
711 struct imx_drm_connector
*imx_drm_connector
;
714 mutex_lock(&imxdrm
->mutex
);
716 if (imxdrm
->references
) {
721 imx_drm_connector
= kzalloc(sizeof(*imx_drm_connector
), GFP_KERNEL
);
722 if (!imx_drm_connector
) {
727 imx_drm_connector
->connector
= connector
;
728 imx_drm_connector
->owner
= owner
;
730 ret
= imx_drm_connector_register(imx_drm_connector
);
734 list_add_tail(&imx_drm_connector
->list
, &imxdrm
->connector_list
);
736 *new_con
= imx_drm_connector
;
738 mutex_unlock(&imxdrm
->mutex
);
743 kfree(imx_drm_connector
);
746 mutex_unlock(&imxdrm
->mutex
);
750 EXPORT_SYMBOL_GPL(imx_drm_add_connector
);
752 void imx_drm_fb_helper_set(struct drm_fbdev_cma
*fbdev_helper
)
754 struct imx_drm_device
*imxdrm
= __imx_drm_device();
756 imxdrm
->fbhelper
= fbdev_helper
;
758 EXPORT_SYMBOL_GPL(imx_drm_fb_helper_set
);
761 * imx_drm_remove_connector - remove a connector
763 int imx_drm_remove_connector(struct imx_drm_connector
*imx_drm_connector
)
765 struct imx_drm_device
*imxdrm
= __imx_drm_device();
767 mutex_lock(&imxdrm
->mutex
);
769 imx_drm_connector_unregister(imx_drm_connector
);
771 list_del(&imx_drm_connector
->list
);
773 mutex_unlock(&imxdrm
->mutex
);
775 kfree(imx_drm_connector
);
779 EXPORT_SYMBOL_GPL(imx_drm_remove_connector
);
781 static struct drm_ioctl_desc imx_drm_ioctls
[] = {
785 static struct drm_driver imx_drm_driver
= {
786 .driver_features
= DRIVER_MODESET
| DRIVER_GEM
,
787 .load
= imx_drm_driver_load
,
788 .unload
= imx_drm_driver_unload
,
789 .firstopen
= imx_drm_driver_firstopen
,
790 .lastclose
= imx_drm_driver_lastclose
,
791 .gem_free_object
= drm_gem_cma_free_object
,
792 .gem_vm_ops
= &drm_gem_cma_vm_ops
,
793 .dumb_create
= drm_gem_cma_dumb_create
,
794 .dumb_map_offset
= drm_gem_cma_dumb_map_offset
,
795 .dumb_destroy
= drm_gem_cma_dumb_destroy
,
797 .get_vblank_counter
= drm_vblank_count
,
798 .enable_vblank
= imx_drm_enable_vblank
,
799 .disable_vblank
= imx_drm_disable_vblank
,
800 .ioctls
= imx_drm_ioctls
,
801 .num_ioctls
= ARRAY_SIZE(imx_drm_ioctls
),
802 .fops
= &imx_drm_driver_fops
,
804 .desc
= "i.MX DRM graphics",
811 static int imx_drm_platform_probe(struct platform_device
*pdev
)
813 imx_drm_device
->dev
= &pdev
->dev
;
815 return drm_platform_init(&imx_drm_driver
, pdev
);
818 static int imx_drm_platform_remove(struct platform_device
*pdev
)
820 drm_platform_exit(&imx_drm_driver
, pdev
);
825 static struct platform_driver imx_drm_pdrv
= {
826 .probe
= imx_drm_platform_probe
,
827 .remove
= imx_drm_platform_remove
,
829 .owner
= THIS_MODULE
,
834 static struct platform_device
*imx_drm_pdev
;
836 static int __init
imx_drm_init(void)
840 imx_drm_device
= kzalloc(sizeof(*imx_drm_device
), GFP_KERNEL
);
844 mutex_init(&imx_drm_device
->mutex
);
845 INIT_LIST_HEAD(&imx_drm_device
->crtc_list
);
846 INIT_LIST_HEAD(&imx_drm_device
->connector_list
);
847 INIT_LIST_HEAD(&imx_drm_device
->encoder_list
);
849 imx_drm_pdev
= platform_device_register_simple("imx-drm", -1, NULL
, 0);
855 imx_drm_pdev
->dev
.coherent_dma_mask
= DMA_BIT_MASK(32),
857 ret
= platform_driver_register(&imx_drm_pdrv
);
864 platform_device_unregister(imx_drm_pdev
);
866 kfree(imx_drm_device
);
871 static void __exit
imx_drm_exit(void)
873 platform_device_unregister(imx_drm_pdev
);
874 platform_driver_unregister(&imx_drm_pdrv
);
876 kfree(imx_drm_device
);
879 module_init(imx_drm_init
);
880 module_exit(imx_drm_exit
);
882 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
883 MODULE_DESCRIPTION("i.MX drm driver core");
884 MODULE_LICENSE("GPL");