summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0069-mt9t112-Fix-pll-p-dividers-abstraction.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0069-mt9t112-Fix-pll-p-dividers-abstraction.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0069-mt9t112-Fix-pll-p-dividers-abstraction.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0069-mt9t112-Fix-pll-p-dividers-abstraction.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0069-mt9t112-Fix-pll-p-dividers-abstraction.patch
new file mode 100644
index 00000000..07c2e201
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0069-mt9t112-Fix-pll-p-dividers-abstraction.patch
@@ -0,0 +1,58 @@
1From bf70e34844f0a3984d4ca48614fa39896ce5ca5f Mon Sep 17 00:00:00 2001
2From: Sergio Aguirre <saaguirre@ti.com>
3Date: Mon, 19 Jul 2010 12:31:47 -0500
4Subject: [PATCH 69/75] mt9t112: Fix pll p-dividers abstraction
5
6Previously, it wasn't clear that the values needed to be filled
7were (val - 1). Fix that.
8
9Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
10---
11 drivers/media/video/mt9t112.c | 16 +++++++++-------
12 1 files changed, 9 insertions(+), 7 deletions(-)
13
14diff --git a/drivers/media/video/mt9t112.c b/drivers/media/video/mt9t112.c
15index 3c516b4..c1a9b41 100644
16--- a/drivers/media/video/mt9t112.c
17+++ b/drivers/media/video/mt9t112.c
18@@ -393,6 +393,8 @@ static void mt9t112_frame_check(u32 *width, u32 *height)
19 *height = MAX_HEIGHT;
20 }
21
22+#define PLL_ADJ(x) ((x != 0) ? x - 1 : 0)
23+
24 static int mt9t112_set_pll_dividers(const struct i2c_client *client,
25 u8 m, u8 n,
26 u8 p1, u8 p2, u8 p3,
27@@ -408,21 +410,21 @@ static int mt9t112_set_pll_dividers(const struct i2c_client *client,
28 mt9t112_reg_mask_set(ret, client, 0x0010, 0x3fff, val);
29
30 /* P1/P2/P3 */
31- val = ((p3 & 0x0F) << 8) |
32- ((p2 & 0x0F) << 4) |
33- ((p1 & 0x0F) << 0);
34+ val = ((PLL_ADJ(p3) & 0x0F) << 8) |
35+ ((PLL_ADJ(p2) & 0x0F) << 4) |
36+ ((PLL_ADJ(p1) & 0x0F) << 0);
37 mt9t112_reg_mask_set(ret, client, 0x0012, 0x0fff, val);
38
39 /* P4/P5/P6 */
40 val = (0x7 << 12) |
41- ((p6 & 0x0F) << 8) |
42- ((p5 & 0x0F) << 4) |
43- ((p4 & 0x0F) << 0);
44+ ((PLL_ADJ(p6) & 0x0F) << 8) |
45+ ((PLL_ADJ(p5) & 0x0F) << 4) |
46+ ((PLL_ADJ(p4) & 0x0F) << 0);
47 mt9t112_reg_mask_set(ret, client, 0x002A, 0x7fff, val);
48
49 /* P7 */
50 val = (0x1 << 12) |
51- ((p7 & 0x0F) << 0);
52+ ((PLL_ADJ(p7) & 0x0F) << 0);
53 mt9t112_reg_mask_set(ret, client, 0x002C, 0x100f, val);
54
55 return ret;
56--
571.6.6.1
58