diff options
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0023-omap3beagle-camera-Fix-powerup-sequence.patch')
-rw-r--r-- | extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0023-omap3beagle-camera-Fix-powerup-sequence.patch | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0023-omap3beagle-camera-Fix-powerup-sequence.patch b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0023-omap3beagle-camera-Fix-powerup-sequence.patch new file mode 100644 index 00000000..052b9152 --- /dev/null +++ b/extras/recipes-kernel/linux/linux-omap-psp-2.6.32/cam/0023-omap3beagle-camera-Fix-powerup-sequence.patch | |||
@@ -0,0 +1,103 @@ | |||
1 | From e4f2c3641ccae2cb1614c8fda5ce307170b20921 Mon Sep 17 00:00:00 2001 | ||
2 | From: Sergio Aguirre <saaguirre@ti.com> | ||
3 | Date: Thu, 24 Jun 2010 18:21:52 -0500 | ||
4 | Subject: [PATCH 23/75] omap3beagle: camera: Fix powerup sequence | ||
5 | |||
6 | The powerup sequence was very incomplete. After revisiting the | ||
7 | Aptina developer's guide, the resulting powerup sequence is followed. | ||
8 | |||
9 | Signed-off-by: Sergio Aguirre <saaguirre@ti.com> | ||
10 | --- | ||
11 | arch/arm/mach-omap2/board-omap3beagle-camera.c | 49 ++++++++++++++++++++++-- | ||
12 | 1 files changed, 45 insertions(+), 4 deletions(-) | ||
13 | |||
14 | diff --git a/arch/arm/mach-omap2/board-omap3beagle-camera.c b/arch/arm/mach-omap2/board-omap3beagle-camera.c | ||
15 | index 6babaf3..792c48d 100644 | ||
16 | --- a/arch/arm/mach-omap2/board-omap3beagle-camera.c | ||
17 | +++ b/arch/arm/mach-omap2/board-omap3beagle-camera.c | ||
18 | @@ -51,6 +51,8 @@ | ||
19 | |||
20 | #define ISP_MT9T111_MCLK 216000000 | ||
21 | |||
22 | +#define LEOPARD_RESET_GPIO 98 | ||
23 | + | ||
24 | static struct regulator *beagle_mt9t111_1_8v; | ||
25 | static struct regulator *beagle_mt9t111_2_8v; | ||
26 | |||
27 | @@ -174,16 +176,42 @@ static int mt9t111_power_set(struct v4l2_int_device *s, enum v4l2_power power) | ||
28 | break; | ||
29 | |||
30 | case V4L2_POWER_ON: | ||
31 | - isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); | ||
32 | - | ||
33 | #if defined(CONFIG_VIDEO_OMAP3) || defined(CONFIG_VIDEO_OMAP3_MODULE) | ||
34 | isp_configure_interface(vdev->cam->isp, &mt9t111_if_config); | ||
35 | #endif | ||
36 | |||
37 | - /* turn on analog power */ | ||
38 | + /* Set RESET_BAR to 0 */ | ||
39 | + gpio_set_value(LEOPARD_RESET_GPIO, 0); | ||
40 | + | ||
41 | + /* turn on VDD */ | ||
42 | regulator_enable(beagle_mt9t111_1_8v); | ||
43 | + | ||
44 | + mdelay(1); | ||
45 | + | ||
46 | + /* turn on VDD_IO */ | ||
47 | regulator_enable(beagle_mt9t111_2_8v); | ||
48 | - udelay(100); | ||
49 | + | ||
50 | + mdelay(50); | ||
51 | + | ||
52 | + /* Enable EXTCLK */ | ||
53 | + isp_set_xclk(vdev->cam->isp, MT9T111_CLK_MIN, CAM_USE_XCLKA); | ||
54 | + | ||
55 | + /* | ||
56 | + * Wait at least 70 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): | ||
57 | + * ((1000000 * 70) / 6000000) = aprox 12 us. | ||
58 | + */ | ||
59 | + | ||
60 | + udelay(12); | ||
61 | + | ||
62 | + /* Set RESET_BAR to 1 */ | ||
63 | + gpio_set_value(LEOPARD_RESET_GPIO, 1); | ||
64 | + | ||
65 | + /* | ||
66 | + * Wait at least 100 CLK cycles (w/EXTCLK = 6MHz, or CLK_MIN): | ||
67 | + * ((1000000 * 100) / 6000000) = aprox 17 us. | ||
68 | + */ | ||
69 | + | ||
70 | + udelay(17); | ||
71 | |||
72 | break; | ||
73 | |||
74 | @@ -224,6 +252,17 @@ static int beagle_cam_probe(struct platform_device *pdev) | ||
75 | return PTR_ERR(beagle_mt9t111_2_8v); | ||
76 | } | ||
77 | |||
78 | + if (gpio_request(LEOPARD_RESET_GPIO, "cam_rst") != 0) { | ||
79 | + dev_err(&pdev->dev, "Could not request GPIO %d", | ||
80 | + LEOPARD_RESET_GPIO); | ||
81 | + regulator_put(beagle_mt9t111_2_8v); | ||
82 | + regulator_put(beagle_mt9t111_1_8v); | ||
83 | + return -ENODEV; | ||
84 | + } | ||
85 | + | ||
86 | + /* set to output mode, default value 0 */ | ||
87 | + gpio_direction_output(LEOPARD_RESET_GPIO, 0); | ||
88 | + | ||
89 | printk(KERN_INFO MODULE_NAME ": Driver registration complete \n"); | ||
90 | |||
91 | return 0; | ||
92 | @@ -238,6 +277,8 @@ static int beagle_cam_remove(struct platform_device *pdev) | ||
93 | regulator_disable(beagle_mt9t111_2_8v); | ||
94 | regulator_put(beagle_mt9t111_2_8v); | ||
95 | |||
96 | + gpio_free(LEOPARD_RESET_GPIO); | ||
97 | + | ||
98 | return 0; | ||
99 | } | ||
100 | |||
101 | -- | ||
102 | 1.6.6.1 | ||
103 | |||