media: tegra: PCL driver updates
Charlie Huang [Thu, 8 Aug 2013 23:41:55 +0000 (16:41 -0700)]
change some dev_err to dev_notice to avoid LNX error filter alarm.

synchronize cam_device_layout with odm imager as well as update
debugfs prints.

change the regulator names of imx132 and ov5693 to avoid name conflict
with other sensors.

bug 1339839

Change-Id: I134b8b10d5df965bffa8ac0333a0c3775cf882a5
Signed-off-by: Charlie Huang <chahuang@nvidia.com>
Reviewed-on: http://git-master/r/259810
(cherry picked from commit 89f7b0768a509fc70e78457c6352ef13f874988f)
Reviewed-on: http://git-master/r/272739
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>

drivers/media/platform/tegra/cam_dev/debugfs.c
drivers/media/platform/tegra/cam_dev/dev_access.c
drivers/media/platform/tegra/camera.c
drivers/media/platform/tegra/imx132.c
drivers/media/platform/tegra/ov5693.c
include/media/camera.h

index 8e95036..84c4c15 100644 (file)
 #include <media/camera.h>
 
 static struct camera_platform_info *cam_desc;
+static const char *device_type[] = {
+       "sensor",
+       "focuser",
+       "flash",
+       "rom",
+       "other1",
+       "other2",
+       "other3",
+       "other4",
+       "unsupported type"
+};
 
 static int camera_debugfs_layout(struct seq_file *s)
 {
        struct cam_device_layout *layout = cam_desc->layout;
        int num = cam_desc->size_layout / sizeof(*layout);
+       const char *pt;
 
        if (!layout)
                return -EEXIST;
 
        if (unlikely(num * sizeof(*layout) != cam_desc->size_layout)) {
-               seq_printf(s, "WHAT? layout size is incorrect!\n");
+               seq_printf(s, "WHAT? layout size mismatch: %d vs %d x %d\n",
+                       cam_desc->size_layout, num, sizeof(*layout));
                return -EFAULT;
        }
 
        while (num--) {
-               seq_printf(s, "%.20s %016llx %1x %1x %02x %1x %.20s\n",
-                       layout->name, layout->guid, layout->is_front,
+               if (layout->type < ARRAY_SIZE(device_type))
+                       pt = device_type[layout->type];
+               else
+                       pt = device_type[ARRAY_SIZE(device_type) - 1];
+               seq_printf(s,
+                       "%016llx %.20s %.20s %1x %1x %.2x %1x %.8x %x %.20s\n",
+                       layout->guid, pt, layout->alt_name, layout->pos,
                        layout->bus, layout->addr, layout->addr_byte,
-                       layout->alt_name);
+                       layout->dev_id, layout->index, layout->name);
                layout++;
        }
 
index b4acec9..99fdecb 100644 (file)
@@ -72,7 +72,7 @@ static int camera_dev_rd(struct camera_device *cdev, u32 reg, u32 *val)
        if (cdev->is_power_on)
                ret = regmap_read(cdev->regmap, reg, val);
        else
-               dev_err(cdev->dev, "%s: power is off.\n", __func__);
+               dev_notice(cdev->dev, "%s: power is off.\n", __func__);
        mutex_unlock(&cdev->mutex);
        camera_dev_dump(cdev, reg, (u8 *)val, sizeof(*val));
        return ret;
@@ -109,7 +109,7 @@ static int camera_dev_wr_blk(
        if (cdev->is_power_on)
                ret = regmap_raw_write(cdev->regmap, reg, buf, len);
        else
-               dev_err(cdev->dev, "%s: power is off.\n", __func__);
+               dev_notice(cdev->dev, "%s: power is off.\n", __func__);
        mutex_unlock(&cdev->mutex);
        return ret;
 }
@@ -368,7 +368,8 @@ int camera_regulator_get(struct device *dev,
        }
        reg = regulator_get(dev, vreg_name);
        if (unlikely(IS_ERR_OR_NULL(reg))) {
-               dev_err(dev, "%s %s ERR: %d\n", __func__, vreg_name, (int)reg);
+               dev_notice(dev, "%s %s not there: %d\n",
+                       __func__, vreg_name, (int)reg);
                err = PTR_ERR(reg);
                nvc_reg->vreg = NULL;
        } else {
index e6e07c5..49b216b 100644 (file)
@@ -283,7 +283,6 @@ static struct camera_chip *camera_chip_chk(char *name)
                        return ccp;
                }
        mutex_unlock(cam_desc.c_mutex);
-       dev_err(cam_desc.dev, "%s device %s not found\n", __func__, name);
        return NULL;
 }
 
