drm.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * DRM/KMS device registration for TI OMAP platforms
  3. *
  4. * Copyright (C) 2012 Texas Instruments
  5. * Author: Rob Clark <rob.clark@linaro.org>
  6. *
  7. * This program is free software; you can redistribute it and/or modify it
  8. * under the terms of the GNU General Public License version 2 as published by
  9. * the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT
  12. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. * more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along with
  17. * this program. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #include <linux/module.h>
  20. #include <linux/kernel.h>
  21. #include <linux/mm.h>
  22. #include <linux/init.h>
  23. #include <linux/platform_device.h>
  24. #include <linux/dma-mapping.h>
  25. #include <linux/platform_data/omap_drm.h>
  26. #include "soc.h"
  27. #include "display.h"
  28. #if IS_ENABLED(CONFIG_DRM_OMAP)
  29. static struct omap_drm_platform_data platform_data;
  30. static struct platform_device omap_drm_device = {
  31. .dev = {
  32. .coherent_dma_mask = DMA_BIT_MASK(32),
  33. .platform_data = &platform_data,
  34. },
  35. .name = "omapdrm",
  36. .id = 0,
  37. };
  38. int __init omap_init_drm(void)
  39. {
  40. platform_data.omaprev = GET_OMAP_TYPE;
  41. return platform_device_register(&omap_drm_device);
  42. }
  43. #else
  44. int __init omap_init_drm(void) { return 0; }
  45. #endif