| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (c) 2015 MediaTek Inc. |
|---|
| 3 | 4 | * Author: YT SHEN <yt.shen@mediatek.com> |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 7 | | - * published by the Free Software Foundation. |
|---|
| 8 | | - * |
|---|
| 9 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 10 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | | - * GNU General Public License for more details. |
|---|
| 13 | 5 | */ |
|---|
| 14 | 6 | |
|---|
| 15 | | -#include <drm/drmP.h> |
|---|
| 16 | | -#include <drm/drm_atomic.h> |
|---|
| 17 | | -#include <drm/drm_atomic_helper.h> |
|---|
| 18 | | -#include <drm/drm_crtc_helper.h> |
|---|
| 19 | | -#include <drm/drm_gem.h> |
|---|
| 20 | | -#include <drm/drm_gem_cma_helper.h> |
|---|
| 21 | | -#include <drm/drm_of.h> |
|---|
| 22 | 7 | #include <linux/component.h> |
|---|
| 23 | 8 | #include <linux/iommu.h> |
|---|
| 9 | +#include <linux/module.h> |
|---|
| 24 | 10 | #include <linux/of_address.h> |
|---|
| 25 | 11 | #include <linux/of_platform.h> |
|---|
| 26 | 12 | #include <linux/pm_runtime.h> |
|---|
| 13 | +#include <linux/soc/mediatek/mtk-mmsys.h> |
|---|
| 14 | +#include <linux/dma-mapping.h> |
|---|
| 15 | + |
|---|
| 16 | +#include <drm/drm_atomic.h> |
|---|
| 17 | +#include <drm/drm_atomic_helper.h> |
|---|
| 18 | +#include <drm/drm_drv.h> |
|---|
| 19 | +#include <drm/drm_fb_helper.h> |
|---|
| 20 | +#include <drm/drm_fourcc.h> |
|---|
| 21 | +#include <drm/drm_gem.h> |
|---|
| 22 | +#include <drm/drm_gem_cma_helper.h> |
|---|
| 23 | +#include <drm/drm_gem_framebuffer_helper.h> |
|---|
| 24 | +#include <drm/drm_of.h> |
|---|
| 25 | +#include <drm/drm_probe_helper.h> |
|---|
| 26 | +#include <drm/drm_vblank.h> |
|---|
| 27 | 27 | |
|---|
| 28 | 28 | #include "mtk_drm_crtc.h" |
|---|
| 29 | 29 | #include "mtk_drm_ddp.h" |
|---|
| 30 | 30 | #include "mtk_drm_ddp_comp.h" |
|---|
| 31 | 31 | #include "mtk_drm_drv.h" |
|---|
| 32 | | -#include "mtk_drm_fb.h" |
|---|
| 33 | 32 | #include "mtk_drm_gem.h" |
|---|
| 34 | 33 | |
|---|
| 35 | 34 | #define DRIVER_NAME "mediatek" |
|---|
| .. | .. |
|---|
| 38 | 37 | #define DRIVER_MAJOR 1 |
|---|
| 39 | 38 | #define DRIVER_MINOR 0 |
|---|
| 40 | 39 | |
|---|
| 41 | | -static void mtk_atomic_schedule(struct mtk_drm_private *private, |
|---|
| 42 | | - struct drm_atomic_state *state) |
|---|
| 40 | +static const struct drm_mode_config_helper_funcs mtk_drm_mode_config_helpers = { |
|---|
| 41 | + .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm, |
|---|
| 42 | +}; |
|---|
| 43 | + |
|---|
| 44 | +static struct drm_framebuffer * |
|---|
| 45 | +mtk_drm_mode_fb_create(struct drm_device *dev, |
|---|
| 46 | + struct drm_file *file, |
|---|
| 47 | + const struct drm_mode_fb_cmd2 *cmd) |
|---|
| 43 | 48 | { |
|---|
| 44 | | - private->commit.state = state; |
|---|
| 45 | | - schedule_work(&private->commit.work); |
|---|
| 46 | | -} |
|---|
| 49 | + const struct drm_format_info *info = drm_get_format_info(dev, cmd); |
|---|
| 47 | 50 | |
|---|
| 48 | | -static void mtk_atomic_wait_for_fences(struct drm_atomic_state *state) |
|---|
| 49 | | -{ |
|---|
| 50 | | - struct drm_plane *plane; |
|---|
| 51 | | - struct drm_plane_state *new_plane_state; |
|---|
| 52 | | - int i; |
|---|
| 51 | + if (info->num_planes != 1) |
|---|
| 52 | + return ERR_PTR(-EINVAL); |
|---|
| 53 | 53 | |
|---|
| 54 | | - for_each_new_plane_in_state(state, plane, new_plane_state, i) |
|---|
| 55 | | - mtk_fb_wait(new_plane_state->fb); |
|---|
| 56 | | -} |
|---|
| 57 | | - |
|---|
| 58 | | -static void mtk_atomic_complete(struct mtk_drm_private *private, |
|---|
| 59 | | - struct drm_atomic_state *state) |
|---|
| 60 | | -{ |
|---|
| 61 | | - struct drm_device *drm = private->drm; |
|---|
| 62 | | - |
|---|
| 63 | | - mtk_atomic_wait_for_fences(state); |
|---|
| 64 | | - |
|---|
| 65 | | - /* |
|---|
| 66 | | - * Mediatek drm supports runtime PM, so plane registers cannot be |
|---|
| 67 | | - * written when their crtc is disabled. |
|---|
| 68 | | - * |
|---|
| 69 | | - * The comment for drm_atomic_helper_commit states: |
|---|
| 70 | | - * For drivers supporting runtime PM the recommended sequence is |
|---|
| 71 | | - * |
|---|
| 72 | | - * drm_atomic_helper_commit_modeset_disables(dev, state); |
|---|
| 73 | | - * drm_atomic_helper_commit_modeset_enables(dev, state); |
|---|
| 74 | | - * drm_atomic_helper_commit_planes(dev, state, |
|---|
| 75 | | - * DRM_PLANE_COMMIT_ACTIVE_ONLY); |
|---|
| 76 | | - * |
|---|
| 77 | | - * See the kerneldoc entries for these three functions for more details. |
|---|
| 78 | | - */ |
|---|
| 79 | | - drm_atomic_helper_commit_modeset_disables(drm, state); |
|---|
| 80 | | - drm_atomic_helper_commit_modeset_enables(drm, state); |
|---|
| 81 | | - drm_atomic_helper_commit_planes(drm, state, |
|---|
| 82 | | - DRM_PLANE_COMMIT_ACTIVE_ONLY); |
|---|
| 83 | | - |
|---|
| 84 | | - drm_atomic_helper_wait_for_vblanks(drm, state); |
|---|
| 85 | | - |
|---|
| 86 | | - drm_atomic_helper_cleanup_planes(drm, state); |
|---|
| 87 | | - drm_atomic_state_put(state); |
|---|
| 88 | | -} |
|---|
| 89 | | - |
|---|
| 90 | | -static void mtk_atomic_work(struct work_struct *work) |
|---|
| 91 | | -{ |
|---|
| 92 | | - struct mtk_drm_private *private = container_of(work, |
|---|
| 93 | | - struct mtk_drm_private, commit.work); |
|---|
| 94 | | - |
|---|
| 95 | | - mtk_atomic_complete(private, private->commit.state); |
|---|
| 96 | | -} |
|---|
| 97 | | - |
|---|
| 98 | | -static int mtk_atomic_commit(struct drm_device *drm, |
|---|
| 99 | | - struct drm_atomic_state *state, |
|---|
| 100 | | - bool async) |
|---|
| 101 | | -{ |
|---|
| 102 | | - struct mtk_drm_private *private = drm->dev_private; |
|---|
| 103 | | - int ret; |
|---|
| 104 | | - |
|---|
| 105 | | - ret = drm_atomic_helper_prepare_planes(drm, state); |
|---|
| 106 | | - if (ret) |
|---|
| 107 | | - return ret; |
|---|
| 108 | | - |
|---|
| 109 | | - mutex_lock(&private->commit.lock); |
|---|
| 110 | | - flush_work(&private->commit.work); |
|---|
| 111 | | - |
|---|
| 112 | | - ret = drm_atomic_helper_swap_state(state, true); |
|---|
| 113 | | - if (ret) { |
|---|
| 114 | | - mutex_unlock(&private->commit.lock); |
|---|
| 115 | | - drm_atomic_helper_cleanup_planes(drm, state); |
|---|
| 116 | | - return ret; |
|---|
| 117 | | - } |
|---|
| 118 | | - |
|---|
| 119 | | - drm_atomic_state_get(state); |
|---|
| 120 | | - if (async) |
|---|
| 121 | | - mtk_atomic_schedule(private, state); |
|---|
| 122 | | - else |
|---|
| 123 | | - mtk_atomic_complete(private, state); |
|---|
| 124 | | - |
|---|
| 125 | | - mutex_unlock(&private->commit.lock); |
|---|
| 126 | | - |
|---|
| 127 | | - return 0; |
|---|
| 54 | + return drm_gem_fb_create(dev, file, cmd); |
|---|
| 128 | 55 | } |
|---|
| 129 | 56 | |
|---|
| 130 | 57 | static const struct drm_mode_config_funcs mtk_drm_mode_config_funcs = { |
|---|
| 131 | 58 | .fb_create = mtk_drm_mode_fb_create, |
|---|
| 132 | 59 | .atomic_check = drm_atomic_helper_check, |
|---|
| 133 | | - .atomic_commit = mtk_atomic_commit, |
|---|
| 60 | + .atomic_commit = drm_atomic_helper_commit, |
|---|
| 134 | 61 | }; |
|---|
| 135 | 62 | |
|---|
| 136 | 63 | static const enum mtk_ddp_comp_id mt2701_mtk_ddp_main[] = { |
|---|
| .. | .. |
|---|
| 144 | 71 | static const enum mtk_ddp_comp_id mt2701_mtk_ddp_ext[] = { |
|---|
| 145 | 72 | DDP_COMPONENT_RDMA1, |
|---|
| 146 | 73 | DDP_COMPONENT_DPI0, |
|---|
| 74 | +}; |
|---|
| 75 | + |
|---|
| 76 | +static const enum mtk_ddp_comp_id mt7623_mtk_ddp_main[] = { |
|---|
| 77 | + DDP_COMPONENT_OVL0, |
|---|
| 78 | + DDP_COMPONENT_RDMA0, |
|---|
| 79 | + DDP_COMPONENT_COLOR0, |
|---|
| 80 | + DDP_COMPONENT_BLS, |
|---|
| 81 | + DDP_COMPONENT_DPI0, |
|---|
| 82 | +}; |
|---|
| 83 | + |
|---|
| 84 | +static const enum mtk_ddp_comp_id mt7623_mtk_ddp_ext[] = { |
|---|
| 85 | + DDP_COMPONENT_RDMA1, |
|---|
| 86 | + DDP_COMPONENT_DSI0, |
|---|
| 147 | 87 | }; |
|---|
| 148 | 88 | |
|---|
| 149 | 89 | static const enum mtk_ddp_comp_id mt2712_mtk_ddp_main[] = { |
|---|
| .. | .. |
|---|
| 199 | 139 | .shadow_register = true, |
|---|
| 200 | 140 | }; |
|---|
| 201 | 141 | |
|---|
| 142 | +static const struct mtk_mmsys_driver_data mt7623_mmsys_driver_data = { |
|---|
| 143 | + .main_path = mt7623_mtk_ddp_main, |
|---|
| 144 | + .main_len = ARRAY_SIZE(mt7623_mtk_ddp_main), |
|---|
| 145 | + .ext_path = mt7623_mtk_ddp_ext, |
|---|
| 146 | + .ext_len = ARRAY_SIZE(mt7623_mtk_ddp_ext), |
|---|
| 147 | + .shadow_register = true, |
|---|
| 148 | +}; |
|---|
| 149 | + |
|---|
| 202 | 150 | static const struct mtk_mmsys_driver_data mt2712_mmsys_driver_data = { |
|---|
| 203 | 151 | .main_path = mt2712_mtk_ddp_main, |
|---|
| 204 | 152 | .main_len = ARRAY_SIZE(mt2712_mtk_ddp_main), |
|---|
| .. | .. |
|---|
| 235 | 183 | } |
|---|
| 236 | 184 | private->mutex_dev = &pdev->dev; |
|---|
| 237 | 185 | |
|---|
| 238 | | - drm_mode_config_init(drm); |
|---|
| 186 | + ret = drmm_mode_config_init(drm); |
|---|
| 187 | + if (ret) |
|---|
| 188 | + goto put_mutex_dev; |
|---|
| 239 | 189 | |
|---|
| 240 | 190 | drm->mode_config.min_width = 64; |
|---|
| 241 | 191 | drm->mode_config.min_height = 64; |
|---|
| .. | .. |
|---|
| 248 | 198 | drm->mode_config.max_width = 4096; |
|---|
| 249 | 199 | drm->mode_config.max_height = 4096; |
|---|
| 250 | 200 | drm->mode_config.funcs = &mtk_drm_mode_config_funcs; |
|---|
| 201 | + drm->mode_config.helper_private = &mtk_drm_mode_config_helpers; |
|---|
| 251 | 202 | |
|---|
| 252 | 203 | ret = component_bind_all(drm->dev, drm); |
|---|
| 253 | 204 | if (ret) |
|---|
| 254 | | - goto err_config_cleanup; |
|---|
| 205 | + goto put_mutex_dev; |
|---|
| 255 | 206 | |
|---|
| 256 | 207 | /* |
|---|
| 257 | 208 | * We currently support two fixed data streams, each optional, |
|---|
| .. | .. |
|---|
| 298 | 249 | } |
|---|
| 299 | 250 | if (!dma_dev->dma_parms) { |
|---|
| 300 | 251 | ret = -ENOMEM; |
|---|
| 301 | | - goto err_component_unbind; |
|---|
| 252 | + goto put_dma_dev; |
|---|
| 302 | 253 | } |
|---|
| 303 | 254 | |
|---|
| 304 | 255 | ret = dma_set_max_seg_size(dma_dev, (unsigned int)DMA_BIT_MASK(32)); |
|---|
| .. | .. |
|---|
| 325 | 276 | err_unset_dma_parms: |
|---|
| 326 | 277 | if (private->dma_parms_allocated) |
|---|
| 327 | 278 | dma_dev->dma_parms = NULL; |
|---|
| 279 | +put_dma_dev: |
|---|
| 280 | + put_device(private->dma_dev); |
|---|
| 328 | 281 | err_component_unbind: |
|---|
| 329 | 282 | component_unbind_all(drm->dev, drm); |
|---|
| 330 | | -err_config_cleanup: |
|---|
| 331 | | - drm_mode_config_cleanup(drm); |
|---|
| 332 | | - |
|---|
| 283 | +put_mutex_dev: |
|---|
| 284 | + put_device(private->mutex_dev); |
|---|
| 333 | 285 | return ret; |
|---|
| 334 | 286 | } |
|---|
| 335 | 287 | |
|---|
| .. | .. |
|---|
| 344 | 296 | private->dma_dev->dma_parms = NULL; |
|---|
| 345 | 297 | |
|---|
| 346 | 298 | component_unbind_all(drm->dev, drm); |
|---|
| 347 | | - drm_mode_config_cleanup(drm); |
|---|
| 348 | 299 | } |
|---|
| 349 | 300 | |
|---|
| 350 | 301 | static const struct file_operations mtk_drm_fops = { |
|---|
| .. | .. |
|---|
| 371 | 322 | } |
|---|
| 372 | 323 | |
|---|
| 373 | 324 | static struct drm_driver mtk_drm_driver = { |
|---|
| 374 | | - .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | |
|---|
| 375 | | - DRIVER_ATOMIC, |
|---|
| 325 | + .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, |
|---|
| 376 | 326 | |
|---|
| 377 | 327 | .gem_free_object_unlocked = mtk_drm_gem_free_object, |
|---|
| 378 | 328 | .gem_vm_ops = &drm_gem_cma_vm_ops, |
|---|
| .. | .. |
|---|
| 380 | 330 | |
|---|
| 381 | 331 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, |
|---|
| 382 | 332 | .prime_fd_to_handle = drm_gem_prime_fd_to_handle, |
|---|
| 383 | | - .gem_prime_export = drm_gem_prime_export, |
|---|
| 384 | 333 | .gem_prime_import = mtk_drm_gem_prime_import, |
|---|
| 385 | 334 | .gem_prime_get_sg_table = mtk_gem_prime_get_sg_table, |
|---|
| 386 | 335 | .gem_prime_import_sg_table = mtk_gem_prime_import_sg_table, |
|---|
| 387 | 336 | .gem_prime_mmap = mtk_drm_gem_mmap_buf, |
|---|
| 337 | + .gem_prime_vmap = mtk_drm_gem_prime_vmap, |
|---|
| 338 | + .gem_prime_vunmap = mtk_drm_gem_prime_vunmap, |
|---|
| 388 | 339 | .fops = &mtk_drm_fops, |
|---|
| 389 | 340 | |
|---|
| 390 | 341 | .name = DRIVER_NAME, |
|---|
| .. | .. |
|---|
| 420 | 371 | if (ret < 0) |
|---|
| 421 | 372 | goto err_deinit; |
|---|
| 422 | 373 | |
|---|
| 374 | + drm_fbdev_generic_setup(drm, 32); |
|---|
| 375 | + |
|---|
| 423 | 376 | return 0; |
|---|
| 424 | 377 | |
|---|
| 425 | 378 | err_deinit: |
|---|
| 426 | 379 | mtk_drm_kms_deinit(drm); |
|---|
| 427 | 380 | err_free: |
|---|
| 381 | + private->drm = NULL; |
|---|
| 428 | 382 | drm_dev_put(drm); |
|---|
| 429 | 383 | return ret; |
|---|
| 430 | 384 | } |
|---|
| .. | .. |
|---|
| 470 | 424 | .data = (void *)MTK_DSI }, |
|---|
| 471 | 425 | { .compatible = "mediatek,mt8173-dsi", |
|---|
| 472 | 426 | .data = (void *)MTK_DSI }, |
|---|
| 427 | + { .compatible = "mediatek,mt2701-dpi", |
|---|
| 428 | + .data = (void *)MTK_DPI }, |
|---|
| 473 | 429 | { .compatible = "mediatek,mt8173-dpi", |
|---|
| 474 | 430 | .data = (void *)MTK_DPI }, |
|---|
| 475 | 431 | { .compatible = "mediatek,mt2701-disp-mutex", |
|---|
| .. | .. |
|---|
| 487 | 443 | { } |
|---|
| 488 | 444 | }; |
|---|
| 489 | 445 | |
|---|
| 446 | +static const struct of_device_id mtk_drm_of_ids[] = { |
|---|
| 447 | + { .compatible = "mediatek,mt2701-mmsys", |
|---|
| 448 | + .data = &mt2701_mmsys_driver_data}, |
|---|
| 449 | + { .compatible = "mediatek,mt7623-mmsys", |
|---|
| 450 | + .data = &mt7623_mmsys_driver_data}, |
|---|
| 451 | + { .compatible = "mediatek,mt2712-mmsys", |
|---|
| 452 | + .data = &mt2712_mmsys_driver_data}, |
|---|
| 453 | + { .compatible = "mediatek,mt8173-mmsys", |
|---|
| 454 | + .data = &mt8173_mmsys_driver_data}, |
|---|
| 455 | + { } |
|---|
| 456 | +}; |
|---|
| 457 | + |
|---|
| 490 | 458 | static int mtk_drm_probe(struct platform_device *pdev) |
|---|
| 491 | 459 | { |
|---|
| 492 | 460 | struct device *dev = &pdev->dev; |
|---|
| 461 | + struct device_node *phandle = dev->parent->of_node; |
|---|
| 462 | + const struct of_device_id *of_id; |
|---|
| 493 | 463 | struct mtk_drm_private *private; |
|---|
| 494 | | - struct resource *mem; |
|---|
| 495 | 464 | struct device_node *node; |
|---|
| 496 | 465 | struct component_match *match = NULL; |
|---|
| 497 | 466 | int ret; |
|---|
| .. | .. |
|---|
| 501 | 470 | if (!private) |
|---|
| 502 | 471 | return -ENOMEM; |
|---|
| 503 | 472 | |
|---|
| 504 | | - mutex_init(&private->commit.lock); |
|---|
| 505 | | - INIT_WORK(&private->commit.work, mtk_atomic_work); |
|---|
| 506 | | - private->data = of_device_get_match_data(dev); |
|---|
| 507 | | - |
|---|
| 508 | | - mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 509 | | - private->config_regs = devm_ioremap_resource(dev, mem); |
|---|
| 510 | | - if (IS_ERR(private->config_regs)) { |
|---|
| 511 | | - ret = PTR_ERR(private->config_regs); |
|---|
| 512 | | - dev_err(dev, "Failed to ioremap mmsys-config resource: %d\n", |
|---|
| 513 | | - ret); |
|---|
| 514 | | - return ret; |
|---|
| 473 | + private->mmsys_dev = dev->parent; |
|---|
| 474 | + if (!private->mmsys_dev) { |
|---|
| 475 | + dev_err(dev, "Failed to get MMSYS device\n"); |
|---|
| 476 | + return -ENODEV; |
|---|
| 515 | 477 | } |
|---|
| 516 | 478 | |
|---|
| 479 | + of_id = of_match_node(mtk_drm_of_ids, phandle); |
|---|
| 480 | + if (!of_id) |
|---|
| 481 | + return -ENODEV; |
|---|
| 482 | + |
|---|
| 483 | + private->data = of_id->data; |
|---|
| 484 | + |
|---|
| 517 | 485 | /* Iterate over sibling DISP function blocks */ |
|---|
| 518 | | - for_each_child_of_node(dev->of_node->parent, node) { |
|---|
| 486 | + for_each_child_of_node(phandle->parent, node) { |
|---|
| 519 | 487 | const struct of_device_id *of_id; |
|---|
| 520 | 488 | enum mtk_ddp_comp_type comp_type; |
|---|
| 521 | 489 | int comp_id; |
|---|
| .. | .. |
|---|
| 553 | 521 | */ |
|---|
| 554 | 522 | if (comp_type == MTK_DISP_COLOR || |
|---|
| 555 | 523 | comp_type == MTK_DISP_OVL || |
|---|
| 524 | + comp_type == MTK_DISP_OVL_2L || |
|---|
| 556 | 525 | comp_type == MTK_DISP_RDMA || |
|---|
| 557 | 526 | comp_type == MTK_DSI || |
|---|
| 558 | 527 | comp_type == MTK_DPI) { |
|---|
| .. | .. |
|---|
| 570 | 539 | goto err_node; |
|---|
| 571 | 540 | } |
|---|
| 572 | 541 | |
|---|
| 573 | | - ret = mtk_ddp_comp_init(dev, node, comp, comp_id, NULL); |
|---|
| 542 | + ret = mtk_ddp_comp_init(dev->parent, node, comp, |
|---|
| 543 | + comp_id, NULL); |
|---|
| 574 | 544 | if (ret) { |
|---|
| 575 | 545 | of_node_put(node); |
|---|
| 576 | 546 | goto err_node; |
|---|
| .. | .. |
|---|
| 632 | 602 | int ret; |
|---|
| 633 | 603 | |
|---|
| 634 | 604 | ret = drm_mode_config_helper_suspend(drm); |
|---|
| 635 | | - DRM_DEBUG_DRIVER("mtk_drm_sys_suspend\n"); |
|---|
| 636 | 605 | |
|---|
| 637 | 606 | return ret; |
|---|
| 638 | 607 | } |
|---|
| .. | .. |
|---|
| 644 | 613 | int ret; |
|---|
| 645 | 614 | |
|---|
| 646 | 615 | ret = drm_mode_config_helper_resume(drm); |
|---|
| 647 | | - DRM_DEBUG_DRIVER("mtk_drm_sys_resume\n"); |
|---|
| 648 | 616 | |
|---|
| 649 | 617 | return ret; |
|---|
| 650 | 618 | } |
|---|
| .. | .. |
|---|
| 653 | 621 | static SIMPLE_DEV_PM_OPS(mtk_drm_pm_ops, mtk_drm_sys_suspend, |
|---|
| 654 | 622 | mtk_drm_sys_resume); |
|---|
| 655 | 623 | |
|---|
| 656 | | -static const struct of_device_id mtk_drm_of_ids[] = { |
|---|
| 657 | | - { .compatible = "mediatek,mt2701-mmsys", |
|---|
| 658 | | - .data = &mt2701_mmsys_driver_data}, |
|---|
| 659 | | - { .compatible = "mediatek,mt2712-mmsys", |
|---|
| 660 | | - .data = &mt2712_mmsys_driver_data}, |
|---|
| 661 | | - { .compatible = "mediatek,mt8173-mmsys", |
|---|
| 662 | | - .data = &mt8173_mmsys_driver_data}, |
|---|
| 663 | | - { } |
|---|
| 664 | | -}; |
|---|
| 665 | | - |
|---|
| 666 | 624 | static struct platform_driver mtk_drm_platform_driver = { |
|---|
| 667 | 625 | .probe = mtk_drm_probe, |
|---|
| 668 | 626 | .remove = mtk_drm_remove, |
|---|
| 669 | 627 | .driver = { |
|---|
| 670 | 628 | .name = "mediatek-drm", |
|---|
| 671 | | - .of_match_table = mtk_drm_of_ids, |
|---|
| 672 | 629 | .pm = &mtk_drm_pm_ops, |
|---|
| 673 | 630 | }, |
|---|
| 674 | 631 | }; |
|---|
| .. | .. |
|---|
| 680 | 637 | &mtk_disp_rdma_driver, |
|---|
| 681 | 638 | &mtk_dpi_driver, |
|---|
| 682 | 639 | &mtk_drm_platform_driver, |
|---|
| 683 | | - &mtk_dsi_driver, |
|---|
| 684 | 640 | &mtk_mipi_tx_driver, |
|---|
| 641 | + &mtk_dsi_driver, |
|---|
| 685 | 642 | }; |
|---|
| 686 | 643 | |
|---|
| 687 | 644 | static int __init mtk_drm_init(void) |
|---|