@@ -296,7 +295,7 @@ int camera_chip_add(struct camera_chip *chip)
        mutex_lock(cam_desc.c_mutex);
        list_for_each_entry(ccp, cam_desc.chip_list, list)
                if (!strcmp(ccp->name, chip->name)) {
-                       dev_err(cam_desc.dev, "%s device %s already added.\n",
+                       dev_notice(cam_desc.dev, "%s chip %s already added.\n",
                                __func__, chip->name);
                        mutex_unlock(cam_desc.c_mutex);
                        return -EEXIST;
@@ -369,6 +368,8 @@ static int camera_new_device(struct camera_info *cam, unsigned long arg)
 
        c_chip = camera_chip_chk(dev_info.name);
        if (c_chip == NULL) {
+               dev_err(cam->dev, "%s device %s not found\n",
+                       __func__, dev_info.name);
                err = -ENODEV;
                goto new_device_end;
        }
@@ -524,7 +525,7 @@ static int camera_layout_update(struct camera_info *cam, unsigned long arg)
        dev_dbg(cam->dev, "%s %lx", __func__, arg);
        mutex_lock(cam_desc.u_mutex);
        if (cam_desc.layout) {
-               dev_err(cam->dev, "layout already there.\n");
+               dev_notice(cam->dev, "layout already there.\n");
                err = -EEXIST;
                goto layout_end;
        }
@@ -567,7 +568,7 @@ static int camera_layout_get(struct camera_info *cam, unsigned long arg)
 
        dev_dbg(cam->dev, "%s %lx", __func__, arg);
        if (!cam_desc.layout) {
-               dev_err(cam->dev, "layout empty.\n");
+               dev_notice(cam->dev, "layout empty.\n");
                err = -EEXIST;
                goto getlayout_end;
        }
@@ -752,7 +753,7 @@ static long camera_ioctl(struct file *file,
 
 ioctl_end:
        if (err)
-               dev_err(cam->dev, "err = %d\n", err);
+               dev_dbg(cam->dev, "err = %d\n", err);
 
        return err;
 }
index c8ba51c..0d34c94 100644 (file)
@@ -1094,7 +1094,7 @@ static int imx132_power_get(struct imx132_info *info)
        struct imx132_power_rail *pw = &info->power;
 
        imx132_regulator_get(info, &pw->dvdd, "vdig"); /* digital 1.2v */
-       imx132_regulator_get(info, &pw->avdd, "vana"); /* analog 2.7v */
+       imx132_regulator_get(info, &pw->avdd, "vana_imx132"); /* analog 2.7v */
        imx132_regulator_get(info, &pw->iovdd, "vif"); /* interface 1.8v */
 
        return 0;
index 3fc4acd..23d38c0 100644 (file)
@@ -1678,7 +1678,7 @@ static void ov5693_pm_init(struct ov5693_info *info)
 
        ov5693_regulator_get(info, &pw->dvdd, "dvdd");
 
-       ov5693_regulator_get(info, &pw->avdd, "avdd");
+       ov5693_regulator_get(info, &pw->avdd, "avdd_ov5693");
 
        ov5693_regulator_get(info, &pw->dovdd, "dovdd");
        info->power_on = false;
index deadd95..9f17b7f 100644 (file)
@@ -158,14 +158,29 @@ struct cam_update {
        u32 size;
 };
 
+enum {
+       DEVICE_SENSOR,
+       DEVICE_FOCUSER,
+       DEVICE_FLASH,
+       DEVICE_ROM,
+       DEVICE_OTHER,
+       DEVICE_OTHER2,
+       DEVICE_OTHER3,
+       DEVICE_OTHER4,
+       DEVICE_MAX_NUM,
+};
+
 struct cam_device_layout {
        __u64 guid;
        __u8 name[CAMERA_MAX_NAME_LENGTH];
+       __u8 type;
        __u8 alt_name[CAMERA_MAX_NAME_LENGTH];
-       __u8 is_front;
+       __u8 pos;
        __u8 bus;
        __u8 addr;
        __u8 addr_byte;
+       __u32 dev_id;
+       __u32 index;
        __u32 reserved1;
        __u32 reserved2;
 };