From 102e668b878d0514fc9a9633ddc362d2d0779c16 Mon Sep 17 00:00:00 2001 From: Tao Jing Date: Mon, 16 Jan 2012 14:18:52 +0800 Subject: [PATCH] [PORT FROM R2] mt9e013: mt9m114: fix i2c burst transfer error BZ: 20773 ORIG_BZ: 16310 The i2c adapter can transfer 32 bytes maximum at a time, while driver implemets maximum 128 bytes burst transfer length, so i2c driver would split buffer transfer if buffer length is more than 32 byte. This will cause some problem sometime, since during two consequtive transfers, if the second transfer starts at the time when the first transfer completely finishes, (i2c transfer buffer empty),the i2c controler would start a new i2c transfer, which include a start/stop signal according to i2c protocal, but it will break the i2c burst transfer rules expected by driver. Change driver's maximum burst length from 128 t0 32 bytes for both sensors. Change-Id: I27df255211161b20d441825397e43a88eb4774cf Orig-Change-Id: I9035825c326c85700bcb0e66d9954588e5459cc4 Signed-off-by: Tao Jing Reviewed-on: http://android.intel.com:8080/31997 Reviewed-by: Wang, Wen W Reviewed-by: Jong-a-lock, Robert Tested-by: Lampila, KalleX Reviewed-by: Cohen, David A Reviewed-by: buildbot Tested-by: buildbot Reviewed-on: http://android.intel.com:8080/32601 Reviewed-by: Lampila, KalleX --- drivers/media/video/mt9e013.h | 2 +- drivers/media/video/mt9m114.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/mt9e013.h b/drivers/media/video/mt9e013.h index eeb64b3..8e5c5bb 100644 --- a/drivers/media/video/mt9e013.h +++ b/drivers/media/video/mt9e013.h @@ -388,7 +388,7 @@ struct mt9e013_device { void *otp_data; }; -#define MT9E013_MAX_WRITE_BUF_SIZE 128 +#define MT9E013_MAX_WRITE_BUF_SIZE 32 struct mt9e013_write_buffer { u16 addr; u8 data[MT9E013_MAX_WRITE_BUF_SIZE]; diff --git a/drivers/media/video/mt9m114.h b/drivers/media/video/mt9m114.h index 547a293..4563bcb 100644 --- a/drivers/media/video/mt9m114.h +++ b/drivers/media/video/mt9m114.h @@ -276,7 +276,7 @@ struct mt9m114_control { int (*tweak)(struct v4l2_subdev *sd, int value); }; -#define MT9M114_MAX_WRITE_BUF_SIZE 128 +#define MT9M114_MAX_WRITE_BUF_SIZE 32 struct mt9m114_write_buffer { u16 addr; u8 data[MT9M114_MAX_WRITE_BUF_SIZE]; -- 2.7.4