linux-omap 2.6.37: sync with OE .dev
[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap / media / 0042-omap2-Fix-camera-resources-for-multiomap.patch
1 From 5cc262328a97b1d048ae42234909ac33c2fc342c Mon Sep 17 00:00:00 2001
2 From: Sergio Aguirre <saaguirre@ti.com>
3 Date: Mon, 15 Nov 2010 08:29:54 -0600
4 Subject: [PATCH 42/43] omap2: Fix camera resources for multiomap
6 Make sure the kernel can be compiled with both OMAP2 and OMAP3 camera
7 support linked in, and give public symbols proper omap2/omap3 prefixes.
9 Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
10 Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
11 ---
12  arch/arm/mach-omap2/devices.c |   25 ++++++++++++-------------
13  1 files changed, 12 insertions(+), 13 deletions(-)
15 diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
16 index 9b243be..c132c65 100644
17 --- a/arch/arm/mach-omap2/devices.c
18 +++ b/arch/arm/mach-omap2/devices.c
19 @@ -38,7 +38,7 @@
20  
21  #if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
22  
23 -static struct resource cam_resources[] = {
24 +static struct resource omap2cam_resources[] = {
25         {
26                 .start          = OMAP24XX_CAMERA_BASE,
27                 .end            = OMAP24XX_CAMERA_BASE + 0xfff,
28 @@ -50,21 +50,12 @@ static struct resource cam_resources[] = {
29         }
30  };
31  
32 -static struct platform_device omap_cam_device = {
33 +static struct platform_device omap2cam_device = {
34         .name           = "omap24xxcam",
35         .id             = -1,
36 -       .num_resources  = ARRAY_SIZE(cam_resources),
37 -       .resource       = cam_resources,
38 +       .num_resources  = ARRAY_SIZE(omap2cam_resources),
39 +       .resource       = omap2cam_resources,
40  };
41 -
42 -static inline void omap_init_camera(void)
43 -{
44 -       platform_device_register(&omap_cam_device);
45 -}
46 -#else
47 -static inline void omap_init_camera(void)
48 -{
49 -}
50  #endif
51  
52  static struct resource omap3isp_resources[] = {
53 @@ -158,6 +149,14 @@ int omap3_init_camera(void *pdata)
54  }
55  EXPORT_SYMBOL_GPL(omap3_init_camera);
56  
57 +static inline void omap_init_camera(void)
58 +{
59 +#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
60 +       if (cpu_is_omap24xx())
61 +               platform_device_register(&omap2cam_device);
62 +#endif
63 +}
64 +
65  #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
66  
67  #define MBOX_REG_SIZE   0x120
68 -- 
69 1.6.6.1