aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-12-14 06:09:07 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:53:42 -0400
commita11f6706ca4473c2df3f72a306d9b9fee6512a33 (patch)
tree7c3b1a769392dab56f1c8c9d39a70139abc45032
parent837c83283daa5ae3831c4dff6bdb75e26aeab4b0 (diff)
[media] omap3: Add function to register omap3isp platform device structure
The omap3isp platform device requires platform data. Instead of registering the device in omap2_init_devices(), export an omap3_init_camera() function to fill the device structure with the platform data pointer and register the device. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--arch/arm/mach-omap2/devices.c19
-rw-r--r--arch/arm/mach-omap2/devices.h19
2 files changed, 29 insertions, 9 deletions
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index d3897562aa4a..6fd92eb97048 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -34,6 +34,8 @@
34#include "mux.h" 34#include "mux.h"
35#include "control.h" 35#include "control.h"
36 36
37#include "devices.h"
38
37#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE) 39#if defined(CONFIG_VIDEO_OMAP2) || defined(CONFIG_VIDEO_OMAP2_MODULE)
38 40
39static struct resource cam_resources[] = { 41static struct resource cam_resources[] = {
@@ -59,8 +61,11 @@ static inline void omap_init_camera(void)
59{ 61{
60 platform_device_register(&omap_cam_device); 62 platform_device_register(&omap_cam_device);
61} 63}
62 64#else
63#elif defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) 65static inline void omap_init_camera(void)
66{
67}
68#endif
64 69
65static struct resource omap3isp_resources[] = { 70static struct resource omap3isp_resources[] = {
66 { 71 {
@@ -146,15 +151,11 @@ static struct platform_device omap3isp_device = {
146 .resource = omap3isp_resources, 151 .resource = omap3isp_resources,
147}; 152};
148 153
149static inline void omap_init_camera(void) 154int omap3_init_camera(struct isp_platform_data *pdata)
150{
151 platform_device_register(&omap3isp_device);
152}
153#else
154static inline void omap_init_camera(void)
155{ 155{
156 omap3isp_device.dev.platform_data = pdata;
157 return platform_device_register(&omap3isp_device);
156} 158}
157#endif
158 159
159#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) 160#if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE)
160 161
diff --git a/arch/arm/mach-omap2/devices.h b/arch/arm/mach-omap2/devices.h
new file mode 100644
index 000000000000..f61eb6e5d136
--- /dev/null
+++ b/arch/arm/mach-omap2/devices.h
@@ -0,0 +1,19 @@
1/*
2 * arch/arm/mach-omap2/devices.h
3 *
4 * OMAP2 platform device setup/initialization
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __ARCH_ARM_MACH_OMAP_DEVICES_H
13#define __ARCH_ARM_MACH_OMAP_DEVICES_H
14
15struct isp_platform_data;
16
17int omap3_init_camera(struct isp_platform_data *pdata);
18
19#endif