media: platform: tegra: ov5693: update fuseid read
Phil Breczinski [Mon, 16 Sep 2013 23:39:33 +0000 (16:39 -0700)]
Update ov5693's fuse ID read ioctl handling to match
the standard.

Bug 1369367

Change-Id: I600bd459ca4c8315b4f2bfe243a3e36e5ffc8aa7
Signed-off-by: Phil Breczinski <pbreczinski@nvidia.com>
(cherry picked from commit 84654e65576d0c9d735d889959786c8883678689)
Signed-off-by: Ajay Nandakumar <anandakumarm@nvidia.com>

drivers/media/platform/tegra/ov5693.c
include/media/ov5693.h

index 23d38c0..3e64faa 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
 #include <media/ov5693.h>
+#include <media/nvc.h>
 
 #define OV5693_ID                      0x5693
 #define OV5693_SENSOR_TYPE             NVC_IMAGER_TYPE_RAW
@@ -66,7 +67,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;
 };
@@ -1779,11 +1780,11 @@ 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]);
+       ov5693_i2c_rd8(info, 0x300A, &info->fuseid.data[0]);
+       ov5693_i2c_rd8(info, 0x300B, &info->fuseid.data[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]);
+               info->fuseid.data[0], info->fuseid.data[1]);
        return 0;
 }
 
@@ -1849,7 +1850,7 @@ static long ov5693_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
                }
                if (copy_to_user((void __user *)arg,
                                &info->fuseid,
-                               sizeof(struct ov5693_fuseid))) {
+                               sizeof(struct nvc_fuseid))) {
                        dev_dbg(&info->i2c_client->dev, "%s:Fail copy fuse id to user space\n",
                                __func__);
                        return -EFAULT;
index 8980ed5..ea4f062 100644 (file)
@@ -33,7 +33,7 @@
  * This can be either stereo , leftOnly or rightOnly */
 #define OV5693_IOCTL_SET_CAMERA_MODE        _IOW('o', 10, __u32)
 #define OV5693_IOCTL_SYNC_SENSORS           _IOW('o', 11, __u32)
-#define OV5693_IOCTL_GET_FUSEID             _IOR('o', 12, struct ov5693_fuseid)
+#define OV5693_IOCTL_GET_FUSEID             _IOR('o', 12, struct nvc_fuseid)
 
 
 struct ov5693_mode {
@@ -54,11 +54,6 @@ struct ov5693_ae {
        __u8  gain_enable;
 };
 
-struct ov5693_fuseid {
-       __u32 size;
-       __u8  id[16];
-};
-
 /* See notes in the nvc.h file on the GPIO usage */
 enum ov5693_gpio_type {
        OV5693_GPIO_TYPE_PWRDN = 0,