2 * linux/drivers/video/omap2/dss/core.c
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.com>
7 * Some code and ideas taken from drivers/video/omap/ driver
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License version 2 as published by
12 * the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * You should have received a copy of the GNU General Public License along with
20 * this program. If not, see <http://www.gnu.org/licenses/>.
23 #define DSS_SUBSYS_NAME "CORE"
25 #include <linux/kernel.h>
26 #include <linux/module.h>
27 #include <linux/platform_device.h>
33 static int (*dss_output_drv_reg_funcs[])(void) __initdata = {
34 dss_init_platform_driver,
35 dispc_init_platform_driver,
36 #ifdef CONFIG_OMAP2_DSS_DSI
37 dsi_init_platform_driver,
39 #ifdef CONFIG_OMAP2_DSS_VENC
40 venc_init_platform_driver,
42 #ifdef CONFIG_OMAP4_DSS_HDMI
43 hdmi4_init_platform_driver,
45 #ifdef CONFIG_OMAP5_DSS_HDMI
46 hdmi5_init_platform_driver,
50 static void (*dss_output_drv_unreg_funcs[])(void) = {
51 #ifdef CONFIG_OMAP5_DSS_HDMI
52 hdmi5_uninit_platform_driver,
54 #ifdef CONFIG_OMAP4_DSS_HDMI
55 hdmi4_uninit_platform_driver,
57 #ifdef CONFIG_OMAP2_DSS_VENC
58 venc_uninit_platform_driver,
60 #ifdef CONFIG_OMAP2_DSS_DSI
61 dsi_uninit_platform_driver,
63 dispc_uninit_platform_driver,
64 dss_uninit_platform_driver,
67 static struct platform_device *omap_drm_device;
69 static int __init omap_dss_init(void)
74 for (i = 0; i < ARRAY_SIZE(dss_output_drv_reg_funcs); ++i) {
75 r = dss_output_drv_reg_funcs[i]();
80 omap_drm_device = platform_device_register_simple("omapdrm", 0, NULL, 0);
81 if (IS_ERR(omap_drm_device)) {
82 r = PTR_ERR(omap_drm_device);
89 for (i = ARRAY_SIZE(dss_output_drv_reg_funcs) - i;
90 i < ARRAY_SIZE(dss_output_drv_reg_funcs);
92 dss_output_drv_unreg_funcs[i]();
97 static void __exit omap_dss_exit(void)
101 platform_device_unregister(omap_drm_device);
103 for (i = 0; i < ARRAY_SIZE(dss_output_drv_unreg_funcs); ++i)
104 dss_output_drv_unreg_funcs[i]();
107 module_init(omap_dss_init);
108 module_exit(omap_dss_exit);
110 MODULE_AUTHOR("Tomi Valkeinen <tomi.valkeinen@nokia.com>");
111 MODULE_DESCRIPTION("OMAP2/3 Display Subsystem");
112 MODULE_LICENSE("GPL v2");