[COMMON] fimc-is2: update ois bu24218gwl settings
authorlibm1 <libm1@lenovo.com>
Tue, 18 Dec 2018 05:31:42 +0000 (13:31 +0800)
committerKim Gunho <gunho.kim@samsung.com>
Wed, 7 Aug 2019 13:00:12 +0000 (22:00 +0900)
Temp use default cal data, not use cal data from eeprom
Move ois init timing after eeprom init done
Update FW ver 1.0 to 1.2 support

Change-Id: I70d2f306208345f3d98cc09c07807f01c4dcf1d1
Signed-off-by: libm1 <libm1@lenovo.com>
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/modules/fimc-is-device-module-base.c
drivers/media/platform/exynos/fimc-is2/sensor/module_framework/ois/fimc-is-ois-bu24218gwl.c

index 25d7adb7171856d3bc3bec0b3e4d7e88386b5acf..3d5bab5d478de7abe249aa6c3f6fd5caa549333c 100644 (file)
@@ -252,6 +252,15 @@ int sensor_module_init(struct v4l2_subdev *subdev, u32 val)
                }
        }
 
+       subdev_eeprom = sensor_peri->subdev_eeprom;
+       if (subdev_eeprom != NULL) {
+               ret = CALL_EEPROMOPS(sensor_peri->eeprom, eeprom_read, subdev_eeprom);
+               if (ret) {
+                       err("[%s] sensor eeprom read fail\n", __func__);
+                       ret = 0;
+               }
+       }
+
        subdev_ois = sensor_peri->subdev_ois;
 #ifdef USE_OIS_INIT_WORK
        if (subdev_ois)
@@ -291,15 +300,6 @@ int sensor_module_init(struct v4l2_subdev *subdev, u32 val)
        }
 #endif
 
-       subdev_eeprom = sensor_peri->subdev_eeprom;
-       if (subdev_eeprom != NULL) {
-               ret = CALL_EEPROMOPS(sensor_peri->eeprom, eeprom_read, subdev_eeprom);
-               if (ret) {
-                       err("[%s] sensor eeprom read fail\n", __func__);
-                       ret = 0;
-               }
-       }
-
        if (test_bit(FIMC_IS_SENSOR_ACTUATOR_AVAILABLE, &sensor_peri->peri_state) &&
                        pdata->af_product_name != ACTUATOR_NAME_NOTHING && sensor_peri->actuator != NULL) {
 
index f02a7c5ddf6a2e3233b0a31d19bcd8de29f90ee4..b02a8aabf8f6686980b0eca6a30e78209a581085 100644 (file)
 #include "fimc-is-ois.h"
 
 #define OIS_NAME "OIS_ROHM_BU24218GWL"
-#define OIS_FW_1_NAME          "bu24218_Rev1.0_S_data1.bin"
-#define OIS_FW_2_NAME          "bu24218_Rev1.0_S_data2.bin"
+#define OIS_FW_1_NAME          "bu24218_Rev1.2_S_data1.bin"
+#define OIS_FW_2_NAME          "bu24218_Rev1.2_S_data2.bin"
 #define OIS_FW_NUM             2
 #define OIS_FW_ADDR_1          0x0000
 #define OIS_FW_ADDR_2          0x1C00
-#define OIS_FW_CHECK_SUM       0x02D409
+#define OIS_FW_CHECK_SUM       0x02D806
 
 #define OIS_CAL_DATA_PATH              "/data/camera/gm1_eeprom_data.bin"
 #define OIS_CAL_DATA_PATH_DEFAULT      "/vendor/firmware/bu24218_cal_data_default.bin"
@@ -117,6 +117,7 @@ int fimc_is_ois_cal_open(struct fimc_is_ois *ois, char *name, int offset,int siz
        u8 *buf = NULL;
        u16 crc_value = 0;
        u16 crc16 = 0;
+       int i = 0;
 
        FIMC_BUG(!ois);
 
@@ -166,7 +167,10 @@ int fimc_is_ois_cal_open(struct fimc_is_ois *ois, char *name, int offset,int siz
                ret = -EIO;
                goto p_err;
        }
-       info("ois read cal data : 0x%x,%x,%x,%x", buf[0], buf[1], buf[2], buf[3]);
+
+       for(i = 0; i < size/4; i++) {
+               info("ois cal data (%d): 0x%0x,%0x,%0x,%0x", i, buf[4*i+0], buf[4*i+1], buf[4*i+2], buf[4*i+3]);
+       }
 
        if (crc_enable) {
                crc16 = fimc_is_ois_check_crc(buf, OIS_CAL_DATA_SIZE);
@@ -367,7 +371,7 @@ int fimc_is_ois_fw_update(struct v4l2_subdev *subdev)
                        return 0;
                }
                ret = fimc_is_ois_cal_open(ois, OIS_CAL_DATA_PATH, OIS_CAL_DATA_OFFSET, OIS_CAL_DATA_SIZE, 1);
-               if (ret < 0) {
+//             if (ret < 0) {
                        info(" switch to load default OIS Cal Data %s \n", OIS_CAL_DATA_PATH_DEFAULT);
                        ret = fimc_is_ois_cal_open(ois, OIS_CAL_DATA_PATH_DEFAULT, OIS_CAL_DATA_OFFSET_DEFAULT,
                                OIS_CAL_DATA_SIZE_DEFAULT, 0);
@@ -375,7 +379,7 @@ int fimc_is_ois_fw_update(struct v4l2_subdev *subdev)
                                err("OIS %s load is fail\n", OIS_CAL_DATA_PATH_DEFAULT);
                                return 0;
                        }
-               }
+//             }
                is_first_load = 0;
        }