]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-bsp/linux/linux-omap-psp-2.6.32/cam/0058-mt9t112-Do-init_camera-every-powerup.patch
66c4e173737cef5ebc22da4b21b47b63466469a9
[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap-psp-2.6.32 / cam / 0058-mt9t112-Do-init_camera-every-powerup.patch
1 From 52bfcc9b6bcb30cf81589c483f1344c568be7300 Mon Sep 17 00:00:00 2001
2 From: Sergio Aguirre <saaguirre@ti.com>
3 Date: Thu, 15 Jul 2010 17:53:44 -0500
4 Subject: [PATCH 58/75] mt9t112: Do init_camera every powerup
6 This is because we want to ensure we always come from a known state.
8 Probably this could be revisited later for optimization.
10 Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
11 ---
12  drivers/media/video/mt9t112.c |   17 ++++++++---------
13  1 files changed, 8 insertions(+), 9 deletions(-)
15 diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c
16 index 98a4ea9..eebc2b5 100644
17 --- a/drivers/media/video/mt9t112.c
18 +++ b/drivers/media/video/mt9t112.c
19 @@ -982,6 +982,8 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s,
20  {
21         struct mt9t112_priv *priv = s->priv;
22         struct i2c_client *client = priv->client;
23 +       u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE &
24 +                    priv->info.flags) ? 0x0001 : 0x0000;
25         int ret;
26  
27         switch (power) {
28 @@ -1014,20 +1016,17 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s,
29                         return ret;
30                 }
31                 if (!(priv->flags & INIT_DONE)) {
32 -                       u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE &
33 -                                    priv->info.flags) ? 0x0001 : 0x0000;
34 -
35                         ECHECKER(ret, mt9t112_detect(client));
36 -                       ECHECKER(ret, mt9t112_init_camera(client));
37 -
38 -                       /* Invert PCLK (Data sampled on falling edge of pixclk) */
39 -                       mt9t112_reg_write(ret, client, 0x3C20, param);
40 -
41 -                       mdelay(5);
42  
43                         priv->flags |= INIT_DONE;
44                 }
45  
46 +               ECHECKER(ret, mt9t112_init_camera(client));
47 +
48 +               /* Invert PCLK (Data sampled on falling edge of pixclk) */
49 +               mt9t112_reg_write(ret, client, 0x3C20, param);
50 +
51 +               mdelay(5);
52                 mt9t112_mcu_write(ret, client, VAR(26, 7),
53                                   mt9t112_pixfmt_to_fmt(priv->pix.pixelformat));
54                 mt9t112_mcu_write(ret, client, VAR(26, 9),
55 -- 
56 1.6.6.1