aboutsummaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0075-omap3beagle-Add-camera-bootarg.patch
blob: 066bbb48e0eed54fc2ad2737011b321379ac44cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
From d15c09a8ed5441dd843257b6a4396dd058a2e68f Mon Sep 17 00:00:00 2001
From: Sergio Aguirre <saaguirre@ti.com>
Date: Thu, 22 Jul 2010 15:38:43 -0500
Subject: [PATCH 75/75] omap3beagle: Add camera bootarg

This adds a new 'camera' bootarg, with (so far) 2 new possible types:
- lbcmvga: Leopard Board Camera Module: MT9V113 VGA
- lbcm3m1: Leopard Board Camera Module: MT9T111 3MP

Also, cleans up a little bit the current i2c2 bus init code.

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
---
 arch/arm/mach-omap2/board-omap3beagle.c |   42 +++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 7c9e40a..1e8b77b 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -89,6 +89,7 @@ extern struct mt9t112_platform_data mt9t112_pdata;
 #define NAND_BLOCK_SIZE		SZ_128K
 
 char expansionboard_name[16];
+char cameraboard_name[16];
 
 #if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
 
@@ -595,13 +596,16 @@ static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {
 static struct i2c_board_info __initdata beagle_zippy_i2c2_boardinfo[] = {};
 #endif
 
-static struct i2c_board_info __initdata beagle_i2c2_boardinfo[] = {
+static struct i2c_board_info __initdata beagle_lbcmvga_i2c2_boardinfo[] = {
 #if defined(CONFIG_VIDEO_MT9V113) || defined(CONFIG_VIDEO_MT9V113_MODULE)
 	{
 		I2C_BOARD_INFO("mt9v113", MT9V113_I2C_ADDR),
 		.platform_data	= &mt9v113_pdata,
 	},
 #endif
+};
+
+static struct i2c_board_info __initdata beagle_lbcm3m1_i2c2_boardinfo[] = {
 #if defined(CONFIG_VIDEO_MT9T112) || defined(CONFIG_VIDEO_MT9T112_MODULE)
 	{
 		I2C_BOARD_INFO("mt9t112", MT9T112_I2C_ADDR),
@@ -614,15 +618,27 @@ static int __init omap3_beagle_i2c_init(void)
 {
 	omap_register_i2c_bus(1, 2600, beagle_i2c1_boardinfo,
 			ARRAY_SIZE(beagle_i2c1_boardinfo));
-	if(!strcmp(expansionboard_name, "zippy") || !strcmp(expansionboard_name, "zippy2"))
-	{
-		printk(KERN_INFO "Beagle expansionboard: registering i2c2 bus for zippy/zippy2\n");
+
+	if (!strcmp(expansionboard_name, "zippy") ||
+	   !strcmp(expansionboard_name, "zippy2")) {
+		printk(KERN_INFO "Beagle expansionboard:"
+				 " registering i2c2 bus for zippy/zippy2\n");
 		omap_register_i2c_bus(2, 400,  beagle_zippy_i2c2_boardinfo,
 				ARRAY_SIZE(beagle_zippy_i2c2_boardinfo));
-	} else
-	{
-		omap_register_i2c_bus(2, 400,  beagle_i2c2_boardinfo,
-				ARRAY_SIZE(beagle_i2c2_boardinfo));
+	} else {
+		if (!strcmp(cameraboard_name, "lbcmvga")) {
+			printk(KERN_INFO "Beagle cameraboard:"
+					 " registering i2c2 bus for lbcmvga\n");
+			omap_register_i2c_bus(2, 400,  beagle_lbcmvga_i2c2_boardinfo,
+					ARRAY_SIZE(beagle_lbcmvga_i2c2_boardinfo));
+		} else if (!strcmp(cameraboard_name, "lbcm3m1")) {
+			printk(KERN_INFO "Beagle cameraboard:"
+					 " registering i2c2 bus for lbcm3m1\n");
+			omap_register_i2c_bus(2, 400,  beagle_lbcm3m1_i2c2_boardinfo,
+					ARRAY_SIZE(beagle_lbcm3m1_i2c2_boardinfo));
+		} else {
+			omap_register_i2c_bus(2, 400, NULL, 0);
+		}
 	}
 	/* Bus 3 is attached to the DVI port where devices like the pico DLP
 	 * projector don't work reliably with 400kHz */
@@ -825,6 +841,15 @@ static int __init expansionboard_setup(char *str)
 	return 0;
 }
 
+static int __init cameraboard_setup(char *str)
+{
+	if (!str)
+		return -EINVAL;
+	strncpy(cameraboard_name, str, 16);
+	printk(KERN_INFO "Beagle cameraboard: %s\n", cameraboard_name);
+	return 0;
+}
+
 static void __init omap3_beagle_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -910,6 +935,7 @@ static void __init omap3_beagle_map_io(void)
 }
 
 early_param("buddy", expansionboard_setup);
+early_param("camera", cameraboard_setup);
 
 MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board")
 	/* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */
-- 
1.6.6.1