diff options
author | Karl Kim <kkim@nvidia.com> | 2013-11-01 14:05:47 +0900 |
---|---|---|
committer | Harry Hong <hhong@nvidia.com> | 2013-11-03 17:43:37 -0800 |
commit | 2c419af396704cdc1ed6ae9290265f6051352044 (patch) | |
tree | 795aa5e140e462d3cdfe2786c92980738fba6a4e /drivers | |
parent | 34356cd3d7134d35649470faaca1a0e6be3158e6 (diff) |
media:video:tegra: ov5693 fuse ID support
Add fuse ID read support for the ov5693 from OTP Bank 0
Bug 1399569
Change-Id: I27b934556c3e21a4c85c1a65952a4f8e08bc1ab5
Signed-off-by: Karl Kim <kkim@nvidia.com>
Reviewed-on: http://git-master/r/323825
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/tegra/ov5693.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/media/video/tegra/ov5693.c b/drivers/media/video/tegra/ov5693.c index b079d998ddd5..e755399d242b 100644 --- a/drivers/media/video/tegra/ov5693.c +++ b/drivers/media/video/tegra/ov5693.c @@ -44,6 +44,7 @@ #define OV5693_LENS_VIEW_ANGLE_H 60000 /* _INT2FLOAT_DIVISOR */ #define OV5693_LENS_VIEW_ANGLE_V 60000 /* _INT2FLOAT_DIVISOR */ #define OV5693_OTP_BUF_SIZE 16 +#define OV5693_FUSE_ID_SIZE 5 static struct nvc_gpio_init ov5693_gpio[] = { { OV5693_GPIO_TYPE_PWRDN, GPIOF_OUT_INIT_LOW, "pwrdn", false, true, }, @@ -65,7 +66,7 @@ struct ov5693_info { unsigned test_pattern; struct nvc_imager_static_nvc sdata; u8 bin_en; - struct ov5693_fuseid fuseid; + struct nvc_fuseid fuseid; struct regmap *regmap; struct regulator *ext_vcm_vdd; struct ov5693_cal_data cal; @@ -3119,11 +3120,16 @@ ov5693_mode_wr_err: static int ov5693_get_fuse_id(struct ov5693_info *info) { - ov5693_i2c_rd8(info, 0x300A, &info->fuseid.id[0]); - ov5693_i2c_rd8(info, 0x300B, &info->fuseid.id[1]); - info->fuseid.size = 2; - dev_dbg(&info->i2c_client->dev, "ov5693 fuse_id: %x,%x\n", - info->fuseid.id[0], info->fuseid.id[1]); + int i; + regmap_write(info->regmap, 0x3D84, 0xC0); + regmap_write(info->regmap, 0x3D81, 0x40); + for (i = 0; i < OV5693_FUSE_ID_SIZE; i++) { + ov5693_i2c_rd8(info, 0x3D00 + i, &info->fuseid.data[i]); + dev_dbg(&info->i2c_client->dev, "ov5693 fuse_id byte %d:\t0x%0x\n", + i, info->fuseid.data[i]); + } + info->fuseid.size = OV5693_FUSE_ID_SIZE; + return 0; } |