atomisp: mt9e013: fix fuseid read operation
authorDavid Cohen <david.a.cohen@intel.com>
Mon, 16 Apr 2012 10:46:47 +0000 (13:46 +0300)
committerbuildbot <buildbot@intel.com>
Wed, 25 Apr 2012 09:41:26 +0000 (02:41 -0700)
BZ: 33398

mt9e013 driver's function used to read an array of registers is used by
OTP and FUSEID read operations. But due to bug, that function was
ignoring addr argument and hardcoding OTP read registers.

This patch fixed such function to provide correct fuseid values.

Change-Id: I2a0e81da3a724dfb0a933633e294e450e9facc42
Signed-off-by: David Cohen <david.a.cohen@intel.com>
Reviewed-on: http://android.intel.com:8080/43567
Reviewed-by: Koski, Anttu <anttu.koski@intel.com>
Tested-by: Koski, Anttu <anttu.koski@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/media/video/mt9e013.c

index c1a3cdd..2665302 100644 (file)
@@ -691,16 +691,14 @@ static int mt9e013_read_reg_array(struct i2c_client *client, u16 size, u16 addr,
 
        for (index = 0; index + MT9E013_BYTE_MAX <= size;
             index += MT9E013_BYTE_MAX) {
-               ret = mt9e013_read_reg(client, MT9E013_BYTE_MAX,
-                                      MT9E013_OTP_START_ADDR + index,
+               ret = mt9e013_read_reg(client, MT9E013_BYTE_MAX, addr + index,
                                       (u16 *)&buf[index]);
                if (ret)
                        return ret;
        }
 
        if (size - index > 0)
-               ret = mt9e013_read_reg(client, size - index,
-                                      MT9E013_OTP_START_ADDR + index,
+               ret = mt9e013_read_reg(client, size - index, addr + index,
                                       (u16 *)&buf[index]);
 
        return ret;