camsys_drv: v0.0x15.0 camsys_head: v0.9.0
authorddl <ddl@rock-chips.com>
Thu, 18 Sep 2014 01:57:37 +0000 (09:57 +0800)
committerddl <ddl@rock-chips.com>
Thu, 18 Sep 2014 01:57:37 +0000 (09:57 +0800)
drivers/media/video/rk_camsys/camsys_drv.c
drivers/media/video/rk_camsys/camsys_internal.h
include/media/camsys_head.h

index 4f4440c76d23321553b22637d4d022b8892cd9e0..049492f9fa0a861b7090aa4ceab6c098e43dd6c8 100755 (executable)
@@ -167,9 +167,13 @@ static int camsys_extdev_register(camsys_devio_name_t *devio, camsys_dev_t *cams
 
     extdev = camsys_find_extdev(devio->dev_id, camsys_dev);
     if (extdev != NULL) {
-        err = -EBUSY;    /* ddl@rock-chips.com: v0.0x13.0 */
-        camsys_warn("Extdev(dev_id: 0x%x) has been registered in %s!",
-            devio->dev_id, dev_name(camsys_dev->miscdev.this_device));
+        if (strcmp(extdev->dev_name, devio->dev_name) == 0) {
+            err = 0;
+        } else {
+            err = -EINVAL;    /* ddl@rock-chips.com: v0.0x13.0 */
+            camsys_warn("Extdev(dev_id: 0x%x dev_name: %s) has been registered in %s!",
+                extdev->dev_id, extdev->dev_name,dev_name(camsys_dev->miscdev.this_device));
+        }
         goto end;
     }
 
@@ -245,7 +249,10 @@ static int camsys_extdev_register(camsys_devio_name_t *devio, camsys_dev_t *cams
 
     camsys_dev->iomux(extdev, (void*)camsys_dev);
 
-    camsys_trace(1,"Extdev(dev_id: 0x%x) register success",extdev->dev_id);
+    memcpy(extdev->dev_name,devio->dev_name, sizeof(extdev->dev_name));
+    camsys_trace(1,"Extdev(dev_id: 0x%x  dev_name: %s) register success",
+        extdev->dev_id,
+        extdev->dev_name);
 
     return 0;
 fail:
index 30da5fafeba56a968bb1512872f3fa6f16d66145..fd46812c18933d80bf9538601290e99f500e4cea 100755 (executable)
          2) add support JPG irq connect;
 *v0.0x14.0:
          1) camsys_extdev_register return -EBUSY when this dev_id has been registered;
+*v0.0x15.0:
+         1) check extdev name when dev_id has been registered;
 */
-#define CAMSYS_DRIVER_VERSION                   KERNEL_VERSION(0,0x14,0)
+#define CAMSYS_DRIVER_VERSION                   KERNEL_VERSION(0,0x15,0)
 
 
 #define CAMSYS_PLATFORM_DRV_NAME                "RockChip-CamSys"
@@ -193,6 +195,7 @@ typedef struct camsys_flash_s {
     camsys_gpio_t        fl;
 } camsys_flash_t;
 typedef struct camsys_extdev_s {
+    unsigned char            dev_name[CAMSYS_NAME_LEN];
     unsigned int             dev_id;
     camsys_regulator_t       avdd;
     camsys_regulator_t       dovdd;
index f56969670393ee755373ed0740a7810c70682d8f..28dcc5b01a13a6d19b20f0097048c08d2257375f 100755 (executable)
                 1) add flash_trigger_out control
 *v0.8.0:
                 1) support isp iommu
+*v0.9.0:
+         1) add dev_name in struct camsys_devio_name_s;
 */
-#define CAMSYS_HEAD_VERSION           KERNEL_VERSION(0,8,0)
+#define CAMSYS_HEAD_VERSION           KERNEL_VERSION(0,9,0)
 
 #define CAMSYS_MARVIN_DEVNAME         "camsys_marvin"           
 #define CAMSYS_CIF0_DEVNAME           "camsys_cif0"
@@ -209,6 +211,7 @@ typedef struct camsys_extdev_clk_s {
 } camsys_extdev_clk_t;
 
 typedef struct camsys_devio_name_s {
+    unsigned char               dev_name[CAMSYS_NAME_LEN];
     unsigned int                dev_id;
     
     camsys_regulator_info_t     avdd;         // sensor avdd power regulator name