media: video: tegra: ov5650: Fix OTP readout.
authorAndrei Warkentin <andreiw@motorola.com>
Fri, 5 Nov 2010 20:58:27 +0000 (15:58 -0500)
committerRebecca Schultz Zavin <rebecca@android.com>
Tue, 16 Nov 2010 17:48:58 +0000 (09:48 -0800)
Fixes OTP readout.

Change-Id: I3308ca40e551babfe040bbc59e75edafa8147f5e
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
drivers/media/video/tegra/ov5650.c

index 005e31b7b63a1a305d15fef243558b98166be480..6cc06dfb277010ccc02642d84cedde162f7fcf13 100755 (executable)
@@ -67,6 +67,16 @@ static struct ov5650_reg reset_seq[] = {
        {OV5650_TABLE_END, 0x0},
 };
 
+static struct ov5650_reg otp_reset_seq[] = {
+        {0x3008, 0x82}, /* reset registers pg 72 */
+        {OV5650_TABLE_WAIT_MS, 5},
+        {0x3008, 0x42}, /* register power down pg 72 */
+        {OV5650_TABLE_WAIT_MS, 5},
+        {0x3008, 0x02}, /* register power down pg 72 */
+        {OV5650_TABLE_WAIT_MS, 5},
+        {OV5650_TABLE_END, 0x0},
+};
+
 static struct ov5650_reg *test_pattern_modes[] = {
        tp_none_seq,
        tp_cbars_seq,
@@ -572,12 +582,12 @@ static int ov5650_get_otp(struct ov5650_info *info, void __user *ubuffer)
        if (info->otp_valid)
                goto end;
 
-       err = ov5650_write_table(info->i2c_client, reset_seq, NULL, 0);
+       err = ov5650_write_table(info->i2c_client, otp_reset_seq, NULL, 0);
        if (err)
                return err;
 
        /* Read OTP byte by byte. */
-       i = (uint8_t) offsetof(struct ov5650_otp_data, part_num);
+       i = (uint8_t) offsetof(struct ov5650_otp_data, sensor_serial_num);
        err = ov5650_write_reg(info->i2c_client, 0x3D00, i);
        if (err)
                return err;