summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0064-mt9t112-Remove-smart-size-selection.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0064-mt9t112-Remove-smart-size-selection.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0064-mt9t112-Remove-smart-size-selection.patch188
1 files changed, 188 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0064-mt9t112-Remove-smart-size-selection.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0064-mt9t112-Remove-smart-size-selection.patch
new file mode 100644
index 00000000..b3506dc2
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0064-mt9t112-Remove-smart-size-selection.patch
@@ -0,0 +1,188 @@
1From 2c8e7e157de32ebc5c8d60bf642c2f29f607c3d0 Mon Sep 17 00:00:00 2001
2From: Sergio Aguirre <saaguirre@ti.com>
3Date: Fri, 16 Jul 2010 17:09:10 -0500
4Subject: [PATCH 64/75] mt9t112: Remove "smart" size selection
5
6This code is broken, as it doesn't really adjust all other
7settings, but output size to desired size. It isn't really
8toggling everything that needs, and giving the false impression
9of good size flexibility.
10
11So, meanwhile, let's put fixed init settings for the contexts,
12and toggle between them (implemented in other patch).
13
14Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
15---
16 drivers/media/video/mt9t112.c | 105 ++++++++++++++++-------------------------
17 1 files changed, 41 insertions(+), 64 deletions(-)
18
19diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c
20index ac295dd..ee991ef 100644
21--- a/drivers/media/video/mt9t112.c
22+++ b/drivers/media/video/mt9t112.c
23@@ -390,50 +390,6 @@ static void mt9t112_frame_check(u32 *width, u32 *height)
24 *height = MAX_HEIGHT;
25 }
26
27-static int mt9t112_set_a_frame_size(const struct i2c_client *client,
28- u16 width,
29- u16 height)
30-{
31- int ret;
32- u16 wstart, hstart, wend, hend;
33- u16 max_width = MAX_WIDTH_PREV, max_height = MAX_HEIGHT_PREV;
34-
35- if ((width > max_width) || (height > max_height)) {
36- /* Capture case */
37- max_width = MAX_WIDTH;
38- max_height = MAX_HEIGHT;
39- hstart = 4;
40- wstart = 4;
41- hend = 1547;
42- wend = 2059;
43- } else {
44- hstart = 0;
45- wstart = 0;
46- hend = 1549;
47- wend = 2061;
48- }
49-
50- /* (Context A) Image Width/Height */
51- mt9t112_mcu_write(ret, client, VAR(26, 0), width);
52- mt9t112_mcu_write(ret, client, VAR(26, 2), height);
53-
54- /* (Context A) Output Width/Height */
55- mt9t112_mcu_write(ret, client, VAR(18, 43), 8 + max_width);
56- mt9t112_mcu_write(ret, client, VAR(18, 45), 8 + max_height);
57-
58- /* (Context A) Start Row/Column */
59- mt9t112_mcu_write(ret, client, VAR(18, 2), hstart);
60- mt9t112_mcu_write(ret, client, VAR(18, 4), wstart);
61-
62- /* (Context A) End Row/Column */
63- mt9t112_mcu_write(ret, client, VAR(18, 6), hend);
64- mt9t112_mcu_write(ret, client, VAR(18, 8), wend);
65-
66- mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
67-
68- return ret;
69-}
70-
71 static int mt9t112_set_pll_dividers(const struct i2c_client *client,
72 u8 m, u8 n,
73 u8 p1, u8 p2, u8 p3,
74@@ -561,9 +517,27 @@ static int mt9t112_init_setting(const struct i2c_client *client)
75
76 int ret;
77
78+ /* Output Width (A) */
79+ mt9t112_mcu_write(ret, client, VAR(26, 0), 640);
80+
81+ /* Output Height (A) */
82+ mt9t112_mcu_write(ret, client, VAR(26, 2), 480);
83+
84 /* Adaptive Output Clock (A) */
85 mt9t112_mcu_mask_set(ret, client, VAR(26, 160), 0x0040, 0x0000);
86
87+ /* Row Start (A) */
88+ mt9t112_mcu_write(ret, client, VAR(18, 2), 0);
89+
90+ /* Column Start (A) */
91+ mt9t112_mcu_write(ret, client, VAR(18, 4), 0);
92+
93+ /* Row End (A) */
94+ mt9t112_mcu_write(ret, client, VAR(18, 6), 1549);
95+
96+ /* Column End (A) */
97+ mt9t112_mcu_write(ret, client, VAR(18, 8), 2061);
98+
99 /* Read Mode (A) */
100 mt9t112_mcu_write(ret, client, VAR(18, 12), 0x046C);
101
102@@ -585,6 +559,18 @@ static int mt9t112_init_setting(const struct i2c_client *client)
103 /* Line Length (A) */
104 mt9t112_mcu_write(ret, client, VAR(18, 37), 0x07AC);
105
106+ /* Context Width (A) */
107+ mt9t112_mcu_write(ret, client, VAR(18, 43), 8 + 1024);
108+
109+ /* Context Height (A) */
110+ mt9t112_mcu_write(ret, client, VAR(18, 45), 8 + 768);
111+
112+ /* Output Width (B) */
113+ mt9t112_mcu_write(ret, client, VAR(27, 0), 2048);
114+
115+ /* Output Hieght (B) */
116+ mt9t112_mcu_write(ret, client, VAR(27, 2), 1536);
117+
118 /* Adaptive Output Clock (B) */
119 mt9t112_mcu_mask_set(ret, client, VAR(27, 160), 0x0040, 0x0000);
120
121@@ -610,13 +596,19 @@ static int mt9t112_init_setting(const struct i2c_client *client)
122 mt9t112_mcu_write(ret, client, VAR(18, 91), 0x00FF);
123
124 /* Base Frame Lines (B) */
125- mt9t112_mcu_write(ret, client, VAR(18, 101), 0x0668);
126+ mt9t112_mcu_write(ret, client, VAR(18, 101), 0x066C);
127
128 /* Min Line Length (B) */
129- mt9t112_mcu_write(ret, client, VAR(18, 103), 0x0AF0);
130+ mt9t112_mcu_write(ret, client, VAR(18, 103), 0x0378);
131
132 /* Line Length (B) */
133- mt9t112_mcu_write(ret, client, VAR(18, 109), 0x0AF0);
134+ mt9t112_mcu_write(ret, client, VAR(18, 109), 0x0CB1);
135+
136+ /* Context Width (B) */
137+ mt9t112_mcu_write(ret, client, VAR(18, 115), 8 + 2048);
138+
139+ /* Context Height (B) */
140+ mt9t112_mcu_write(ret, client, VAR(18, 117), 8 + 1536);
141
142 /*
143 * Flicker Dectection registers
144@@ -692,10 +684,10 @@ static int mt9t112_init_setting(const struct i2c_client *client)
145 mt9t112_mcu_write(ret, client, VAR8(8, 12), 0x0A);
146
147 /* RX FIFO Watermark (A) */
148- mt9t112_mcu_write(ret, client, VAR(18, 70), 0x0014);
149+ mt9t112_mcu_write(ret, client, VAR(18, 70), 0x0080);
150
151 /* RX FIFO Watermark (B) */
152- mt9t112_mcu_write(ret, client, VAR(18, 142), 0x0014);
153+ mt9t112_mcu_write(ret, client, VAR(18, 142), 0x0080);
154
155 /* MCLK: 16MHz
156 * PCLK: 73MHz
157@@ -1008,17 +1000,6 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s,
158 case V4L2_POWER_STANDBY:
159 /* FALLTHROUGH */
160 case V4L2_POWER_OFF:
161- /* FIXME
162- *
163- * If user selected large output size,
164- * and used it long time,
165- * mt9t112 camera will be very warm.
166- *
167- * But current driver can not stop mt9t112 camera.
168- * So, set small size here to solve this problem.
169- */
170- mt9t112_set_a_frame_size(client, VGA_WIDTH, VGA_HEIGHT);
171-
172 ret = priv->pdata->power_set(s, power);
173 if (ret < 0) {
174 dev_err(&client->dev, "Unable to set target board power "
175@@ -1051,10 +1032,6 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s,
176 mt9t112_pixfmt_to_order(priv->pix.pixelformat));
177 mt9t112_mcu_write(ret, client, VAR8(1, 0), 0x06);
178
179- mt9t112_set_a_frame_size(client,
180- priv->pix.width,
181- priv->pix.height);
182-
183 ECHECKER(ret, mt9t112_auto_focus_trigger(client));
184
185 dev_dbg(&client->dev, "format : %d\n", priv->pix.pixelformat);
186--
1871.6.6.1
188