Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
fb.c
Go to the documentation of this file.
1 /*
2  * File: arch/arm/plat-omap/fb.c
3  *
4  * Framebuffer device registration for TI OMAP platforms
5  *
6  * Copyright (C) 2006 Nokia Corporation
7  * Author: Imre Deak <[email protected]>
8  *
9  * This program is free software; you can redistribute it and/or modify it
10  * under the terms of the GNU General Public License as published by the
11  * Free Software Foundation; either version 2 of the License, or (at your
12  * option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with this program; if not, write to the Free Software Foundation, Inc.,
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22  */
23 
24 #include <linux/module.h>
25 #include <linux/kernel.h>
26 #include <linux/mm.h>
27 #include <linux/init.h>
28 #include <linux/platform_device.h>
29 #include <linux/memblock.h>
30 #include <linux/io.h>
31 #include <linux/omapfb.h>
32 
33 #include <mach/hardware.h>
34 #include <asm/mach/map.h>
35 
36 #if defined(CONFIG_FB_OMAP) || defined(CONFIG_FB_OMAP_MODULE)
37 
38 static bool omapfb_lcd_configured;
39 static struct omapfb_platform_data omapfb_config;
40 
41 static u64 omap_fb_dma_mask = ~(u32)0;
42 
43 static struct platform_device omap_fb_device = {
44  .name = "omapfb",
45  .id = -1,
46  .dev = {
47  .dma_mask = &omap_fb_dma_mask,
48  .coherent_dma_mask = ~(u32)0,
49  .platform_data = &omapfb_config,
50  },
51  .num_resources = 0,
52 };
53 
55 {
56  omapfb_config.lcd = *config;
57  omapfb_lcd_configured = true;
58 }
59 
60 static int __init omap_init_fb(void)
61 {
62  /*
63  * If the board file has not set the lcd config with
64  * omapfb_set_lcd_config(), don't bother registering the omapfb device
65  */
66  if (!omapfb_lcd_configured)
67  return 0;
68 
69  return platform_device_register(&omap_fb_device);
70 }
71 
72 arch_initcall(omap_init_fb);
73 
74 #elif defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
75 
76 static u64 omap_fb_dma_mask = ~(u32)0;
77 static struct omapfb_platform_data omapfb_config;
78 
79 static struct platform_device omap_fb_device = {
80  .name = "omapfb",
81  .id = -1,
82  .dev = {
83  .dma_mask = &omap_fb_dma_mask,
84  .coherent_dma_mask = ~(u32)0,
85  .platform_data = &omapfb_config,
86  },
87  .num_resources = 0,
88 };
89 
90 static int __init omap_init_fb(void)
91 {
92  return platform_device_register(&omap_fb_device);
93 }
94 
95 arch_initcall(omap_init_fb);
96 
97 #else
98 
100 {
101 }
102 
103 #endif