diff options
author | Sumit Semwal <sumit.semwal@ti.com> | 2011-01-24 01:21:54 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-02-23 02:33:27 -0500 |
commit | b7ee79abcc1bd549eadf5a9852657058e6ecca47 (patch) | |
tree | cf1a036586acd6b78cafb2d367b5a2992b27bfea /arch | |
parent | 1dde9732d543f30d4297e8b74329c5ce797b5d16 (diff) |
OMAP2, 3: DSS2: Create new file display.c for central dss driver registration.
A new file display.c is introduced for display driver init, which adds a function
omap_display_init to do the DSS driver registration. This is the first step in moving
away registration of DSS from board files into a common place.
Reviewed-by: Kevin Hilman <khilman@ti.com>
Tested-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Senthilvadivu Guruswamy <svadivu@ti.com>
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-omap2/display.c | 45 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/plat/display.h | 11 |
3 files changed, 59 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index ee72a9787bf1..1c3635d7f4cf 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile | |||
@@ -245,3 +245,6 @@ obj-y += $(smc91x-m) $(smc91x-y) | |||
245 | smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o | 245 | smsc911x-$(CONFIG_SMSC911X) := gpmc-smsc911x.o |
246 | obj-y += $(smsc911x-m) $(smsc911x-y) | 246 | obj-y += $(smsc911x-m) $(smsc911x-y) |
247 | obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o | 247 | obj-$(CONFIG_ARCH_OMAP4) += hwspinlock.o |
248 | |||
249 | disp-$(CONFIG_OMAP2_DSS) := display.o | ||
250 | obj-y += $(disp-m) $(disp-y) | ||
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c new file mode 100644 index 000000000000..b18db84b0349 --- /dev/null +++ b/arch/arm/mach-omap2/display.c | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * OMAP2plus display device setup / initialization. | ||
3 | * | ||
4 | * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ | ||
5 | * Senthilvadivu Guruswamy | ||
6 | * Sumit Semwal | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed "as is" WITHOUT ANY WARRANTY of any | ||
13 | * kind, whether express or implied; without even the implied warranty | ||
14 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | */ | ||
17 | |||
18 | #include <linux/kernel.h> | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/platform_device.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/clk.h> | ||
23 | #include <linux/err.h> | ||
24 | |||
25 | #include <plat/display.h> | ||
26 | |||
27 | static struct platform_device omap_display_device = { | ||
28 | .name = "omapdss", | ||
29 | .id = -1, | ||
30 | .dev = { | ||
31 | .platform_data = NULL, | ||
32 | }, | ||
33 | }; | ||
34 | |||
35 | int __init omap_display_init(struct omap_dss_board_info *board_data) | ||
36 | { | ||
37 | int r = 0; | ||
38 | omap_display_device.dev.platform_data = board_data; | ||
39 | |||
40 | r = platform_device_register(&omap_display_device); | ||
41 | if (r < 0) | ||
42 | printk(KERN_ERR "Unable to register OMAP-Display device\n"); | ||
43 | |||
44 | return r; | ||
45 | } | ||
diff --git a/arch/arm/plat-omap/include/plat/display.h b/arch/arm/plat-omap/include/plat/display.h index 537f4e449f50..0f140ecedb01 100644 --- a/arch/arm/plat-omap/include/plat/display.h +++ b/arch/arm/plat-omap/include/plat/display.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/list.h> | 23 | #include <linux/list.h> |
24 | #include <linux/kobject.h> | 24 | #include <linux/kobject.h> |
25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
26 | #include <linux/platform_device.h> | ||
26 | #include <asm/atomic.h> | 27 | #include <asm/atomic.h> |
27 | 28 | ||
28 | #define DISPC_IRQ_FRAMEDONE (1 << 0) | 29 | #define DISPC_IRQ_FRAMEDONE (1 << 0) |
@@ -226,6 +227,16 @@ struct omap_dss_board_info { | |||
226 | struct omap_dss_device *default_device; | 227 | struct omap_dss_device *default_device; |
227 | }; | 228 | }; |
228 | 229 | ||
230 | #if defined(CONFIG_OMAP2_DSS_MODULE) || defined(CONFIG_OMAP2_DSS) | ||
231 | /* Init with the board info */ | ||
232 | extern int omap_display_init(struct omap_dss_board_info *board_data); | ||
233 | #else | ||
234 | static inline int omap_display_init(struct omap_dss_board_info *board_data) | ||
235 | { | ||
236 | return 0; | ||
237 | } | ||
238 | #endif | ||
239 | |||
229 | struct omap_video_timings { | 240 | struct omap_video_timings { |
230 | /* Unit: pixels */ | 241 | /* Unit: pixels */ |
231 | u16 x_res; | 242 | u16 x_res; |