drm/bochs: Store correct CRTC index in events
[linux-block.git] / drivers / gpu / drm / imx / imx-drm-core.c
CommitLineData
e692da4d
SH
1/*
2 * Freescale i.MX drm driver
3 *
4 * Copyright (C) 2011 Sascha Hauer, Pengutronix
5 *
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.
14 *
15 */
17b5001b 16#include <linux/component.h>
e692da4d 17#include <linux/device.h>
e7d6231e
RK
18#include <linux/fb.h>
19#include <linux/module.h>
655b43cc 20#include <linux/of_graph.h>
e692da4d
SH
21#include <linux/platform_device.h>
22#include <drm/drmP.h>
23#include <drm/drm_fb_helper.h>
24#include <drm/drm_crtc_helper.h>
e692da4d
SH
25#include <drm/drm_gem_cma_helper.h>
26#include <drm/drm_fb_cma_helper.h>
3cb9ae4f 27#include <drm/drm_plane_helper.h>
6457b971 28#include <drm/drm_of.h>
e692da4d
SH
29
30#include "imx-drm.h"
31
32#define MAX_CRTC 4
33
655b43cc
PZ
34struct imx_drm_component {
35 struct device_node *of_node;
36 struct list_head list;
37};
38
e692da4d
SH
39struct imx_drm_device {
40 struct drm_device *drm;
887eceac 41 struct imx_drm_crtc *crtc[MAX_CRTC];
e692da4d
SH
42 int pipes;
43 struct drm_fbdev_cma *fbhelper;
44};
45
46struct imx_drm_crtc {
47 struct drm_crtc *crtc;
e692da4d
SH
48 int pipe;
49 struct imx_drm_crtc_helper_funcs imx_drm_helper_funcs;
e692da4d
SH
50};
51
c1ff5a7a 52#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
8acba02f
RK
53static int legacyfb_depth = 16;
54module_param(legacyfb_depth, int, 0444);
c1ff5a7a 55#endif
8acba02f 56
b8d181e4
PZ
57int imx_drm_crtc_id(struct imx_drm_crtc *crtc)
58{
59 return crtc->pipe;
60}
9c74360f 61EXPORT_SYMBOL_GPL(imx_drm_crtc_id);
b8d181e4 62
e692da4d
SH
63static void imx_drm_driver_lastclose(struct drm_device *drm)
64{
65 struct imx_drm_device *imxdrm = drm->dev_private;
66
3f3a7280 67 drm_fbdev_cma_restore_mode(imxdrm->fbhelper);
e692da4d
SH
68}
69
70static int imx_drm_driver_unload(struct drm_device *drm)
71{
72 struct imx_drm_device *imxdrm = drm->dev_private;
3e68439b
RK
73
74 drm_kms_helper_poll_fini(drm);
e692da4d 75
8acba02f
RK
76 if (imxdrm->fbhelper)
77 drm_fbdev_cma_fini(imxdrm->fbhelper);
8acba02f 78
17b5001b
RK
79 component_unbind_all(drm->dev, drm);
80
020a9ea7 81 drm_vblank_cleanup(drm);
020a9ea7 82 drm_mode_config_cleanup(drm);
e692da4d 83
bfe945c8
SG
84 platform_set_drvdata(drm->platformdev, NULL);
85
e692da4d
SH
86 return 0;
87}
88
fdffa6f2 89static struct imx_drm_crtc *imx_drm_find_crtc(struct drm_crtc *crtc)
e692da4d 90{
32266b45 91 struct imx_drm_device *imxdrm = crtc->dev->dev_private;
887eceac
RK
92 unsigned i;
93
94 for (i = 0; i < MAX_CRTC; i++)
95 if (imxdrm->crtc[i] && imxdrm->crtc[i]->crtc == crtc)
96 return imxdrm->crtc[i];
e692da4d 97
e692da4d
SH
98 return NULL;
99}
100
2872c807
PZ
101int imx_drm_set_bus_format_pins(struct drm_encoder *encoder, u32 bus_format,
102 int hsync_pin, int vsync_pin)
e692da4d 103{
e692da4d 104 struct imx_drm_crtc_helper_funcs *helper;
887eceac 105 struct imx_drm_crtc *imx_crtc;
e692da4d 106
f2d66aad 107 imx_crtc = imx_drm_find_crtc(encoder->crtc);
887eceac
RK
108 if (!imx_crtc)
109 return -EINVAL;
e692da4d 110
e692da4d
SH
111 helper = &imx_crtc->imx_drm_helper_funcs;
112 if (helper->set_interface_pix_fmt)
f2d66aad 113 return helper->set_interface_pix_fmt(encoder->crtc,
2872c807 114 bus_format, hsync_pin, vsync_pin);
e692da4d
SH
115 return 0;
116}
2872c807 117EXPORT_SYMBOL_GPL(imx_drm_set_bus_format_pins);
2ea42608 118
2872c807 119int imx_drm_set_bus_format(struct drm_encoder *encoder, u32 bus_format)
2ea42608 120{
2872c807 121 return imx_drm_set_bus_format_pins(encoder, bus_format, 2, 3);
2ea42608 122}
2872c807 123EXPORT_SYMBOL_GPL(imx_drm_set_bus_format);
e692da4d
SH
124
125int imx_drm_crtc_vblank_get(struct imx_drm_crtc *imx_drm_crtc)
126{
b5ea1492 127 return drm_vblank_get(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe);
e692da4d
SH
128}
129EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_get);
130
131void imx_drm_crtc_vblank_put(struct imx_drm_crtc *imx_drm_crtc)
132{
b5ea1492 133 drm_vblank_put(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe);
e692da4d
SH
134}
135EXPORT_SYMBOL_GPL(imx_drm_crtc_vblank_put);
136
137void imx_drm_handle_vblank(struct imx_drm_crtc *imx_drm_crtc)
138{
b5ea1492 139 drm_handle_vblank(imx_drm_crtc->crtc->dev, imx_drm_crtc->pipe);
e692da4d
SH
140}
141EXPORT_SYMBOL_GPL(imx_drm_handle_vblank);
142
88e72717 143static int imx_drm_enable_vblank(struct drm_device *drm, unsigned int pipe)
e692da4d
SH
144{
145 struct imx_drm_device *imxdrm = drm->dev_private;
88e72717 146 struct imx_drm_crtc *imx_drm_crtc = imxdrm->crtc[pipe];
e692da4d
SH
147 int ret;
148
e692da4d
SH
149 if (!imx_drm_crtc)
150 return -EINVAL;
151
152 if (!imx_drm_crtc->imx_drm_helper_funcs.enable_vblank)
153 return -ENOSYS;
154
155 ret = imx_drm_crtc->imx_drm_helper_funcs.enable_vblank(
156 imx_drm_crtc->crtc);
157
158 return ret;
159}
160
88e72717 161static void imx_drm_disable_vblank(struct drm_device *drm, unsigned int pipe)
e692da4d
SH
162{
163 struct imx_drm_device *imxdrm = drm->dev_private;
88e72717 164 struct imx_drm_crtc *imx_drm_crtc = imxdrm->crtc[pipe];
e692da4d 165
e692da4d
SH
166 if (!imx_drm_crtc)
167 return;
168
169 if (!imx_drm_crtc->imx_drm_helper_funcs.disable_vblank)
170 return;
171
172 imx_drm_crtc->imx_drm_helper_funcs.disable_vblank(imx_drm_crtc->crtc);
173}
174
6ee4d7fe
SH
175static void imx_drm_driver_preclose(struct drm_device *drm,
176 struct drm_file *file)
177{
178 int i;
179
180 if (!file->is_master)
181 return;
182
942325c8
RK
183 for (i = 0; i < MAX_CRTC; i++)
184 imx_drm_disable_vblank(drm, i);
6ee4d7fe
SH
185}
186
e692da4d
SH
187static const struct file_operations imx_drm_driver_fops = {
188 .owner = THIS_MODULE,
189 .open = drm_open,
190 .release = drm_release,
191 .unlocked_ioctl = drm_ioctl,
192 .mmap = drm_gem_cma_mmap,
193 .poll = drm_poll,
e692da4d
SH
194 .read = drm_read,
195 .llseek = noop_llseek,
196};
197
8a51a33b
RK
198void imx_drm_connector_destroy(struct drm_connector *connector)
199{
34ea3d38 200 drm_connector_unregister(connector);
8a51a33b
RK
201 drm_connector_cleanup(connector);
202}
203EXPORT_SYMBOL_GPL(imx_drm_connector_destroy);
204
205void imx_drm_encoder_destroy(struct drm_encoder *encoder)
206{
207 drm_encoder_cleanup(encoder);
208}
209EXPORT_SYMBOL_GPL(imx_drm_encoder_destroy);
210
3e68439b
RK
211static void imx_drm_output_poll_changed(struct drm_device *drm)
212{
3e68439b
RK
213 struct imx_drm_device *imxdrm = drm->dev_private;
214
215 drm_fbdev_cma_hotplug_event(imxdrm->fbhelper);
3e68439b
RK
216}
217
1df8b530
RK
218static struct drm_mode_config_funcs imx_drm_mode_config_funcs = {
219 .fb_create = drm_fb_cma_create,
3e68439b 220 .output_poll_changed = imx_drm_output_poll_changed,
1df8b530
RK
221};
222
e692da4d 223/*
17b5001b
RK
224 * Main DRM initialisation. This binds, initialises and registers
225 * with DRM the subcomponents of the driver.
e692da4d
SH
226 */
227static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags)
228{
b85f2b5d 229 struct imx_drm_device *imxdrm;
e355e7dd 230 struct drm_connector *connector;
e692da4d
SH
231 int ret;
232
b85f2b5d
RK
233 imxdrm = devm_kzalloc(drm->dev, sizeof(*imxdrm), GFP_KERNEL);
234 if (!imxdrm)
235 return -ENOMEM;
236
e692da4d
SH
237 imxdrm->drm = drm;
238
239 drm->dev_private = imxdrm;
240
241 /*
242 * enable drm irq mode.
4423843c 243 * - with irq_enabled = true, we can use the vblank feature.
e692da4d
SH
244 *
245 * P.S. note that we wouldn't use drm irq handler but
246 * just specific driver own one instead because
247 * drm framework supports only one irq handler and
248 * drivers can well take care of their interrupts
249 */
4423843c 250 drm->irq_enabled = true;
e692da4d 251
1df8b530
RK
252 /*
253 * set max width and height as default value(4096x4096).
254 * this value would be used to check framebuffer size limitation
255 * at drm_mode_addfb().
256 */
257 drm->mode_config.min_width = 64;
258 drm->mode_config.min_height = 64;
259 drm->mode_config.max_width = 4096;
260 drm->mode_config.max_height = 4096;
261 drm->mode_config.funcs = &imx_drm_mode_config_funcs;
262
e692da4d 263 drm_mode_config_init(drm);
e692da4d 264
020a9ea7 265 ret = drm_vblank_init(drm, MAX_CRTC);
e692da4d 266 if (ret)
8007875f 267 goto err_kms;
e692da4d
SH
268
269 /*
e7d6231e
RK
270 * with vblank_disable_allowed = true, vblank interrupt will be
271 * disabled by drm timer once a current process gives up ownership
272 * of vblank event. (after drm_vblank_put function is called)
e692da4d 273 */
020a9ea7 274 drm->vblank_disable_allowed = true;
e692da4d 275
a72f8bee 276 platform_set_drvdata(drm->platformdev, drm);
8d71de61 277
17b5001b
RK
278 /* Now try and bind all our sub-components */
279 ret = component_bind_all(drm->dev, drm);
280 if (ret)
ccec7f62 281 goto err_vblank;
e355e7dd
RK
282
283 /*
284 * All components are now added, we can publish the connector sysfs
285 * entries to userspace. This will generate hotplug events and so
286 * userspace will expect to be able to access DRM at this point.
287 */
288 list_for_each_entry(connector, &drm->mode_config.connector_list, head) {
34ea3d38 289 ret = drm_connector_register(connector);
e355e7dd
RK
290 if (ret) {
291 dev_err(drm->dev,
34ea3d38 292 "[CONNECTOR:%d:%s] drm_connector_register failed: %d\n",
e355e7dd 293 connector->base.id,
4a2a450f 294 connector->name, ret);
e355e7dd
RK
295 goto err_unbind;
296 }
297 }
298
8acba02f
RK
299 /*
300 * All components are now initialised, so setup the fb helper.
301 * The fb helper takes copies of key hardware information, so the
302 * crtcs/connectors/encoders must not change after this point.
303 */
c1ff5a7a 304#if IS_ENABLED(CONFIG_DRM_FBDEV_EMULATION)
8acba02f
RK
305 if (legacyfb_depth != 16 && legacyfb_depth != 32) {
306 dev_warn(drm->dev, "Invalid legacyfb_depth. Defaulting to 16bpp\n");
307 legacyfb_depth = 16;
308 }
309 imxdrm->fbhelper = drm_fbdev_cma_init(drm, legacyfb_depth,
310 drm->mode_config.num_crtc, MAX_CRTC);
311 if (IS_ERR(imxdrm->fbhelper)) {
312 ret = PTR_ERR(imxdrm->fbhelper);
313 imxdrm->fbhelper = NULL;
314 goto err_unbind;
315 }
316#endif
3e68439b
RK
317
318 drm_kms_helper_poll_init(drm);
319
8007875f 320 return 0;
a72f8bee 321
e355e7dd
RK
322err_unbind:
323 component_unbind_all(drm->dev, drm);
ccec7f62 324err_vblank:
8007875f
RK
325 drm_vblank_cleanup(drm);
326err_kms:
8007875f 327 drm_mode_config_cleanup(drm);
e692da4d
SH
328
329 return ret;
330}
331
e692da4d
SH
332/*
333 * imx_drm_add_crtc - add a new crtc
e692da4d 334 */
32266b45 335int imx_drm_add_crtc(struct drm_device *drm, struct drm_crtc *crtc,
43895599 336 struct imx_drm_crtc **new_crtc, struct drm_plane *primary_plane,
e692da4d 337 const struct imx_drm_crtc_helper_funcs *imx_drm_helper_funcs,
655b43cc 338 struct device_node *port)
e692da4d 339{
32266b45 340 struct imx_drm_device *imxdrm = drm->dev_private;
e692da4d 341 struct imx_drm_crtc *imx_drm_crtc;
e692da4d
SH
342 int ret;
343
fd6040ed
RK
344 /*
345 * The vblank arrays are dimensioned by MAX_CRTC - we can't
346 * pass IDs greater than this to those functions.
347 */
e7d6231e
RK
348 if (imxdrm->pipes >= MAX_CRTC)
349 return -EINVAL;
fd6040ed 350
e7d6231e
RK
351 if (imxdrm->drm->open_count)
352 return -EBUSY;
e692da4d
SH
353
354 imx_drm_crtc = kzalloc(sizeof(*imx_drm_crtc), GFP_KERNEL);
e7d6231e
RK
355 if (!imx_drm_crtc)
356 return -ENOMEM;
e692da4d
SH
357
358 imx_drm_crtc->imx_drm_helper_funcs = *imx_drm_helper_funcs;
359 imx_drm_crtc->pipe = imxdrm->pipes++;
e692da4d 360 imx_drm_crtc->crtc = crtc;
e692da4d 361
6457b971
RK
362 crtc->port = port;
363
887eceac 364 imxdrm->crtc[imx_drm_crtc->pipe] = imx_drm_crtc;
e692da4d
SH
365
366 *new_crtc = imx_drm_crtc;
367
ec9557d7 368 ret = drm_mode_crtc_set_gamma_size(imx_drm_crtc->crtc, 256);
e692da4d
SH
369 if (ret)
370 goto err_register;
371
ec9557d7
RK
372 drm_crtc_helper_add(crtc,
373 imx_drm_crtc->imx_drm_helper_funcs.crtc_helper_funcs);
374
43895599 375 drm_crtc_init_with_planes(drm, crtc, primary_plane, NULL,
f9882876 376 imx_drm_crtc->imx_drm_helper_funcs.crtc_funcs, NULL);
ec9557d7 377
e692da4d
SH
378 return 0;
379
380err_register:
887eceac 381 imxdrm->crtc[imx_drm_crtc->pipe] = NULL;
e692da4d 382 kfree(imx_drm_crtc);
e692da4d
SH
383 return ret;
384}
385EXPORT_SYMBOL_GPL(imx_drm_add_crtc);
386
387/*
388 * imx_drm_remove_crtc - remove a crtc
389 */
390int imx_drm_remove_crtc(struct imx_drm_crtc *imx_drm_crtc)
391{
ccec7f62 392 struct imx_drm_device *imxdrm = imx_drm_crtc->crtc->dev->dev_private;
e692da4d
SH
393
394 drm_crtc_cleanup(imx_drm_crtc->crtc);
395
887eceac 396 imxdrm->crtc[imx_drm_crtc->pipe] = NULL;
e692da4d 397
e692da4d
SH
398 kfree(imx_drm_crtc);
399
400 return 0;
401}
402EXPORT_SYMBOL_GPL(imx_drm_remove_crtc);
403
6457b971
RK
404int imx_drm_encoder_parse_of(struct drm_device *drm,
405 struct drm_encoder *encoder, struct device_node *np)
9e2d410d 406{
6457b971 407 uint32_t crtc_mask = drm_of_find_possible_crtcs(drm, np);
9e2d410d 408
6457b971
RK
409 /*
410 * If we failed to find the CRTC(s) which this encoder is
411 * supposed to be connected to, it's because the CRTC has
412 * not been registered yet. Defer probing, and hope that
413 * the required CRTC is added later.
414 */
415 if (crtc_mask == 0)
416 return -EPROBE_DEFER;
655b43cc 417
6457b971 418 encoder->possible_crtcs = crtc_mask;
63bc5164 419
6457b971
RK
420 /* FIXME: this is the mask of outputs which can clone this output. */
421 encoder->possible_clones = ~0;
9e2d410d
RK
422
423 return 0;
424}
6457b971 425EXPORT_SYMBOL_GPL(imx_drm_encoder_parse_of);
9e2d410d 426
655b43cc
PZ
427/*
428 * @node: device tree node containing encoder input ports
429 * @encoder: drm_encoder
430 */
431int imx_drm_encoder_get_mux_id(struct device_node *node,
432 struct drm_encoder *encoder)
e692da4d 433{
887eceac 434 struct imx_drm_crtc *imx_crtc = imx_drm_find_crtc(encoder->crtc);
539bb6a2 435 struct device_node *ep;
b6babdd9 436 struct of_endpoint endpoint;
655b43cc 437 struct device_node *port;
b6babdd9 438 int ret;
e692da4d 439
655b43cc
PZ
440 if (!node || !imx_crtc)
441 return -EINVAL;
442
539bb6a2 443 for_each_endpoint_of_node(node, ep) {
655b43cc
PZ
444 port = of_graph_get_remote_port(ep);
445 of_node_put(port);
6457b971 446 if (port == imx_crtc->crtc->port) {
b6babdd9 447 ret = of_graph_parse_endpoint(ep, &endpoint);
539bb6a2 448 of_node_put(ep);
c509bdc2 449 return ret ? ret : endpoint.port;
655b43cc 450 }
539bb6a2 451 }
e692da4d 452
655b43cc 453 return -EINVAL;
e692da4d 454}
ea8d1583 455EXPORT_SYMBOL_GPL(imx_drm_encoder_get_mux_id);
e692da4d 456
baa70943 457static const struct drm_ioctl_desc imx_drm_ioctls[] = {
e692da4d
SH
458 /* none so far */
459};
460
461static struct drm_driver imx_drm_driver = {
bd3665c9 462 .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME,
e692da4d
SH
463 .load = imx_drm_driver_load,
464 .unload = imx_drm_driver_unload,
e692da4d 465 .lastclose = imx_drm_driver_lastclose,
6ee4d7fe 466 .preclose = imx_drm_driver_preclose,
915b4d11 467 .set_busid = drm_platform_set_busid,
e692da4d
SH
468 .gem_free_object = drm_gem_cma_free_object,
469 .gem_vm_ops = &drm_gem_cma_vm_ops,
470 .dumb_create = drm_gem_cma_dumb_create,
471 .dumb_map_offset = drm_gem_cma_dumb_map_offset,
43387b37 472 .dumb_destroy = drm_gem_dumb_destroy,
e692da4d 473
bd3665c9
PZ
474 .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
475 .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
476 .gem_prime_import = drm_gem_prime_import,
477 .gem_prime_export = drm_gem_prime_export,
478 .gem_prime_get_sg_table = drm_gem_cma_prime_get_sg_table,
479 .gem_prime_import_sg_table = drm_gem_cma_prime_import_sg_table,
480 .gem_prime_vmap = drm_gem_cma_prime_vmap,
481 .gem_prime_vunmap = drm_gem_cma_prime_vunmap,
482 .gem_prime_mmap = drm_gem_cma_prime_mmap,
b44f8408 483 .get_vblank_counter = drm_vblank_no_hw_counter,
e692da4d
SH
484 .enable_vblank = imx_drm_enable_vblank,
485 .disable_vblank = imx_drm_disable_vblank,
486 .ioctls = imx_drm_ioctls,
487 .num_ioctls = ARRAY_SIZE(imx_drm_ioctls),
488 .fops = &imx_drm_driver_fops,
489 .name = "imx-drm",
490 .desc = "i.MX DRM graphics",
491 .date = "20120507",
492 .major = 1,
493 .minor = 0,
494 .patchlevel = 0,
495};
496
17b5001b
RK
497static int compare_of(struct device *dev, void *data)
498{
655b43cc 499 struct device_node *np = data;
17b5001b 500
655b43cc
PZ
501 /* Special case for LDB, one device for two channels */
502 if (of_node_cmp(np->name, "lvds-channel") == 0) {
503 np = of_get_parent(np);
504 of_node_put(np);
17b5001b
RK
505 }
506
655b43cc
PZ
507 return dev->of_node == np;
508}
17b5001b 509
17b5001b
RK
510static int imx_drm_bind(struct device *dev)
511{
512 return drm_platform_init(&imx_drm_driver, to_platform_device(dev));
513}
514
515static void imx_drm_unbind(struct device *dev)
516{
517 drm_put_dev(dev_get_drvdata(dev));
518}
519
520static const struct component_master_ops imx_drm_ops = {
17b5001b
RK
521 .bind = imx_drm_bind,
522 .unbind = imx_drm_unbind,
523};
524
e692da4d
SH
525static int imx_drm_platform_probe(struct platform_device *pdev)
526{
9cace32f 527 int ret = drm_of_component_probe(&pdev->dev, compare_of, &imx_drm_ops);
655b43cc 528
9cace32f
LD
529 if (!ret)
530 ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
655b43cc 531
9cace32f 532 return ret;
e692da4d
SH
533}
534
535static int imx_drm_platform_remove(struct platform_device *pdev)
536{
17b5001b 537 component_master_del(&pdev->dev, &imx_drm_ops);
e692da4d
SH
538 return 0;
539}
540
bfe945c8
SG
541#ifdef CONFIG_PM_SLEEP
542static int imx_drm_suspend(struct device *dev)
543{
544 struct drm_device *drm_dev = dev_get_drvdata(dev);
545
546 /* The drm_dev is NULL before .load hook is called */
547 if (drm_dev == NULL)
548 return 0;
549
550 drm_kms_helper_poll_disable(drm_dev);
551
552 return 0;
553}
554
555static int imx_drm_resume(struct device *dev)
556{
557 struct drm_device *drm_dev = dev_get_drvdata(dev);
558
559 if (drm_dev == NULL)
560 return 0;
561
562 drm_helper_resume_force_mode(drm_dev);
563 drm_kms_helper_poll_enable(drm_dev);
564
565 return 0;
566}
567#endif
568
569static SIMPLE_DEV_PM_OPS(imx_drm_pm_ops, imx_drm_suspend, imx_drm_resume);
570
17b5001b 571static const struct of_device_id imx_drm_dt_ids[] = {
655b43cc 572 { .compatible = "fsl,imx-display-subsystem", },
17b5001b
RK
573 { /* sentinel */ },
574};
575MODULE_DEVICE_TABLE(of, imx_drm_dt_ids);
576
e692da4d
SH
577static struct platform_driver imx_drm_pdrv = {
578 .probe = imx_drm_platform_probe,
99c28f10 579 .remove = imx_drm_platform_remove,
e692da4d 580 .driver = {
e692da4d 581 .name = "imx-drm",
bfe945c8 582 .pm = &imx_drm_pm_ops,
17b5001b 583 .of_match_table = imx_drm_dt_ids,
e692da4d
SH
584 },
585};
b85f2b5d 586module_platform_driver(imx_drm_pdrv);
e692da4d
SH
587
588MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
589MODULE_DESCRIPTION("i.MX drm driver core");
590MODULE_LICENSE("GPL");