core.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright (C) 2009 Nokia Corporation
  3. * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
  4. *
  5. * Some code and ideas taken from drivers/video/omap/ driver
  6. * by Imre Deak.
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License version 2 as published by
  10. * the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  15. * more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along with
  18. * this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #define DSS_SUBSYS_NAME "CORE"
  21. #include <linux/kernel.h>
  22. #include <linux/module.h>
  23. #include <linux/platform_device.h>
  24. #include "omapdss.h"
  25. #include "dss.h"
  26. /* INIT */
  27. static struct platform_driver * const omap_dss_drivers[] = {
  28. &omap_dsshw_driver,
  29. &omap_dispchw_driver,
  30. #ifdef CONFIG_OMAP2_DSS_DSI
  31. &omap_dsihw_driver,
  32. #endif
  33. #ifdef CONFIG_OMAP2_DSS_VENC
  34. &omap_venchw_driver,
  35. #endif
  36. #ifdef CONFIG_OMAP4_DSS_HDMI
  37. &omapdss_hdmi4hw_driver,
  38. #endif
  39. #ifdef CONFIG_OMAP5_DSS_HDMI
  40. &omapdss_hdmi5hw_driver,
  41. #endif
  42. };
  43. static struct platform_device *omap_drm_device;
  44. static int __init omap_dss_init(void)
  45. {
  46. int r;
  47. r = platform_register_drivers(omap_dss_drivers,
  48. ARRAY_SIZE(omap_dss_drivers));
  49. if (r)
  50. goto err_reg;
  51. omap_drm_device = platform_device_register_simple("omapdrm", 0, NULL, 0);
  52. if (IS_ERR(omap_drm_device)) {
  53. r = PTR_ERR(omap_drm_device);
  54. goto err_reg;
  55. }
  56. return 0;
  57. err_reg:
  58. platform_unregister_drivers(omap_dss_drivers,
  59. ARRAY_SIZE(omap_dss_drivers));
  60. return r;
  61. }
  62. static void __exit omap_dss_exit(void)
  63. {
  64. platform_device_unregister(omap_drm_device);
  65. platform_unregister_drivers(omap_dss_drivers,
  66. ARRAY_SIZE(omap_dss_drivers));
  67. }
  68. module_init(omap_dss_init);
  69. module_exit(omap_dss_exit);
  70. MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
  71. MODULE_DESCRIPTION("OMAP2/3 Display Subsystem");
  72. MODULE_LICENSE("GPL v2");