]> 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/0053-mt9t112-Fix-null-pointer-kernel-bug.patch
BSP: rename beagleboard to TI
[glsdk/meta-ti-glsdk.git] / recipes-bsp / linux / linux-omap-psp-2.6.32 / cam / 0053-mt9t112-Fix-null-pointer-kernel-bug.patch
1 From 8ef0425ef8bc0d228e03666cf7d0af564882fcef Mon Sep 17 00:00:00 2001
2 From: Sergio Aguirre <saaguirre@ti.com>
3 Date: Thu, 1 Jul 2010 09:12:37 -0500
4 Subject: [PATCH 53/75] mt9t112: Fix null pointer kernel bug
6 We were trying to access a null pointer (info) which we weren't
7 initializing anywhere.
9 Fix this.
11 Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
12 ---
13  drivers/media/video/mt9t112.c |   34 +++++++++++++++++++++++-----------
14  1 files changed, 23 insertions(+), 11 deletions(-)
16 diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c
17 index 6f54394..98a4ea9 100644
18 --- a/drivers/media/video/mt9t112.c
19 +++ b/drivers/media/video/mt9t112.c
20 @@ -92,7 +92,7 @@ struct mt9t112_frame_size {
21  struct mt9t112_priv {
22         struct mt9t112_platform_data    *pdata;
23         struct v4l2_int_device          *v4l2_int_device;
24 -       struct mt9t112_camera_info      *info;
25 +       struct mt9t112_camera_info      info;
26         struct i2c_client               *client;
27         struct v4l2_pix_format           pix;
28         int                              model;
29 @@ -463,15 +463,15 @@ static int mt9t112_init_pll(const struct i2c_client *client)
30  
31         /* Replace these registers when new timing parameters are generated */
32         mt9t112_set_pll_dividers(client,
33 -                                priv->info->divider.m,
34 -                                priv->info->divider.n,
35 -                                priv->info->divider.p1,
36 -                                priv->info->divider.p2,
37 -                                priv->info->divider.p3,
38 -                                priv->info->divider.p4,
39 -                                priv->info->divider.p5,
40 -                                priv->info->divider.p6,
41 -                                priv->info->divider.p7);
42 +                                priv->info.divider.m,
43 +                                priv->info.divider.n,
44 +                                priv->info.divider.p1,
45 +                                priv->info.divider.p2,
46 +                                priv->info.divider.p3,
47 +                                priv->info.divider.p4,
48 +                                priv->info.divider.p5,
49 +                                priv->info.divider.p6,
50 +                                priv->info.divider.p7);
51  
52         /*
53          * TEST_BYPASS  on
54 @@ -1015,7 +1015,7 @@ static int mt9t112_v4l2_int_s_power(struct v4l2_int_device *s,
55                 }
56                 if (!(priv->flags & INIT_DONE)) {
57                         u16 param = (MT9T112_FLAG_PCLK_RISING_EDGE &
58 -                                    priv->info->flags) ? 0x0001 : 0x0000;
59 +                                    priv->info.flags) ? 0x0001 : 0x0000;
60  
61                         ECHECKER(ret, mt9t112_detect(client));
62                         ECHECKER(ret, mt9t112_init_camera(client));
63 @@ -1195,6 +1195,18 @@ static int mt9t112_probe(struct i2c_client *client,
64         priv->client = client;
65         priv->pdata = client->dev.platform_data;
66  
67 +       /* Revisit: Init Sensor info settings */
68 +       priv->info.divider.m = 25;
69 +       priv->info.divider.n = 2;
70 +       priv->info.divider.p1 = 0;
71 +       priv->info.divider.p2 = 9;
72 +       priv->info.divider.p3 = 0;
73 +       priv->info.divider.p4 = 13;
74 +       priv->info.divider.p5 = 13;
75 +       priv->info.divider.p6 = 9;
76 +       priv->info.divider.p7 = 0;
77 +       priv->info.flags = MT9T112_FLAG_PCLK_RISING_EDGE;
78 +
79         i2c_set_clientdata(client, priv);
80  
81         //ret = mt9t112_detect(client);
82 -- 
83 1.6.6.1