OSDN Git Service

camera_v2: import xiaomi changes
authorDemon Singur <demonsingur@gmail.com>
Wed, 28 Feb 2018 19:40:09 +0000 (19:40 +0000)
committerArian <arian.kulmer@web.de>
Tue, 19 Nov 2019 15:24:33 +0000 (16:24 +0100)
Change-Id: I1c63e5f13cfea310256e173c1164cc68198304d6

24 files changed:
drivers/media/platform/msm/camera_v2/common/cam_soc_api.c
drivers/media/platform/msm/camera_v2/common/msm_camera_io_util.c
drivers/media/platform/msm/camera_v2/isp/msm_isp_axi_util.c
drivers/media/platform/msm/camera_v2/ispif/msm_ispif.c
drivers/media/platform/msm/camera_v2/sensor/actuator/msm_actuator.c
drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.c
drivers/media/platform/msm/camera_v2/sensor/eeprom/msm_eeprom.h
drivers/media/platform/msm/camera_v2/sensor/msm_sensor.c
drivers/media/platform/msm/camera_v2/sensor/msm_sensor_driver.c
drivers/media/platform/msm/camera_v2/sensor/msm_sensor_init.c
drivers/media/platform/msm/camera_v2/sensor/ois/OIS_coef.h [new file with mode: 0644]
drivers/media/platform/msm/camera_v2/sensor/ois/OIS_coef_chiron.h [new file with mode: 0644]
drivers/media/platform/msm/camera_v2/sensor/ois/OIS_defi.h [new file with mode: 0644]
drivers/media/platform/msm/camera_v2/sensor/ois/OIS_func.c [new file with mode: 0644]
drivers/media/platform/msm/camera_v2/sensor/ois/OIS_head.h [new file with mode: 0644]
drivers/media/platform/msm/camera_v2/sensor/ois/OIS_prog.h [new file with mode: 0644]
drivers/media/platform/msm/camera_v2/sensor/ois/OIS_prog_chiron.h [new file with mode: 0644]
drivers/media/platform/msm/camera_v2/sensor/ois/OIS_user.c [new file with mode: 0644]
drivers/media/platform/msm/camera_v2/sensor/ois/msm_ois.c
drivers/media/platform/msm/camera_v2/sensor/ois/msm_ois.h
include/media/msm_cam_sensor.h
include/uapi/media/msm_cam_sensor.h
include/uapi/media/msm_camsensor_sdk.h
include/uapi/media/msmb_ispif.h

index a0c606c..0e41eab 100644 (file)
@@ -355,6 +355,14 @@ int msm_camera_clk_enable(struct device *dev,
        if (enable) {
                for (i = 0; i < num_clk; i++) {
                        CDBG("enable %s\n", clk_info[i].clk_name);
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+                       clk_ptr[i] = clk_get(dev, clk_info[i].clk_name);
+                       if (IS_ERR(clk_ptr[i])) {
+                               pr_err("%s get failed\n", clk_info[i].clk_name);
+                               rc = PTR_ERR(clk_ptr[i]);
+                               goto cam_clk_set_err;
+                       }
+#endif
                        if (clk_info[i].clk_rate > 0) {
                                clk_rate = clk_round_rate(clk_ptr[i],
                                        clk_info[i].clk_rate);
index 2143807..5f40914 100644 (file)
@@ -772,6 +772,9 @@ int msm_camera_request_gpio_table(struct gpio *gpio_tbl, uint8_t size,
                                pr_err("%s:%d gpio %d:%s request fails\n",
                                        __func__, __LINE__,
                                        gpio_tbl[i].gpio, gpio_tbl[i].label);
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+                               rc = -err;
+#endif
                        }
                }
        } else {
index 1af55fe..199a7c8 100644 (file)
@@ -841,6 +841,9 @@ static void msm_isp_sync_dual_cam_frame_id(
                return;
        }
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       WARN_ON(ms_res->dual_sync_mode == MSM_ISP_DUAL_CAM_ASYNC);
+#endif
        /* find highest frame id */
        for (i = 0; i < MAX_VFE * VFE_SRC_MAX; i++) {
                if (ms_res->src_info[i] == NULL)
@@ -937,6 +940,10 @@ void msm_isp_increment_frame_id(struct vfe_device *vfe_dev,
                                                        sync_state =
                                                        MSM_ISP_DUAL_CAM_ASYNC;
                                }
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+                               ms_res->src_sof_mask = 0;
+                               ms_res->active_src_mask = 1 << src_info->dual_hw_ms_info.index;
+#endif
                        }
                        ms_res->src_sof_mask |= (1 <<
                                        src_info->dual_hw_ms_info.index);
index da2381d..6a5270e 100644 (file)
@@ -1419,7 +1419,11 @@ static int msm_ispif_stop_frame_boundary(struct ispif_device *ispif,
                rc = readl_poll_timeout(ispif->base + intf_addr, stop_flag,
                                        (stop_flag & 0xF) == 0xF,
                                        ISPIF_TIMEOUT_SLEEP_US,
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+                                       (params->reserved_param ? params->reserved_param : ISPIF_TIMEOUT_ALL_US));
+#else
                                        ISPIF_TIMEOUT_ALL_US);
+#endif
                if (rc < 0)
                        goto end;
                if (cid_right_mask) {
index c80f815..06a9be4 100644 (file)
@@ -31,6 +31,10 @@ DEFINE_MSM_MUTEX(msm_actuator_mutex);
 #define PARK_LENS_SMALL_STEP 3
 #define MAX_QVALUE 4096
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+#define FL 4
+#endif
+
 static struct v4l2_file_operations msm_actuator_v4l2_subdev_fops;
 static int32_t msm_actuator_power_up(struct msm_actuator_ctrl_t *a_ctrl);
 static int32_t msm_actuator_power_down(struct msm_actuator_ctrl_t *a_ctrl);
@@ -389,6 +393,9 @@ static int32_t msm_actuator_init_focus(struct msm_actuator_ctrl_t *a_ctrl,
 
                switch (settings[i].i2c_operation) {
                case MSM_ACT_WRITE:
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+                       usleep_range(1000, 2000);
+#endif
                        rc = a_ctrl->i2c_client.i2c_func_tbl->i2c_write(
                                &a_ctrl->i2c_client,
                                settings[i].reg_addr,
@@ -401,6 +408,9 @@ static int32_t msm_actuator_init_focus(struct msm_actuator_ctrl_t *a_ctrl,
                                        (settings[i].delay * 1000) + 1000);
                        break;
                case MSM_ACT_POLL:
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+               case MSM_ACT_POLL_RESULT:
+#endif
                        rc = a_ctrl->i2c_client.i2c_func_tbl->i2c_poll(
                                &a_ctrl->i2c_client,
                                settings[i].reg_addr,
@@ -420,6 +430,16 @@ static int32_t msm_actuator_init_focus(struct msm_actuator_ctrl_t *a_ctrl,
                                settings[i].reg_data, settings[i].data_type);
                        break;
                }
+
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+               if ((settings[i].i2c_operation == MSM_ACT_POLL_RESULT)
+                       && (rc == 1)) {
+                       pr_err("%s:%d poll fail (non-fatal) addr = 0X%X, data = 0X%X, dt = %d",
+                               __func__, __LINE__, settings[i].reg_addr,
+                               settings[i].reg_data, settings[i].data_type);
+                       break;
+               }
+#endif
        }
 
        a_ctrl->curr_step_pos = 0;
@@ -570,6 +590,11 @@ static int32_t msm_actuator_piezo_move_focus(
        return rc;
 }
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+extern void msm_ois_shift_gain(int distance);
+extern bool SENSOR_SUPPORT_OIS_FLAG;
+#endif
+
 static int32_t msm_actuator_move_focus(
        struct msm_actuator_ctrl_t *a_ctrl,
        struct msm_actuator_move_params_t *move_params)
@@ -585,6 +610,11 @@ static int32_t msm_actuator_move_focus(
        int dir = move_params->dir;
        int32_t num_steps = move_params->num_steps;
        struct msm_camera_i2c_reg_setting reg_setting;
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       int distance = 0;
+       int target_margin = 0;
+       int origin_total = 0;
+#endif
 
        CDBG("called, dir %d, num_steps %d\n", dir, num_steps);
 
@@ -695,6 +725,30 @@ static int32_t msm_actuator_move_focus(
                return rc;
        }
        a_ctrl->i2c_tbl_index = 0;
+
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+#ifdef CONFIG_MACH_CHIRON
+#define OIS_FACTOR1 160
+#define OIS_FACTOR2 35
+#else
+#define OIS_FACTOR1 140
+#define OIS_FACTOR2 35
+#endif
+#endif
+
+       if ((SENSOR_SUPPORT_OIS_FLAG) && (!strcmp(a_ctrl->pdev->name, "ca0c000.qcom,cci:qcom,actuator@0"))) {
+               if (target_step_pos > 0) {
+                       origin_total = ((a_ctrl->total_steps * 100) / OIS_FACTOR1);
+                       target_margin = ((origin_total * OIS_FACTOR2) / 100);
+                       if (target_step_pos > target_margin) {
+                               distance = (((FL + (FL * (FL * origin_total))) / (target_step_pos - target_margin)) / 2);
+                       } else {
+                               distance = ((FL + (FL * (FL * origin_total) / 1)) / 2);
+                       }
+                       distance = distance < 10 ? 10 : distance;
+                       msm_ois_shift_gain(distance);
+               }
+       }
        CDBG("Exit\n");
 
        return rc;
@@ -1114,6 +1168,12 @@ static int32_t msm_actuator_power_down(struct msm_actuator_ctrl_t *a_ctrl)
 {
        int32_t rc = 0;
        enum msm_sensor_power_seq_gpio_t gpio;
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       struct device_node *src_node = NULL;
+       int i = 0;
+       const char *af_name;
+       struct device_node *of_node = a_ctrl->pdev->dev.of_node;
+#endif
 
        CDBG("Enter\n");
        if (a_ctrl->actuator_state != ACT_DISABLE_STATE) {
@@ -1173,6 +1233,71 @@ static int32_t msm_actuator_power_down(struct msm_actuator_ctrl_t *a_ctrl)
                a_ctrl->i2c_tbl_index = 0;
                a_ctrl->actuator_state = ACT_OPS_INACTIVE;
        }
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       else {
+               if (of_gpio_count(of_node)) {
+                       for (gpio = SENSOR_GPIO_AF_PWDM;
+                               gpio < SENSOR_GPIO_MAX; gpio++) {
+                               if (a_ctrl->gconf &&
+                                       a_ctrl->gconf->gpio_num_info &&
+                                       a_ctrl->gconf->gpio_num_info->valid[gpio] == 1) {
+                                       gpio_set_value_cansleep(
+                                                       a_ctrl->gconf->gpio_num_info->
+                                                       gpio_num[gpio],
+                                                       GPIOF_OUT_INIT_LOW);
+
+                                       if (a_ctrl->cam_pinctrl_status) {
+                                               rc = pinctrl_select_state(
+                                                       a_ctrl->pinctrl_info.pinctrl,
+                                                       a_ctrl->pinctrl_info.gpio_state_suspend);
+                                               if (rc < 0)
+                                                       pr_err("ERR:%s:%d cannot set pin to suspend state: %d",
+                                                               __func__, __LINE__, rc);
+
+                                               devm_pinctrl_put(a_ctrl->pinctrl_info.pinctrl);
+                                       }
+                                       a_ctrl->cam_pinctrl_status = 0;
+                                       rc = msm_camera_request_gpio_table(
+                                               a_ctrl->gconf->cam_gpio_req_tbl,
+                                               a_ctrl->gconf->cam_gpio_req_tbl_size,
+                                               0);
+                                       if (rc < 0)
+                                               pr_err("ERR:%s:Failed in selecting state in actuator power down: %d\n", __func__, rc);
+                               }
+                       }
+               } else {
+                       for (i = 0; i < a_ctrl->vreg_cfg.num_vreg; i++) {
+                               src_node = of_parse_phandle(of_node, "cam_vaf-supply", 0);
+                               if (!src_node) {
+                                       pr_err("actuator node is NULL\n");
+                                       continue;
+                               }
+                               rc = of_property_read_string(src_node, "regulator-name", &af_name);
+                               if (rc < 0) {
+                                       if (strcmp(af_name, "vaf_gpio_supply") == 0) {
+                                               pr_err("read regulator-name fail\n");
+                                               of_node_put(src_node);
+                                               src_node = NULL;
+                                               break;
+                                       }
+                               } else {
+                                       pr_err("actuator regulator name = %s", af_name);
+                                       if (gpio_get_value_cansleep(29)) {
+                                               pr_err("actuator power down again\n");
+                                               for (i = 0; i < 3; i++) {
+                                                       rc = msm_actuator_vreg_control(a_ctrl, 0);
+                                                       if (rc < 0)
+                                                               pr_err("%s power down again failed %d\n", __func__, __LINE__);
+                                               }
+                                       }
+                               }
+                               of_node_put(src_node);
+                               src_node = NULL;
+                       }
+               }
+       }
+#endif
+
        CDBG("Exit\n");
        return rc;
 }
@@ -1397,6 +1522,14 @@ static int32_t msm_actuator_set_param(struct msm_actuator_ctrl_t *a_ctrl,
                                pr_err("Error actuator_init_focus\n");
                                return -EFAULT;
                        }
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+                       else if (rc == 1) {
+                               kfree(a_ctrl->i2c_reg_tbl);
+                               a_ctrl->i2c_reg_tbl = NULL;
+                               pr_err("actuator_init_focus return 1\n");
+                               return rc;
+                       }
+#endif
                }
        }
 
@@ -1985,6 +2118,10 @@ static int32_t msm_actuator_platform_probe(struct platform_device *pdev)
                (&pdev->dev)->of_node);
        if (rc <= 0) {
                pr_err("%s: No/Error Actuator GPIOs\n", __func__);
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       } else if (!msm_actuator_t->gconf) {
+               pr_err("%s: %d: Actuator no GPIO control\n", __func__, __LINE__);
+#endif
        } else {
                msm_actuator_t->cam_pinctrl_status = 1;
                rc = msm_camera_pinctrl_init(
index 31d2fdc..6369b90 100644 (file)
 #undef CDBG
 #define CDBG(fmt, args...) pr_debug(fmt, ##args)
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+#define EEPROM_NAME_MAX 32
+
+struct sensor_eeprom_name_t {
+       char name[4*EEPROM_NAME_MAX];
+};
+
+struct sensor_eeprom_name_t sensor_eeprom_name[3];
+uint8_t eeprom_name_count;
+#endif
+
 DEFINE_MSM_MUTEX(msm_eeprom_mutex);
 #ifdef CONFIG_COMPAT
 static struct v4l2_file_operations msm_eeprom_v4l2_subdev_fops;
 #endif
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+bool back_sensor_module_invalid = true;
+#endif
+
 /**
   * msm_get_read_mem_size - Get the total size for allocation
   * @eeprom_map_array: mem map
@@ -1521,7 +1536,9 @@ static int msm_eeprom_config32(struct msm_eeprom_ctrl_t *e_ctrl,
                if (e_ctrl->userspace_probe == 0) {
                        pr_err("%s:%d Eeprom already probed at kernel boot",
                                __func__, __LINE__);
+#ifndef CONFIG_MACH_XIAOMI_MSM8998
                        rc = -EINVAL;
+#endif
                        break;
                }
                if (e_ctrl->cal_data.num_data == 0) {
@@ -1579,6 +1596,31 @@ static long msm_eeprom_subdev_fops_ioctl32(struct file *file, unsigned int cmd,
 
 #endif
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+uint8_t g_cal_fadj_data[128];
+EXPORT_SYMBOL(g_cal_fadj_data);
+
+/* add eeprom identification flow */
+void get_eeprom_name(uint8_t index, char *name)
+{
+       strlcpy(name, sensor_eeprom_name[index].name, sizeof(sensor_eeprom_name[index].name));
+       return;
+}
+EXPORT_SYMBOL(get_eeprom_name);
+EXPORT_SYMBOL(eeprom_name_count);
+
+/* compatible eeprom map for sagit P3 & P2 */
+int get_back_sensor_module_invalid(void)
+{
+       if (back_sensor_module_invalid) {
+               return -EINVAL;
+       } else {
+               return 0;
+       }
+}
+EXPORT_SYMBOL(get_back_sensor_module_invalid);
+#endif
+
 static int msm_eeprom_platform_probe(struct platform_device *pdev)
 {
        int rc = 0;
@@ -1591,6 +1633,15 @@ static int msm_eeprom_platform_probe(struct platform_device *pdev)
        struct device_node *of_node = pdev->dev.of_node;
        struct msm_camera_power_ctrl_t *power_info = NULL;
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       int eeprom_basic_info_off = 0;
+       int eeprom_ois_info_off = 0;
+       char module_eeprom_name[4*EEPROM_NAME_MAX] = {0};
+       char pro_name[EEPROM_NAME_MAX] = {0};
+       char sensor_name[EEPROM_NAME_MAX] = {0};
+       char module_name[EEPROM_NAME_MAX] = {0};
+#endif
+
        CDBG("%s E\n", __func__);
 
        e_ctrl = kzalloc(sizeof(*e_ctrl), GFP_KERNEL);
@@ -1724,10 +1775,91 @@ static int msm_eeprom_platform_probe(struct platform_device *pdev)
                        pr_err("%s read_eeprom_memory failed\n", __func__);
                        goto power_down;
                }
+
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+               /* compatible eeprom map for sagit P3 & P2 */
+               CDBG("++++++++0x0e = 0x%x, 0x0d = 0x%x \n", e_ctrl->cal_data.mapdata[0x0e], e_ctrl->cal_data.mapdata[0x0d]);
+               if ((strcmp(eb_info->eeprom_name, "sagit_imx386_semco") == 0) ||
+                       (strcmp(eb_info->eeprom_name, "sagit_s5k3m3_semco") == 0)) {
+                       if (e_ctrl->cal_data.mapdata[0x0e] != 0x03) {
+                               if ((e_ctrl->cal_data.mapdata[0x01] == 0x07) || (e_ctrl->cal_data.mapdata[0x01] == 0x03)) {
+                                       pr_err("3m3 semco and ofilm eeprom goto etcrl free");
+                                       back_sensor_module_invalid = false;
+                                       pr_err("back_sensor_module_invalid = %d \n", back_sensor_module_invalid);
+                                       strlcpy(sensor_eeprom_name[eeprom_name_count].name, eb_info->eeprom_name, EEPROM_NAME_MAX);
+                                       pr_err("%s: sensor_eeprom_name[%d] = %s, probe unnecessary!\n", __func__, eeprom_name_count, sensor_eeprom_name[eeprom_name_count].name);
+                                       eeprom_name_count++;
+                                       goto ectrl_free;
+                               }
+                       }
+               }
+               if (strcmp(eb_info->eeprom_name, "chiron_imx386_semco") == 0) {
+                       eeprom_basic_info_off = 1;
+               }
+               CDBG("++++++++0x01 = 0x%x, 0x0d = 0x%x, 0x0c = 0x%x \n", e_ctrl->cal_data.mapdata[0x01], e_ctrl->cal_data.mapdata[0x0d], e_ctrl->cal_data.mapdata[0x0c]);
+               for (j = 0; j < (sizeof(module_info) / sizeof(struct module_info_t)); j++) {
+                       if (e_ctrl->cal_data.mapdata[0x01 + eeprom_basic_info_off] == module_info[j].module_num) {
+                               strlcpy(module_name, module_info[j].name, sizeof(module_info[j].name));
+                               break;
+                       }
+               }
+               CDBG("%s: module_name = %s\n", __func__, module_name);
+
+               for (j = 0; j < (sizeof(project_info) / sizeof(struct project_info_t)); j++) {
+                       if (e_ctrl->cal_data.mapdata[0x0D + eeprom_basic_info_off] == project_info[j].pro_num) {
+                               strlcpy(pro_name, project_info[j].name, sizeof(project_info[j].name));
+                               break;
+                       }
+               }
+               CDBG("%s: project_name = %s\n", __func__, pro_name);
+
+               for (j = 0; j < (sizeof(sensor_info) / sizeof(struct sensor_info_t)); j++) {
+                       if (e_ctrl->cal_data.mapdata[0x0C + eeprom_basic_info_off] == sensor_info[j].sensor_num) {
+                               if ((strcmp(pro_name, "sagit_") == 0) && (1 == pdev->id)) {
+                                       strlcpy(sensor_name, "s5k3m3", sizeof("s5k3m3"));
+                               } else {
+                                       strlcpy(sensor_name, sensor_info[j].name, sizeof(sensor_info[j].name));
+                               }
+                               break;
+                       }
+               }
+               CDBG("%s: sensor_name = %s\n", __func__, sensor_name);
+
+               for (j = 0; j < 3; j++) {
+                       if (0 == j) {
+                               strlcat(module_eeprom_name, pro_name, sizeof(pro_name));
+                       } else if (1 == j) {
+                               strlcat(module_eeprom_name, sensor_name, sizeof(sensor_name));
+                       } else {
+                               strlcat(module_eeprom_name, module_name, sizeof(module_name));
+                       }
+               }
+               CDBG("%s: module_eeprom_name = %s\n", __func__, module_eeprom_name);
+
+               if (strcmp(module_eeprom_name, eb_info->eeprom_name) != 0) {
+                       CDBG("%s: eeprom identify failed (non fatal)! qcom,eeprom-name = %s, module_eeprom_name = %s\n", __func__, eb_info->eeprom_name, module_eeprom_name);
+                       rc = -ENOMEM;
+                       goto power_down;
+               }
+#endif
+
                for (j = 0; j < e_ctrl->cal_data.num_data; j++)
                        CDBG("memory_data[%d] = 0x%X\n", j,
                                e_ctrl->cal_data.mapdata[j]);
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+               if ((strcmp(eb_info->eeprom_name, "sagit_imx386_semco") == 0) ||
+                       (strcmp(eb_info->eeprom_name, "chiron_imx386_semco") == 0)) {
+                       if (strcmp(eb_info->eeprom_name, "sagit_imx386_semco") == 0)
+                               eeprom_ois_info_off = 4910;
+                       else if (strcmp(eb_info->eeprom_name, "chiron_imx386_semco") == 0)
+                               eeprom_ois_info_off = 2095;
+                       memcpy((void *)g_cal_fadj_data, (void *)(e_ctrl->cal_data.mapdata+eeprom_ois_info_off), 43);
+                       for (j = 0; j < 43; j++)
+                               CDBG("g_cal_fadj_data[%d] = 0x%X\n", j, g_cal_fadj_data[j]);
+               }
+#endif
+
                e_ctrl->is_supported |= msm_eeprom_match_crc(&e_ctrl->cal_data);
 
                rc = msm_camera_power_down(power_info,
@@ -1760,6 +1892,13 @@ static int msm_eeprom_platform_probe(struct platform_device *pdev)
 #endif
 
        e_ctrl->is_supported = (e_ctrl->is_supported << 1) | 1;
+
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       strlcpy(sensor_eeprom_name[eeprom_name_count].name, module_eeprom_name, sizeof(module_eeprom_name));
+       pr_err("%s: sensor_eeprom_name[%d] = %s, probe success!\n", __func__, eeprom_name_count, sensor_eeprom_name[eeprom_name_count].name);
+       eeprom_name_count++;
+#endif
+
        CDBG("%s X\n", __func__);
        return rc;
 
index 5e348a8..d38fea7 100644 (file)
@@ -29,6 +29,66 @@ struct msm_eeprom_ctrl_t;
 
 #define PROPERTY_MAXSIZE 32
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+#define SEMCO 0x03
+#define LITEON 0x01
+#define SUNNY 0x15
+#define QTECH 0x06
+#define OFILM 0x07
+#define PRIMAX1 0x09
+#define PRIMAX 0x25
+
+#define IMX268 0x03
+#define DUAL_IMX386_S5K3M3 0x0B
+#define IMX386 0x0D
+#define S5K3M3 0x0F
+#define S5K4H9 0x10
+#define OV5675 0x0A
+
+#define SAGIT 0x07
+#define CENTAUR 0x08
+#define CHIRON 0x10
+
+struct module_info_t {
+       uint16_t module_num;
+       char name[16];
+};
+
+struct project_info_t {
+       uint16_t pro_num;
+       char name[16];
+};
+
+struct sensor_info_t {
+       uint16_t sensor_num;
+       char name[16];
+};
+
+struct module_info_t module_info[] = {
+       {SEMCO,  "_semco"},
+       {LITEON, "_liteon"},
+       {SUNNY,  "_sunny"},
+       {QTECH,  "_qtech"},
+       {OFILM,  "_ofilm"},
+       {PRIMAX, "_primax"},
+       {PRIMAX1, "_primax"}, /* for sagit*/
+};
+
+struct project_info_t project_info[] = {
+       {SAGIT, "sagit_"},
+       {CHIRON, "chiron_"},
+};
+
+struct sensor_info_t sensor_info[] = {
+       {IMX268, "imx268"},
+       {DUAL_IMX386_S5K3M3, "imx386"},
+       {IMX386, "imx386"},
+       {S5K3M3, "s5k3m3"},
+       {S5K4H9, "s5k4h9"},
+       {OV5675, "ov5675"},
+};
+#endif
+
 struct msm_eeprom_ctrl_t {
        struct platform_device *pdev;
        struct mutex *eeprom_mutex;
index fcef053..07e5a36 100644 (file)
 static struct msm_camera_i2c_fn_t msm_sensor_cci_func_tbl;
 static struct msm_camera_i2c_fn_t msm_sensor_secure_func_tbl;
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+static uint8_t fusion_id[16];
+static uint8_t fuse_id_len;
+#endif
+
 static void msm_sensor_adjust_mclk(struct msm_camera_power_ctrl_t *ctrl)
 {
        int idx;
@@ -324,6 +329,37 @@ static int msm_sensor_get_af_status(struct msm_sensor_ctrl_t *s_ctrl,
        return 0;
 }
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+static int msm_sensor_read_fusion_id_len(struct msm_sensor_ctrl_t *s_ctrl, void __user *argp)
+{
+       uint8_t *len = (uint8_t *)argp;
+       int rc = 0;
+
+       if (len == NULL)
+               return 0;
+
+       *len = fuse_id_len;
+
+       return rc;
+}
+
+static int msm_sensor_read_fusion_id(struct msm_sensor_ctrl_t *s_ctrl, void __user *argp)
+{
+       struct sensorb_info_fusion_id32 *data32 = (struct sensorb_info_fusion_id32 *)argp;
+       char *data = NULL;
+       int rc = 0;
+       uint32_t length = 0;
+
+       data = (char *) compat_ptr(data32->data_buffer);
+       length = fuse_id_len > sizeof(fusion_id) ? sizeof(fusion_id) : fuse_id_len;
+       rc = copy_to_user(data, (char *)fusion_id, fuse_id_len);
+       if (rc != 0)
+               pr_err("%s: copy data to userspace fail,rc = %d\n", __func__, rc);
+
+       return rc;
+}
+#endif
+
 static long msm_sensor_subdev_ioctl(struct v4l2_subdev *sd,
                        unsigned int cmd, void *arg)
 {
@@ -343,6 +379,12 @@ static long msm_sensor_subdev_ioctl(struct v4l2_subdev *sd,
 #endif
                        rc = s_ctrl->func_tbl->sensor_config(s_ctrl, argp);
                return rc;
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       case VIDIOC_MSM_READ_FUSION_ID_LEN:
+               return msm_sensor_read_fusion_id_len(s_ctrl, argp);
+       case VIDIOC_MSM_READ_FUSION_ID:
+               return msm_sensor_read_fusion_id(s_ctrl, argp);
+#endif
        case VIDIOC_MSM_SENSOR_GET_AF_STATUS:
                return msm_sensor_get_af_status(s_ctrl, argp);
        case VIDIOC_MSM_SENSOR_RELEASE:
@@ -365,6 +407,11 @@ static long msm_sensor_subdev_do_ioctl(
        struct video_device *vdev = video_devdata(file);
        struct v4l2_subdev *sd = vdev_to_v4l2_subdev(vdev);
        switch (cmd) {
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       case VIDIOC_MSM_READ_FUSION_ID32:
+               cmd = VIDIOC_MSM_READ_FUSION_ID;
+               return msm_sensor_subdev_ioctl(sd, cmd, arg);
+#endif
        case VIDIOC_MSM_SENSOR_CFG32:
                cmd = VIDIOC_MSM_SENSOR_CFG;
        default:
@@ -378,6 +425,87 @@ long msm_sensor_subdev_fops_ioctl(struct file *file,
        return video_usercopy(file, cmd, arg, msm_sensor_subdev_do_ioctl);
 }
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+int msm_sensor_get_fuseid(struct msm_sensor_ctrl_t *s_ctrl, struct msm_camera_i2c_reg_setting *conf_array)
+{
+       int rc = 0;
+       struct msm_camera_i2c_client *sensor_i2c_client;
+       uint16_t flag[1] = {0};
+       uint8_t i = 0;
+       sensor_i2c_client = s_ctrl->sensor_i2c_client;
+       sensor_i2c_client->addr_type = conf_array->addr_type;
+       CDBG("%s: sensor_name = %s, addr = 0x%x\n", __func__, s_ctrl->sensordata->sensor_name, sensor_i2c_client->cci_client->sid);
+
+       fuse_id_len = 0;
+
+       if (strnstr(s_ctrl->sensordata->sensor_name, "imx", strlen(s_ctrl->sensordata->sensor_name))) {
+               CDBG("%s: sony\n", __func__);
+               for (i = 0; i < (conf_array->size - 1); i++) {
+                       rc =  sensor_i2c_client->i2c_func_tbl->i2c_write(sensor_i2c_client, conf_array->reg_setting->reg_addr, conf_array->reg_setting->reg_data, conf_array->data_type);
+                       if (rc < 0) {
+                               pr_err("write 0x%0x fail\n", conf_array->reg_setting->reg_addr);
+                               return rc;
+                       }
+                       conf_array->reg_setting++;
+               }
+
+               rc = sensor_i2c_client->i2c_func_tbl->i2c_read(sensor_i2c_client, 0x0A01, flag, MSM_CAMERA_I2C_BYTE_DATA);
+               if (rc < 0)
+                       pr_err("read 0x0A01 fail\n");
+               if (flag[0] != 1) {
+                       CDBG("%d: flag = %d\n", __LINE__, flag[0]);
+                       msleep(20);
+               }
+
+               rc = sensor_i2c_client->i2c_func_tbl->i2c_read_seq(sensor_i2c_client, conf_array->reg_setting->reg_addr, fusion_id, 8);
+               if (rc < 0)
+                       pr_err("read data fail\n");
+
+               for (i = 0; i < 8; i++)
+                       CDBG("data_sony[%d] = 0x%x\n", i, fusion_id[i]);
+               fuse_id_len = 8;
+       } else if (strnstr(s_ctrl->sensordata->sensor_name, "s5k", strlen(s_ctrl->sensordata->sensor_name))) {
+               CDBG("%s: samsung\n", __func__);
+               for (i = 0; i < 2; i++) {
+                       rc = sensor_i2c_client->i2c_func_tbl->i2c_write(sensor_i2c_client, conf_array->reg_setting->reg_addr, conf_array->reg_setting->reg_data, conf_array->data_type);
+                       if (rc < 0) {
+                               pr_err("write 0x%0x fail\n", conf_array->reg_setting->reg_addr);
+                               return rc;
+                       }
+                       conf_array->reg_setting++;
+               }
+
+               rc = sensor_i2c_client->i2c_func_tbl->i2c_read_seq(sensor_i2c_client, conf_array->reg_setting->reg_addr, fusion_id, 6);
+               if (rc < 0)
+                       pr_err("%d: read data fail\n", __LINE__);
+               for (i = 0; i < (conf_array->size - 2); i++)
+                       CDBG("data_samsung[%d] = 0x%x\n", i, fusion_id[i]);
+               fuse_id_len = conf_array->size - 2;
+       } else if (strnstr(s_ctrl->sensordata->sensor_name, "ov", strlen(s_ctrl->sensordata->sensor_name))) {
+               pr_err("%s: OmniVision\n", __func__);
+               for (i = 0; i < conf_array->size; i++) {
+                       rc = sensor_i2c_client->i2c_func_tbl->i2c_write(sensor_i2c_client, conf_array->reg_setting->reg_addr, conf_array->reg_setting->reg_data, conf_array->data_type);
+                       if (rc < 0) {
+                               pr_err("write 0x%0x fail\n", conf_array->reg_setting->reg_addr);
+                               return rc;
+                       }
+                       conf_array->reg_setting++;
+               }
+
+               msleep(50);
+               rc =  sensor_i2c_client->i2c_func_tbl->i2c_read_seq(sensor_i2c_client, 0x7000, fusion_id, 16);
+               if (rc < 0)
+                       pr_err("%d: read data fail\n", __LINE__);
+
+               for (i = 0; i < 16; i++)
+                       CDBG("data_OmniVision[%d] = 0x%x\n", i, fusion_id[i]);
+
+               fuse_id_len = 16;
+       }
+       return rc;
+}
+#endif
+
 static int msm_sensor_config32(struct msm_sensor_ctrl_t *s_ctrl,
        void __user *argp)
 {
@@ -388,6 +516,63 @@ static int msm_sensor_config32(struct msm_sensor_ctrl_t *s_ctrl,
        CDBG("%s:%d %s cfgtype = %d\n", __func__, __LINE__,
                s_ctrl->sensordata->sensor_name, cdata->cfgtype);
        switch (cdata->cfgtype) {
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       case CFG_GET_SENSOR_FUSION_ID: {
+               struct msm_camera_i2c_reg_setting32 f_conf_array32;
+               struct msm_camera_i2c_reg_setting f_conf_array;
+               struct msm_camera_i2c_reg_array *f_reg_setting = NULL;
+
+               if (s_ctrl->sensor_state != MSM_SENSOR_POWER_UP) {
+                       pr_err("%s:%d failed: invalid state %d\n", __func__,
+                               __LINE__, s_ctrl->sensor_state);
+                       rc = -EFAULT;
+                       break;
+               }
+
+               if (copy_from_user(&f_conf_array32,
+                       (void *)compat_ptr(cdata->cfg.setting),
+                       sizeof(struct msm_camera_i2c_reg_setting32))) {
+                       pr_err("%s:%d failed\n", __func__, __LINE__);
+                       rc = -EFAULT;
+                       break;
+               }
+
+               f_conf_array.addr_type = f_conf_array32.addr_type;
+               f_conf_array.data_type = f_conf_array32.data_type;
+               f_conf_array.delay = f_conf_array32.delay;
+               f_conf_array.size = f_conf_array32.size;
+               f_conf_array.reg_setting = compat_ptr(f_conf_array32.reg_setting);
+
+               if (!f_conf_array.size ||
+                       f_conf_array.size > I2C_REG_DATA_MAX) {
+                       pr_err("%s:%d failed, size = %d\n", __func__, __LINE__, f_conf_array.size);
+                       rc = -EFAULT;
+                       break;
+               }
+
+               f_reg_setting = kzalloc(f_conf_array.size *
+                       (sizeof(struct msm_camera_i2c_reg_array)), GFP_KERNEL);
+               if (!f_reg_setting) {
+                       pr_err("%s:%d failed\n", __func__, __LINE__);
+                       rc = -ENOMEM;
+                       break;
+               }
+               if (copy_from_user(f_reg_setting,
+                       (void *)(f_conf_array.reg_setting),
+                       f_conf_array.size *
+                       sizeof(struct msm_camera_i2c_reg_array))) {
+                       pr_err("%s:%d failed\n", __func__, __LINE__);
+                       kfree(f_reg_setting);
+                       rc = -EFAULT;
+                       break;
+               }
+
+               f_conf_array.reg_setting = f_reg_setting;
+
+               rc = msm_sensor_get_fuseid(s_ctrl, &f_conf_array);
+               break;
+       }
+#endif
        case CFG_GET_SENSOR_INFO:
                memcpy(cdata->cfg.sensor_info.sensor_name,
                        s_ctrl->sensordata->sensor_name,
index 3f18073..a1726aa 100644 (file)
@@ -86,13 +86,17 @@ static int32_t msm_sensor_driver_create_i2c_v4l_subdev
        struct i2c_client *client = s_ctrl->sensor_i2c_client->client;
 
        CDBG("%s %s I2c probe succeeded\n", __func__, client->name);
+#ifndef CONFIG_MACH_XIAOMI_MSM8998
        if (s_ctrl->bypass_video_node_creation == 0) {
+#endif
                rc = camera_init_v4l2(&client->dev, &session_id);
                if (rc < 0) {
                        pr_err("failed: camera_init_i2c_v4l2 rc %d", rc);
                        return rc;
                }
+#ifndef CONFIG_MACH_XIAOMI_MSM8998
        }
+#endif
 
        CDBG("%s rc %d session_id %d\n", __func__, rc, session_id);
        snprintf(s_ctrl->msm_sd.sd.name,
@@ -130,13 +134,17 @@ static int32_t msm_sensor_driver_create_v4l_subdev
        int32_t rc = 0;
        uint32_t session_id = 0;
 
+#ifndef CONFIG_MACH_XIAOMI_MSM8998
        if (s_ctrl->bypass_video_node_creation == 0) {
+#endif
                rc = camera_init_v4l2(&s_ctrl->pdev->dev, &session_id);
                if (rc < 0) {
                        pr_err("failed: camera_init_v4l2 rc %d", rc);
                        return rc;
                }
+#ifndef CONFIG_MACH_XIAOMI_MSM8998
        }
+#endif
 
        CDBG("rc %d session_id %d", rc, session_id);
        s_ctrl->sensordata->sensor_info->session_id = session_id;
@@ -741,6 +749,14 @@ static int32_t msm_sensor_driver_is_special_support(
        return rc;
 }
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+/* compatible eeprom map for sagit P3 & P2 */
+extern int get_back_sensor_module_invalid(void);
+
+extern void get_eeprom_name(uint8_t index, char *name);
+extern uint8_t eeprom_name_count;
+#endif
+
 /* static function definition */
 int32_t msm_sensor_driver_probe(void *setting,
        struct msm_sensor_info_t *probed_info, char *entity_name)
@@ -754,6 +770,11 @@ int32_t msm_sensor_driver_probe(void *setting,
        unsigned long                        mount_pos = 0;
        uint32_t                             is_yuv;
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       uint8_t i = 0;
+       char eeprom_name[64];
+#endif
+
        /* Validate input parameters */
        if (!setting) {
                pr_err("failed: slave_info %pK", setting);
@@ -834,6 +855,22 @@ int32_t msm_sensor_driver_probe(void *setting,
                }
        }
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       if (strcmp(slave_info->eeprom_name, "") != 0) {
+               for (i = 0; i < eeprom_name_count; i++) {
+                       get_eeprom_name(i, eeprom_name);
+                       if (strcmp(slave_info->eeprom_name, eeprom_name) != 0) {
+                               CDBG("%s: sensor_eeprom_name %d = %s, sensor_name = %s! can't probe!\n", __func__, i, eeprom_name, slave_info->eeprom_name);
+                               if ((eeprom_name_count - 1) == i) {
+                                       goto free_slave_info;
+                               }
+                       } else {
+                               CDBG("%s: sensor_eeprom_name %d = %s\n", __func__, i, eeprom_name);
+                               break;
+                       }
+               }
+       }
+#else
        if (strlen(slave_info->sensor_name) >= MAX_SENSOR_NAME ||
                strlen(slave_info->eeprom_name) >= MAX_SENSOR_NAME ||
                strlen(slave_info->actuator_name) >= MAX_SENSOR_NAME ||
@@ -848,6 +885,7 @@ int32_t msm_sensor_driver_probe(void *setting,
                rc = -EINVAL;
                goto free_slave_info;
        }
+#endif
 
        /* Print slave info */
        CDBG("camera id %d Slave addr 0x%X addr_type %d\n",
@@ -885,6 +923,18 @@ int32_t msm_sensor_driver_probe(void *setting,
 
        CDBG("s_ctrl[%d] %pK", slave_info->camera_id, s_ctrl);
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       /* compatible eeprom map for sagit P3 & P2 */
+       if (slave_info->camera_id == 1) {
+               rc = get_back_sensor_module_invalid();
+               pr_err("rc = %d invalid back module \n", rc);
+
+               if (rc == 0) {
+                       goto  free_camera_info;
+               }
+       }
+#endif
+
        if (s_ctrl->sensordata->special_support_size > 0) {
                if (!msm_sensor_driver_is_special_support(s_ctrl,
                        slave_info->sensor_name)) {
@@ -1110,6 +1160,11 @@ free_slave_info:
        return rc;
 }
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+bool SENSOR_SUPPORT_OIS_FLAG;
+EXPORT_SYMBOL(SENSOR_SUPPORT_OIS_FLAG);
+#endif
+
 static int32_t msm_sensor_driver_get_dt_data(struct msm_sensor_ctrl_t *s_ctrl)
 {
        int32_t                              rc = 0, i = 0;
@@ -1117,6 +1172,10 @@ static int32_t msm_sensor_driver_get_dt_data(struct msm_sensor_ctrl_t *s_ctrl)
        struct device_node                  *of_node = s_ctrl->of_node;
        uint32_t        cell_id;
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       struct device_node *ois_src_node = NULL;
+#endif
+
        s_ctrl->sensordata = kzalloc(sizeof(*sensordata), GFP_KERNEL);
        if (!s_ctrl->sensordata) {
                pr_err("failed: no memory");
@@ -1150,6 +1209,22 @@ static int32_t msm_sensor_driver_get_dt_data(struct msm_sensor_ctrl_t *s_ctrl)
                goto FREE_SENSOR_DATA;
        }
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       /* check whether support ois*/
+       ois_src_node = of_parse_phandle(of_node, "qcom,ois-src", 0);
+       if (cell_id == 0) {
+               if (!ois_src_node) {
+                       pr_err("failes: no ois node, maybe didn't support ois SENSOR_SUPPORT_OIS_FLAG false\n");
+                       SENSOR_SUPPORT_OIS_FLAG = false;
+               } else {
+                       pr_err("OIS SENSOR_SUPPORT_OIS_FLAG true");
+                       SENSOR_SUPPORT_OIS_FLAG = true;
+                       of_node_put(ois_src_node);
+                       ois_src_node = NULL;
+               }
+       }
+#endif
+
        sensordata->special_support_size =
                of_property_count_strings(of_node,
                                 "qcom,special-support-sensors");
index 7e36660..2b4531a 100644 (file)
@@ -42,7 +42,12 @@ static const struct v4l2_subdev_internal_ops msm_sensor_init_internal_ops;
 static int msm_sensor_wait_for_probe_done(struct msm_sensor_init_t *s_init)
 {
        int rc;
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       int tm = 60000;
+#else
        int tm = 20000;
+#endif
+
        if (s_init->module_init_status == 1) {
                CDBG("msm_cam_get_module_init_status -2\n");
                return 0;
diff --git a/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_coef.h b/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_coef.h
new file mode 100644 (file)
index 0000000..144f738
--- /dev/null
@@ -0,0 +1,498 @@
+/***********************************************************************
+* File Name   : OIS_coef.h
+* Function    : Header file for Coefficient table
+* Rule        : Use TAB 4
+*
+* Copyright(c) Rohm Co.,Ltd. All rights reserved
+* Copyright (C) 2018 XiaoMi, Inc.
+************************************************************************/
+/***** ROHM Confidential ***************************************************/
+#ifndef OIS_COEF_H
+#define OIS_COEF_H
+
+const OIS_UBYTE DOWNLOAD_COEF[] = { /* DOWNLOAD_169_SEMCO_ICM20690_010_SEMCO_Xiaomi_C1.mem */
+       0xef,
+       0x00,
+       0x00,
+       0x00,
+       0x20,
+       0x00,
+       0x18,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xab,
+       0x0a,
+       0x00,
+       0x40,
+       0x00,
+       0x40,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x80,
+       0x00,
+       0x00,
+       0x9b,
+       0x82,
+       0xae,
+       0x7e,
+       0xa7,
+       0x00,
+       0xff,
+       0x7f,
+       0xff,
+       0x7f,
+       0xff,
+       0x7f,
+       0x7f,
+       0x7f,
+       0x7e,
+       0x7e,
+       0xfc,
+       0x7c,
+       0xf2,
+       0x72,
+       0x5e,
+       0x5e,
+       0xec,
+       0x6c,
+       0x5b,
+       0x5b,
+       0x56,
+       0x56,
+       0x3f,
+       0x3f,
+       0xb0,
+       0x30,
+       0x9b,
+       0x1b,
+       0xa5,
+       0x25,
+       0x3f,
+       0x3f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x39,
+       0x00,
+       0xf8,
+       0x05,
+       0x1b,
+       0x00,
+       0x20,
+       0x00,
+       0xc4,
+       0x00,
+       0x1f,
+       0x89,
+       0x41,
+       0x00,
+       0x7f,
+       0xff,
+       0x7f,
+       0xd5,
+       0x09,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xb0,
+       0x00,
+       0x70,
+       0xe0,
+       0x7f,
+       0x52,
+       0x09,
+       0x00,
+       0x00,
+       0xe0,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x0a,
+       0xff,
+       0x7f,
+       0x00,
+       0x2f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x20,
+       0xff,
+       0x7f,
+       0x00,
+       0x4c,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x01,
+       0x00,
+       0x03,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x00,
+       0x30,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x60,
+       0x00,
+       0x20,
+       0x00,
+       0x00,
+       0x10,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x60,
+       0x00,
+       0x20,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x80,
+       0x1b,
+       0x1c,
+       0x5a,
+       0x04,
+       0xc4,
+       0x20,
+       0xad,
+       0xf0,
+       0x00,
+       0x10,
+       0x10,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x02,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x7a,
+       0x56,
+       0x00,
+       0x00,
+       0x00,
+       0x40,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x0e,
+       0x01,
+       0x00,
+       0x01,
+       0x00,
+       0x00,
+       0x00,
+       0x08,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x39,
+       0x00,
+       0xf6,
+       0x05,
+       0x1b,
+       0x00,
+       0x20,
+       0x00,
+       0xc4,
+       0x00,
+       0x1f,
+       0x89,
+       0x41,
+       0x00,
+       0x7f,
+       0xff,
+       0x7f,
+       0xd5,
+       0x09,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xb0,
+       0x00,
+       0x70,
+       0xe0,
+       0x7f,
+       0x52,
+       0x09,
+       0x00,
+       0x00,
+       0xe0,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x0a,
+       0xff,
+       0x7f,
+       0x00,
+       0x30,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x20,
+       0xff,
+       0x7f,
+       0x00,
+       0x4c,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x01,
+       0x00,
+       0x03,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x30,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x60,
+       0x00,
+       0x20,
+       0x00,
+       0x00,
+       0x10,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x60,
+       0x00,
+       0x20,
+};
+
+const OIS_UWORD DOWNLOAD_COEF_LEN = sizeof(DOWNLOAD_COEF);
+#endif /* OIS_COEF_H */
diff --git a/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_coef_chiron.h b/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_coef_chiron.h
new file mode 100644 (file)
index 0000000..87e3306
--- /dev/null
@@ -0,0 +1,497 @@
+/* File Name   : OIS_coef.h
+               Function                : Header file for Coefficient table
+               Rule         : Use TAB 4
+
+               Copyright(c)    Rohm Co.,Ltd. All rights reserved
+*/
+/***** ROHM Confidential ***************************************************/
+#ifndef OIS_COEF_H
+#define OIS_COEF_H
+
+const  OIS_UBYTE       DOWNLOAD_COEF[] = {     /* DOWNLOAD_165_SEMCO_ICM20690_011_SEMCO_Xiaomi_D3.mem*/
+       0xef,
+       0x00,
+       0x00,
+       0x00,
+       0x20,
+       0x00,
+       0x18,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xab,
+       0x0a,
+       0x00,
+       0x40,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x80,
+       0x00,
+       0x00,
+       0x9b,
+       0x82,
+       0xae,
+       0x7e,
+       0xa7,
+       0x00,
+       0xff,
+       0x7f,
+       0xff,
+       0x7f,
+       0xff,
+       0x7f,
+       0x7f,
+       0x7f,
+       0x7e,
+       0x7e,
+       0xfc,
+       0x7c,
+       0xf2,
+       0x72,
+       0x5e,
+       0x5e,
+       0xec,
+       0x6c,
+       0x5b,
+       0x5b,
+       0x56,
+       0x56,
+       0x3f,
+       0x3f,
+       0xb0,
+       0x30,
+       0x9b,
+       0x1b,
+       0xa5,
+       0x25,
+       0x3f,
+       0x3f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x0e,
+       0x00,
+       0x35,
+       0x00,
+       0xf3,
+       0x05,
+       0x1b,
+       0x00,
+       0x20,
+       0x00,
+       0x8c,
+       0x00,
+       0x40,
+       0x89,
+       0x41,
+       0x00,
+       0x7f,
+       0xff,
+       0x7f,
+       0xd5,
+       0x09,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xa4,
+       0x00,
+       0x7c,
+       0xe0,
+       0x7f,
+       0x52,
+       0x09,
+       0x00,
+       0x00,
+       0xe0,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0xc8,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x4c,
+       0x8a,
+       0x00,
+       0x7f,
+       0xff,
+       0x7f,
+       0xc5,
+       0x6a,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x80,
+       0xff,
+       0x7f,
+       0x00,
+       0x20,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x80,
+       0x00,
+       0x00,
+       0x01,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x00,
+       0x30,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x60,
+       0x00,
+       0x20,
+       0x00,
+       0x00,
+       0x10,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x60,
+       0x00,
+       0x20,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x80,
+       0xff,
+       0x7f,
+       0x1c,
+       0x1b,
+       0x5a,
+       0x04,
+       0xc4,
+       0x20,
+       0xfd,
+       0xf0,
+       0x00,
+       0x10,
+       0x10,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x02,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xcc,
+       0x59,
+       0x00,
+       0x00,
+       0x00,
+       0x40,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x0e,
+       0x01,
+       0x00,
+       0x01,
+       0x00,
+       0x00,
+       0x00,
+       0x08,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x0e,
+       0x00,
+       0x35,
+       0x00,
+       0xf3,
+       0x05,
+       0x1b,
+       0x00,
+       0x20,
+       0x00,
+       0x8c,
+       0x00,
+       0x40,
+       0x89,
+       0x41,
+       0x00,
+       0x7f,
+       0xff,
+       0x7f,
+       0xd5,
+       0x09,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xa3,
+       0x00,
+       0x7d,
+       0xe0,
+       0x7f,
+       0x52,
+       0x09,
+       0x00,
+       0x00,
+       0xe0,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0xc8,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xcc,
+       0x8c,
+       0x00,
+       0x7f,
+       0xff,
+       0x7f,
+       0xd2,
+       0x65,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x80,
+       0xff,
+       0x7f,
+       0x00,
+       0x20,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x80,
+       0x00,
+       0x00,
+       0x01,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x30,
+       0xff,
+       0x7f,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x60,
+       0x00,
+       0x20,
+       0x00,
+       0x00,
+       0x10,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0xff,
+       0x7f,
+       0x00,
+       0x60,
+       0x00,
+       0x20
+};
+
+
+const  OIS_UWORD       DOWNLOAD_COEF_LEN = sizeof(DOWNLOAD_COEF);
+#endif
diff --git a/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_defi.h b/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_defi.h
new file mode 100644 (file)
index 0000000..6885851
--- /dev/null
@@ -0,0 +1,1156 @@
+/***************************************************************************
+* File Name   : OIS_defi.h
+* Function    : Header file for OIS controller
+* Rule        : Use TAB 4
+*
+* Copyright(c) Rohm Co.,Ltd. All rights reserved
+* Copyright (C) 2018 XiaoMi, Inc.
+****************************************************************************/
+/***** ROHM Confidential ***************************************************/
+
+#ifndef OIS_DEFINITION_H
+#define OIS_DEFINITION_H
+
+#ifdef OIS_MAIN_C
+#define        EXT
+#else
+#define        EXT extern
+#endif
+
+/*=================================================================*/
+/*Common*/
+/*=================================================================*/
+#define __ON_          1
+#define _OFF_          0
+#define __IN_          1
+#define _MON_          2
+#define _PWM32__       3
+#define _PWM3_1_       4
+#define _PWM3__0       5
+#define _PWM_21_       6
+#define _PWM_2_0       7
+#define _PWM__10       8
+#define _PRN_          4
+#define _m_RSP         1
+#define _m_CLK_GEN     2
+#define _m_CLK_TRI     3
+#define _m_I2C_SLV     4
+#define _m_SPI_MAS     5
+#define _m_PWM_CNT     6
+#define _m_ADA_WRP     7
+#define _m_EXT_SIG     8
+
+#define _HIGH_         1
+#define __LOW_         0
+
+#define _FOCUS_                1
+#define _ZOOM__                0
+
+#define _FACTORY_      1
+#define _NORMADJ_      2
+#define _NORMAL__      0
+
+#define _NOT_READY     0
+
+/*=================================================================*/
+/*PIC uP port assign*/
+/*=================================================================*/
+#define _PIO_O_L_      0
+#define _PIO_O_H_      1
+#define _PIO_INP_      2
+
+#define _PIC_RB_0_     0x00
+#define _PIC_RB_1_     0x01
+#define _PIC_RB_2_     0x02
+#define _PIC_RB_3_     0x03
+#define _PIC_RB_4_     0x04
+#define _PIC_RB_5_     0x05
+#define _PIC_RB_6_     0x06
+#define _PIC_RB_7_     0x07
+#define _PIC_RB_8_     0x08
+#define _PIC_RB_9_     0x09
+#define _PIC_RB_A_     0x0A
+#define _PIC_RB_B_     0x0B
+#define _PIC_RB_C_     0x0C
+#define _PIC_RB_D_     0x0D
+#define _PIC_RB_E_     0x0E
+#define _PIC_RB_F_     0x0F
+
+#define _PIC_RC_0_     0x10
+#define _PIC_RC_1_     0x11
+#define _PIC_RC_2_     0x12
+#define _PIC_RC_3_     0x13
+#define _PIC_RC_4_     0x14
+#define _PIC_RC_5_     0x15
+#define _PIC_RC_6_     0x16
+#define _PIC_RC_7_     0x17
+#define _PIC_RC_8_     0x18
+#define _PIC_RC_9_     0x19
+#define _PIC_RC_A_     0x1A
+#define _PIC_RC_B_     0x1B
+#define _PIC_RC_C_     0x1C
+#define _PIC_RC_D_     0x1D
+#define _PIC_RC_E_     0x1E
+#define _PIC_RC_F_     0x1F
+
+#define _PIC_RD_0_     0x20
+#define _PIC_RD_1_     0x21
+#define _PIC_RD_2_     0x22
+#define _PIC_RD_3_     0x23
+#define _PIC_RD_4_     0x24
+#define _PIC_RD_5_     0x25
+#define _PIC_RD_6_     0x26
+#define _PIC_RD_7_     0x27
+#define _PIC_RD_8_     0x28
+#define _PIC_RD_9_     0x29
+#define _PIC_RD_A_     0x2A
+#define _PIC_RD_B_     0x2B
+#define _PIC_RD_C_     0x2C
+#define _PIC_RD_D_     0x2D
+#define _PIC_RD_E_     0x2E
+#define _PIC_RD_F_     0x2F
+
+#define _PIC_RE_0_     0x30
+#define _PIC_RE_1_     0x31
+#define _PIC_RE_2_     0x32
+#define _PIC_RE_3_     0x33
+#define _PIC_RE_4_     0x34
+#define _PIC_RE_5_     0x35
+#define _PIC_RE_6_     0x36
+#define _PIC_RE_7_     0x37
+#define _PIC_RE_8_     0x38
+#define _PIC_RE_9_     0x39
+#define _PIC_RE_A_     0x3A
+#define _PIC_RE_B_     0x3B
+#define _PIC_RE_C_     0x3C
+#define _PIC_RE_D_     0x3D
+#define _PIC_RE_E_     0x3E
+#define _PIC_RE_F_     0x3F
+
+#define _PIC_RF_0_     0x40
+#define _PIC_RF_1_     0x41
+#define _PIC_RF_2_     0x42
+#define _PIC_RF_3_     0x43
+#define _PIC_RF_4_     0x44
+#define _PIC_RF_5_     0x45
+#define _PIC_RF_6_     0x46
+#define _PIC_RF_7_     0x47
+#define _PIC_RF_8_     0x48
+#define _PIC_RF_9_     0x49
+#define _PIC_RF_A_     0x4A
+#define _PIC_RF_B_     0x4B
+#define _PIC_RF_C_     0x4C
+#define _PIC_RF_D_     0x4D
+#define _PIC_RF_E_     0x4E
+#define _PIC_RF_F_     0x4F
+
+#define _PIC_RG_6_     0x56
+
+#define _PIC_AD_0_     8
+#define _PIC_AD_1_     9
+#define _PIC_AD_2_     10
+#define _PIC_AD_3_     11
+#define _PIC_AD_4_     12
+#define _PIC_AD_5_     13
+#define _PIC_AD_6_     14
+
+/* _picsig_PS_POL = _PIC_RB_8_ */
+
+#define _picsig_PS____ _PIC_RE_5_
+#define _picsig_TRIG__ _PIC_RE_4_
+#define _picsig_AF____ _PIC_RC_E_
+
+/* _picsig_Shutr_ = _PIC_RD_1_ */
+
+#define _picsig_FPGAcs _PIC_RB_6_
+#if 0
+ _picsig_CRNR_0 = _PIC_RD_2_
+ _picsig_CRNR_1 = _PIC_RD_1_
+ _picsig_CRNR_2 = _PIC_RC_E_
+ _picsig_CRNR_3 = _PIC_RC_D_
+#endif
+/*=================================================================*/
+/*OIS controller assign*/
+/*=================================================================*/
+/* Slave Address */
+#define _SLV_OIS_      0x0E
+
+/* Packet Command OP code */
+#define _OP_FIRM_DWNLD 0x80
+#define _OP_Periphe_RW 0x82
+#define _OP_Memory__RW 0x84
+#define _OP_AD_TRNSFER 0x86
+#define _OP_COEF_DWNLD 0x88
+#define _OP_PrgMem__RD 0x8A
+#define _OP_SpecialCMD 0x8C
+
+#define _cmd_8C_EI     0x0001
+#define _cmd_8C_DI     0x0002
+#define _cmd_8C_STRB   0x0004
+#define _cmd_8C_TRI_SHT        0x0008
+#define _cmd_8C_TRI_con        0x0010
+
+#define _OP_FX_Cmnd_0  0xF0
+#define _OP_FX_Cmnd_1  0xF1
+#define _OP_FX_Cmnd_2  0xF2
+#define _OP_FX_Cmnd_3  0xF3
+#define _OP_FX_Cmnd_8  0xF8
+#define _OP_FX_Cmnd_A  0xFA
+
+/* Peripheral Adr Mapping */
+#define _P_00_CLK_CONTRL       0x00
+#define _P_01_CLK_PWMCNT       0x01
+#define _P_02_CLK_TMRCNT       0x02
+#define _P_03_CLK_DWNSMP       0x03
+#define _P_04_CLK_CALDIV       0x04
+#define _P_05_CLK_CLKSEL       0x05
+#define _P_06_CLK_MONITR       0x06
+/* _P_07) */
+#define _P_08_TRI_CNTRL_       0x08
+#define _P_09_TRI_TARGET       0x09
+#define _P_0A_TRI_PHSCNT       0x0A
+#if 0
+_P_0B)
+_P_0C)
+_P_0D)
+_P_0E)
+_P_0F)
+#endif
+#define _P_10_I2C_SLVADR       0x10
+#define _P_11_I2C__DATA_       0x11
+#define _P_12_I2C_STSADR       0x12
+#define _P_13_I2C_MONSEL       0x13
+#define _P_14_I2C_OFSREG       0x14
+#if 0
+
+
+
+#endif
+#define _P_18_SPI_TRSNUM       0x18
+#define _P_19_SPI_CONTRL       0x19
+
+/* _P_1A_SPI_D_000H = 0x1A */
+
+#define _P_1A_SPI_D_HHHL       0x1B
+#define _P_1B_SPI_D_LHLL       0x1C
+#if 0
+
+
+
+
+
+#endif
+#define _P_20_MSC_MONCTL1      0x20
+#define _P_21_MSC_MONCTL2      0x21
+#define _P_22_MSC_PORTCTL      0x22
+#define _P_23_MSC_PORTSTS      0x23
+#define _P_24_MSC_PWMREGA      0x24
+#define _P_25_MSC_PWMREGB      0x25
+#define _P_26_MSC_SIGMON       0x26
+/*  _P_27) */
+#define _P_28_PWM_ENB_SR       0x28
+#define _P_29_PWM_FRQSEL       0x29
+#define _P_2A_PWM_SFT_YX       0x2A
+#define _P_2B_PWM_SFT__Z       0x2B
+#define _P_2C_PWM_ChX_DAT      0x2C
+#define _P_2D_PWM_ChY_DAT      0x2D
+#define _P_2E_PWM_ChZ_DAT      0x2E
+#define _P_2F_PWM_SMPLSFT      0x2F
+
+#define _P_30_ADC_CH0  0x30
+#define _P_31_ADC_CH1  0x31
+#define _P_32_ADC_CH2  0x32
+#define _P_33_ADC_CH3  0x33
+#define _P_34_ADC_CH4  0x34
+#define _P_35_ADC_CH5  0x35
+#define _P_36_ADC_CH6  0x36
+#define _P_37_ADC_CH7  0x37
+#define _P_38_Ch3_VAL_0        0x38
+#define _P_39_Ch3_VAL_1        0x39
+#define _P_3A_Ch3_VAL_2        0x3A
+#define _P_3B_Ch3_VAL_3        0x3B
+#define _P_3C_ADC_GAIN 0x3C
+#define _P_3D_ADC_CTL  0x3D
+#if 0
+
+
+#endif
+#define _P_40_OUT_CH   0x40
+#define _P_41_OUT_CTL  0x41
+#define _P_42_OUT_DAC  0x42
+#define _P_43_OUT_SW   0x43
+#if 0
+
+
+
+
+#endif
+#define _P_48_TOP_00   0x48
+#if 0
+
+
+
+
+
+
+
+#endif
+#define _P_50_TST_TSTCMD       0x50
+#define _P_51_TST_AF_SLP       0x51
+#define _P_52_TST_AF_OFS       0x52
+#define _P_53_TST_SH_SLP       0x53
+#define _P_54_TST_OSC___       0x54
+#define _P_55_TST_VREF__       0x55
+#define _P_56_TST_MUXCRN       0x56
+#define _P_57_TST_TSADAC       0x57
+#define _P_58_TST_FIXHBR       0x58
+#define _P_59_TST_SMPPWR       0x59
+#define _P_5A_TST_MPXFIX       0x5A
+#if 0
+
+
+
+
+#endif
+#define _P_5F_TST_INFVER       0x5F
+
+#define _P_F0_I2CnSTR  0xF0
+#define _P_F1_I2CnSTR  0xF1
+#define _P_F2_I2CnSTR  0xF2
+#define _P_F3_I2CnSTR  0xF3
+
+/* Memory Adr Mapping */
+#define _M_Kgx01       0x00
+#define _M_Kgx02       0x01
+#define _M_Kgx03       0x02
+#define _M_Kgx04       0x03
+#define _M_wDgx00      0x04
+#define _M_X_HPF0      0x05
+#define _M_Kgx00       0x06
+#define _M_wDgxof      0x07
+#define _M_Kgx05       0x08
+#define _M_Kgx06       0x09
+#define _M_Kgx07       0x0A
+#define _M_Kgx08       0x0B
+#define _M_wDgx01      0x0C
+#define _M_X_HPF1      0x0D
+#define _M_KgxWv       0x0E
+#define _M_KgxG                0x0F
+#define _M_Kgx09       0x10
+#define _M_Kgx0A       0x11
+#define _M_Kgx0B       0x12
+#define _M_Kgx0C       0x13
+#define _M_wDgx02      0x14
+#define _M_X_HPF2      0x15
+#define _M_wDgx04      0x16
+#define _M_X_TRGT      0x17
+#define _M_Kgx0D       0x18
+#define _M_Kgx0E       0x19
+#define _M_Kgx0F       0x1A
+#define _M_Kgx10       0x1B
+#define _M_wDgx03      0x1C
+#define _M_X_HPF3      0x1D
+#define _M_X_H_ofs     0x1E
+#define _M_X_wGIN      0x1F
+#define _M_Kgx1F       0x20
+#define _M_Kgx20       0x21
+#define _M_Kgx21       0x22
+#define _M_Kgx22       0x23
+#define _M_wDgx0B      0x24
+#define _M_wDgx_EQL1   0x25
+#define _M_X_wGOU      0x26
+#define _M_wDgx09      0x27
+#define _M_Kgx1B       0x28
+#define _M_Kgx1C       0x29
+#define _M_Kgx1D       0x2A
+#define _M_Kgx1E       0x2B
+#define _M_wDgx0A      0x2C
+#define _M_wDgx_EQH    0x2D
+#define _M_X_wGAS      0x2E
+#define _M_X_GYIN      0x2F
+#define _M_Kgx23       0x30
+#define _M_Kgx24       0x31
+#define _M_Kgx25       0x32
+#define _M_Kgx26       0x33
+#define _M_wDgx0C      0x34
+#define _M_wDgx_EQL    0x35
+#define _M_Kgxdr       0x36
+#define _M_X_axofs     0x37
+#define _M_Kgx11       0x38
+#define _M_Kgx12       0x39
+#define _M_Kgx13       0x3A
+#define _M_Kgx14       0x3B
+#define _M_Kgx15       0x3C
+#define _M_wDgx05      0x3D
+#define _M_wDgx06      0x3E
+#define _M_X_H_Lmt     0x3F
+#define _M_X_LMT       0x40
+#define _M_X_LMO       0x41
+#define _M_X_DRP       0x42
+#define _M_X_TGT       0x43
+#define _M_Kgx19       0x44
+#define _M_Kgx1A       0x45
+#define _M_KgxHG       0x46
+#define _M_KgxTG       0x47
+#define _M_Kgx01t      0x48
+#define _M_Kgx02t      0x49
+#define _M_Kgx03t      0x4A
+#define _M_Kgx04t      0x4B
+#define _M_Kgx05t      0x4C
+#define _M_wDgx01t     0x4D
+#define _M_wDgx02t     0x4E
+#define _M_wDgx_EQ     0x4F
+#if 0
+#define _M_rsv 0x50
+#define _M_rsv 0x51
+#define _M_rsv 0x52
+#define _M_rsv 0x53
+#define _M_rsv 0x54
+#endif
+#define _M_DigGx       0x55
+#define _M_DigGy       0x56
+#define _M_CURIN       0x57
+#if 0
+#define _M_rsv 0x58
+#define _M_rsv 0x59
+#define _M_rsv 0x5A
+#define _M_rsv 0x5B
+#endif
+#define _M_wDf00       0x5C
+#define _M_FOTRIM      0x5D
+#define _M_CUROFS      0x5E
+#define _M_Kf0A                0x5F
+#define _M_wCRFED      0x60
+#define _M_wFTRGT      0x61
+#define _M_wFSUB       0x62
+/* #define _M_rsv      0x63 */
+#define _M_Kf0C                0x64
+#define _M_wDf03       0x65
+#define _M_rsv         0x66
+#define _M_CUROFO      0x67
+#define _M_Kf00                0x68
+#define _M_Kf01                0x69
+#define _M_TMP_X_      0x6A  /* RHM_HT 2013/11/25 Modified */
+#define _M_TMP_Y_      0x6B  /* RHM_HT 2013/11/25 Modified */
+#define _M_wDf01       0x6C
+#define _M_AFLPF       0x6D
+#if 0
+#define _M_rsv 0x6E
+#define _M_rsv 0x6F
+#endif
+#define _M_KgxH0       0x70  /* RHM_HT 2013/11/25 Modified */
+#define _M_X_PEO       0x71
+#define _M_KgyH0       0x72
+#define _M_Y_PEO       0x73
+#define _M_FOC_CNTRL   0x74
+/* #define _M_rsv      0x75 */
+#define _M_CEFTYP      0x76
+#define _M_GYRSNS      0x77
+#define _M_SHDAC0      0x78
+#define _M_SHDAC1      0x79
+#define _M_Ksh0                0x7A
+#define _M_Ksh1                0x7B
+#define _M_mon0                0x7C
+#define _M_mon1                0x7D
+#define _M_GLBFLG      0x7E
+#define _M_EQCTL       0x7F
+#define _M_Kgy01       0x80
+#define _M_Kgy02       0x81
+#define _M_Kgy03       0x82
+#define _M_Kgy04       0x83
+#define _M_wDgy00      0x84
+#define _M_Y_HPF0      0x85
+#define _M_Kgy00       0x86
+#define _M_wDgyof      0x87
+#define _M_Kgy05       0x88
+#define _M_Kgy06       0x89
+#define _M_Kgy07       0x8A
+#define _M_Kgy08       0x8B
+#define _M_wDgy01      0x8C
+#define _M_Y_HPF1      0x8D
+#define _M_KgyWv       0x8E
+#define _M_KgyG                0x8F
+#define _M_Kgy09       0x90
+#define _M_Kgy0A       0x91
+#define _M_Kgy0B       0x92
+#define _M_Kgy0C       0x93
+#define _M_wDgy02      0x94
+#define _M_Y_HPF2      0x95
+#define _M_wDgy04      0x96
+#define _M_Y_TRGT      0x97
+#define _M_Kgy0D       0x98
+#define _M_Kgy0E       0x99
+#define _M_Kgy0F       0x9A
+#define _M_Kgy10       0x9B
+#define _M_wDgy03      0x9C
+#define _M_Y_HPF3      0x9D
+#define _M_Y_H_ofs     0x9E
+#define _M_Y_wGIN      0x9F
+#define _M_Kgy1F       0xA0
+#define _M_Kgy20       0xA1
+#define _M_Kgy21       0xA2
+#define _M_Kgy22       0xA3
+#define _M_wDgy0B      0xA4
+#define _M_wDgy_EQL1   0xA5
+#define _M_Y_wGOU      0xA6
+#define _M_wDgy09      0xA7
+#define _M_Kgy1B       0xA8
+#define _M_Kgy1C       0xA9
+#define _M_Kgy1D       0xAA
+#define _M_Kgy1E       0xAB
+#define _M_wDgy0A      0xAC
+#define _M_wDgy_EQH    0xAD
+#define _M_Y_wGAS      0xAE
+#define _M_Y_GYIN      0xAF
+#define _M_Kgy23       0xB0
+#define _M_Kgy24       0xB1
+#define _M_Kgy25       0xB2
+#define _M_Kgy26       0xB3
+#define _M_wDgy0C      0xB4
+#define _M_wDgy_EQL    0xB5
+#define _M_Kgydr       0xB6
+#define _M_Y_axofs     0xB7
+#define _M_Kgy11       0xB8
+#define _M_Kgy12       0xB9
+#define _M_Kgy13       0xBA
+#define _M_Kgy14       0xBB
+#define _M_Kgy15       0xBC
+#define _M_wDgy05      0xBD
+#define _M_wDgy06      0xBE
+#define _M_Y_H_Lmt     0xBF
+#define _M_Y_LMT       0xC0
+#define _M_Y_LMO       0xC1
+#define _M_Y_DRP       0xC2
+#define _M_Y_TGT       0xC3
+#define _M_Kgy19       0xC4
+#define _M_Kgy1A       0xC5
+#define _M_KgyHG       0xC6
+#define _M_KgyTG       0xC7
+#define _M_Kgy01t      0xC8
+#define _M_Kgy02t      0xC9
+#define _M_Kgy03t      0xCA
+#define _M_Kgy04t      0xCB
+#define _M_Kgy05t      0xCC
+#define _M_wDgy01t     0xCD
+#define _M_wDgy02t     0xCE
+#define _M_wDgy_EQ     0xCF
+#define _M_ISRC0       0xD0
+#define _M_ISRC1       0xD1
+#define _M_ISRC2       0xD2
+#define _M_ISRC3       0xD3
+#define _M_ISRC4       0xD4
+#define _M_ISRC5       0xD5
+#define _M_ISRC6       0xD6
+#define _M_ISRC7       0xD7
+#define _M_ISRC8       0xD8
+#define _M_ISRC9       0xD9
+#define _M_ISRCA       0xDA
+#define _M_ISRCB       0xDB
+#define _M_ISRCC       0xDC
+#define _M_ISRCD       0xDD
+#define _M_ISRCE       0xDE
+#define _M_ISRCF       0xDF
+#define _M_Kgy16       0xE0
+#define _M_Kgy17       0xE1
+#define _M_Kgy18       0xE2
+#define _M_0x0000      0xE3
+#define _M_0x8000      0xE4
+#define _M_wDgy07      0xE5
+#define _M_wDgy08      0xE6
+#define _M_VMTRGT      0xE7
+#define _M_Kv00                0xE8
+#define _M_Kv01                0xE9
+#define _M_Kv02                0xEA
+#define _M_Kv03                0xEB
+#define _M_wDv00       0xEC
+#define _M_VMLPF       0xED
+#define _M_wDv01       0xEE
+#define _M_Kv04                0xEF
+#define _M_SHND_sts    0xF0
+#define _M_SHND_tim_org        0xF1
+#define _M_SHND_tim    0xF2
+#define _M_SHND_CWCCW  0xF3
+#define _M_BPFOUT      0xF4
+#define _M_BPFMON      0xF5
+#define _M_FIRMVER     0xF6
+#define _M_OIS_STS     0xF7
+
+#define _def_OIS____________BOOT       0x00
+#define _def_OIS__while_FWdwnlod       0x01
+#define _def_OIS__FW_NG_NG_NG_NG       0x02
+#define _def_OIS____________FWOK       0x03
+#define _def_OIS_main_______IDLE       0x04
+
+#define _M_I2C_dat     0xF8
+#define _M_I2C_cmd     0xF9
+#define _M_I2C_STS     0xFA
+#define _M____tmp4     0xFB
+#define _M____tmp3     0xFC
+#define _M____tmp2     0xFD
+#define _M____tmp1     0xFE
+#define _M____tmp0     0xFF
+/*=================================================================*/
+/*Another definition*/
+/*=================================================================*/
+/* Scene parameter */
+#define _SCENE_NIGHT_1 1
+#define _SCENE_NIGHT_2 2
+#define _SCENE_NIGHT_3 3
+
+#define _SCENE_D_A_Y_1 4
+#define _SCENE_D_A_Y_2 5
+#define _SCENE_D_A_Y_3 6
+
+#define _SCENE_SPORT_1 7
+#define _SCENE_SPORT_2 8
+#define _SCENE_SPORT_3 9
+
+#define _SCENE_TEST___ 10
+
+/* for Factory Adjustment */
+#define _CUR100mA              0x00A0
+#define _CUR125mA              0x00C8
+#define _CUR150mA              0x00F0
+#define _CUR175mA              0x0118
+#define _CUR200mA              0x0140
+#define _CUR225mA              0x0168
+#define _CUR250mA              0x0190
+#define _CUR275mA              0x01B8
+#define _CUR300mA              0x01E0
+#define _CUR325mA              0x0208
+#define _CUR350mA              0x0230
+#define _CUR375mA              0x0258
+#define _CUR400mA              0x0280
+
+/* #define _VHTRGT             0x0460 // 3mA * 750 = 2250mV ->1/2-> 1125mV = 1125mV/1980mV *1024=582d-512d=70d 70d*16=1120 */
+#define _VHTRGT                0x0BA2 /* 3mA * 750 = 2250mV ->1/2-> 1125mV = 1125mV/1650mV *1024=698d-512d= 186d  186d*16= 2979 = 0BA3 */
+
+#define _OTHR_IN_HALPX 0x0006
+#define _OTHR_IN_HALPY 0x0008
+#define _OTHR_HXpreOUT 0x0001
+#define _OTHR_HYpreOUT 0x0002
+
+/* Factory Adjustment data */
+typedef struct{
+       OIS_UWORD       gl_CURDAT;
+       OIS_UWORD       gl_HALOFS_X;
+       OIS_UWORD       gl_HALOFS_Y;
+       OIS_UWORD       gl_HX_OFS;
+       OIS_UWORD       gl_HY_OFS;
+       OIS_UWORD       gl_PSTXOF;  /* RHM_HT 2013.03.21 Change order to adjust EEP ROM map */
+       OIS_UWORD       gl_PSTYOF;  /* RHM_HT 2013.03.21 Change order to adjust EEP ROM map */
+       OIS_UWORD       gl_GX_OFS;
+       OIS_UWORD       gl_GY_OFS;
+       OIS_UWORD       gl_KgxHG ;
+       OIS_UWORD       gl_KgyHG ;
+       OIS_UWORD       gl_KGXG  ;
+       OIS_UWORD       gl_KGYG  ;
+       OIS_UWORD       gl_SFTHAL_X; /* RHM_HT 2013/11/25 Added */
+       OIS_UWORD       gl_SFTHAL_Y; /* RHM_HT 2013/11/25 Added */
+       OIS_UWORD       gl_TMP_X_;   /* RHM_HT 2013/11/25 Added */
+       OIS_UWORD       gl_TMP_Y_;   /* RHM_HT 2013/11/25 Added */
+       OIS_UWORD       gl_KgxH0;    /* RHM_HT 2013/11/25 Added */
+       OIS_UWORD       gl_KgyH0;    /* RHM_HT 2013/11/25 Added */
+} _FACT_ADJ;
+
+/* Default Parameter of FACTORY Adjust data */
+/*---------------------------------------------*/
+EXT const _FACT_ADJ FADJ_DEF
+#ifdef OIS_MAIN_C
+= {
+       0x01bf,
+       0x01e3,
+       0x020a,
+       0x0120,
+       0x02ec,
+       0x0080,
+       0x007f,
+       0xfd40,
+       0x0460,
+       0xdb3f,
+       0xda4a,
+       0x2d36,
+       0x268c,
+       0x01e3,
+       0x020a,
+       0x0000,
+       0x0000,
+       0xffce,
+       0xfffc,
+#if 0
+       0x0200,  /* gl_CURDAT; */
+       0x0200,  /* gl_HALOFS_X; */
+       0x0200,  /* gl_HALOFS_Y; */
+       0x0000,  /* gl_HX_OFS; */
+       0x0000,  /* gl_HY_OFS; */
+       0x0080,  /* gl_PSTXOF;  RHM_HT 2013.03.21  Change order to adjust EEP ROM map */
+       0x0080,  /* gl_PSTYOF;  RHM_HT 2013.03.21  Change order to adjust EEP ROM map */
+       0x0000,  /* gl_GX_OFS; */
+       0x0000,  /* gl_GY_OFS; */
+       0x2000,  /* gl_KgxHG ;  RHM_HT 2013/11/25  Modified */
+       0x2000,  /* gl_KgyHG ;  RHM_HT 2013/11/25  Modified */
+       0x2000,  /* gl_KGXG  ;  RHM_HT 2013/11/25  Modified */
+       0x2000,  /* gl_KGYG  ;  RHM_HT 2013/11/25  Modified */
+       0x0200,  /* gl_SFTHAL_X; RHM_HT 2013/11/25  Added */
+       0x0200,  /* gl_SFTHAL_Y; RHM_HT 2013/11/25  Added */
+       0x0000,  /* gl_TMP_X_;  RHM_HT 2013/11/25  Added */
+       0x0000,  /* gl_TMP_Y_;  RHM_HT 2013/11/25  Added */
+       0x0000,  /* gl_KgxH0;   RHM_HT 2013/11/25  Added */
+       0x0000,  /* gl_KgyH0;   RHM_HT 2013/11/25  Added */
+#endif
+}
+#endif
+;
+/****************************************************
+* FACTORY Adjusted data
+* These data are stored at the non-vollatile
+* memory inside of the CMOS sensor.
+* The Host ( ISP or I2C master ) read these
+* data from above memory and write to the OIS
+* controller.
+***************************************************/
+_FACT_ADJ FADJ_MEM = {
+   0x01bf,
+   0x01e3,
+   0x020a,
+   0x0120,
+   0x02ec,
+   0x0080,
+   0x007f,
+   0xfd40,
+   0x0460,
+   0xdb3f,
+   0xda4a,
+   0x2d36,
+   0x268c,
+   0x01e3,
+   0x020a,
+   0x0000,
+   0x0000,
+   0xffce,
+   0xfffc,
+};
+
+#ifdef CONFIG_MACH_CHIRON
+int OIS_ACC_Gain_Table[201] = {
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x2CA0,
+       0x28E8,
+       0x25C2,
+       0x2310,
+       0x20BA,
+       0x1EAE,
+       0x1CE0,
+       0x1B45,
+       0x19D6,
+       0x188B,
+       0x1760,
+       0x1650,
+       0x1557,
+       0x1474,
+       0x13A2,
+       0x12E1,
+       0x122E,
+       0x1188,
+       0x10ED,
+       0x105D,
+       0xFD5,
+       0xF57,
+       0xEE0,
+       0xE70,
+       0xE06,
+       0xDA2,
+       0xD44,
+       0xCEB,
+       0xC96,
+       0xC45,
+       0xBF9,
+       0xBB0,
+       0xB6A,
+       0xB28,
+       0xAE8,
+       0xAAB,
+       0xA71,
+       0xA3A,
+       0xA04,
+       0x9D1,
+       0x9A0,
+       0x970,
+       0x943,
+       0x917,
+       0x8EC,
+       0x8C4,
+       0x89C,
+       0x876,
+       0x852,
+       0x82E,
+       0x80C,
+       0x7EA,
+       0x7CA,
+       0x7AB,
+       0x78D,
+       0x770,
+       0x753,
+       0x738,
+       0x71D,
+       0x703,
+       0x6EA,
+       0x6D1,
+       0x6B9,
+       0x6A2,
+       0x68B,
+       0x675,
+       0x660,
+       0x64B,
+       0x636,
+       0x622,
+       0x60F,
+       0x5FC,
+       0x5EA,
+       0x5D8,
+       0x5C6,
+       0x5B5,
+       0x5A4,
+       0x594,
+       0x584,
+       0x574,
+       0x564,
+       0x555,
+       0x547,
+       0x538,
+       0x52A,
+       0x51D,
+       0x50F,
+       0x502,
+       0x4F5,
+       0x4E8,
+       0x4DC,
+       0x4D0,
+       0x4C4,
+       0x4B8,
+       0x4AC,
+       0x4A1,
+       0x496,
+       0x48B,
+       0x480,
+       0x476,
+       0x46C,
+       0x462,
+       0x458,
+       0x44E,
+       0x444,
+       0x43B,
+       0x432,
+       0x429,
+       0x420,
+       0x417,
+       0x40E,
+       0x406,
+       0x3FD,
+       0x3F5,
+       0x3ED,
+       0x3E5,
+       0x3DD,
+       0x3D5,
+       0x3CE,
+       0x3C6,
+       0x3BF,
+       0x3B8,
+       0x3B0,
+       0x3A9,
+       0x3A2,
+       0x39C,
+       0x395,
+       0x38E,
+       0x388,
+       0x381,
+       0x37B,
+       0x375,
+       0x36E,
+       0x368,
+       0x362,
+       0x35C,
+       0x356,
+       0x351,
+       0x34B,
+       0x345,
+       0x340,
+       0x33A,
+       0x335,
+       0x330,
+       0x32A,
+       0x325,
+       0x320,
+       0x31B,
+       0x316,
+       0x311,
+       0x30C,
+       0x307,
+       0x302,
+       0x2FE,
+       0x2F9,
+       0x2F5,
+       0x2F0,
+       0x2EC,
+       0x2E7,
+       0x2E3,
+       0x2DE,
+       0x2DA,
+       0x2D6,
+       0x2D2,
+       0x2CE,
+       0x2CA,
+       0x2C6,
+       0x2C2,
+       0x2BE,
+       0x2BA,
+       0x2B6,
+       0x2B2,
+       0x2AE,
+       0x2AA,
+       0x2A7,
+       0x2A3,
+       0x2A0,
+       0x29C,
+       0x298,
+       0x295,
+       0x291,
+       0x28E,
+       0x28B,
+       0x287,
+       0x284,
+       0x281,
+       0x27D,
+       0x27A,
+       0x277,
+       0x274,
+};
+#else
+int OIS_ACC_Gain_Table[201] = {
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x3489,
+       0x2FC2,
+       0x2BC7,
+       0x2869,
+       0x2586,
+       0x2306,
+       0x20D5,
+       0x1EE7,
+       0x1D2F,
+       0x1BA6,
+       0x1A44,
+       0x1904,
+       0x17E1,
+       0x16D7,
+       0x15E3,
+       0x1503,
+       0x1434,
+       0x1375,
+       0x12C3,
+       0x121D,
+       0x1183,
+       0x10F2,
+       0x106A,
+       0xFEB,
+       0xF73,
+       0xF02,
+       0xE97,
+       0xE32,
+       0xDD3,
+       0xD78,
+       0xD22,
+       0xCD0,
+       0xC82,
+       0xC37,
+       0xBF0,
+       0xBAC,
+       0xB6B,
+       0xB2D,
+       0xAF1,
+       0xAB8,
+       0xA81,
+       0xA4D,
+       0xA1A,
+       0x9E9,
+       0x9BA,
+       0x98D,
+       0x967,
+       0x937,
+       0x90E,
+       0x8E7,
+       0x8C1,
+       0x89C,
+       0x879,
+       0x856,
+       0x835,
+       0x815,
+       0x7F5,
+       0x7D7,
+       0x7B9,
+       0x79D,
+       0x781,
+       0x766,
+       0x74B,
+       0x732,
+       0x719,
+       0x701,
+       0x6E9,
+       0x6D2,
+       0x6BC,
+       0x6A6,
+       0x691,
+       0x67C,
+       0x668,
+       0x654,
+       0x641,
+       0x62E,
+       0x61B,
+       0x609,
+       0x5F8,
+       0x5E7,
+       0x5D6,
+       0x5C5,
+       0x5B5,
+       0x5A6,
+       0x596,
+       0x587,
+       0x578,
+       0x56A,
+       0x55C,
+       0x54E,
+       0x540,
+       0x533,
+       0x526,
+       0x519,
+       0x50D,
+       0x500,
+       0x4F4,
+       0x4E8,
+       0x4DD,
+       0x4D1,
+       0x4C6,
+       0x4BB,
+       0x4B0,
+       0x4A6,
+       0x49B,
+       0x491,
+       0x487,
+       0x47D,
+       0x473,
+       0x46A,
+       0x460,
+       0x457,
+       0x44E,
+       0x445,
+       0x43C,
+       0x433,
+       0x42B,
+       0x422,
+       0x41A,
+       0x412,
+       0x40A,
+       0x402,
+       0x3FA,
+       0x3F3,
+       0x3EB,
+       0x3E4,
+       0x3DC,
+       0x3D5,
+       0x3CE,
+       0x3C7,
+       0x3C0,
+       0x3B9,
+       0x3B3,
+       0x3AC,
+       0x3A5,
+       0x39F,
+       0x399,
+       0x392,
+       0x38C,
+       0x386,
+       0x380,
+       0x37A,
+       0x374,
+       0x36F,
+       0x369,
+       0x363,
+       0x35E,
+       0x358,
+       0x353,
+       0x34D,
+       0x348,
+       0x343,
+       0x33E,
+       0x339,
+       0x334,
+       0x32F,
+       0x32A,
+       0x325,
+       0x320,
+       0x31B,
+       0x317,
+       0x312,
+       0x30D,
+       0x309,
+       0x304,
+       0x300,
+       0x2FC,
+       0x2F7,
+       0x2F3,
+       0x2EF,
+       0x2EB,
+       0x2E7,
+       0x2E2,
+       0x2DE,
+       0x2DA,
+       0x2D6,
+       0x2D3,
+       0x2CF,
+       0x2CB,
+       0x2C7,
+       0x2C3,
+       0x2C0,
+       0x2BC,
+       0x2B8,
+       0x2B5,
+       0x2B1,
+       0x2AE,
+       0x2AA,
+       0x2A7,
+       0x2A3,
+       0x2A0,
+};
+#endif
+
+/* Parameters for expanding OIS range */
+/*---------------------------------------------*/
+EXT double p_x, q_x;
+EXT double p_y, q_y;
+EXT OIS_WORD zero_X;
+EXT OIS_WORD zero_Y;
+EXT OIS_WORD PREOUT_X_P, PREOUT_X_N;
+EXT OIS_WORD PREOUT_Y_P, PREOUT_Y_N;
+EXT double alfa_X, beta_X;
+EXT double alfa_Y, beta_Y;
+
+#undef EXT
+#endif /* OIS_DEFINITION_H */
diff --git a/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_func.c b/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_func.c
new file mode 100644 (file)
index 0000000..1e0b12c
--- /dev/null
@@ -0,0 +1,668 @@
+/*************************************************************************
+* File Name: OIS_func.c
+* Function: Various function for OIS control
+* Rule: Use TAB 4
+*
+* Copyright(c) Rohm Co.,Ltd. All rights reserved
+* Copyright (C) 2018 XiaoMi, Inc.
+**************************************************************************/
+/***** ROHM Confidential ***************************************************/
+
+#include "OIS_head.h"
+#include "OIS_defi.h"
+#ifdef CONFIG_MACH_CHIRON
+#include "OIS_prog_chiron.h"
+#include "OIS_coef_chiron.h"
+#else
+#include "OIS_coef.h"
+#include "OIS_prog.h"
+#endif
+/* #include "usb_func.h" //Darcy mask/20140620 */
+
+extern OIS_UWORD OIS_REQUEST; /* OIS control register. */
+
+/* ==> RHM_HT 2013.03.04 Change type (OIS_UWORD -> double) */
+extern double OIS_PIXEL[2]; /* Just Only use for factory adjustment. */
+
+/* ==> RHM_HT 2013.03.13 add for HALL_SENSE_ADJUST */
+extern OIS_WORD        CROP_X; /* x start position for cropping */
+extern OIS_WORD        CROP_Y; /* y start position for cropping */
+extern OIS_WORD        CROP_WIDTH; /* cropping width */
+extern OIS_WORD CROP_HEIGHT; /* cropping height */
+extern OIS_UBYTE SLICE_LEVE; /* slice level of bitmap binalization */
+extern double DISTANCE_BETWEEN_CIRCLE; /* distance between center of each circle (vertical and horizontal) [mm] */
+extern double DISTANCE_TO_CIRCLE; /* distance to the circle [mm] */
+extern double D_CF; /* Correction Factor for distance to the circle */
+
+/* ==> RHM_HT 2013/07/10 Added new user definition variables for DC gain check */
+extern OIS_UWORD ACT_DRV; /* [mV]: Full Scale of OUTPUT DAC. */
+extern OIS_UWORD FOCAL_LENGTH; /* [um]: Focal Length 3.83mm */
+extern double MAX_OIS_SENSE; /* [um/mA]: per actuator difinition (change to absolute value) */
+extern double MIN_OIS_SENSE; /* [um/mA]: per actuator difinition (change to absolute value) */
+extern OIS_UWORD MAX_COIL_R; /* [ohm]: Max value of coil resistance */
+extern OIS_UWORD MIN_COIL_R; /* [ohm]: Min value of coil resistance */
+/* <== RHM_HT 2013/07/10 Added new user definition variables */
+
+
+
+/* ==> RHM_HT 2013/11/25 Modified */
+OIS_UWORD u16_ofs_tbl[] = { /* RHM_HT 2013.03.13 [Improvement of Loop Gain Adjust] Change to global variable */
+/* 0x0FBC, // 1 For MITSUMI */
+   0x0DFC, /* 2 */
+/* 0x0C3D, // 3 */
+   0x0A7D, /* 4 */
+/* 0x08BD, // 5 */
+   0x06FE, /* 6 */
+/* 0x053E, // 7 */
+   0x037F, /* 8 */
+/* 0x01BF, // 9 */
+   0x0000, /* 10 */
+/* 0xFE40, // 11 */
+   0xFC80, /* 12 */
+/* 0xFAC1, // 13 */
+   0xF901, /* 14 */
+/* 0xF742, // 15 */
+   0xF582, /* 16 */
+/* 0xF3C2, // 17 */
+   0xF203, /* 18 */
+/* 0xF043 // 19 */
+};
+/* <== RHM_HT 2013/11/25 Modified */
+/* <== RHM_HT 2013.03.13 */
+
+/*****************************************************
+*  **** Program Download Function
+******************************************************/
+ADJ_STS func_PROGRAM_DOWNLOAD(void)
+{ /* RHM_HT 2013/04/15 Change "typedef" of return value */
+       OIS_UWORD sts; /* RHM_HT 2013/04/15 Change "typedef". */
+       OIS_UBYTE ret = 0;
+
+       ret = download(0, 0); /* Program Download */
+       if (ret < 0) {
+               return PROG_DL_ERR;
+       }
+       sts = I2C_OIS_mem__read(_M_OIS_STS); /* Check Status */
+       if ((sts & 0x0004) == 0x0004) {
+               /* ==> RHM_HT 2013/07/10 Added */
+               OIS_UWORD u16_dat;
+               u16_dat = I2C_OIS_mem__read(_M_FIRMVER);
+               /* DEBUG_printf(("Firm Ver:%4d\n\n",u16_dat)); //Darcy mask/20140620 */
+               /* <== RHM_HT 2013/07/10 Added */
+               return ADJ_OK; /* Success       RHM_HT 2013/04/15 Change return value. */
+       } else {
+               return PROG_DL_ERR; /* FAIL RHM_HT 2013/04/15 Change return value. */
+       }
+}
+
+/* ==> RHM_HT 2013/11/26 Reverted */
+/*****************************************************
+**** COEF Download function
+*****************************************************/
+uint8_t func_COEF_DOWNLOAD(OIS_UWORD u16_coef_type)
+{
+       uint8_t ret = 0;
+       /* OIS_UWORD u16_i, u16_dat; */
+       ret = download(1, u16_coef_type); /* COEF Download */
+       if (ret < 0) {
+               return ret;
+       }
+
+       return 1;
+}
+/* <== RHM_HT 2013/11/26 Reverted */
+
+/*****************************************************
+**** Download the data
+*****************************************************/
+uint8_t download(OIS_UWORD u16_type, OIS_UWORD u16_coef_type)
+{
+       /* Data Transfer Size per one I2C access */
+#define DWNLD_TRNS_SIZE     (32)
+       OIS_UBYTE temp[DWNLD_TRNS_SIZE+1];
+       OIS_UWORD block_cnt;
+       OIS_UWORD total_cnt;
+       OIS_UWORD lp;
+       OIS_UWORD n;
+       OIS_UWORD u16_i;
+       OIS_UBYTE ret = 0;
+
+       if (u16_type == 0) {
+               n = DOWNLOAD_BIN_LEN;
+       } else {
+               n = DOWNLOAD_COEF_LEN; /* RHM_HT 2013/07/10 Modified */
+       }
+       block_cnt = n / DWNLD_TRNS_SIZE + 1;
+       total_cnt = block_cnt;
+       while (1) {
+               /* Residual Number Check */
+               if (block_cnt == 1) {
+                       lp = n % DWNLD_TRNS_SIZE;
+               } else {
+                       lp = DWNLD_TRNS_SIZE;
+               }
+               /* Transfer Data set */
+               if (lp != 0) {
+                       if (u16_type == 0) {
+                               temp[0] = _OP_FIRM_DWNLD;
+                               for (u16_i = 1; u16_i <= lp; u16_i += 1) {
+                                       temp[u16_i] = (DOWNLOAD_BIN[(((total_cnt - block_cnt) * DWNLD_TRNS_SIZE) + u16_i) - 1]);
+                               }
+                       } else {
+                               temp[0] = _OP_COEF_DWNLD;
+                               for (u16_i = 1; u16_i <= lp; u16_i += 1) {
+                                       temp[u16_i] = (DOWNLOAD_COEF[(((total_cnt - block_cnt) * DWNLD_TRNS_SIZE) + u16_i) - 1]); /* RHM_HT 2013/07/10 Modified */
+                               }
+                       }
+                       /* Data Transfer */
+                       /* WR_I2C( _SLV_OIS_, lp + 1, temp ); */
+                       pr_debug("DL_I2C");
+                       g_i2c_ctrl->i2c_client.addr_type = MSM_CAMERA_I2C_BYTE_ADDR;
+                       ret = g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_write_seq(&g_i2c_ctrl->i2c_client, temp[0], &(temp[1]), lp);
+                       if (ret < 0)
+                               return ret;
+               }
+               /* Block Counter Decrement */
+               block_cnt = block_cnt - 1;
+               if (block_cnt == 0)
+                       break;
+       }
+       return 1;
+}
+
+/* ==> RHM_HT 2015/01/08 Added */
+OIS_UWORD INTG__INPUT;         /* Integral Input value szx_2014/12/24_2 */
+OIS_UWORD KGNTG_VALUE;         /* KgxTG / KgyTG szx_2014/12/24_2 */
+OIS_UWORD GYRSNS;       /* RHM_HT 2015/01/16  Added */
+/* <== RHM_HT 2015/01/08 Added */
+
+void SET_FADJ_PARAM(const _FACT_ADJ *param)
+{
+       /*********************
+       * HALL ADJUST
+       *********************/
+       /* Set Hall Current DAC value that is FACTORY ADJUSTED */
+       I2C_OIS_per_write(_P_30_ADC_CH0, param->gl_CURDAT);
+       /* Set Hall PreAmp Offset that is FACTORY ADJUSTED */
+       I2C_OIS_per_write(_P_31_ADC_CH1, param->gl_HALOFS_X);
+       I2C_OIS_per_write(_P_32_ADC_CH2, param->gl_HALOFS_Y);
+       /* Set Hall-X/Y PostAmp Offset that is FACTORY ADJUSTED */
+       I2C_OIS_mem_write(_M_X_H_ofs, param->gl_HX_OFS);
+       I2C_OIS_mem_write(_M_Y_H_ofs, param->gl_HY_OFS);
+       /* Set Residual Offset that is FACTORY ADJUSTED */
+       I2C_OIS_per_write(_P_39_Ch3_VAL_1, param->gl_PSTXOF);
+       I2C_OIS_per_write(_P_3B_Ch3_VAL_3, param->gl_PSTYOF);
+
+       /*********************
+       * DIGITAL GYRO OFFSET
+       *********************/
+       I2C_OIS_mem_write(_M_Kgx00, param->gl_GX_OFS);
+       I2C_OIS_mem_write(_M_Kgy00, param->gl_GY_OFS);
+       I2C_OIS_mem_write(_M_TMP_X_, param->gl_TMP_X_);
+       I2C_OIS_mem_write(_M_TMP_Y_, param->gl_TMP_Y_);
+
+       /*********************
+       * HALL SENSE
+       *********************/
+       /* Set Hall Gain value that is FACTORY ADJUSTED */
+       I2C_OIS_mem_write(_M_KgxHG, param->gl_KgxHG);
+       I2C_OIS_mem_write(_M_KgyHG, param->gl_KgyHG);
+       /* Set Cross Talk Canceller */
+       I2C_OIS_mem_write(_M_KgxH0, param->gl_KgxH0);
+       I2C_OIS_mem_write(_M_KgyH0, param->gl_KgyH0);
+
+       /*********************
+       * LOOPGAIN
+       *********************/
+       I2C_OIS_mem_write(_M_KgxG, param->gl_KGXG);
+       I2C_OIS_mem_write(_M_KgyG, param->gl_KGYG);
+
+       /* ==> RHM_HT 2015/01/08 Added */
+       /* Get default Integ_input and KgnTG value */
+       INTG__INPUT = I2C_OIS_mem__read(0x38);
+       KGNTG_VALUE = I2C_OIS_mem__read(_M_KgxTG);
+       /* <== RHM_HT 2015/01/08 Added */
+       GYRSNS = I2C_OIS_mem__read(_M_GYRSNS); /* RHM_HT 2015/01/16  Added */
+
+       /* Position Servo ON ( OIS OFF ) */
+       I2C_OIS_mem_write(_M_EQCTL, 0x0C0C);
+}
+
+/*****************************************************
+**** Scence parameter
+*****************************************************/
+/* #define ANGLE_LIMIT (0x3020) // (0x2BC0 * 1.1) // GYRSNS * limit[deg] */
+#define        ANGLE_LIMIT (OIS_UWORD)((GYRSNS * 11) / 10)     /* GYRSNS * limit[deg] */
+#define        G_SENSE 131 /* [LSB/dps] for INVEN ICG20690 */
+
+ADJ_STS        func_SET_SCENE_PARAM(OIS_UBYTE u16_scene, OIS_UBYTE u16_mode, OIS_UBYTE filter, OIS_UBYTE range, const _FACT_ADJ *param)
+{ /* RHM_HT 2013/04/15 Change "typedef" of return value */
+       OIS_UWORD u16_i;
+       OIS_UWORD u16_dat;
+       /* ==> RHM_HT 2013/11/25 Modified */
+       OIS_UBYTE u16_adr_target[3] = {_M_Kgxdr, _M_X_LMT, _M_X_TGT, };
+       OIS_UWORD u16_dat_SCENE_NIGHT_1[3] = {0x7FFE, ANGLE_LIMIT, G_SENSE * 16, }; /* 16dps */
+       OIS_UWORD u16_dat_SCENE_NIGHT_2[3] = {0x7FFC, ANGLE_LIMIT, G_SENSE * 16, }; /* 16dps */
+       OIS_UWORD u16_dat_SCENE_NIGHT_3[3] = {0x7FFA, ANGLE_LIMIT, G_SENSE * 16, }; /* 16dps */
+       OIS_UWORD u16_dat_SCENE_D_A_Y_1[3] = {0x7FFE, ANGLE_LIMIT, G_SENSE * 40, }; /* 40dps */
+       OIS_UWORD u16_dat_SCENE_D_A_Y_2[3] = {0x7FFA, ANGLE_LIMIT, G_SENSE * 40, }; /* 40dps */
+       OIS_UWORD u16_dat_SCENE_D_A_Y_3[3] = {0x7FF0, ANGLE_LIMIT, G_SENSE * 40, }; /* 40dps */
+       OIS_UWORD u16_dat_SCENE_SPORT_1[3] = {0x7FFE, ANGLE_LIMIT, G_SENSE * 60, }; /* 60dps */
+       OIS_UWORD u16_dat_SCENE_SPORT_2[3] = {0x7FF0, ANGLE_LIMIT, G_SENSE * 60, }; /* 60dps */
+       OIS_UWORD u16_dat_SCENE_SPORT_3[3] = {0x7FE0, ANGLE_LIMIT, G_SENSE * 60, }; /* 60dps */
+       OIS_UWORD u16_dat_SCENE_TEST___[3] = {0x7FF0, 0x7FFF, 0x7FFF, }; /* Limmiter OFF */
+       /* <== RHM_HT 2013/11/25 Modified */
+       OIS_UWORD *u16_dat_SCENE_;
+       OIS_UBYTE size_SCENE_tbl = (sizeof(u16_dat_SCENE_NIGHT_1) / sizeof(OIS_UWORD));
+       /* Disable OIS ( position Servo is not disable ) */
+       u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+       u16_dat = (u16_dat & 0xFEFE);
+       I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+       /* Scene parameter select */
+       switch (u16_scene) {
+       case _SCENE_NIGHT_1:
+               u16_dat_SCENE_ = u16_dat_SCENE_NIGHT_1;
+               DEBUG_printf("+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n+---_SCENE_NIGHT_1---+\n+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n");
+               break;
+       case _SCENE_NIGHT_2:
+               u16_dat_SCENE_ = u16_dat_SCENE_NIGHT_2;
+               DEBUG_printf("+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n+---_SCENE_NIGHT_2---+\n+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n");
+               break;
+       case _SCENE_NIGHT_3:
+               u16_dat_SCENE_ = u16_dat_SCENE_NIGHT_3;
+               DEBUG_printf("+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n+---_SCENE_NIGHT_3---+\n+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n");
+               break;
+       case _SCENE_D_A_Y_1:
+               u16_dat_SCENE_ = u16_dat_SCENE_D_A_Y_1;
+               DEBUG_printf("+??????????+\n+---_SCENE_D_A_Y_1---+\n+??????????+\n");
+               break;
+       case _SCENE_D_A_Y_2:
+               u16_dat_SCENE_ = u16_dat_SCENE_D_A_Y_2;
+               DEBUG_printf("+??????????+\n+---_SCENE_D_A_Y_2---+\n+??????????+\n");
+               break;
+       case _SCENE_D_A_Y_3:
+               u16_dat_SCENE_ = u16_dat_SCENE_D_A_Y_3;
+               DEBUG_printf("+??????????+\n+---_SCENE_D_A_Y_3---+\n+??????????+\n");
+               break;
+       case _SCENE_SPORT_1:
+               u16_dat_SCENE_ = u16_dat_SCENE_SPORT_1;
+               DEBUG_printf("+??????????+\n+---_SCENE_SPORT_1---+\n+??????????+\n");
+               break;
+       case _SCENE_SPORT_2:
+               u16_dat_SCENE_ = u16_dat_SCENE_SPORT_2;
+               DEBUG_printf("+??????????+\n+---_SCENE_SPORT_2---+\n+??????????+\n");
+               break;
+       case _SCENE_SPORT_3:
+               u16_dat_SCENE_ = u16_dat_SCENE_SPORT_3;
+               DEBUG_printf("+??????????+\n+---_SCENE_SPORT_3---+\n+??????????+\n");
+               break;
+       case _SCENE_TEST___:
+               u16_dat_SCENE_ = u16_dat_SCENE_TEST___;
+               DEBUG_printf("+********************+\n+---dat_SCENE_TEST___+\n+********************+\n");
+               break;
+       default:
+               u16_dat_SCENE_ = u16_dat_SCENE_TEST___;
+               DEBUG_printf("+********************+\n+---dat_SCENE_TEST___+\n+********************+\n");
+               break;
+       }
+       /* Set parameter to the OIS controller */
+       for (u16_i = 0; u16_i < size_SCENE_tbl; u16_i += 1) {
+               I2C_OIS_mem_write(u16_adr_target[u16_i], u16_dat_SCENE_[u16_i]);
+       }
+       for (u16_i = 0; u16_i < size_SCENE_tbl; u16_i += 1) {
+               I2C_OIS_mem_write(u16_adr_target[u16_i] + 0x80, u16_dat_SCENE_[u16_i]);
+       }
+       /* Set/Reset Notch filter */
+       if (filter == 1) { /* Disable Filter */
+               u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+               u16_dat |= 0x4000;
+               I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+       } else { /* Enable Filter */
+               u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+               u16_dat &= 0xBFFF;
+               I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+       }
+       /* Clear the register of the OIS controller */
+       I2C_OIS_mem_write(_M_wDgx02, 0x0000);
+       I2C_OIS_mem_write(_M_wDgx03, 0x0000);
+       I2C_OIS_mem_write(_M_wDgx06, 0x7FFF);
+       I2C_OIS_mem_write(_M_Kgx15, 0x0000);
+       I2C_OIS_mem_write(_M_wDgy02, 0x0000);
+       I2C_OIS_mem_write(_M_wDgy03, 0x0000);
+       I2C_OIS_mem_write(_M_wDgy06, 0x7FFF);
+       I2C_OIS_mem_write(_M_Kgy15, 0x0000);
+       /* Set the pre-Amp offset value (X and Y) */
+       /* ==> RHM_HT 2013/11/25 Modified */
+       if (range == 1) {
+               I2C_OIS_per_write(_P_31_ADC_CH1, param->gl_SFTHAL_X);
+               I2C_OIS_per_write(_P_32_ADC_CH2, param->gl_SFTHAL_Y);
+       } else {
+               I2C_OIS_per_write(_P_31_ADC_CH1, param->gl_HALOFS_X);
+               I2C_OIS_per_write(_P_32_ADC_CH2, param->gl_HALOFS_Y);
+       }
+       /* <== RHM_HT 2013/11/25 Modified */
+
+       /* Enable OIS (if u16_mode = 1) */
+       if ((u16_mode == 1)) {
+               u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+               u16_dat = (u16_dat | 0x0101);
+               I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+               DEBUG_printf(("SET : EQCTL:%.4x\n", u16_dat));
+       } else { /* ==> RHM_HT 2013.03.23 Add for OIS controll */
+               u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+               u16_dat = (u16_dat & 0xFEFE);
+               I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+               DEBUG_printf(("SET:EQCTL:%.4x\n", u16_dat));
+       } /* <== RHM_HT 2013.03.23 Add for OIS controll */
+
+       return ADJ_OK; /* RHM_HT 2013/04/15 Change return value */
+}
+
+ADJ_STS        func_SET_SCENE_PARAM_for_NewGYRO_Fil(OIS_UBYTE u16_scene, OIS_UBYTE u16_mode, OIS_UBYTE filter, OIS_UBYTE range, const _FACT_ADJ *param)
+{ /* RHM_HT 2013/04/15 Change "typedef" of return value */
+       OIS_UWORD u16_i;
+       OIS_UWORD u16_dat;
+#ifdef CONFIG_MACH_CHIRON
+       OIS_ULONG temp_x, temp_y;
+       OIS_UWORD u16_dat_x = 0;
+       OIS_UWORD u16_dat_y = 0;
+#endif
+       OIS_ULONG temp;
+       OIS_UWORD angle_limit;
+
+       /* szx_2014/09/19 ---> Modified */
+       /* ==> RHM_HT 2013/11/25 Modified */
+       OIS_UBYTE u16_adr_target[4] = {_M_Kgxdr, _M_X_LMT, _M_X_TGT, 0x1B, };
+       OIS_UWORD u16_dat_SCENE_NIGHT_1[4] = {0x7FE0, 0x7FF0, G_SENSE * 16, 0x0300, }; /* 16dps */
+       OIS_UWORD u16_dat_SCENE_NIGHT_2[4] = {0x7FFF, 0x7FF0, G_SENSE * 16, 0x0080, }; /* 16dps RHM_HT 2014/11/27 Changed Kgxdr at Xiaomi */
+       OIS_UWORD u16_dat_SCENE_NIGHT_3[4] = {0x7FF0, 0x7FF0, G_SENSE * 16, 0x0300, }; /* 16dps RHM_HT 2014/11/27 Changed Kgxdr at Xiaomi */
+       OIS_UWORD u16_dat_SCENE_D_A_Y_1[4] = {0x7FE0, 0x7FF0, G_SENSE * 40, 0x0300, }; /* 40dps RHM_HT 2014/11/27 Changed Kgxdr at Xiaomi */
+       OIS_UWORD u16_dat_SCENE_D_A_Y_2[4] = {0x7F80, 0x7FF0, G_SENSE * 40, 0x0140, }; /* 40dps RHM_HT 2014/11/27 Changed Kgxdr at Xiaomi */
+       OIS_UWORD u16_dat_SCENE_D_A_Y_3[4] = {0x7F00, 0x7FF0, G_SENSE * 40, 0x0300, }; /* 40dps RHM_HT 2014/11/27 Changed Kgxdr at Xiaomi */
+       OIS_UWORD u16_dat_SCENE_SPORT_1[4] = {0x7FE0, 0x7FF0, G_SENSE * 60, 0x0300, }; /* 60dps RHM_HT 2014/11/27 Changed Kgxdr at Xiaomi */
+       /* szx_2014/12/24 ===> */
+       OIS_UWORD u16_dat_SCENE_SPORT_2[4] = {0x7F40, 0x7FF0, G_SENSE * 60, 0x0100, };  /* video,  60dps RHM_HT 2014/11/27 Changed Kgxdr at Xiaomi */
+       /* szx_2015/01/20 ===> */
+       /* OIS_UWORD u16_dat_SCENE_SPORT_3[4] = {0x7FFF, ANGLE_LIMIT, G_SENSE * 60, 0x0100, }; // 60dps RHM_HT 2014/11/27 Changed Kgxdr at Xiaomi */
+       OIS_UWORD u16_dat_SCENE_SPORT_3[4] = {0x7FE0, 0x7FF0, G_SENSE * 60, 0x0140, };  /* capture & preview */
+       /* szx_2015/01/20 <=== */
+       /* szx_2014/12/24 <=== */
+       OIS_UWORD u16_dat_SCENE_TEST___[4] = {0x7FFF, 0x7FFF, 0x7FFF, 0x0080, }; /* Limmiter OFF */
+       /* <== RHM_HT 2013/11/25 Modified */
+       /* szx_2014/09/19 <--- */
+       OIS_UWORD *u16_dat_SCENE_;
+       OIS_UBYTE size_SCENE_tbl = (sizeof(u16_dat_SCENE_NIGHT_1) / sizeof(OIS_UWORD));
+       /* Disable OIS ( position Servo is not disable ) */
+       u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+       u16_dat = (u16_dat & 0xFEFE);
+       I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+       /* Scene parameter select */
+       switch (u16_scene) {
+       case _SCENE_NIGHT_1:
+               u16_dat_SCENE_ = u16_dat_SCENE_NIGHT_1;
+               DEBUG_printf("+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n+---_SCENE_NIGHT_1---+\n+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n");
+               break;
+       case _SCENE_NIGHT_2:
+               u16_dat_SCENE_ = u16_dat_SCENE_NIGHT_2;
+               DEBUG_printf("+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n+---_SCENE_NIGHT_2---+\n+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n");
+               break;
+       case _SCENE_NIGHT_3:
+               u16_dat_SCENE_ = u16_dat_SCENE_NIGHT_3;
+               DEBUG_printf("+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n+---_SCENE_NIGHT_3---+\n+?²â\96²?²â\96²?²â\96²?²â\96²?²â\96²+\n");
+               break;
+       case _SCENE_D_A_Y_1:
+               u16_dat_SCENE_ = u16_dat_SCENE_D_A_Y_1;
+               DEBUG_printf("+??????????+\n+---_SCENE_D_A_Y_1---+\n+??????????+\n");
+               break;
+       case _SCENE_D_A_Y_2:
+               u16_dat_SCENE_ = u16_dat_SCENE_D_A_Y_2;
+               DEBUG_printf("+??????????+\n+---_SCENE_D_A_Y_2---+\n+??????????+\n");
+               break;
+       case _SCENE_D_A_Y_3:
+               u16_dat_SCENE_ = u16_dat_SCENE_D_A_Y_3;
+               DEBUG_printf("+??????????+\n+---_SCENE_D_A_Y_3---+\n+??????????+\n");
+               break;
+       case _SCENE_SPORT_1:
+               u16_dat_SCENE_ = u16_dat_SCENE_SPORT_1;
+               DEBUG_printf("+??????????+\n+---_SCENE_SPORT_1---+\n+??????????+\n");
+               break;
+       case _SCENE_SPORT_2:
+               u16_dat_SCENE_ = u16_dat_SCENE_SPORT_2;
+               angle_limit = (OIS_UWORD)((GYRSNS * 13) / 10);
+               DEBUG_printf("+??????????+\n+---_SCENE_SPORT_2---+\n+??????????+\n");
+               break;
+       case _SCENE_SPORT_3:
+               u16_dat_SCENE_ = u16_dat_SCENE_SPORT_3;
+               angle_limit = (OIS_UWORD)((GYRSNS * 9) / 10);
+               DEBUG_printf("+??????????+\n+---_SCENE_SPORT_3---+\n+??????????+\n");
+               break;
+       case _SCENE_TEST___:
+               u16_dat_SCENE_ = u16_dat_SCENE_TEST___;
+               DEBUG_printf("+********************+\n+---dat_SCENE_TEST___+\n+********************+\n");
+               break;
+       default:
+               u16_dat_SCENE_ = u16_dat_SCENE_TEST___;
+               DEBUG_printf("+********************+\n+---dat_SCENE_TEST___+\n+********************+\n");
+               break;
+       }
+       /* Set parameter to the OIS controller */
+       for (u16_i = 0; u16_i < size_SCENE_tbl; u16_i += 1) {
+               I2C_OIS_mem_write(u16_adr_target[u16_i], u16_dat_SCENE_[u16_i]);
+       }
+       for (u16_i = 0; u16_i < size_SCENE_tbl; u16_i += 1) {
+               I2C_OIS_mem_write(u16_adr_target[u16_i] + 0x80, u16_dat_SCENE_[u16_i]);
+       }
+
+       temp = (INTG__INPUT * 16384); /* X2 * 4000h / X1 */
+       /* u16_dat = temp / ANGLE_LIMIT; */
+       u16_dat = temp / angle_limit;
+
+#ifdef CONFIG_MACH_CHIRON
+       temp_x = u16_dat*1064/1000;
+       temp_y = u16_dat*1088/1000;
+       u16_dat_x = temp_x;
+       u16_dat_y = temp_y;
+       pr_err("OIS temp_y %ld u16_dat_y %d", temp_y, u16_dat_y);
+       I2C_OIS_mem_write(0x38, u16_dat_x);
+       I2C_OIS_mem_write(0xB8, u16_dat_y);
+#else
+       I2C_OIS_mem_write(0x38, u16_dat);
+       I2C_OIS_mem_write(0xB8, u16_dat);
+#endif
+       /* ---------------------------------------------- */
+       /* temp = (KGNTG_VALUE * ANGLE_LIMIT); */ /* X3 * X1 / 4000h */
+       temp = (KGNTG_VALUE * angle_limit);
+       u16_dat = temp / 16384;
+       I2C_OIS_mem_write(0x47, u16_dat);
+       I2C_OIS_mem_write(0xC7, u16_dat);
+       /* ---------------------------------------------- */
+       I2C_OIS_mem_write(0x40, 0x7FF0);
+       I2C_OIS_mem_write(0xC0, 0x7FF0);
+
+#ifdef CONFIG_MACH_CHIRON
+       I2C_OIS_per_write(0xBB, 0x7F30);
+#endif
+       /* szx_2014/12/24 <=== */
+       /* Set/Reset Notch filter */
+       if (filter == 1) { /* Disable Filter */
+               u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+               u16_dat |= 0x4000;
+               I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+       } else { /* Enable Filter */
+               u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+               u16_dat &= 0xBFFF;
+               I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+       }
+       if (range == 1) {
+               I2C_OIS_per_write(_P_31_ADC_CH1, param->gl_SFTHAL_X);
+               I2C_OIS_per_write(_P_32_ADC_CH2, param->gl_SFTHAL_Y);
+       } else {
+               I2C_OIS_per_write(_P_31_ADC_CH1, param->gl_HALOFS_X);
+               I2C_OIS_per_write(_P_32_ADC_CH2, param->gl_HALOFS_Y);
+       }
+       /* <== RHM_HT 2013/11/25 Modified */
+       /* Enable OIS (if u16_mode = 1) */
+       if ((u16_mode == 1)) { /* OIS ON */
+               u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+               u16_dat = (u16_dat & 0xEFFF); /* Clear Halfshutter mode */
+               u16_dat = (u16_dat | 0x0101);
+               I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+               DEBUG_printf(("SET : EQCTL:%.4x\n", u16_dat));
+       } else if (u16_mode == 2) { /* Half Shutter */
+               u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+               u16_dat = (u16_dat | 0x1101);
+               I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+               DEBUG_printf(("SET:EQCTL:%.4x\n", u16_dat));
+       } else { /* ==> RHM_HT 2013.03.23 Add for OIS controll */
+               u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+               u16_dat = (u16_dat & 0xFEFE);
+               I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+               DEBUG_printf(("SET:EQCTL:%.4x\n", u16_dat));
+       } /* <== RHM_HT 2013.03.23 Add for OIS controll */
+
+       return ADJ_OK; /* RHM_HT 2013/04/15 Change return value */
+}
+
+/* ==> RHM_HT 2014/11/27 Added */
+/*****************************************************
+**** Enable HalfShutter
+*****************************************************/
+void HalfShutterOn(void)
+{
+       OIS_UWORD u16_dat = 0;
+
+       u16_dat = I2C_OIS_mem__read(_M_EQCTL);
+       u16_dat = (u16_dat | 0x1101);
+       I2C_OIS_mem_write(_M_EQCTL, u16_dat);
+       DEBUG_printf(("SET:EQCTL:%.4x\n", u16_dat));
+}
+
+void ChangeShiftOISGain(int distance)
+{
+       int shift_gain = 0;
+
+       /* shift_gain = 0x2DAF * 10 / distance; */
+       if (distance > 200) {
+               shift_gain = 0x00;
+       } else {
+               shift_gain = OIS_ACC_Gain_Table[distance];
+       }
+
+       I2C_OIS_per_write(0x8B, shift_gain);
+       I2C_OIS_per_write(0xCB, shift_gain);
+
+       return;
+}
+
+/* <== RHM_HT 2014/11/27 Added */
+/*****************************************************
+**** Write to the Peripheral register < 82h >
+**** OIS_UBYTE adr Peripheral Address
+**** OIS_UWORD dat Write data
+*****************************************************/
+void I2C_OIS_per_write(OIS_UBYTE u08_adr, OIS_UWORD u16_dat)
+{
+       OIS_UBYTE out[4];
+
+       out[0] = _OP_Periphe_RW;
+       out[1] = u08_adr;
+       out[2] = (u16_dat) & 0xFF;
+       out[3] = (u16_dat >> 8) & 0xFF;
+
+       WR_I2C(_SLV_OIS_, 4, out);
+}
+
+/*****************************************************
+**** Write to the Memory register < 84h >
+**** ------------------------------------------------
+**** OIS_UBYTE adr Memory Address
+**** OIS_UWORD dat Write data
+*****************************************************/
+void I2C_OIS_mem_write(OIS_UBYTE u08_adr, OIS_UWORD u16_dat)
+{
+       OIS_UBYTE out[4];
+
+       out[0] = _OP_Memory__RW;
+       out[1] = u08_adr;
+       out[2] = (u16_dat) & 0xFF;
+       out[3] = (u16_dat >> 8) & 0xFF;
+
+       WR_I2C(_SLV_OIS_, 4, out);
+}
+
+/*****************************************************
+**** Read from the Peripheral register < 82h >
+**** ------------------------------------------------
+**** OIS_UBYTE adr Peripheral Address
+**** OIS_UWORD dat Read data
+*****************************************************/
+OIS_UWORD I2C_OIS_per__read(OIS_UBYTE u08_adr)
+{
+       OIS_UBYTE u08_dat[2];
+
+       u08_dat[0] = _OP_Periphe_RW;    /* Op-code */
+       u08_dat[1] = u08_adr; /* target address */
+
+       return RD_I2C(_SLV_OIS_, 2, u08_dat);
+}
+
+/*****************************************************
+**** Read from the Memory register < 84h >
+**** ------------------------------------------------
+**** OIS_UBYTE adr Memory Address
+**** OIS_UWORD dat Read data
+*****************************************************/
+OIS_UWORD I2C_OIS_mem__read(OIS_UBYTE u08_adr)
+{
+       OIS_UBYTE u08_dat[2];
+
+       u08_dat[0] = _OP_Memory__RW;    /* Op-code */
+       u08_dat[1] = u08_adr; /* target address */
+
+       return RD_I2C(_SLV_OIS_, 2, u08_dat);
+}
+
+/*****************************************************
+**** Special Command 8Ah
+_cmd_8C_EI 0 // 0x0001
+_cmd_8C_DI 1 // 0x0002
+*****************************************************/
+void I2C_OIS_spcl_cmnd(OIS_UBYTE u08_on, OIS_UBYTE u08_dat)
+{
+       if ((u08_dat == _cmd_8C_EI) || (u08_dat == _cmd_8C_DI)) {
+               OIS_UBYTE out[2];
+               out[0] = _OP_SpecialCMD;
+               out[1] = u08_dat;
+               pr_err("SPCL WR_I2C 0x%x 0x%x", out[0], out[1]);
+               g_i2c_ctrl->i2c_client.addr_type = MSM_CAMERA_I2C_BYTE_ADDR;
+               g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_write(&g_i2c_ctrl->i2c_client, out[0], out[1], MSM_CAMERA_I2C_BYTE_DATA);
+               pr_err("exit\n");
+       }
+}
+
+/*****************************************************
+**** F0-F3h Command NonAssertClockStretch Function
+*****************************************************/
+void I2C_OIS_F0123_wr_(OIS_UBYTE u08_dat0, OIS_UBYTE u08_dat1, OIS_UWORD u16_dat2)
+{
+       OIS_UBYTE out[5];
+
+       out[0] = 0xF0;
+       out[1] = u08_dat0;
+       out[2] = u08_dat1;
+       out[3] = u16_dat2 / 256;
+       out[4] = u16_dat2 % 256;
+       pr_debug("SPCL WR_I2C 0x%x 0x%x dat2:%d", out[0], out[1], u16_dat2*2);
+       g_i2c_ctrl->i2c_client.addr_type = MSM_CAMERA_I2C_BYTE_ADDR;
+
+       g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_write_seq(&g_i2c_ctrl->i2c_client, out[0], &(out[1]), 4);
+}
+
+OIS_UWORD I2C_OIS_F0123__rd(void)
+{
+       OIS_UBYTE u08_dat;
+
+       u08_dat = 0xF0; /* Op-code */
+
+       return RD_I2C(_SLV_OIS_, 1, &u08_dat);
+}
diff --git a/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_head.h b/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_head.h
new file mode 100644 (file)
index 0000000..7b2a0c8
--- /dev/null
@@ -0,0 +1,155 @@
+#ifndef OIS_MAIN_H
+#define OIS_MAIN_H
+
+/* Compile Switch Purpose*/
+/* #define CENTER_OF_HALL_OUT // RHM_HT 2013.03.15 Enable to detect hall output center and set shifted offset value */
+#define ENABLE_GYRO_DRIFT_COMP /* RHM_HT 2013/11/25 Added */
+#define _STR_AREA_ "F:\\DEBUGBMP\\" /* For Image save (Debug purpose) */
+
+/* ==> RHM_HT 2013/04/15 Add to the report for error details */
+/* #define OIS_TRUE  0 */
+/* #define OIS_FALSE -1 */
+/* #define OIS_READY 1 */
+#define ADJ_OK  0
+#define ADJ_ERR        -1
+#define PROG_DL_ERR -2
+#define COEF_DL_ERR -3
+
+#define CURDAT_FIT_ERR  -4
+#define CURDAT_ADJ_ERR  -5
+#define HALOFS_X_ADJ_ERR -6
+#define HALOFS_Y_ADJ_ERR -7
+#define PSTXOF_FIT_ERR  -8
+#define PSTYOF_FIT_ERR  -9
+#define PSTXOF_ADJ_ERR  -10
+#define PSTYOF_ADJ_ERR  -11
+#define KGXG_ROUGH_ADJ_ERR -12
+#define KGYG_ROUGH_ADJ_ERR -13
+#define GX_OFS_ADJ_ERR    -14
+#define GY_OFS_ADJ_ERR    -15
+
+#define TAKE_PICTURE_ERR  -20
+#define KGXG_FINE_ADJ_ERR -21
+#define KGYG_FINE_ADJ_ERR -22
+#define KGXG_SENSITIVITY_ERR -23
+#define KGYG_SENSITIVITY_ERR -24
+#define KGXHG_ADJ_ERR    -25
+#define KGYHG_ADJ_ERR    -26
+#define ACGX_ADJ_OVER_P          -27
+#define ACGY_ADJ_OVER_P          -28
+#define ACGX_ADJ_OVER_N          -29
+#define ACGY_ADJ_OVER_N          -30
+#define ACGX_KGXG_ADJ_ERR -31
+#define ACGY_KGYG_ADJ_ERR -32
+
+#define TMP_X_ADJ_ERR -33 /* RHM_HT 2013/11/25 Added */
+#define TMP_Y_ADJ_ERR -34 /* RHM_HT 2013/11/25 Added */
+
+#define MALLOC1_ERR -51
+#define MALLOC2_ERR -52
+#define MALLOC3_ERR -53
+#define MALLOC4_ERR -54
+
+/* Error for sub-routine */
+#define OIS_NO_ERROR ADJ_OK
+#define OIS_INVALID_PARAMETERS -100
+#define OIS_FILE_RENAME_ERROR  -101
+#define OIS_FILE_NOT_FOUND     -102
+#define OIS_BITMAP_READ_ERROR  -103
+#define OIS_MATRIX_INV_ERROR   -104
+#define OIS_SC2_XLIMIT_OVER    -105
+#define OIS_CHART_ARRAY_OVER   -106
+
+#define OIS_DC_GAIN_SENS_OVER  -107
+
+#define OIS_MALLOC1_ERROR  -111
+#define OIS_MALLOC2_ERROR  -112
+#define OIS_MALLOC3_ERROR  -113
+#define OIS_MALLOC4_ERROR  -114
+#define OIS_MALLOC5_ERROR  -115
+#define OIS_MALLOC6_ERROR  -116
+#define OIS_MALLOC7_ERROR  -117
+#define OIS_MALLOC8_ERROR  -118
+#define OIS_MALLOC9_ERROR  -119
+#define OIS_MALLOC10_ERROR -120
+#define OIS_MALLOC11_ERROR -121
+#define OIS_MALLOC12_ERROR -122
+#define OIS_MALLOC13_ERROR -123
+#define OIS_MALLOC14_ERROR -124        /* RHM_HT 2013/11/25 add */
+
+typedef short int ADJ_STS;
+/* typedef short int OIS_BOOL; */
+/* <== RHM_HT 2013/04/15 Add to the report for error details */
+
+typedef char     OIS_BYTE;
+typedef short int OIS_WORD;
+typedef long int  OIS_LONG;
+typedef unsigned char     OIS_UBYTE;
+typedef unsigned short int OIS_UWORD;
+typedef unsigned long int  OIS_ULONG;
+typedef volatile char     OIS_vBYTE;
+typedef volatile short int OIS_vWORD;
+typedef volatile long int  OIS_vLONG;
+typedef volatile unsigned char     OIS_vUBYTE;
+typedef volatile unsigned short int OIS_vUWORD;
+typedef volatile unsigned long int  OIS_vULONG;
+
+typedef struct tagBmpGetPos {
+       OIS_WORD x; /* x start position for clipping */
+       OIS_WORD y; /* y start position for clipping */
+       OIS_WORD width; /* clipping width */
+       OIS_WORD height; /* clipping height */
+       OIS_UBYTE slice_level; /* slice level of bitmap binalization */
+       OIS_UBYTE filter; /* median filter enable */
+       char *direction;  /* direction of detection */
+} _BMP_GET_POS;
+
+typedef        struct tagPos {
+       float x;
+       float y;
+} _POS;
+
+typedef struct tagApproxResult {
+       double a; /* position x */
+       double b; /* position y */
+       double r; /* Radius */
+} _APPROXRESULT;
+
+#include "OIS_defi.h"
+/* #include "windef.h" */
+
+/* #define Wait(a) Wait_usec(a*1000UL) */
+
+ADJ_STS func_PROGRAM_DOWNLOAD(void); /* RHM_HT 2013/04/15 Change "typedef" of return value */
+uint8_t func_COEF_DOWNLOAD(OIS_UWORD u16_coef_type); /* RHM_HT 2013/11/26 Reverted */
+uint8_t download(OIS_UWORD u16_type, OIS_UWORD u16_coef_type);
+ADJ_STS func_SET_SCENE_PARAM(OIS_UBYTE u16_scene, OIS_UBYTE u16_mode, OIS_UBYTE filter, OIS_UBYTE range, const _FACT_ADJ *param); /* RHM_HT 2013/04/15 Change "typedef" of return value */
+void SET_FADJ_PARAM(const _FACT_ADJ *param);
+void I2C_OIS_per_write(OIS_UBYTE u08_adr, OIS_UWORD u16_dat);
+void I2C_OIS_mem_write(OIS_UBYTE u08_adr, OIS_UWORD u16_dat);
+OIS_UWORD I2C_OIS_per__read(OIS_UBYTE u08_adr);
+OIS_UWORD I2C_OIS_mem__read(OIS_UBYTE u08_adr);
+void I2C_OIS_spcl_cmnd(OIS_UBYTE u08_on, OIS_UBYTE u08_dat);
+void I2C_OIS_F0123_wr_(OIS_UBYTE u08_dat0, OIS_UBYTE u08_dat1, OIS_UWORD u16_dat2);
+OIS_UWORD I2C_OIS_F0123__rd(void);
+
+/* void POWER_UP_AND_PS_DISABLE(void); */
+/* void POWER_DOWN_AND_PS_ENABLE(void); */
+void VCOSET0(void);
+void VCOSET1(void);
+void WR_I2C(OIS_UBYTE slvadr, OIS_UBYTE size, OIS_UBYTE *dat);
+OIS_UWORD RD_I2C(OIS_UBYTE slvadr, OIS_UBYTE size, OIS_UBYTE *dat);
+void store_FADJ_MEM_to_non_volatile_memory(_FACT_ADJ param);
+void get_FADJ_MEM_from_non_volatile_memory(void);
+/* void Wait_usec(OIS_ULONG time); */
+int debug_print(const char *format, ...); /* RHM_HT 2013/04/15 Add for DEBUG */
+
+/* #define DEBUG_FADJ //Darcy Mask/20140919 */
+#ifdef DEBUG_FADJ
+/* #define DEBUG_printf(a) printf a */
+#define DEBUG_printf(a) debug_print a
+#else
+#define DEBUG_printf(a)
+#endif
+
+#endif  /* OIS_MAIN_H */
diff --git a/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_prog.h b/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_prog.h
new file mode 100644 (file)
index 0000000..03b81de
--- /dev/null
@@ -0,0 +1,4632 @@
+/***************************************************************************
+* File Name   : OIS_prog.h
+* Function    : Header file for OIS controller firmware
+* Rule        : Use TAB 4
+*
+* Copyright(c) Rohm Co.,Ltd. All rights reserved
+* Copyright (C) 2018 XiaoMi, Inc.
+*
+******************* ROHM Confidential *************************************/
+#ifndef OIS_PROG_H
+#define OIS_PROG_H
+
+const OIS_UBYTE DOWNLOAD_BIN[] = { /* DOWNLOAD14d_SEMCO_Xiaomi_C1.bin */
+       0x00,
+       0x5F,
+       0x6B,
+       0x00,
+       0x05,
+       0xFF,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0x00,
+       0x20,
+       0x90,
+       0x00,
+       0x84,
+       0x20,
+       0x8F,
+       0x08,
+       0x02,
+       0x8F,
+       0x11,
+       0x20,
+       0x2F,
+       0x08,
+       0x7D,
+       0x6F,
+       0x01,
+       0x80,
+       0x00,
+       0x90,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0x00,
+       0x20,
+       0x90,
+       0x00,
+       0x84,
+       0x20,
+       0x8F,
+       0x08,
+       0x14,
+       0xF3,
+       0x11,
+       0x20,
+       0x2F,
+       0x08,
+       0x6B,
+       0x0C,
+       0x01,
+       0x80,
+       0x00,
+       0x90,
+       0x00,
+       0x03,
+       0x00,
+       0x90,
+       0x00,
+       0x84,
+       0x00,
+       0x20,
+       0x08,
+       0x10,
+       0x00,
+       0x20,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xFE,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x1D,
+       0xA0,
+       0x04,
+       0xFF,
+       0x84,
+       0x80,
+       0x00,
+       0x90,
+       0x00,
+       0x03,
+       0x00,
+       0x04,
+       0xB6,
+       0x44,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xB9,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xB9,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xBA,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0xBA,
+       0x60,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x10,
+       0x00,
+       0x20,
+       0xFF,
+       0xFF,
+       0x11,
+       0x50,
+       0x0F,
+       0x07,
+       0x00,
+       0x20,
+       0x08,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x20,
+       0x8F,
+       0x08,
+       0x20,
+       0xB9,
+       0x50,
+       0x20,
+       0x00,
+       0x08,
+       0x20,
+       0xBA,
+       0x50,
+       0x40,
+       0x1D,
+       0xA0,
+       0x04,
+       0xFF,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x04,
+       0xB5,
+       0x44,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xB7,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xB7,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xB8,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0xB8,
+       0x60,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x10,
+       0x00,
+       0x20,
+       0xFF,
+       0xFF,
+       0x11,
+       0x50,
+       0x0F,
+       0x07,
+       0x00,
+       0x20,
+       0x08,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x20,
+       0x8F,
+       0x08,
+       0x20,
+       0xB7,
+       0x50,
+       0x20,
+       0x00,
+       0x08,
+       0x20,
+       0xB8,
+       0x50,
+       0x40,
+       0x1D,
+       0xA0,
+       0x04,
+       0xFF,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xFB,
+       0xA0,
+       0x60,
+       0x02,
+       0x07,
+       0x00,
+       0x00,
+       0x21,
+       0x10,
+       0x10,
+       0x08,
+       0x10,
+       0xFB,
+       0x84,
+       0x40,
+       0xFB,
+       0xA0,
+       0x3F,
+       0xF1,
+       0x00,
+       0x08,
+       0xFB,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xFB,
+       0xA0,
+       0x60,
+       0x02,
+       0x07,
+       0x10,
+       0x10,
+       0x08,
+       0x10,
+       0xFB,
+       0x84,
+       0x40,
+       0xFB,
+       0xA0,
+       0x3F,
+       0xFA,
+       0x00,
+       0x08,
+       0xFB,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x00,
+       0x03,
+       0x00,
+       0x8F,
+       0xFF,
+       0x07,
+       0x20,
+       0x19,
+       0x60,
+       0x04,
+       0x1C,
+       0x44,
+       0x04,
+       0x1B,
+       0x44,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0x7E,
+       0x84,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0x7E,
+       0x84,
+       0x60,
+       0x00,
+       0x08,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x03,
+       0x00,
+       0x04,
+       0x6E,
+       0x84,
+       0x00,
+       0x05,
+       0x21,
+       0x20,
+       0x04,
+       0x00,
+       0x00,
+       0x04,
+       0x11,
+       0x30,
+       0x05,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x00,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x90,
+       0x19,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x19,
+       0xA0,
+       0x20,
+       0x1F,
+       0x08,
+       0x40,
+       0xF5,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x2B,
+       0x00,
+       0x20,
+       0x8D,
+       0x50,
+       0x20,
+       0x11,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x40,
+       0xFE,
+       0xA0,
+       0x20,
+       0x14,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x40,
+       0xF5,
+       0xA0,
+       0x00,
+       0x00,
+       0x11,
+       0x90,
+       0x18,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x18,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x90,
+       0x19,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x80,
+       0x19,
+       0xA0,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0xFF,
+       0xFF,
+       0x11,
+       0x08,
+       0x00,
+       0x20,
+       0x50,
+       0x0F,
+       0x07,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x18,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x0A,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x08,
+       0xFE,
+       0x84,
+       0x00,
+       0x04,
+       0x07,
+       0x20,
+       0x0C,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x08,
+       0xFE,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x90,
+       0x17,
+       0x84,
+       0x20,
+       0x1F,
+       0x08,
+       0x80,
+       0x17,
+       0xA0,
+       0x10,
+       0x10,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x10,
+       0x00,
+       0x08,
+       0x01,
+       0x00,
+       0x11,
+       0x40,
+       0x51,
+       0xA0,
+       0x90,
+       0x17,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x80,
+       0x47,
+       0xA0,
+       0x8D,
+       0x0C,
+       0x07,
+       0x00,
+       0x00,
+       0x11,
+       0x30,
+       0x03,
+       0x07,
+       0x80,
+       0x41,
+       0x90,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0xFC,
+       0x90,
+       0x88,
+       0x2F,
+       0x84,
+       0x00,
+       0x00,
+       0x11,
+       0x30,
+       0x02,
+       0x07,
+       0x40,
+       0xFF,
+       0x90,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0xFD,
+       0x90,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x2D,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x20,
+       0x0D,
+       0x08,
+       0x80,
+       0x0F,
+       0x90,
+       0x80,
+       0x26,
+       0xA0,
+       0x90,
+       0x2E,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x90,
+       0x26,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x1F,
+       0xA0,
+       0x20,
+       0x2E,
+       0x08,
+       0x40,
+       0xED,
+       0x90,
+       0x20,
+       0x0F,
+       0x08,
+       0x80,
+       0x0E,
+       0x90,
+       0x00,
+       0x00,
+       0x21,
+       0x30,
+       0x02,
+       0x07,
+       0x40,
+       0xEB,
+       0xA0,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0xFE,
+       0x90,
+       0x40,
+       0x7F,
+       0xA0,
+       0x04,
+       0xEB,
+       0x84,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x0F,
+       0x08,
+       0x80,
+       0x00,
+       0x21,
+       0x60,
+       0x04,
+       0x07,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0xEA,
+       0x90,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x0F,
+       0x08,
+       0x80,
+       0x00,
+       0x11,
+       0x00,
+       0x0B,
+       0x07,
+       0x08,
+       0x00,
+       0x20,
+       0x60,
+       0x0D,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0xEA,
+       0x90,
+       0x8F,
+       0x06,
+       0x07,
+       0x04,
+       0xFF,
+       0x84,
+       0x20,
+       0x09,
+       0x60,
+       0x10,
+       0xFC,
+       0x84,
+       0x08,
+       0xFD,
+       0x84,
+       0x04,
+       0xFE,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x37,
+       0xA0,
+       0x90,
+       0x69,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x69,
+       0xA0,
+       0x20,
+       0x1A,
+       0x08,
+       0x40,
+       0x64,
+       0xA0,
+       0x10,
+       0x10,
+       0x08,
+       0x80,
+       0x4F,
+       0xA0,
+       0x10,
+       0xFB,
+       0x84,
+       0x20,
+       0x1D,
+       0x08,
+       0x40,
+       0x5F,
+       0xA0,
+       0x20,
+       0x1E,
+       0x08,
+       0x40,
+       0x5D,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x80,
+       0x68,
+       0x90,
+       0x40,
+       0xFE,
+       0xA0,
+       0x20,
+       0x0F,
+       0x07,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0x7F,
+       0xA0,
+       0x04,
+       0xFE,
+       0x84,
+       0x00,
+       0x04,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0x0A,
+       0x44,
+       0x10,
+       0xF4,
+       0x84,
+       0x3A,
+       0x96,
+       0x00,
+       0xE0,
+       0x14,
+       0x43,
+       0x08,
+       0x00,
+       0x20,
+       0x00,
+       0x06,
+       0x07,
+       0x89,
+       0x02,
+       0x07,
+       0x40,
+       0xAE,
+       0x90,
+       0x81,
+       0x04,
+       0x07,
+       0x40,
+       0x2E,
+       0x90,
+       0x40,
+       0x7F,
+       0xA0,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0xCF,
+       0x84,
+       0x20,
+       0x1A,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x10,
+       0xAE,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x04,
+       0xAF,
+       0x44,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0xC9,
+       0x90,
+       0x20,
+       0xAE,
+       0x60,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xCA,
+       0x90,
+       0x20,
+       0xAF,
+       0x60,
+       0x10,
+       0xFF,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x04,
+       0xCD,
+       0x84,
+       0x40,
+       0xFF,
+       0xA0,
+       0x08,
+       0xCE,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0xCD,
+       0x90,
+       0x40,
+       0xCB,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xCE,
+       0x90,
+       0x40,
+       0xCC,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x2F,
+       0x08,
+       0x40,
+       0xC8,
+       0x90,
+       0x00,
+       0x00,
+       0x08,
+       0x40,
+       0xB5,
+       0x90,
+       0x40,
+       0xAD,
+       0xA0,
+       0x00,
+       0x1F,
+       0x07,
+       0x10,
+       0x4F,
+       0x84,
+       0x20,
+       0x1A,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x10,
+       0xAC,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x04,
+       0xAD,
+       0x44,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x49,
+       0x90,
+       0x20,
+       0xAC,
+       0x60,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x4A,
+       0x90,
+       0x20,
+       0xAD,
+       0x60,
+       0x10,
+       0xFF,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x04,
+       0x4D,
+       0x84,
+       0x40,
+       0xFF,
+       0xA0,
+       0x08,
+       0x4E,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x4D,
+       0x90,
+       0x40,
+       0x4B,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x4E,
+       0x90,
+       0x40,
+       0x4C,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x2F,
+       0x08,
+       0x40,
+       0x48,
+       0x90,
+       0x00,
+       0x00,
+       0x08,
+       0x40,
+       0x35,
+       0x90,
+       0x40,
+       0x2D,
+       0xA0,
+       0x00,
+       0x3E,
+       0x07,
+       0x80,
+       0x21,
+       0x07,
+       0x82,
+       0x03,
+       0x07,
+       0x04,
+       0x50,
+       0x84,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x02,
+       0x07,
+       0x00,
+       0x08,
+       0x21,
+       0x40,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x40,
+       0x50,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x10,
+       0xD4,
+       0x44,
+       0x00,
+       0x00,
+       0x01,
+       0x70,
+       0x02,
+       0x07,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0xD4,
+       0x60,
+       0xFF,
+       0xF0,
+       0x11,
+       0x98,
+       0x02,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x02,
+       0x11,
+       0x20,
+       0x76,
+       0x00,
+       0x80,
+       0x14,
+       0x43,
+       0x01,
+       0x00,
+       0x01,
+       0x04,
+       0x00,
+       0x11,
+       0x02,
+       0x00,
+       0x21,
+       0x08,
+       0x9F,
+       0x84,
+       0x20,
+       0x94,
+       0x50,
+       0x08,
+       0x93,
+       0x44,
+       0x9C,
+       0x03,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0x00,
+       0x10,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x97,
+       0x90,
+       0x10,
+       0xBF,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x20,
+       0xCE,
+       0x50,
+       0x40,
+       0x90,
+       0xA0,
+       0x20,
+       0x1D,
+       0x08,
+       0x40,
+       0xC6,
+       0xA0,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x72,
+       0x90,
+       0x40,
+       0x16,
+       0xA0,
+       0x10,
+       0x96,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x9E,
+       0xA0,
+       0x20,
+       0x36,
+       0x50,
+       0x20,
+       0x90,
+       0x00,
+       0x00,
+       0x14,
+       0x43,
+       0x00,
+       0x01,
+       0x01,
+       0x00,
+       0x04,
+       0x11,
+       0x00,
+       0x02,
+       0x21,
+       0x08,
+       0x1F,
+       0x84,
+       0x20,
+       0x94,
+       0x50,
+       0x08,
+       0x93,
+       0x44,
+       0x9F,
+       0x03,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0x00,
+       0x10,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x17,
+       0x90,
+       0x10,
+       0x3F,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x20,
+       0xCD,
+       0x50,
+       0x40,
+       0x90,
+       0xA0,
+       0x20,
+       0x1D,
+       0x08,
+       0x40,
+       0x46,
+       0xA0,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x70,
+       0x90,
+       0x40,
+       0x96,
+       0xA0,
+       0x10,
+       0x16,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x1E,
+       0xA0,
+       0x20,
+       0x34,
+       0x50,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x04,
+       0x00,
+       0x04,
+       0x1C,
+       0x44,
+       0x04,
+       0x1B,
+       0x44,
+       0x40,
+       0x52,
+       0xA0,
+       0x87,
+       0x04,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0xC0,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8F,
+       0x50,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0x80,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8E,
+       0x50,
+       0x40,
+       0xFE,
+       0xA0,
+       0x00,
+       0x09,
+       0x07,
+       0x10,
+       0xC0,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8F,
+       0x50,
+       0x40,
+       0xFE,
+       0xA0,
+       0x10,
+       0x80,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8E,
+       0x50,
+       0x40,
+       0xFF,
+       0xA0,
+       0x81,
+       0x0A,
+       0x07,
+       0x40,
+       0x79,
+       0xA0,
+       0x10,
+       0xFE,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0xC1,
+       0x50,
+       0x20,
+       0x1C,
+       0x60,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0x81,
+       0x50,
+       0x20,
+       0x1B,
+       0x60,
+       0x08,
+       0x52,
+       0x84,
+       0x00,
+       0x1D,
+       0x07,
+       0x10,
+       0x8C,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8A,
+       0x50,
+       0x20,
+       0x8B,
+       0x60,
+       0x10,
+       0x42,
+       0x84,
+       0x20,
+       0x1E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x00,
+       0x20,
+       0x08,
+       0x20,
+       0x8C,
+       0x50,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x1C,
+       0x90,
+       0x10,
+       0x07,
+       0x84,
+       0x20,
+       0x1E,
+       0x08,
+       0x40,
+       0x10,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x06,
+       0x90,
+       0x40,
+       0x55,
+       0xA0,
+       0x10,
+       0xCC,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xCA,
+       0x50,
+       0x20,
+       0xCB,
+       0x60,
+       0x10,
+       0xC2,
+       0x84,
+       0x20,
+       0x1E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x00,
+       0x20,
+       0x08,
+       0x20,
+       0xCC,
+       0x50,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x9C,
+       0x90,
+       0x10,
+       0x87,
+       0x84,
+       0x20,
+       0x1E,
+       0x08,
+       0x40,
+       0x10,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x86,
+       0x90,
+       0x40,
+       0x56,
+       0xA0,
+       0x10,
+       0x56,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x7B,
+       0x90,
+       0x22,
+       0x00,
+       0x60,
+       0x40,
+       0x00,
+       0x08,
+       0x40,
+       0x79,
+       0xA0,
+       0x00,
+       0x08,
+       0x11,
+       0x10,
+       0x55,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x7A,
+       0x90,
+       0x22,
+       0x00,
+       0x60,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0x79,
+       0xA0,
+       0x00,
+       0xFF,
+       0x11,
+       0x08,
+       0x52,
+       0x84,
+       0x80,
+       0xFF,
+       0x11,
+       0x30,
+       0x34,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x88,
+       0xFF,
+       0x11,
+       0x40,
+       0x52,
+       0xA0,
+       0x04,
+       0x6F,
+       0x84,
+       0x00,
+       0x05,
+       0x21,
+       0x21,
+       0x7C,
+       0x00,
+       0x04,
+       0x00,
+       0x11,
+       0x10,
+       0xC1,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x70,
+       0x07,
+       0x07,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0xC0,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x08,
+       0x00,
+       0x20,
+       0x08,
+       0xC1,
+       0x84,
+       0x10,
+       0x00,
+       0x10,
+       0x20,
+       0x0E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x40,
+       0xBD,
+       0x90,
+       0x9E,
+       0x05,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x40,
+       0xEC,
+       0x90,
+       0x04,
+       0x6E,
+       0x84,
+       0x00,
+       0x05,
+       0x21,
+       0x21,
+       0x92,
+       0x00,
+       0x00,
+       0x04,
+       0x11,
+       0x10,
+       0x41,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x70,
+       0x07,
+       0x07,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0x40,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x08,
+       0x00,
+       0x20,
+       0x08,
+       0x41,
+       0x84,
+       0x10,
+       0x00,
+       0x10,
+       0x20,
+       0x0E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x40,
+       0x3D,
+       0x90,
+       0x9E,
+       0x05,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x40,
+       0x6D,
+       0x90,
+       0xFB,
+       0xCE,
+       0xC6,
+       0x10,
+       0x2D,
+       0x44,
+       0x21,
+       0x1C,
+       0x00,
+       0x08,
+       0x00,
+       0x11,
+       0x20,
+       0x32,
+       0x60,
+       0x80,
+       0x14,
+       0x43,
+       0xFB,
+       0xCD,
+       0xC6,
+       0x10,
+       0x2C,
+       0x44,
+       0x21,
+       0x22,
+       0x00,
+       0x00,
+       0x08,
+       0x11,
+       0x20,
+       0x31,
+       0x60,
+       0x00,
+       0x14,
+       0x43,
+       0x04,
+       0x34,
+       0x44,
+       0x40,
+       0x5B,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x21,
+       0xB5,
+       0x00,
+       0x80,
+       0x00,
+       0x11,
+       0x21,
+       0xBB,
+       0x00,
+       0x3F,
+       0xFF,
+       0x11,
+       0x08,
+       0xE8,
+       0x84,
+       0x20,
+       0x32,
+       0x50,
+       0x08,
+       0x68,
+       0x84,
+       0x20,
+       0x31,
+       0x50,
+       0x08,
+       0x5E,
+       0x84,
+       0x20,
+       0x30,
+       0x50,
+       0x0F,
+       0xC2,
+       0x07,
+       0x10,
+       0x34,
+       0x44,
+       0x10,
+       0x5B,
+       0x84,
+       0x6F,
+       0xF3,
+       0x07,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0xBD,
+       0x60,
+       0x40,
+       0xFC,
+       0x90,
+       0x3C,
+       0xF3,
+       0x00,
+       0x04,
+       0xFC,
+       0x84,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0xFD,
+       0x84,
+       0x00,
+       0x08,
+       0x21,
+       0x00,
+       0x04,
+       0x00,
+       0x21,
+       0xCC,
+       0x00,
+       0xC0,
+       0x00,
+       0x11,
+       0x04,
+       0x5B,
+       0x84,
+       0x20,
+       0xBD,
+       0x60,
+       0x70,
+       0x06,
+       0x07,
+       0x10,
+       0xFE,
+       0x84,
+       0x30,
+       0x20,
+       0x08,
+       0x00,
+       0x03,
+       0x11,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x59,
+       0x90,
+       0x04,
+       0xFF,
+       0x84,
+       0x40,
+       0x58,
+       0xA0,
+       0x10,
+       0x59,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x59,
+       0xA0,
+       0x20,
+       0x00,
+       0x11,
+       0x70,
+       0x1E,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x0B,
+       0x11,
+       0x0F,
+       0xE2,
+       0x07,
+       0x10,
+       0x59,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0x30,
+       0x50,
+       0x40,
+       0x59,
+       0xA0,
+       0x70,
+       0x06,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x0A,
+       0x11,
+       0x0F,
+       0xEA,
+       0x07,
+       0x10,
+       0x34,
+       0x44,
+       0x00,
+       0x20,
+       0x08,
+       0x00,
+       0x10,
+       0x01,
+       0x20,
+       0xBD,
+       0x50,
+       0x10,
+       0x58,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x58,
+       0xA0,
+       0x20,
+       0x00,
+       0x11,
+       0x30,
+       0x0A,
+       0x07,
+       0x0F,
+       0xF4,
+       0x07,
+       0x10,
+       0x58,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0x30,
+       0x50,
+       0x40,
+       0x58,
+       0xA0,
+       0x70,
+       0x06,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x05,
+       0x11,
+       0x00,
+       0x04,
+       0x00,
+       0x10,
+       0x5A,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x40,
+       0x5A,
+       0xA0,
+       0x08,
+       0x34,
+       0x44,
+       0x20,
+       0xBD,
+       0x50,
+       0x30,
+       0x08,
+       0x07,
+       0x60,
+       0x00,
+       0x08,
+       0x00,
+       0x00,
+       0x11,
+       0x40,
+       0x5A,
+       0xA0,
+       0x8F,
+       0x51,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0xB4,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x20,
+       0xB4,
+       0x60,
+       0x60,
+       0x05,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x50,
+       0x21,
+       0x40,
+       0xFD,
+       0x90,
+       0x60,
+       0x02,
+       0x07,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0xFE,
+       0x90,
+       0x10,
+       0xFD,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x20,
+       0xC2,
+       0x60,
+       0x10,
+       0xFE,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x20,
+       0x82,
+       0x60,
+       0x3C,
+       0x16,
+       0x00,
+       0x10,
+       0x00,
+       0x20,
+       0xA8,
+       0x14,
+       0x43,
+       0x04,
+       0xA7,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0xC4,
+       0x90,
+       0x40,
+       0xAF,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xC5,
+       0x90,
+       0x40,
+       0xA7,
+       0xA0,
+       0x3C,
+       0x20,
+       0x00,
+       0x10,
+       0x00,
+       0x20,
+       0x28,
+       0x14,
+       0x43,
+       0x04,
+       0x27,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x44,
+       0x90,
+       0x40,
+       0x2F,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x45,
+       0x90,
+       0x40,
+       0x27,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x08,
+       0x6F,
+       0x84,
+       0x00,
+       0x00,
+       0x11,
+       0x04,
+       0xF1,
+       0x84,
+       0x00,
+       0x40,
+       0x21,
+       0x22,
+       0x38,
+       0x00,
+       0x02,
+       0x00,
+       0x11,
+       0x60,
+       0x07,
+       0x07,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0xC3,
+       0x90,
+       0x20,
+       0x2F,
+       0x08,
+       0x80,
+       0x00,
+       0x11,
+       0x70,
+       0x02,
+       0x07,
+       0x7F,
+       0xFF,
+       0x11,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x8D,
+       0x90,
+       0x40,
+       0x85,
+       0xA0,
+       0x08,
+       0x6E,
+       0x84,
+       0x00,
+       0x00,
+       0x11,
+       0x04,
+       0xF0,
+       0x84,
+       0x00,
+       0x40,
+       0x21,
+       0x22,
+       0x48,
+       0x00,
+       0x00,
+       0x02,
+       0x11,
+       0x60,
+       0x07,
+       0x07,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x43,
+       0x90,
+       0x20,
+       0x2F,
+       0x08,
+       0x80,
+       0x00,
+       0x11,
+       0x70,
+       0x02,
+       0x07,
+       0x7F,
+       0xFF,
+       0x11,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x0D,
+       0x90,
+       0x40,
+       0x05,
+       0xA0,
+       0x10,
+       0xEC,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x10,
+       0xE7,
+       0x84,
+       0x40,
+       0xE7,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xEF,
+       0xA0,
+       0x10,
+       0x6D,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x10,
+       0x6C,
+       0x84,
+       0x40,
+       0x6C,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x7D,
+       0xA0,
+       0x7F,
+       0xFF,
+       0x11,
+       0x00,
+       0x04,
+       0x00,
+       0x10,
+       0xCA,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xD4,
+       0x50,
+       0x22,
+       0xC4,
+       0x00,
+       0x94,
+       0x14,
+       0x43,
+       0x20,
+       0xC4,
+       0x60,
+       0x10,
+       0xD3,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x20,
+       0xC2,
+       0x50,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0xC2,
+       0x44,
+       0x00,
+       0x00,
+       0x01,
+       0x20,
+       0x03,
+       0x07,
+       0x50,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x20,
+       0xB3,
+       0x60,
+       0x04,
+       0xC2,
+       0x44,
+       0x22,
+       0xD3,
+       0x00,
+       0x93,
+       0x14,
+       0x43,
+       0x22,
+       0xE0,
+       0x00,
+       0x95,
+       0x14,
+       0x43,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x0D,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x22,
+       0xBD,
+       0x00,
+       0x20,
+       0xC0,
+       0x60,
+       0x10,
+       0x8A,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xD4,
+       0x50,
+       0x22,
+       0xDF,
+       0x00,
+       0x14,
+       0x14,
+       0x43,
+       0x20,
+       0x84,
+       0x60,
+       0x10,
+       0xD2,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x20,
+       0x82,
+       0x50,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0x82,
+       0x44,
+       0x00,
+       0x00,
+       0x01,
+       0x20,
+       0x03,
+       0x07,
+       0x50,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x20,
+       0xB3,
+       0x60,
+       0x04,
+       0x82,
+       0x44,
+       0x22,
+       0xEE,
+       0x00,
+       0x13,
+       0x14,
+       0x43,
+       0x22,
+       0xFB,
+       0x00,
+       0x15,
+       0x14,
+       0x43,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x0D,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x22,
+       0xBB,
+       0x00,
+       0x20,
+       0x80,
+       0x60,
+       0x10,
+       0xD6,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xD6,
+       0x60,
+       0x10,
+       0xD5,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xD5,
+       0x60,
+       0x10,
+       0x51,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xC0,
+       0x11,
+       0x40,
+       0x51,
+       0xA0,
+       0x10,
+       0xEF,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x10,
+       0xEE,
+       0x84,
+       0x40,
+       0xEE,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xBD,
+       0xA0,
+       0x10,
+       0x7D,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x10,
+       0x7C,
+       0x84,
+       0x40,
+       0x7C,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x3D,
+       0xA0,
+       0x40,
+       0x00,
+       0x11,
+       0x3D,
+       0xF0,
+       0x00,
+       0xFB,
+       0xFF,
+       0x21,
+       0x6F,
+       0x14,
+       0x43,
+       0x3D,
+       0xF3,
+       0x00,
+       0xFF,
+       0xFB,
+       0x21,
+       0x6E,
+       0x14,
+       0x43,
+       0x3C,
+       0xAC,
+       0x00,
+       0x40,
+       0xAF,
+       0xA0,
+       0xA0,
+       0x14,
+       0x43,
+       0x3C,
+       0xAF,
+       0x00,
+       0x40,
+       0x2F,
+       0xA0,
+       0x20,
+       0x14,
+       0x43,
+       0x00,
+       0x04,
+       0x00,
+       0x3C,
+       0xB3,
+       0x00,
+       0x40,
+       0xA5,
+       0xA0,
+       0xB0,
+       0x14,
+       0x43,
+       0x3C,
+       0xB6,
+       0x00,
+       0x40,
+       0x25,
+       0xA0,
+       0x30,
+       0x14,
+       0x43,
+       0x00,
+       0x00,
+       0x00,
+       0x22,
+       0x95,
+       0x00,
+       0x00,
+       0x02,
+       0x07,
+       0x22,
+       0x93,
+       0x00,
+       0x89,
+       0x03,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x80,
+       0x14,
+       0x43,
+       0x40,
+       0xBD,
+       0x90,
+       0x10,
+       0x9C,
+       0x84,
+       0x20,
+       0x8F,
+       0x08,
+       0x40,
+       0x9A,
+       0x90,
+       0x40,
+       0x99,
+       0xA0,
+       0x20,
+       0x2E,
+       0x08,
+       0x40,
+       0xBD,
+       0x90,
+       0x00,
+       0x10,
+       0x08,
+       0x40,
+       0x9B,
+       0xA0,
+       0x20,
+       0x0E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x40,
+       0xF5,
+       0x90,
+       0x00,
+       0x00,
+       0x00,
+       0x22,
+       0xA8,
+       0x00,
+       0x00,
+       0x02,
+       0x07,
+       0x22,
+       0xA6,
+       0x00,
+       0x81,
+       0x03,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x14,
+       0x43,
+       0x40,
+       0x3D,
+       0x90,
+       0x18,
+       0x14,
+       0x43,
+       0x10,
+       0x1C,
+       0x84,
+       0x20,
+       0x8F,
+       0x08,
+       0x40,
+       0x1A,
+       0x90,
+       0x40,
+       0x19,
+       0xA0,
+       0x20,
+       0x2E,
+       0x08,
+       0x40,
+       0x3D,
+       0x90,
+       0x00,
+       0x10,
+       0x08,
+       0x40,
+       0x1B,
+       0xA0,
+       0x20,
+       0x0E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x40,
+       0xF5,
+       0x90,
+       0x00,
+       0x00,
+       0x00,
+       0x04,
+       0xD6,
+       0x44,
+       0x30,
+       0x02,
+       0x07,
+       0x70,
+       0x10,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x22,
+       0xFB,
+       0x00,
+       0x40,
+       0xBC,
+       0xA0,
+       0x04,
+       0xD5,
+       0x44,
+       0x30,
+       0x02,
+       0x07,
+       0x70,
+       0x10,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x23,
+       0x01,
+       0x00,
+       0x40,
+       0x3C,
+       0xA0,
+       0x3E,
+       0x01,
+       0x00,
+       0xB8,
+       0x14,
+       0x43,
+       0x40,
+       0xC2,
+       0xA0,
+       0x3E,
+       0x04,
+       0x00,
+       0x38,
+       0x14,
+       0x43,
+       0x40,
+       0x42,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x10,
+       0xC5,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xC5,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xC9,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xC9,
+       0x60,
+       0x20,
+       0x1C,
+       0x08,
+       0x20,
+       0xC8,
+       0x60,
+       0x10,
+       0xC6,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0xC6,
+       0x60,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0xFF,
+       0xFF,
+       0x11,
+       0x50,
+       0x13,
+       0x07,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xC5,
+       0x60,
+       0x20,
+       0x0C,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x00,
+       0x03,
+       0x07,
+       0x20,
+       0x09,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x98,
+       0x04,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x20,
+       0xC4,
+       0x50,
+       0x10,
+       0xC9,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xC7,
+       0x50,
+       0x10,
+       0x00,
+       0x20,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0xC4,
+       0x44,
+       0x20,
+       0x1D,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x20,
+       0x8F,
+       0x08,
+       0x4F,
+       0x91,
+       0x11,
+       0x20,
+       0xC3,
+       0x60,
+       0x20,
+       0x0F,
+       0x08,
+       0xF0,
+       0x70,
+       0x11,
+       0x10,
+       0xC3,
+       0x44,
+       0x20,
+       0x8F,
+       0x08,
+       0x40,
+       0xFC,
+       0x90,
+       0x20,
+       0xC3,
+       0x60,
+       0x20,
+       0x1F,
+       0x08,
+       0x12,
+       0xA4,
+       0x21,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0xC9,
+       0x50,
+       0x20,
+       0xD3,
+       0x60,
+       0x10,
+       0xFC,
+       0x84,
+       0x20,
+       0x1F,
+       0x08,
+       0x20,
+       0xBB,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0xD6,
+       0x50,
+       0x7F,
+       0xFF,
+       0x21,
+       0x10,
+       0x85,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0x85,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0x89,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0x89,
+       0x60,
+       0x20,
+       0x1C,
+       0x08,
+       0x20,
+       0x88,
+       0x60,
+       0x10,
+       0x86,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0x86,
+       0x60,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0xFF,
+       0xFF,
+       0x11,
+       0x50,
+       0x13,
+       0x07,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0x85,
+       0x60,
+       0x20,
+       0x0C,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x00,
+       0x03,
+       0x07,
+       0x20,
+       0x09,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x98,
+       0x04,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x20,
+       0x84,
+       0x50,
+       0x10,
+       0x89,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x87,
+       0x50,
+       0x10,
+       0x00,
+       0x20,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0x84,
+       0x44,
+       0x20,
+       0x1D,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x20,
+       0x8F,
+       0x08,
+       0x4F,
+       0x91,
+       0x11,
+       0x20,
+       0x83,
+       0x60,
+       0x20,
+       0x0F,
+       0x08,
+       0xF0,
+       0x70,
+       0x11,
+       0x10,
+       0x83,
+       0x44,
+       0x20,
+       0x8F,
+       0x08,
+       0x40,
+       0xFC,
+       0x90,
+       0x20,
+       0x83,
+       0x60,
+       0x20,
+       0x1F,
+       0x08,
+       0x12,
+       0xA4,
+       0x21,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0x89,
+       0x50,
+       0x20,
+       0xD2,
+       0x60,
+       0x10,
+       0xFC,
+       0x84,
+       0x20,
+       0x1F,
+       0x08,
+       0x20,
+       0xBB,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0xD5,
+       0x50,
+       0x7F,
+       0xFF,
+       0x21,
+       0x3E,
+       0xB2,
+       0x00,
+       0xFD,
+       0xFF,
+       0x21,
+       0xF1,
+       0x14,
+       0x43,
+       0x3E,
+       0xB5,
+       0x00,
+       0xFF,
+       0xFD,
+       0x21,
+       0xF0,
+       0x14,
+       0x43,
+       0x00,
+       0x04,
+       0x00,
+       0x04,
+       0xB9,
+       0x84,
+       0x40,
+       0xB6,
+       0xA0,
+       0x04,
+       0x39,
+       0x84,
+       0x40,
+       0x36,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x3E,
+       0x88,
+       0x00,
+       0x40,
+       0x87,
+       0xA0,
+       0x80,
+       0x14,
+       0x43,
+       0x3E,
+       0x8B,
+       0x00,
+       0x40,
+       0x07,
+       0xA0,
+       0x00,
+       0x14,
+       0x43,
+       0x00,
+       0x04,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0xB3,
+       0x44,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x20,
+       0x04,
+       0x07,
+       0x50,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x20,
+       0xB3,
+       0x60,
+       0x00,
+       0x00,
+       0x00,
+       0x04,
+       0xF5,
+       0x84,
+       0x00,
+       0x00,
+       0x21,
+       0x70,
+       0x03,
+       0x07,
+       0x10,
+       0xF5,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0xF3,
+       0x90,
+       0x40,
+       0xF5,
+       0xA0,
+       0x82,
+       0x08,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x3E,
+       0xA1,
+       0x00,
+       0x40,
+       0x85,
+       0xA0,
+       0x88,
+       0x14,
+       0x43,
+       0x3E,
+       0xA4,
+       0x00,
+       0x40,
+       0x05,
+       0xA0,
+       0x08,
+       0x14,
+       0x43,
+       0x00,
+       0x04,
+       0x00,
+       0x04,
+       0xB4,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x23,
+       0x9F,
+       0x00,
+       0x01,
+       0x00,
+       0x11,
+       0x00,
+       0x03,
+       0x07,
+       0x23,
+       0xA6,
+       0x00,
+       0xFE,
+       0xFF,
+       0x11,
+       0x70,
+       0x04,
+       0x07,
+       0x00,
+       0x01,
+       0x11,
+       0x10,
+       0x00,
+       0x08,
+       0x01,
+       0xC2,
+       0x11,
+       0x20,
+       0xB4,
+       0x60,
+       0x00,
+       0x04,
+       0x00,
+       0x00,
+       0x01,
+       0x07,
+       0x00,
+       0x02,
+       0x07,
+       0x00,
+       0x04,
+       0x07,
+       0x00,
+       0x04,
+       0x07,
+       0x00,
+       0x13,
+       0x07,
+       0x00,
+       0x2D,
+       0x07,
+       0x00,
+       0x35,
+       0x07,
+       0x00,
+       0x3B,
+       0x07,
+       0x00,
+       0xB7,
+       0x07,
+       0x00,
+       0xF9,
+       0x07,
+       0x01,
+       0x54,
+       0x07,
+       0x01,
+       0x83,
+       0x07,
+       0x01,
+       0xB1,
+       0x07,
+       0x02,
+       0x97,
+       0x07,
+       0x02,
+       0xD7,
+       0x07,
+       0x00,
+       0x10,
+       0x07,
+       0x1F,
+       0xFF,
+       0x07,
+       0x20,
+       0x03,
+       0x60,
+       0x0F,
+       0x4B,
+       0x07,
+       0x08,
+       0xFA,
+       0x84,
+       0x04,
+       0x11,
+       0x44,
+       0xFF,
+       0x00,
+       0x11,
+       0x2F,
+       0x4F,
+       0x07,
+       0x70,
+       0x10,
+       0x08,
+       0x00,
+       0xF0,
+       0x21,
+       0x50,
+       0x00,
+       0x08,
+       0x00,
+       0xF0,
+       0x21,
+       0x40,
+       0xF9,
+       0x90,
+       0x00,
+       0x08,
+       0x07,
+       0x3E,
+       0x55,
+       0x00,
+       0x0F,
+       0x57,
+       0x07,
+       0x90,
+       0x01,
+       0x07,
+       0x40,
+       0xF9,
+       0xA0,
+       0x3F,
+       0x5A,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x00,
+       0x7F,
+       0x11,
+       0x40,
+       0xF8,
+       0xA0,
+       0x9D,
+       0x07,
+       0x07,
+       0x20,
+       0x12,
+       0x60,
+       0x08,
+       0xFA,
+       0x84,
+       0x04,
+       0x11,
+       0x44,
+       0x3E,
+       0x30,
+       0x00,
+       0x00,
+       0x16,
+       0x07,
+       0x48,
+       0x80,
+       0x11,
+       0x08,
+       0x09,
+       0x44,
+       0x40,
+       0x75,
+       0x90,
+       0x7F,
+       0xEF,
+       0x07,
+       0x10,
+       0x00,
+       0x20,
+       0x00,
+       0x10,
+       0x08,
+       0xFF,
+       0xFF,
+       0x21,
+       0x06,
+       0x00,
+       0x84,
+       0x40,
+       0xFB,
+       0xA0,
+       0x60,
+       0x00,
+       0x08,
+       0x00,
+       0x00,
+       0x21,
+       0x40,
+       0xFF,
+       0x90,
+       0x10,
+       0xFB,
+       0x84,
+       0x60,
+       0x20,
+       0x08,
+       0x40,
+       0xFB,
+       0x90,
+       0x30,
+       0x00,
+       0x08,
+       0x00,
+       0x08,
+       0x11,
+       0x3D,
+       0xC6,
+       0x00,
+       0x04,
+       0xFB,
+       0x84,
+       0x3D,
+       0xC8,
+       0x00,
+       0x04,
+       0xFF,
+       0x84,
+       0x40,
+       0xF8,
+       0xA0,
+       0x04,
+       0x11,
+       0x44,
+       0x8F,
+       0xFF,
+       0x07,
+       0x20,
+       0x19,
+       0x60,
+       0x3E,
+       0xAE,
+       0x00,
+       0x00,
+       0x31,
+       0x07,
+       0x00,
+       0x01,
+       0x00,
+       0x00,
+       0x33,
+       0x07,
+       0x00,
+       0x02,
+       0x00,
+       0x04,
+       0xC1,
+       0x44,
+       0x04,
+       0x81,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x27,
+       0x18,
+       0x43,
+       0x70,
+       0x00,
+       0x43,
+       0x08,
+       0xD4,
+       0x44,
+       0x00,
+       0x00,
+       0x00,
+       0x08,
+       0x8F,
+       0x44,
+       0x8F,
+       0x02,
+       0x07,
+       0x40,
+       0x7A,
+       0xA0,
+       0x10,
+       0x8F,
+       0x44,
+       0x10,
+       0x8E,
+       0x44,
+       0x8F,
+       0x02,
+       0x07,
+       0x40,
+       0x7B,
+       0xA0,
+       0x08,
+       0x8E,
+       0x44,
+       0x80,
+       0x00,
+       0x01,
+       0x7F,
+       0xFF,
+       0x11,
+       0x04,
+       0x8D,
+       0x44,
+       0x08,
+       0x00,
+       0x21,
+       0x04,
+       0xB3,
+       0x44,
+       0x00,
+       0xA0,
+       0x21,
+       0x04,
+       0xBB,
+       0x44,
+       0x7F,
+       0x00,
+       0x21,
+       0x04,
+       0x10,
+       0x84,
+       0x40,
+       0x00,
+       0x21,
+       0x04,
+       0xCB,
+       0x44,
+       0x04,
+       0x8B,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0x1D,
+       0x84,
+       0x00,
+       0x3B,
+       0x21,
+       0x04,
+       0xC7,
+       0x44,
+       0x04,
+       0x87,
+       0x44,
+       0x01,
+       0x00,
+       0x21,
+       0x04,
+       0xC8,
+       0x44,
+       0x04,
+       0x88,
+       0x44,
+       0x02,
+       0x00,
+       0x21,
+       0x04,
+       0xBD,
+       0x44,
+       0x01,
+       0x08,
+       0x21,
+       0x10,
+       0x5F,
+       0x84,
+       0x20,
+       0x0E,
+       0x08,
+       0x4D,
+       0x19,
+       0x11,
+       0x40,
+       0x5F,
+       0xA0,
+       0x10,
+       0x3C,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x15,
+       0x00,
+       0x11,
+       0x20,
+       0x3C,
+       0x60,
+       0x30,
+       0x0B,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x08,
+       0x00,
+       0x11,
+       0x20,
+       0x5F,
+       0x60,
+       0x04,
+       0xBD,
+       0x44,
+       0x00,
+       0xF4,
+       0x21,
+       0x04,
+       0xF5,
+       0x84,
+       0x40,
+       0xF2,
+       0xA0,
+       0x04,
+       0x51,
+       0x84,
+       0x7F,
+       0xFF,
+       0x21,
+       0x04,
+       0xF5,
+       0x84,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0xF3,
+       0x84,
+       0x00,
+       0x10,
+       0x21,
+       0x04,
+       0xF2,
+       0x84,
+       0x06,
+       0x00,
+       0x21,
+       0x04,
+       0x72,
+       0x44,
+       0x00,
+       0x77,
+       0x21,
+       0x04,
+       0x2E,
+       0x44,
+       0x04,
+       0x2D,
+       0x44,
+       0x04,
+       0x2C,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x08,
+       0x28,
+       0x44,
+       0x01,
+       0x11,
+       0x11,
+       0x08,
+       0x5D,
+       0x84,
+       0x10,
+       0x00,
+       0x10,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x00,
+       0x21,
+       0x30,
+       0x04,
+       0x07,
+       0x40,
+       0xFF,
+       0x90,
+       0x50,
+       0x20,
+       0x08,
+       0xC0,
+       0x00,
+       0x11,
+       0x10,
+       0xFF,
+       0x84,
+       0x00,
+       0x20,
+       0x08,
+       0x00,
+       0x40,
+       0x11,
+       0x40,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x20,
+       0x51,
+       0x60,
+       0x10,
+       0x00,
+       0x44,
+       0x60,
+       0x00,
+       0x08,
+       0x40,
+       0x54,
+       0x90,
+       0x20,
+       0x00,
+       0x60,
+       0x00,
+       0x8D,
+       0x07,
+       0x81,
+       0x5C,
+       0x07,
+       0x80,
+       0x03,
+       0x07,
+       0x40,
+       0xF8,
+       0xA0,
+       0x48,
+       0xC0,
+       0x11,
+       0x00,
+       0x8B,
+       0x07,
+       0x00,
+       0x8C,
+       0x07,
+       0x00,
+       0x8D,
+       0x07,
+       0x00,
+       0x04,
+       0x07,
+       0x00,
+       0x8F,
+       0x07,
+       0x00,
+       0x90,
+       0x07,
+       0x00,
+       0x91,
+       0x07,
+       0x00,
+       0x69,
+       0x07,
+       0x00,
+       0x93,
+       0x07,
+       0x00,
+       0x94,
+       0x07,
+       0x00,
+       0x95,
+       0x07,
+       0x00,
+       0x88,
+       0x07,
+       0x00,
+       0x97,
+       0x07,
+       0x00,
+       0x96,
+       0x07,
+       0x00,
+       0x99,
+       0x07,
+       0x00,
+       0x9A,
+       0x07,
+       0x0F,
+       0xEF,
+       0x07,
+       0x1F,
+       0xFF,
+       0x07,
+       0xFF,
+       0x00,
+       0x11,
+       0x10,
+       0x00,
+       0x20,
+       0x30,
+       0x10,
+       0x08,
+       0x00,
+       0x01,
+       0x21,
+       0x50,
+       0x00,
+       0x08,
+       0x00,
+       0x0F,
+       0x21,
+       0x40,
+       0xF9,
+       0x90,
+       0x30,
+       0xA4,
+       0x07,
+       0x70,
+       0x10,
+       0x08,
+       0x00,
+       0x80,
+       0x21,
+       0x50,
+       0x00,
+       0x08,
+       0x00,
+       0xF0,
+       0x21,
+       0x08,
+       0xF9,
+       0x84,
+       0x04,
+       0xF8,
+       0x84,
+       0x2F,
+       0xFF,
+       0x07,
+       0x3E,
+       0x49,
+       0x00,
+       0x3F,
+       0xF8,
+       0x07,
+       0x70,
+       0x20,
+       0x08,
+       0x00,
+       0xDF,
+       0x11,
+       0x06,
+       0x00,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x10,
+       0xFF,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x04,
+       0xFF,
+       0x84,
+       0x00,
+       0x7F,
+       0x21,
+       0x04,
+       0xF1,
+       0x84,
+       0x04,
+       0xF0,
+       0x84,
+       0x04,
+       0x5A,
+       0x84,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0xF6,
+       0x84,
+       0x00,
+       0x0E,
+       0x21,
+       0x04,
+       0xFA,
+       0x84,
+       0x40,
+       0x00,
+       0x21,
+       0x04,
+       0xF7,
+       0x84,
+       0x01,
+       0x04,
+       0x21,
+       0x04,
+       0x70,
+       0x44,
+       0x06,
+       0x66,
+       0x21,
+       0x04,
+       0x3B,
+       0x44,
+       0x04,
+       0x39,
+       0x44,
+       0x00,
+       0x80,
+       0x21,
+       0x04,
+       0x3C,
+       0x44,
+       0x2A,
+       0x00,
+       0x21,
+       0x04,
+       0x2F,
+       0x44,
+       0x00,
+       0x44,
+       0x21,
+       0x04,
+       0x29,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x03,
+       0x19,
+       0x42,
+       0xCE,
+       0x19,
+       0x43,
+       0x0C,
+       0x59,
+       0x43,
+       0x40,
+       0x18,
+       0x42,
+       0x27,
+       0x18,
+       0x43,
+       0x15,
+       0x00,
+       0x43,
+       0x04,
+       0x22,
+       0x44,
+       0x03,
+       0x07,
+       0x21,
+       0x04,
+       0x21,
+       0x44,
+       0x11,
+       0x11,
+       0x21,
+       0x04,
+       0x20,
+       0x44,
+       0x33,
+       0x33,
+       0x21,
+       0x00,
+       0x00,
+       0x42,
+       0xC0,
+       0x3D,
+       0x42,
+       0x80,
+       0x3D,
+       0x43,
+       0x04,
+       0x35,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0x05,
+       0x43,
+       0x42,
+       0xE9,
+       0x00,
+};
+
+const OIS_UWORD DOWNLOAD_BIN_LEN = sizeof(DOWNLOAD_BIN);
+#endif /* OIS_PROG_H */
diff --git a/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_prog_chiron.h b/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_prog_chiron.h
new file mode 100644 (file)
index 0000000..41f765a
--- /dev/null
@@ -0,0 +1,4631 @@
+/*
+       File Name       : OIS_prog.h
+       Function                : Header file for OIS controller firmware
+       Rule         : Use TAB 4
+
+       Copyright(c)    Rohm Co.,Ltd. All rights reserved
+*/
+/***** ROHM Confidential ***************************************************/
+#ifndef OIS_PROG_H
+#define OIS_PROG_H
+
+const  OIS_UBYTE       DOWNLOAD_BIN[] = {      /* DOWNLOAD10d_SEMCO_Xiaomi_D5 20170616.bin*/
+       0x00,
+       0x2F,
+       0x65,
+       0x00,
+       0x05,
+       0xFF,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0x00,
+       0x20,
+       0x90,
+       0x00,
+       0x84,
+       0x20,
+       0x8F,
+       0x08,
+       0x80,
+       0x00,
+       0x90,
+       0x7D,
+       0x6F,
+       0x21,
+       0x20,
+       0x0F,
+       0x08,
+       0x02,
+       0xEC,
+       0x11,
+       0x00,
+       0x03,
+       0x00,
+       0x08,
+       0xE5,
+       0x44,
+       0x00,
+       0x00,
+       0x11,
+       0x04,
+       0xE6,
+       0x44,
+       0x2F,
+       0xF1,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x00,
+       0x00,
+       0x11,
+       0x0F,
+       0xF4,
+       0x07,
+       0x10,
+       0xE5,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x20,
+       0x05,
+       0x07,
+       0x20,
+       0xE5,
+       0x60,
+       0x10,
+       0xE4,
+       0x44,
+       0x70,
+       0x00,
+       0x08,
+       0x20,
+       0xE1,
+       0x50,
+       0x8D,
+       0xFD,
+       0x07,
+       0x20,
+       0xE3,
+       0x60,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0xE4,
+       0x44,
+       0x70,
+       0x00,
+       0x08,
+       0x20,
+       0xE3,
+       0x50,
+       0x20,
+       0xE1,
+       0x60,
+       0x08,
+       0xE3,
+       0x44,
+       0x20,
+       0x00,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x00,
+       0x00,
+       0x11,
+       0x40,
+       0xDF,
+       0xA0,
+       0x60,
+       0x0A,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x04,
+       0x11,
+       0x04,
+       0xE2,
+       0x44,
+       0x10,
+       0x00,
+       0x20,
+       0x3F,
+       0x7B,
+       0x00,
+       0x40,
+       0xDF,
+       0xA0,
+       0x10,
+       0xDF,
+       0x84,
+       0x39,
+       0x6A,
+       0x00,
+       0xD8,
+       0x14,
+       0x43,
+       0x20,
+       0xE8,
+       0x60,
+       0x08,
+       0xE1,
+       0x44,
+       0x20,
+       0x00,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x00,
+       0x00,
+       0x11,
+       0x40,
+       0xD7,
+       0xA0,
+       0x60,
+       0x06,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x04,
+       0x11,
+       0x04,
+       0xE0,
+       0x44,
+       0x10,
+       0x00,
+       0x20,
+       0x3F,
+       0x8B,
+       0x00,
+       0x40,
+       0xD7,
+       0xA0,
+       0x10,
+       0xD7,
+       0x84,
+       0x39,
+       0x7A,
+       0x00,
+       0xD0,
+       0x14,
+       0x43,
+       0x10,
+       0xE7,
+       0x44,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x0F,
+       0x08,
+       0x80,
+       0x00,
+       0x11,
+       0x20,
+       0xE7,
+       0x60,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0x00,
+       0x20,
+       0x90,
+       0x00,
+       0x84,
+       0x20,
+       0x8F,
+       0x08,
+       0x02,
+       0x8F,
+       0x11,
+       0x20,
+       0x2F,
+       0x08,
+       0x7D,
+       0x6F,
+       0x01,
+       0x80,
+       0x00,
+       0x90,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0x00,
+       0x20,
+       0x90,
+       0x00,
+       0x84,
+       0x20,
+       0x8F,
+       0x08,
+       0x14,
+       0xF3,
+       0x11,
+       0x20,
+       0x2F,
+       0x08,
+       0x6B,
+       0x0C,
+       0x01,
+       0x80,
+       0x00,
+       0x90,
+       0x00,
+       0x03,
+       0x00,
+       0x90,
+       0x00,
+       0x84,
+       0x00,
+       0x20,
+       0x08,
+       0x10,
+       0x00,
+       0x20,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x1D,
+       0xA0,
+       0x04,
+       0xFF,
+       0x84,
+       0x80,
+       0x00,
+       0x90,
+       0x00,
+       0x03,
+       0x00,
+       0x04,
+       0xB6,
+       0x44,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xB9,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xB9,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xBA,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0xBA,
+       0x60,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x10,
+       0x00,
+       0x20,
+       0xFF,
+       0xFF,
+       0x11,
+       0x50,
+       0x0F,
+       0x07,
+       0x00,
+       0x20,
+       0x08,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x20,
+       0x8F,
+       0x08,
+       0x20,
+       0xB9,
+       0x50,
+       0x20,
+       0x00,
+       0x08,
+       0x20,
+       0xBA,
+       0x50,
+       0x40,
+       0x1D,
+       0xA0,
+       0x04,
+       0xFF,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x04,
+       0xB5,
+       0x44,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xB7,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xB7,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xB8,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0xB8,
+       0x60,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x10,
+       0x00,
+       0x20,
+       0xFF,
+       0xFF,
+       0x11,
+       0x50,
+       0x0F,
+       0x07,
+       0x00,
+       0x20,
+       0x08,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x20,
+       0x8F,
+       0x08,
+       0x20,
+       0xB7,
+       0x50,
+       0x20,
+       0x00,
+       0x08,
+       0x20,
+       0xB8,
+       0x50,
+       0x40,
+       0x1D,
+       0xA0,
+       0x04,
+       0xFF,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xFB,
+       0xA0,
+       0x60,
+       0x02,
+       0x07,
+       0x00,
+       0x00,
+       0x21,
+       0x10,
+       0x10,
+       0x08,
+       0x10,
+       0xFB,
+       0x84,
+       0x40,
+       0xFB,
+       0xA0,
+       0x3F,
+       0xF1,
+       0x00,
+       0x08,
+       0xFB,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xFB,
+       0xA0,
+       0x60,
+       0x02,
+       0x07,
+       0x10,
+       0x10,
+       0x08,
+       0x10,
+       0xFB,
+       0x84,
+       0x40,
+       0xFB,
+       0xA0,
+       0x3F,
+       0xFA,
+       0x00,
+       0x08,
+       0xFB,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x00,
+       0x03,
+       0x00,
+       0x8F,
+       0xFF,
+       0x07,
+       0x20,
+       0x19,
+       0x60,
+       0x04,
+       0x1C,
+       0x44,
+       0x04,
+       0x1B,
+       0x44,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0x7E,
+       0x84,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x03,
+       0x00,
+       0x10,
+       0x7E,
+       0x84,
+       0x60,
+       0x00,
+       0x08,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x03,
+       0x00,
+       0x04,
+       0x6E,
+       0x84,
+       0x00,
+       0x05,
+       0x21,
+       0x20,
+       0x04,
+       0x00,
+       0x00,
+       0x04,
+       0x11,
+       0x30,
+       0x05,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x00,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x90,
+       0x19,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x19,
+       0xA0,
+       0x20,
+       0x1F,
+       0x08,
+       0x40,
+       0xF5,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x2B,
+       0x00,
+       0x20,
+       0x8D,
+       0x50,
+       0x20,
+       0x11,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x40,
+       0xFE,
+       0xA0,
+       0x20,
+       0x14,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x40,
+       0xF5,
+       0xA0,
+       0x00,
+       0x00,
+       0x11,
+       0x90,
+       0x18,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x18,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x90,
+       0x19,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x80,
+       0x19,
+       0xA0,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0xFF,
+       0xFF,
+       0x11,
+       0x08,
+       0x00,
+       0x20,
+       0x50,
+       0x0F,
+       0x07,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x18,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x0A,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x08,
+       0xFE,
+       0x84,
+       0x00,
+       0x04,
+       0x07,
+       0x20,
+       0x0C,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x08,
+       0xFE,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x90,
+       0x17,
+       0x84,
+       0x20,
+       0x1F,
+       0x08,
+       0x80,
+       0x17,
+       0xA0,
+       0x10,
+       0x10,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x10,
+       0x00,
+       0x08,
+       0x01,
+       0x00,
+       0x11,
+       0x40,
+       0x51,
+       0xA0,
+       0x90,
+       0x17,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x80,
+       0x47,
+       0xA0,
+       0x8D,
+       0x0C,
+       0x07,
+       0x00,
+       0x00,
+       0x11,
+       0x30,
+       0x03,
+       0x07,
+       0x80,
+       0x41,
+       0x90,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0xFC,
+       0x90,
+       0x88,
+       0x2F,
+       0x84,
+       0x00,
+       0x00,
+       0x11,
+       0x30,
+       0x02,
+       0x07,
+       0x40,
+       0xFF,
+       0x90,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0xFD,
+       0x90,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x2B,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x20,
+       0x0D,
+       0x08,
+       0x80,
+       0x0F,
+       0x90,
+       0x80,
+       0x26,
+       0xA0,
+       0x90,
+       0x2E,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x90,
+       0x26,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x1F,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x80,
+       0x0E,
+       0x90,
+       0x00,
+       0x00,
+       0x21,
+       0x30,
+       0x02,
+       0x07,
+       0x40,
+       0xEB,
+       0xA0,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0xFE,
+       0x90,
+       0x40,
+       0x7F,
+       0xA0,
+       0x04,
+       0xE9,
+       0x44,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x0F,
+       0x08,
+       0x80,
+       0x00,
+       0x21,
+       0x60,
+       0x04,
+       0x07,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0xEA,
+       0x90,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x0F,
+       0x08,
+       0x80,
+       0x00,
+       0x11,
+       0x00,
+       0x0B,
+       0x07,
+       0x08,
+       0x00,
+       0x20,
+       0x60,
+       0x0D,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0xEA,
+       0x90,
+       0x8F,
+       0x06,
+       0x07,
+       0x04,
+       0xFF,
+       0x84,
+       0x20,
+       0x09,
+       0x60,
+       0x10,
+       0xFC,
+       0x84,
+       0x08,
+       0xFD,
+       0x84,
+       0x04,
+       0xFE,
+       0x84,
+       0x00,
+       0x03,
+       0x00,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x37,
+       0xA0,
+       0x90,
+       0x69,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x80,
+       0x69,
+       0xA0,
+       0x20,
+       0x1A,
+       0x08,
+       0x40,
+       0x64,
+       0xA0,
+       0x10,
+       0x10,
+       0x08,
+       0x80,
+       0x4F,
+       0xA0,
+       0x10,
+       0xFB,
+       0x84,
+       0x20,
+       0x1D,
+       0x08,
+       0x40,
+       0x5F,
+       0xA0,
+       0x20,
+       0x1E,
+       0x08,
+       0x40,
+       0x5D,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x80,
+       0x68,
+       0x90,
+       0x40,
+       0xFE,
+       0xA0,
+       0x20,
+       0x0F,
+       0x07,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0x7F,
+       0xA0,
+       0x04,
+       0xFE,
+       0x84,
+       0x00,
+       0x04,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x02,
+       0x07,
+       0x89,
+       0x02,
+       0x07,
+       0x40,
+       0xAE,
+       0x90,
+       0x81,
+       0x04,
+       0x07,
+       0x40,
+       0x2E,
+       0x90,
+       0x40,
+       0x7F,
+       0xA0,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0xCF,
+       0x84,
+       0x20,
+       0x1C,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x84,
+       0x04,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0xAE,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x04,
+       0xAF,
+       0x44,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0xC9,
+       0x90,
+       0x20,
+       0xAE,
+       0x60,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xCA,
+       0x90,
+       0x20,
+       0xAF,
+       0x60,
+       0x10,
+       0xFF,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x04,
+       0xCD,
+       0x84,
+       0x40,
+       0xFF,
+       0xA0,
+       0x08,
+       0xCE,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0xCD,
+       0x90,
+       0x40,
+       0xCB,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xCE,
+       0x90,
+       0x40,
+       0xCC,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x2F,
+       0x08,
+       0x40,
+       0xC8,
+       0x90,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0xB5,
+       0x90,
+       0x40,
+       0xAD,
+       0xA0,
+       0x00,
+       0x21,
+       0x07,
+       0x10,
+       0x4F,
+       0x84,
+       0x20,
+       0x1C,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x84,
+       0x05,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0xAC,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x40,
+       0xFF,
+       0xA0,
+       0x04,
+       0xAD,
+       0x44,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x49,
+       0x90,
+       0x20,
+       0xAC,
+       0x60,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x4A,
+       0x90,
+       0x20,
+       0xAD,
+       0x60,
+       0x10,
+       0xFF,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x04,
+       0x4D,
+       0x84,
+       0x40,
+       0xFF,
+       0xA0,
+       0x08,
+       0x4E,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x4D,
+       0x90,
+       0x40,
+       0x4B,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x4E,
+       0x90,
+       0x40,
+       0x4C,
+       0xA0,
+       0x10,
+       0xFF,
+       0x84,
+       0x20,
+       0x2F,
+       0x08,
+       0x40,
+       0x48,
+       0x90,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x35,
+       0x90,
+       0x40,
+       0x2D,
+       0xA0,
+       0x00,
+       0x42,
+       0x07,
+       0x80,
+       0x23,
+       0x07,
+       0x82,
+       0x03,
+       0x07,
+       0x04,
+       0x50,
+       0x84,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x02,
+       0x07,
+       0x00,
+       0x08,
+       0x21,
+       0x40,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x40,
+       0x50,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x21,
+       0x83,
+       0x00,
+       0x10,
+       0xD4,
+       0x44,
+       0x00,
+       0x00,
+       0x01,
+       0x70,
+       0x02,
+       0x07,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0xD4,
+       0x60,
+       0xFF,
+       0xF0,
+       0x11,
+       0x98,
+       0x02,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x02,
+       0x11,
+       0x20,
+       0x77,
+       0x00,
+       0x80,
+       0x14,
+       0x43,
+       0x01,
+       0x00,
+       0x01,
+       0x04,
+       0x00,
+       0x11,
+       0x02,
+       0x00,
+       0x21,
+       0x08,
+       0x9F,
+       0x84,
+       0x20,
+       0x94,
+       0x50,
+       0x08,
+       0x93,
+       0x44,
+       0x9C,
+       0x03,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0x00,
+       0x10,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x97,
+       0x90,
+       0x10,
+       0xBF,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x20,
+       0xCE,
+       0x50,
+       0xFE,
+       0x00,
+       0x21,
+       0x20,
+       0x1D,
+       0x08,
+       0x40,
+       0xC6,
+       0xA0,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x72,
+       0x90,
+       0x40,
+       0x16,
+       0xA0,
+       0x10,
+       0x96,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x9E,
+       0xA0,
+       0x20,
+       0x36,
+       0x50,
+       0x20,
+       0x91,
+       0x00,
+       0x00,
+       0x14,
+       0x43,
+       0x00,
+       0x01,
+       0x01,
+       0x00,
+       0x04,
+       0x11,
+       0x00,
+       0x02,
+       0x21,
+       0x08,
+       0x1F,
+       0x84,
+       0x20,
+       0x94,
+       0x50,
+       0x08,
+       0x93,
+       0x44,
+       0x9F,
+       0x03,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0x00,
+       0x10,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x17,
+       0x90,
+       0x10,
+       0x3F,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x20,
+       0xCD,
+       0x50,
+       0xFF,
+       0x00,
+       0x21,
+       0x20,
+       0x1D,
+       0x08,
+       0x40,
+       0x46,
+       0xA0,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x70,
+       0x90,
+       0x40,
+       0x96,
+       0xA0,
+       0x10,
+       0x16,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x1E,
+       0xA0,
+       0x20,
+       0x34,
+       0x50,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x04,
+       0x00,
+       0x04,
+       0x1C,
+       0x44,
+       0x04,
+       0x1B,
+       0x44,
+       0x40,
+       0x52,
+       0xA0,
+       0x87,
+       0x04,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x10,
+       0xC0,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8F,
+       0x50,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0x80,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8E,
+       0x50,
+       0x40,
+       0xFE,
+       0xA0,
+       0x00,
+       0x09,
+       0x07,
+       0x10,
+       0xC0,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8F,
+       0x50,
+       0x40,
+       0xFE,
+       0xA0,
+       0x10,
+       0x80,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8E,
+       0x50,
+       0x40,
+       0xFF,
+       0xA0,
+       0x81,
+       0x0A,
+       0x07,
+       0x40,
+       0x79,
+       0xA0,
+       0x10,
+       0xFE,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0xC1,
+       0x50,
+       0x20,
+       0x1C,
+       0x60,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0x81,
+       0x50,
+       0x20,
+       0x1B,
+       0x60,
+       0x08,
+       0x52,
+       0x84,
+       0x00,
+       0x1D,
+       0x07,
+       0x10,
+       0x8C,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x8A,
+       0x50,
+       0x20,
+       0x8B,
+       0x60,
+       0x10,
+       0x42,
+       0x84,
+       0x20,
+       0x1E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x00,
+       0x20,
+       0x08,
+       0x20,
+       0x8C,
+       0x50,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x1C,
+       0x90,
+       0x10,
+       0x07,
+       0x84,
+       0x20,
+       0x1E,
+       0x08,
+       0x40,
+       0x10,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x06,
+       0x90,
+       0x40,
+       0x55,
+       0xA0,
+       0x10,
+       0xCC,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xCA,
+       0x50,
+       0x20,
+       0xCB,
+       0x60,
+       0x10,
+       0xC2,
+       0x84,
+       0x20,
+       0x1E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x00,
+       0x20,
+       0x08,
+       0x20,
+       0xCC,
+       0x50,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x9C,
+       0x90,
+       0x10,
+       0x87,
+       0x84,
+       0x20,
+       0x1E,
+       0x08,
+       0x40,
+       0x10,
+       0xA0,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x86,
+       0x90,
+       0x40,
+       0x56,
+       0xA0,
+       0x10,
+       0x56,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x7B,
+       0x90,
+       0x22,
+       0x00,
+       0x60,
+       0x40,
+       0x00,
+       0x08,
+       0x40,
+       0x79,
+       0xA0,
+       0x00,
+       0x08,
+       0x11,
+       0x10,
+       0x55,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x7A,
+       0x90,
+       0x22,
+       0x00,
+       0x60,
+       0x50,
+       0x00,
+       0x08,
+       0x40,
+       0x79,
+       0xA0,
+       0x00,
+       0xFF,
+       0x11,
+       0x08,
+       0x52,
+       0x84,
+       0x80,
+       0xFF,
+       0x11,
+       0x30,
+       0x34,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x88,
+       0xFF,
+       0x11,
+       0x40,
+       0x52,
+       0xA0,
+       0x04,
+       0x6F,
+       0x84,
+       0x00,
+       0x05,
+       0x21,
+       0x21,
+       0x7B,
+       0x00,
+       0x04,
+       0x00,
+       0x11,
+       0x10,
+       0xC1,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x70,
+       0x07,
+       0x07,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0xC0,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x08,
+       0x00,
+       0x20,
+       0x08,
+       0xC1,
+       0x84,
+       0x10,
+       0x00,
+       0x10,
+       0x20,
+       0x0E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x40,
+       0xBD,
+       0x90,
+       0x9E,
+       0x05,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x40,
+       0xEC,
+       0x90,
+       0x04,
+       0x6E,
+       0x84,
+       0x00,
+       0x05,
+       0x21,
+       0x21,
+       0x91,
+       0x00,
+       0x00,
+       0x04,
+       0x11,
+       0x10,
+       0x41,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x70,
+       0x07,
+       0x07,
+       0x10,
+       0x10,
+       0x08,
+       0x40,
+       0x40,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x08,
+       0x00,
+       0x20,
+       0x08,
+       0x41,
+       0x84,
+       0x10,
+       0x00,
+       0x10,
+       0x20,
+       0x0E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x40,
+       0x3D,
+       0x90,
+       0x9E,
+       0x05,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x40,
+       0x6D,
+       0x90,
+       0xFB,
+       0xCE,
+       0xC6,
+       0x10,
+       0x2D,
+       0x44,
+       0x21,
+       0x1D,
+       0x00,
+       0x08,
+       0x00,
+       0x11,
+       0x20,
+       0x32,
+       0x60,
+       0x80,
+       0x14,
+       0x43,
+       0xFB,
+       0xCD,
+       0xC6,
+       0x10,
+       0x2C,
+       0x44,
+       0x21,
+       0x23,
+       0x00,
+       0x00,
+       0x08,
+       0x11,
+       0x20,
+       0x31,
+       0x60,
+       0x00,
+       0x14,
+       0x43,
+       0x04,
+       0x34,
+       0x44,
+       0x40,
+       0x5B,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x21,
+       0xB4,
+       0x00,
+       0x80,
+       0x00,
+       0x11,
+       0x21,
+       0xBA,
+       0x00,
+       0x3F,
+       0xFF,
+       0x11,
+       0x08,
+       0xE8,
+       0x84,
+       0x20,
+       0x32,
+       0x50,
+       0x08,
+       0x68,
+       0x84,
+       0x20,
+       0x31,
+       0x50,
+       0x08,
+       0x5E,
+       0x84,
+       0x20,
+       0x30,
+       0x50,
+       0x0F,
+       0xC4,
+       0x07,
+       0x10,
+       0x34,
+       0x44,
+       0x10,
+       0x5B,
+       0x84,
+       0x6F,
+       0xF3,
+       0x07,
+       0x00,
+       0x00,
+       0x08,
+       0x02,
+       0x00,
+       0x21,
+       0x40,
+       0xFC,
+       0x90,
+       0x3C,
+       0xE6,
+       0x00,
+       0x04,
+       0xFC,
+       0x84,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0xFD,
+       0x84,
+       0x00,
+       0x08,
+       0x21,
+       0x00,
+       0x04,
+       0x00,
+       0x21,
+       0xCB,
+       0x00,
+       0xC0,
+       0x00,
+       0x11,
+       0x04,
+       0x5B,
+       0x84,
+       0x02,
+       0x00,
+       0x21,
+       0x70,
+       0x06,
+       0x07,
+       0x10,
+       0xFE,
+       0x84,
+       0x30,
+       0x20,
+       0x08,
+       0x00,
+       0x03,
+       0x11,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x59,
+       0x90,
+       0x04,
+       0xFF,
+       0x84,
+       0x40,
+       0x58,
+       0xA0,
+       0x10,
+       0x59,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x59,
+       0xA0,
+       0x20,
+       0x00,
+       0x11,
+       0x70,
+       0x1E,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x0B,
+       0x11,
+       0x0F,
+       0xE4,
+       0x07,
+       0x10,
+       0x59,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0x30,
+       0x50,
+       0x40,
+       0x59,
+       0xA0,
+       0x70,
+       0x06,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x0A,
+       0x11,
+       0x0F,
+       0xEC,
+       0x07,
+       0x08,
+       0x34,
+       0x44,
+       0x02,
+       0x10,
+       0x11,
+       0x10,
+       0x58,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x58,
+       0xA0,
+       0x20,
+       0x00,
+       0x11,
+       0x30,
+       0x08,
+       0x07,
+       0x0F,
+       0xF4,
+       0x07,
+       0x10,
+       0x58,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0x30,
+       0x50,
+       0x40,
+       0x58,
+       0xA0,
+       0x70,
+       0x06,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x05,
+       0x11,
+       0x00,
+       0x04,
+       0x00,
+       0x10,
+       0x5A,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x40,
+       0x5A,
+       0xA0,
+       0x08,
+       0x34,
+       0x44,
+       0x02,
+       0x00,
+       0x11,
+       0x30,
+       0x08,
+       0x07,
+       0x60,
+       0x00,
+       0x08,
+       0x00,
+       0x00,
+       0x11,
+       0x40,
+       0x5A,
+       0xA0,
+       0x8F,
+       0x4F,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x22,
+       0x7D,
+       0x00,
+       0x10,
+       0xEB,
+       0x84,
+       0x3B,
+       0xFF,
+       0x00,
+       0xE0,
+       0x14,
+       0x43,
+       0x20,
+       0xE9,
+       0x60,
+       0x96,
+       0x06,
+       0x07,
+       0xA6,
+       0xE8,
+       0xC6,
+       0x9F,
+       0xE7,
+       0xC6,
+       0x85,
+       0x04,
+       0x07,
+       0x26,
+       0xE8,
+       0xC6,
+       0x1F,
+       0xE7,
+       0xC6,
+       0x40,
+       0x7F,
+       0xA0,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0xB4,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x20,
+       0xB4,
+       0x60,
+       0x60,
+       0x05,
+       0x07,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x50,
+       0x21,
+       0x40,
+       0xFD,
+       0x90,
+       0x60,
+       0x02,
+       0x07,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0xFE,
+       0x90,
+       0x10,
+       0xFD,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x20,
+       0xC2,
+       0x60,
+       0x10,
+       0xFE,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x20,
+       0x82,
+       0x60,
+       0x3C,
+       0x13,
+       0x00,
+       0xB0,
+       0x14,
+       0x43,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x1B,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x3C,
+       0x18,
+       0x00,
+       0xA0,
+       0x14,
+       0x43,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x1F,
+       0x08,
+       0x55,
+       0x55,
+       0x21,
+       0x20,
+       0x0B,
+       0x08,
+       0x40,
+       0x8F,
+       0x90,
+       0x40,
+       0xBF,
+       0xA0,
+       0x3C,
+       0x20,
+       0x00,
+       0x30,
+       0x14,
+       0x43,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x1B,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x3C,
+       0x25,
+       0x00,
+       0x20,
+       0x14,
+       0x43,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x1F,
+       0x08,
+       0x55,
+       0x55,
+       0x21,
+       0x20,
+       0x0B,
+       0x08,
+       0x40,
+       0x0F,
+       0x90,
+       0x40,
+       0x3F,
+       0xA0,
+       0x3C,
+       0x2D,
+       0x00,
+       0x10,
+       0x00,
+       0x20,
+       0xA8,
+       0x14,
+       0x43,
+       0x04,
+       0xA7,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0xC4,
+       0x90,
+       0x40,
+       0xAF,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xC5,
+       0x90,
+       0x40,
+       0xA7,
+       0xA0,
+       0x3C,
+       0x37,
+       0x00,
+       0x10,
+       0x00,
+       0x20,
+       0x28,
+       0x14,
+       0x43,
+       0x04,
+       0x27,
+       0x84,
+       0x20,
+       0x8E,
+       0x08,
+       0x40,
+       0x44,
+       0x90,
+       0x40,
+       0x2F,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x45,
+       0x90,
+       0x40,
+       0x27,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x08,
+       0x6F,
+       0x84,
+       0x00,
+       0x00,
+       0x11,
+       0x04,
+       0xF1,
+       0x84,
+       0x00,
+       0x40,
+       0x21,
+       0x22,
+       0x5B,
+       0x00,
+       0x02,
+       0x00,
+       0x11,
+       0x60,
+       0x07,
+       0x07,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0xC3,
+       0x90,
+       0x20,
+       0x2F,
+       0x08,
+       0x80,
+       0x00,
+       0x11,
+       0x70,
+       0x02,
+       0x07,
+       0x7F,
+       0xFF,
+       0x11,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x8D,
+       0x90,
+       0x40,
+       0x85,
+       0xA0,
+       0x08,
+       0x6E,
+       0x84,
+       0x00,
+       0x00,
+       0x11,
+       0x04,
+       0xF0,
+       0x84,
+       0x00,
+       0x40,
+       0x21,
+       0x22,
+       0x6B,
+       0x00,
+       0x00,
+       0x02,
+       0x11,
+       0x60,
+       0x07,
+       0x07,
+       0x10,
+       0x20,
+       0x08,
+       0x40,
+       0x43,
+       0x90,
+       0x20,
+       0x2F,
+       0x08,
+       0x80,
+       0x00,
+       0x11,
+       0x70,
+       0x02,
+       0x07,
+       0x7F,
+       0xFF,
+       0x11,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x0D,
+       0x90,
+       0x40,
+       0x05,
+       0xA0,
+       0x10,
+       0xEC,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x10,
+       0xE7,
+       0x84,
+       0x40,
+       0xE7,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xEF,
+       0xA0,
+       0x10,
+       0x6D,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x10,
+       0x6C,
+       0x84,
+       0x40,
+       0x6C,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x7D,
+       0xA0,
+       0x7F,
+       0xFF,
+       0x11,
+       0x00,
+       0x04,
+       0x00,
+       0x10,
+       0xCA,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xD4,
+       0x50,
+       0x22,
+       0xE7,
+       0x00,
+       0x94,
+       0x14,
+       0x43,
+       0x20,
+       0xC4,
+       0x60,
+       0x10,
+       0xD3,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x20,
+       0xC2,
+       0x50,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0xC2,
+       0x44,
+       0x00,
+       0x00,
+       0x01,
+       0x20,
+       0x03,
+       0x07,
+       0x50,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x20,
+       0xB3,
+       0x60,
+       0x04,
+       0xC2,
+       0x44,
+       0x22,
+       0xF6,
+       0x00,
+       0x93,
+       0x14,
+       0x43,
+       0x23,
+       0x02,
+       0x00,
+       0x95,
+       0x14,
+       0x43,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x0D,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x22,
+       0xE0,
+       0x00,
+       0x20,
+       0xC0,
+       0x60,
+       0x10,
+       0x8A,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xD4,
+       0x50,
+       0x23,
+       0x02,
+       0x00,
+       0x14,
+       0x14,
+       0x43,
+       0x20,
+       0x84,
+       0x60,
+       0x10,
+       0xD2,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x20,
+       0x82,
+       0x50,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0x82,
+       0x44,
+       0x00,
+       0x00,
+       0x01,
+       0x20,
+       0x03,
+       0x07,
+       0x50,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x20,
+       0xB3,
+       0x60,
+       0x04,
+       0x82,
+       0x44,
+       0x23,
+       0x11,
+       0x00,
+       0x13,
+       0x14,
+       0x43,
+       0x23,
+       0x1D,
+       0x00,
+       0x15,
+       0x14,
+       0x43,
+       0x10,
+       0x00,
+       0x20,
+       0x20,
+       0x0D,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x22,
+       0xDE,
+       0x00,
+       0x20,
+       0x80,
+       0x60,
+       0x10,
+       0xD6,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xD6,
+       0x60,
+       0x10,
+       0xD5,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xD5,
+       0x60,
+       0x10,
+       0x51,
+       0x84,
+       0x20,
+       0x0F,
+       0x08,
+       0x7F,
+       0xC0,
+       0x11,
+       0x40,
+       0x51,
+       0xA0,
+       0x10,
+       0xEF,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x10,
+       0xEE,
+       0x84,
+       0x40,
+       0xEE,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0xBD,
+       0xA0,
+       0x10,
+       0x7D,
+       0x84,
+       0x00,
+       0x10,
+       0x08,
+       0x10,
+       0x7C,
+       0x84,
+       0x40,
+       0x7C,
+       0xA0,
+       0x20,
+       0x0F,
+       0x08,
+       0x40,
+       0x3D,
+       0xA0,
+       0x40,
+       0x00,
+       0x11,
+       0x3E,
+       0x07,
+       0x00,
+       0xFB,
+       0xFF,
+       0x21,
+       0x6F,
+       0x14,
+       0x43,
+       0x3E,
+       0x0A,
+       0x00,
+       0xFF,
+       0xFB,
+       0x21,
+       0x6E,
+       0x14,
+       0x43,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x04,
+       0x00,
+       0x23,
+       0x8F,
+       0x00,
+       0x59,
+       0x14,
+       0x43,
+       0x20,
+       0xE4,
+       0x60,
+       0x23,
+       0x92,
+       0x00,
+       0x58,
+       0x14,
+       0x43,
+       0x20,
+       0xE2,
+       0x60,
+       0x23,
+       0x95,
+       0x00,
+       0x53,
+       0x14,
+       0x43,
+       0x20,
+       0xE0,
+       0x60,
+       0x00,
+       0x00,
+       0x00,
+       0x22,
+       0xB6,
+       0x00,
+       0x00,
+       0x02,
+       0x07,
+       0x22,
+       0xB4,
+       0x00,
+       0x89,
+       0x03,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x80,
+       0x14,
+       0x43,
+       0x40,
+       0xBD,
+       0x90,
+       0x10,
+       0x9C,
+       0x84,
+       0x20,
+       0x8F,
+       0x08,
+       0x40,
+       0x9A,
+       0x90,
+       0x40,
+       0x99,
+       0xA0,
+       0x20,
+       0x2E,
+       0x08,
+       0x40,
+       0xBD,
+       0x90,
+       0x00,
+       0x10,
+       0x08,
+       0x40,
+       0x9B,
+       0xA0,
+       0x20,
+       0x0E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x40,
+       0xF5,
+       0x90,
+       0x00,
+       0x00,
+       0x00,
+       0x22,
+       0xC9,
+       0x00,
+       0x00,
+       0x02,
+       0x07,
+       0x22,
+       0xC7,
+       0x00,
+       0x81,
+       0x03,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x00,
+       0x14,
+       0x43,
+       0x40,
+       0x3D,
+       0x90,
+       0x18,
+       0x14,
+       0x43,
+       0x10,
+       0x1C,
+       0x84,
+       0x20,
+       0x8F,
+       0x08,
+       0x40,
+       0x1A,
+       0x90,
+       0x40,
+       0x19,
+       0xA0,
+       0x20,
+       0x2E,
+       0x08,
+       0x40,
+       0x3D,
+       0x90,
+       0x00,
+       0x10,
+       0x08,
+       0x40,
+       0x1B,
+       0xA0,
+       0x20,
+       0x0E,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x40,
+       0xF5,
+       0x90,
+       0x00,
+       0x00,
+       0x00,
+       0x04,
+       0xD6,
+       0x44,
+       0x30,
+       0x02,
+       0x07,
+       0x70,
+       0x10,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x23,
+       0x1C,
+       0x00,
+       0x40,
+       0xBC,
+       0xA0,
+       0x04,
+       0xD5,
+       0x44,
+       0x30,
+       0x02,
+       0x07,
+       0x70,
+       0x10,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x23,
+       0x22,
+       0x00,
+       0x40,
+       0x3C,
+       0xA0,
+       0x3E,
+       0x16,
+       0x00,
+       0xB8,
+       0x14,
+       0x43,
+       0x40,
+       0xC2,
+       0xA0,
+       0x3E,
+       0x19,
+       0x00,
+       0x38,
+       0x14,
+       0x43,
+       0x40,
+       0x42,
+       0xA0,
+       0x86,
+       0x3B,
+       0x07,
+       0x85,
+       0x3C,
+       0x07,
+       0x40,
+       0x7F,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x10,
+       0xC5,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xC5,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0xC9,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xC9,
+       0x60,
+       0x20,
+       0x1C,
+       0x08,
+       0x20,
+       0xC8,
+       0x60,
+       0x10,
+       0xC6,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0xC6,
+       0x60,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0xFF,
+       0xFF,
+       0x11,
+       0x50,
+       0x13,
+       0x07,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0xC5,
+       0x60,
+       0x20,
+       0x0C,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x00,
+       0x03,
+       0x07,
+       0x20,
+       0x09,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x98,
+       0x04,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x20,
+       0xC4,
+       0x50,
+       0x10,
+       0xC9,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0xC7,
+       0x50,
+       0x10,
+       0x00,
+       0x20,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0xC4,
+       0x44,
+       0x20,
+       0x1D,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x20,
+       0x8F,
+       0x08,
+       0x4F,
+       0x91,
+       0x11,
+       0x20,
+       0xC3,
+       0x60,
+       0x20,
+       0x0F,
+       0x08,
+       0xF0,
+       0x70,
+       0x11,
+       0x10,
+       0xC3,
+       0x44,
+       0x20,
+       0x8F,
+       0x08,
+       0x40,
+       0xFC,
+       0x90,
+       0x20,
+       0xC3,
+       0x60,
+       0x20,
+       0x1F,
+       0x08,
+       0x12,
+       0xA4,
+       0x21,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0xC9,
+       0x50,
+       0x20,
+       0xD3,
+       0x60,
+       0x10,
+       0xFC,
+       0x84,
+       0x20,
+       0x1F,
+       0x08,
+       0x20,
+       0xBB,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0xD6,
+       0x50,
+       0x7F,
+       0xFF,
+       0x21,
+       0x10,
+       0x85,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0x85,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0x80,
+       0x00,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x10,
+       0x89,
+       0x44,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0x89,
+       0x60,
+       0x20,
+       0x1C,
+       0x08,
+       0x20,
+       0x88,
+       0x60,
+       0x10,
+       0x86,
+       0x44,
+       0x00,
+       0x00,
+       0x08,
+       0x20,
+       0x86,
+       0x60,
+       0x00,
+       0x01,
+       0x11,
+       0x8F,
+       0x02,
+       0x07,
+       0xFF,
+       0xFF,
+       0x11,
+       0x50,
+       0x13,
+       0x07,
+       0x00,
+       0x10,
+       0x08,
+       0x20,
+       0x85,
+       0x60,
+       0x20,
+       0x0C,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x00,
+       0x03,
+       0x07,
+       0x20,
+       0x09,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x98,
+       0x04,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x20,
+       0x84,
+       0x50,
+       0x10,
+       0x89,
+       0x44,
+       0x20,
+       0x0F,
+       0x08,
+       0x20,
+       0x87,
+       0x50,
+       0x10,
+       0x00,
+       0x20,
+       0x10,
+       0xFF,
+       0x84,
+       0x10,
+       0x84,
+       0x44,
+       0x20,
+       0x1D,
+       0x08,
+       0x7F,
+       0xFF,
+       0x21,
+       0x20,
+       0x8F,
+       0x08,
+       0x4F,
+       0x91,
+       0x11,
+       0x20,
+       0x83,
+       0x60,
+       0x20,
+       0x0F,
+       0x08,
+       0xF0,
+       0x70,
+       0x11,
+       0x10,
+       0x83,
+       0x44,
+       0x20,
+       0x8F,
+       0x08,
+       0x40,
+       0xFC,
+       0x90,
+       0x20,
+       0x83,
+       0x60,
+       0x20,
+       0x1F,
+       0x08,
+       0x12,
+       0xA4,
+       0x21,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0x89,
+       0x50,
+       0x20,
+       0xD2,
+       0x60,
+       0x10,
+       0xFC,
+       0x84,
+       0x20,
+       0x1F,
+       0x08,
+       0x20,
+       0xBB,
+       0x60,
+       0x10,
+       0x00,
+       0x08,
+       0x20,
+       0xD5,
+       0x50,
+       0x7F,
+       0xFF,
+       0x21,
+       0x3E,
+       0xCA,
+       0x00,
+       0xFD,
+       0xFF,
+       0x21,
+       0xF1,
+       0x14,
+       0x43,
+       0x3E,
+       0xCD,
+       0x00,
+       0xFF,
+       0xFD,
+       0x21,
+       0xF0,
+       0x14,
+       0x43,
+       0x00,
+       0x04,
+       0x00,
+       0x04,
+       0xB9,
+       0x84,
+       0x40,
+       0xB6,
+       0xA0,
+       0x04,
+       0x39,
+       0x84,
+       0x40,
+       0x36,
+       0xA0,
+       0x00,
+       0x04,
+       0x00,
+       0x3E,
+       0xA0,
+       0x00,
+       0x40,
+       0x87,
+       0xA0,
+       0x80,
+       0x14,
+       0x43,
+       0x3E,
+       0xA3,
+       0x00,
+       0x40,
+       0x07,
+       0xA0,
+       0x00,
+       0x14,
+       0x43,
+       0x00,
+       0x04,
+       0x00,
+       0x00,
+       0x00,
+       0x00,
+       0x10,
+       0xB3,
+       0x44,
+       0x10,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x20,
+       0x04,
+       0x07,
+       0x50,
+       0x00,
+       0x08,
+       0x7F,
+       0xFF,
+       0x11,
+       0x20,
+       0xB3,
+       0x60,
+       0x00,
+       0x00,
+       0x00,
+       0x04,
+       0xF5,
+       0x84,
+       0x00,
+       0x00,
+       0x21,
+       0x70,
+       0x03,
+       0x07,
+       0x10,
+       0xF5,
+       0x84,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0xF3,
+       0x90,
+       0x40,
+       0xF5,
+       0xA0,
+       0x82,
+       0x08,
+       0x07,
+       0x40,
+       0x7E,
+       0xA0,
+       0x3E,
+       0xB9,
+       0x00,
+       0x40,
+       0x85,
+       0xA0,
+       0x88,
+       0x14,
+       0x43,
+       0x3E,
+       0xBC,
+       0x00,
+       0x40,
+       0x05,
+       0xA0,
+       0x08,
+       0x14,
+       0x43,
+       0x00,
+       0x04,
+       0x00,
+       0x04,
+       0xB4,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x23,
+       0xC3,
+       0x00,
+       0x01,
+       0x00,
+       0x11,
+       0x00,
+       0x03,
+       0x07,
+       0x23,
+       0xCA,
+       0x00,
+       0xFE,
+       0xFF,
+       0x11,
+       0x70,
+       0x04,
+       0x07,
+       0x00,
+       0x01,
+       0x11,
+       0x10,
+       0x00,
+       0x08,
+       0x01,
+       0xC2,
+       0x11,
+       0x20,
+       0xB4,
+       0x60,
+       0x00,
+       0x04,
+       0x00,
+       0x00,
+       0x01,
+       0x07,
+       0x00,
+       0x02,
+       0x07,
+       0x00,
+       0x04,
+       0x07,
+       0x00,
+       0x04,
+       0x07,
+       0x00,
+       0x13,
+       0x07,
+       0x00,
+       0x2D,
+       0x07,
+       0x00,
+       0x35,
+       0x07,
+       0x00,
+       0x3B,
+       0x07,
+       0x00,
+       0xB7,
+       0x07,
+       0x00,
+       0xFF,
+       0x07,
+       0x01,
+       0x55,
+       0x07,
+       0x01,
+       0x84,
+       0x07,
+       0x01,
+       0xD8,
+       0x07,
+       0x02,
+       0xBC,
+       0x07,
+       0x02,
+       0xFD,
+       0x07,
+       0x00,
+       0x10,
+       0x07,
+       0x1F,
+       0xFF,
+       0x07,
+       0x20,
+       0x03,
+       0x60,
+       0x0F,
+       0x5B,
+       0x07,
+       0x08,
+       0xFA,
+       0x84,
+       0x04,
+       0x11,
+       0x44,
+       0xFF,
+       0x00,
+       0x11,
+       0x2F,
+       0x5F,
+       0x07,
+       0x70,
+       0x10,
+       0x08,
+       0x00,
+       0xF0,
+       0x21,
+       0x50,
+       0x00,
+       0x08,
+       0x00,
+       0xF0,
+       0x21,
+       0x40,
+       0xF9,
+       0x90,
+       0x00,
+       0x08,
+       0x07,
+       0x3E,
+       0x6D,
+       0x00,
+       0x0F,
+       0x67,
+       0x07,
+       0x90,
+       0x01,
+       0x07,
+       0x40,
+       0xF9,
+       0xA0,
+       0x3F,
+       0x6A,
+       0x07,
+       0x70,
+       0x00,
+       0x08,
+       0x00,
+       0x7F,
+       0x11,
+       0x40,
+       0xF8,
+       0xA0,
+       0x9D,
+       0x07,
+       0x07,
+       0x20,
+       0x12,
+       0x60,
+       0x08,
+       0xFA,
+       0x84,
+       0x04,
+       0x11,
+       0x44,
+       0x3E,
+       0x48,
+       0x00,
+       0x00,
+       0x16,
+       0x07,
+       0x48,
+       0x80,
+       0x11,
+       0x08,
+       0x09,
+       0x44,
+       0x40,
+       0x75,
+       0x90,
+       0x7F,
+       0xEF,
+       0x07,
+       0x10,
+       0x00,
+       0x20,
+       0x00,
+       0x10,
+       0x08,
+       0xFF,
+       0xFF,
+       0x21,
+       0x06,
+       0x00,
+       0x84,
+       0x40,
+       0xFB,
+       0xA0,
+       0x60,
+       0x00,
+       0x08,
+       0x00,
+       0x00,
+       0x21,
+       0x40,
+       0xFF,
+       0x90,
+       0x10,
+       0xFB,
+       0x84,
+       0x60,
+       0x20,
+       0x08,
+       0x40,
+       0xFB,
+       0x90,
+       0x30,
+       0x00,
+       0x08,
+       0x00,
+       0x08,
+       0x11,
+       0x3D,
+       0xDE,
+       0x00,
+       0x04,
+       0xFB,
+       0x84,
+       0x3D,
+       0xE0,
+       0x00,
+       0x04,
+       0xFF,
+       0x84,
+       0x40,
+       0xF8,
+       0xA0,
+       0x04,
+       0x11,
+       0x44,
+       0x8F,
+       0xFF,
+       0x07,
+       0x20,
+       0x19,
+       0x60,
+       0x3E,
+       0xC6,
+       0x00,
+       0x00,
+       0x31,
+       0x07,
+       0x00,
+       0x01,
+       0x00,
+       0x00,
+       0x33,
+       0x07,
+       0x00,
+       0x02,
+       0x00,
+       0x04,
+       0xC1,
+       0x44,
+       0x04,
+       0x81,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x27,
+       0x18,
+       0x43,
+       0x75,
+       0x00,
+       0x43,
+       0x08,
+       0xD4,
+       0x44,
+       0x00,
+       0x00,
+       0x00,
+       0x08,
+       0x8F,
+       0x44,
+       0x8F,
+       0x02,
+       0x07,
+       0x40,
+       0x7A,
+       0xA0,
+       0x10,
+       0x8F,
+       0x44,
+       0x10,
+       0x8E,
+       0x44,
+       0x8F,
+       0x02,
+       0x07,
+       0x40,
+       0x7B,
+       0xA0,
+       0x08,
+       0x8E,
+       0x44,
+       0x7F,
+       0xFF,
+       0x01,
+       0x80,
+       0x00,
+       0x11,
+       0x04,
+       0x8D,
+       0x44,
+       0x08,
+       0x00,
+       0x21,
+       0x04,
+       0xB3,
+       0x44,
+       0x00,
+       0xA0,
+       0x21,
+       0x04,
+       0xBB,
+       0x44,
+       0x7E,
+       0x00,
+       0x21,
+       0x04,
+       0x10,
+       0x84,
+       0x40,
+       0x00,
+       0x21,
+       0x04,
+       0xCB,
+       0x44,
+       0x04,
+       0x8B,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0x1D,
+       0x84,
+       0x00,
+       0x3B,
+       0x21,
+       0x04,
+       0xC7,
+       0x44,
+       0x04,
+       0x87,
+       0x44,
+       0x01,
+       0x00,
+       0x21,
+       0x04,
+       0xC8,
+       0x44,
+       0x04,
+       0x88,
+       0x44,
+       0x02,
+       0x00,
+       0x21,
+       0x04,
+       0xF5,
+       0x84,
+       0x40,
+       0xF2,
+       0xA0,
+       0x04,
+       0x51,
+       0x84,
+       0x7F,
+       0xFF,
+       0x21,
+       0x04,
+       0xF5,
+       0x84,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0xF3,
+       0x84,
+       0x00,
+       0x10,
+       0x21,
+       0x04,
+       0xF2,
+       0x84,
+       0x06,
+       0x00,
+       0x21,
+       0x04,
+       0x72,
+       0x44,
+       0x00,
+       0x77,
+       0x21,
+       0x04,
+       0x2E,
+       0x44,
+       0x04,
+       0x2D,
+       0x44,
+       0x04,
+       0x2C,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x08,
+       0x28,
+       0x44,
+       0x01,
+       0x11,
+       0x11,
+       0x08,
+       0x5D,
+       0x84,
+       0x10,
+       0x00,
+       0x10,
+       0x10,
+       0x00,
+       0x08,
+       0x40,
+       0x00,
+       0x21,
+       0x30,
+       0x04,
+       0x07,
+       0x40,
+       0xFF,
+       0x90,
+       0x50,
+       0x20,
+       0x08,
+       0xC0,
+       0x00,
+       0x11,
+       0x10,
+       0xFF,
+       0x84,
+       0x00,
+       0x20,
+       0x08,
+       0x00,
+       0x40,
+       0x11,
+       0x40,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x20,
+       0x51,
+       0x60,
+       0x10,
+       0x00,
+       0x44,
+       0x60,
+       0x00,
+       0x08,
+       0x40,
+       0x54,
+       0x90,
+       0x20,
+       0x00,
+       0x60,
+       0x00,
+       0x7D,
+       0x07,
+       0x81,
+       0x4C,
+       0x07,
+       0x80,
+       0x03,
+       0x07,
+       0x40,
+       0xF8,
+       0xA0,
+       0x48,
+       0xC0,
+       0x11,
+       0x00,
+       0x7B,
+       0x07,
+       0x00,
+       0x7C,
+       0x07,
+       0x00,
+       0x7D,
+       0x07,
+       0x00,
+       0x04,
+       0x07,
+       0x00,
+       0x7F,
+       0x07,
+       0x00,
+       0x80,
+       0x07,
+       0x00,
+       0x81,
+       0x07,
+       0x00,
+       0x59,
+       0x07,
+       0x00,
+       0x83,
+       0x07,
+       0x00,
+       0x84,
+       0x07,
+       0x00,
+       0x85,
+       0x07,
+       0x00,
+       0x78,
+       0x07,
+       0x00,
+       0x87,
+       0x07,
+       0x00,
+       0x86,
+       0x07,
+       0x00,
+       0x89,
+       0x07,
+       0x00,
+       0x8A,
+       0x07,
+       0x0F,
+       0xEF,
+       0x07,
+       0x1F,
+       0xFF,
+       0x07,
+       0xFF,
+       0x00,
+       0x11,
+       0x10,
+       0x00,
+       0x20,
+       0x30,
+       0x10,
+       0x08,
+       0x00,
+       0x01,
+       0x21,
+       0x50,
+       0x00,
+       0x08,
+       0x00,
+       0x0F,
+       0x21,
+       0x40,
+       0xF9,
+       0x90,
+       0x30,
+       0x94,
+       0x07,
+       0x70,
+       0x10,
+       0x08,
+       0x00,
+       0x80,
+       0x21,
+       0x50,
+       0x00,
+       0x08,
+       0x00,
+       0xF0,
+       0x21,
+       0x08,
+       0xF9,
+       0x84,
+       0x04,
+       0xF8,
+       0x84,
+       0x2F,
+       0xFF,
+       0x07,
+       0x3E,
+       0x51,
+       0x00,
+       0x3F,
+       0xF8,
+       0x07,
+       0x70,
+       0x20,
+       0x08,
+       0x00,
+       0xDF,
+       0x11,
+       0x06,
+       0x00,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x10,
+       0xFF,
+       0x84,
+       0x00,
+       0x00,
+       0x08,
+       0x00,
+       0x01,
+       0x11,
+       0x40,
+       0xFF,
+       0xA0,
+       0x04,
+       0xFF,
+       0x84,
+       0x00,
+       0x7F,
+       0x21,
+       0x04,
+       0xF1,
+       0x84,
+       0x04,
+       0xF0,
+       0x84,
+       0x04,
+       0x5A,
+       0x84,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0xF6,
+       0x84,
+       0x00,
+       0x17,
+       0x21,
+       0x04,
+       0xFA,
+       0x84,
+       0x40,
+       0x00,
+       0x21,
+       0x04,
+       0xF7,
+       0x84,
+       0x01,
+       0x04,
+       0x21,
+       0x04,
+       0x70,
+       0x44,
+       0x06,
+       0x66,
+       0x21,
+       0x04,
+       0x3B,
+       0x44,
+       0x04,
+       0x39,
+       0x44,
+       0x00,
+       0x80,
+       0x21,
+       0x04,
+       0x3C,
+       0x44,
+       0x2A,
+       0x00,
+       0x21,
+       0x04,
+       0x2F,
+       0x44,
+       0x00,
+       0x44,
+       0x21,
+       0x04,
+       0x29,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x03,
+       0x19,
+       0x42,
+       0xCE,
+       0x19,
+       0x43,
+       0x0C,
+       0x59,
+       0x43,
+       0x40,
+       0x18,
+       0x42,
+       0x27,
+       0x18,
+       0x43,
+       0x15,
+       0x00,
+       0x43,
+       0x04,
+       0x22,
+       0x44,
+       0x03,
+       0x07,
+       0x21,
+       0x04,
+       0x21,
+       0x44,
+       0x11,
+       0x11,
+       0x21,
+       0x04,
+       0x20,
+       0x44,
+       0x33,
+       0x33,
+       0x21,
+       0x00,
+       0x00,
+       0x42,
+       0xC0,
+       0x3D,
+       0x42,
+       0x80,
+       0x3D,
+       0x43,
+       0x04,
+       0x35,
+       0x44,
+       0x00,
+       0x00,
+       0x21,
+       0x04,
+       0x05,
+       0x43,
+       0x42,
+       0xD9,
+       0x00
+};
+
+const  OIS_UWORD       DOWNLOAD_BIN_LEN = sizeof(DOWNLOAD_BIN);
+#endif
diff --git a/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_user.c b/drivers/media/platform/msm/camera_v2/sensor/ois/OIS_user.c
new file mode 100644 (file)
index 0000000..88924b0
--- /dev/null
@@ -0,0 +1,222 @@
+/**************************************************************************
+* File Name: OIS_user.c
+* Function: User defined function.
+* These functions depend on user's circumstance
+*
+* Rule: Use TAB 4
+*
+* Copyright(c) Rohm Co.,Ltd. All rights reserved
+* Copyright (C) 2018 XiaoMi, Inc.
+**************************************************************************/
+/***** ROHM Confidential ***************************************************/
+#ifndef OIS_USER_C
+#define OIS_USER_C
+#endif
+
+#include "OIS_head.h"
+
+/* Following Variables that depend on user's environment RHM_HT 2013.03.13 add */
+OIS_UWORD FOCUS_VAL = 0x0122; /* Focus Value */
+
+/*********************************************************
+* VCOSET function
+* ---------------------------------------------------------
+* <Function>
+* To use external clock at CLK/PS, it need to set PLL.
+* After enabling PLL, more than 30ms wait time is required to change clock source.
+* So the below sequence has to be used:
+* Input CLK/PS --> Call VCOSET0 --> Download Program/Coed --> Call VCOSET1
+*
+* <Input>  none
+*
+* <Output> none
+********************************************************/
+void VCOSET0(void)
+{
+       OIS_UWORD CLK_PS = 24000; /* X5=24MHz //Input Frequency [kHz] of CLK/PS terminal (Depend on your system) */
+       OIS_UWORD FVCO_1 = 36000; /* Target Frequency [kHz] */
+       OIS_UWORD FREF   = 25;    /* Reference Clock Frequency [kHz] */
+       OIS_UWORD DIV_N  = CLK_PS / FREF - 1; /* calc DIV_N */
+       OIS_UWORD DIV_M  = FVCO_1 / FREF - 1; /* calc DIV_M */
+
+       I2C_OIS_per_write(0x62, DIV_N); /* Divider for internal reference clock */
+       I2C_OIS_per_write(0x63, DIV_M); /* Divider for internal PLL clock */
+       I2C_OIS_per_write(0x64, 0x4060); /* Loop Filter */
+       I2C_OIS_per_write(0x60, 0x3011); /* PLL */
+       I2C_OIS_per_write(0x65, 0x0080);
+       I2C_OIS_per_write(0x61, 0x8002); /* VCOON */
+       I2C_OIS_per_write(0x61, 0x8003); /* Circuit ON */
+       I2C_OIS_per_write(0x61, 0x8809); /* PLL ON */
+}
+
+void VCOSET1(void)
+{
+       I2C_OIS_per_write(0x05, 0x000C); /* Prepare for PLL clock as master clock */
+       I2C_OIS_per_write(0x05, 0x000D); /* Change to PLL clock */
+}
+
+struct msm_ois_ctrl_t *g_i2c_ctrl;
+
+void WR_I2C(OIS_UBYTE slvadr, OIS_UBYTE size, OIS_UBYTE *dat)
+{
+       OIS_UWORD addr = ((dat[0] << 8) | dat[1]);
+       OIS_UBYTE *data_wr = dat + 2;
+
+       g_i2c_ctrl->i2c_client.addr_type = MSM_CAMERA_I2C_WORD_ADDR;
+       g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_write_seq(&g_i2c_ctrl->i2c_client, addr, data_wr, size - 2);
+       pr_debug("WR_I2C addr:0x%x data:0x%x", addr, data_wr[0]);
+}
+
+OIS_UWORD RD_I2C(OIS_UBYTE slvadr, OIS_UBYTE size, OIS_UBYTE *dat)
+{
+       OIS_UWORD read_data = 0;
+       OIS_UWORD addr = ((dat[0] << 8) | dat[1]);
+
+       g_i2c_ctrl->i2c_client.addr_type = MSM_CAMERA_I2C_WORD_ADDR;
+       g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_read(&g_i2c_ctrl->i2c_client, addr, &read_data, MSM_CAMERA_I2C_WORD_DATA);
+
+       pr_debug("RD_I2C addr:0x%x data:0x%x", addr, read_data);
+
+       return read_data;
+}
+
+/*********************************************************
+* Write Factory Adjusted data to the non-volatile memory
+* ---------------------------------------------------------
+* <Function>
+*    Factory adjusted data are sotred somewhere
+*    non-volatile memory.
+*
+* <Input>
+*    _FACT_ADJ Factory Adjusted data
+*
+* <Output>
+*    none
+*
+* <Description>
+*    You have to port your own system.
+*
+**********************************************************/
+void store_FADJ_MEM_to_non_volatile_memory(_FACT_ADJ param)
+{
+       /* Write to the non-vollatile memory such as EEPROM or internal of the CMOS sensor... */
+}
+
+/*****************************************************
+**** Digital Gyro Adjust
+*****************************************************/
+int g_fadj_gyro_kd = 1;
+void fadj_ois_gyro_offset_calibraion(void)
+{
+       OIS_UWORD u16_avrN = 32; /* Averaging number */
+       OIS_LONG s32_dat1;
+       OIS_LONG s32_dat2;
+       OIS_UWORD u16_i;
+       OIS_UWORD u16_tmp_read1;
+       OIS_UWORD u16_tmp_read2;
+       OIS_UWORD sid;
+
+       if (g_fadj_gyro_kd) {
+               return;
+       }
+
+       s32_dat1 = 0;
+       s32_dat2 = 0;
+       for (u16_i = 1; u16_i <= u16_avrN; u16_i += 1) {
+               usleep_range(5000, 6000);
+               u16_tmp_read1 = I2C_OIS_mem__read(_M_DigGx);
+               u16_tmp_read2 = I2C_OIS_mem__read(_M_DigGy);
+               s32_dat1 += u16_tmp_read1;
+               s32_dat2 += u16_tmp_read2;
+               pr_info("%02d,g 0x%04x 0x%04x -> %d,%d", u16_i, u16_tmp_read1, u16_tmp_read2, (int16_t)u16_tmp_read1, (int16_t)u16_tmp_read2);
+       }
+       u16_tmp_read1 = s32_dat1 / u16_avrN;
+       u16_tmp_read2 = s32_dat2 / u16_avrN;
+
+       pr_info("gx:0x%04x gy:0x%04x -> %d,%d", u16_tmp_read1, u16_tmp_read2, (int16_t)u16_tmp_read1, (int16_t)u16_tmp_read2);
+       g_fadj_gyro_kd = 1;
+
+       /* For Gyro EV IDG-2030 */
+       if ((((int16_t)u16_tmp_read1 > 1444) || ((int16_t)u16_tmp_read1 < -1444)) || (((int16_t)u16_tmp_read2 > 1444) || ((int16_t)u16_tmp_read2 < -1444)))
+               return;/* ileagal calibration value */
+
+       FADJ_MEM.gl_GX_OFS = u16_tmp_read1;
+       FADJ_MEM.gl_GY_OFS = u16_tmp_read2;
+
+       /* Write back to EEPROM to save it */
+       sid = g_i2c_ctrl->i2c_client.cci_client->sid;
+       g_i2c_ctrl->i2c_client.cci_client->sid = 0x50;
+       g_i2c_ctrl->i2c_client.addr_type = MSM_CAMERA_I2C_BYTE_ADDR;
+       g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_write(&g_i2c_ctrl->i2c_client, 0x3E, FADJ_MEM.gl_GX_OFS, MSM_CAMERA_I2C_BYTE_DATA);
+       usleep_range(1000, 2000);
+       g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_write(&g_i2c_ctrl->i2c_client, 0x3F, FADJ_MEM.gl_GX_OFS >> 8, MSM_CAMERA_I2C_BYTE_DATA);
+       usleep_range(1000, 2000);
+       g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_write(&g_i2c_ctrl->i2c_client, 0x40, FADJ_MEM.gl_GY_OFS, MSM_CAMERA_I2C_BYTE_DATA);
+       usleep_range(1000, 2000);
+       g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_write(&g_i2c_ctrl->i2c_client, 0x41, FADJ_MEM.gl_GY_OFS >> 8, MSM_CAMERA_I2C_BYTE_DATA);
+       g_i2c_ctrl->i2c_client.cci_client->sid = sid;
+
+       return;
+}
+
+/*********************************************************
+* Read Factory Adjusted data from the non-volatile memory
+ ---------------------------------------------------------
+* <Function>
+*    Factory adjusted data are sotred somewhere
+*    non-volatile memory.  I2C master has to read these
+*    data and store the data to the OIS controller.
+*
+* <Input>
+*    none
+*
+* <Output>
+*    _FACT_ADT Factory Adjusted data
+*
+* <Description>
+*    You have to port your own system.
+*
+**********************************************************/
+static int fadj_got;
+extern uint8_t g_cal_fadj_data[128];
+
+void get_FADJ_MEM_from_non_volatile_memory(void)
+{
+       /* Read from the non-vollatile memory such as EEPROM or internal of the CMOS sensor... */
+       /* OIS_UWORD sid; */
+       OIS_UBYTE *data = (OIS_UBYTE *)(&FADJ_MEM);
+       OIS_UBYTE buf[128];
+       /* char i = 0; */
+       /* if (fadj_got) return; */
+
+       memcpy((void *)buf, (void *)g_cal_fadj_data, 43);
+       memcpy((void *) data, (void *) (&buf[0x05]), 38);
+       /* g_i2c_ctrl->i2c_client.i2c_func_tbl->i2c_read_seq(&g_i2c_ctrl->i2c_client, 0x3A, data, 38); */
+       pr_debug("ois fadj 0x%04x 0x%04x 0x%04x\n", FADJ_MEM.gl_CURDAT, FADJ_MEM.gl_HALOFS_X, FADJ_MEM.gl_HALOFS_Y);
+       /* g_i2c_ctrl->i2c_client.cci_client->sid = sid; */
+
+       fadj_got = 1;
+
+       return;
+}
+
+/* ==> RHM_HT 2013/04/15 Add for DEBUG */
+/*********************************************************
+* Printf for DEBUG
+* ---------------------------------------------------------
+* <Function>
+*
+* <Input>
+*    const char *format, ...
+*    Same as printf
+*
+* <Output>
+*    none
+*
+* <Description>
+*
+**********************************************************/
+int debug_print(const char *format, ...)
+{
+       return 0;/* Darcy deleted/20140620 */
+}
index d3d48b0..b283e95 100644 (file)
 #include "msm_ois.h"
 #include "msm_cci.h"
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+#include "OIS_head.h"
+#include "OIS_user.c"
+#include "OIS_func.c"
+#endif
+
 DEFINE_MSM_MUTEX(msm_ois_mutex);
 /*#define MSM_OIS_DEBUG*/
 #undef CDBG
@@ -27,10 +33,19 @@ DEFINE_MSM_MUTEX(msm_ois_mutex);
 #define CDBG(fmt, args...) pr_debug(fmt, ##args)
 #endif
 
+#ifdef CONFIG_MACH_CHIRON
+bool ois_spi_work_flag = true;
+bool ois_check_flag;
+#endif
+
 static struct v4l2_file_operations msm_ois_v4l2_subdev_fops;
 static int32_t msm_ois_power_up(struct msm_ois_ctrl_t *o_ctrl);
 static int32_t msm_ois_power_down(struct msm_ois_ctrl_t *o_ctrl);
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+static void msm_ois_FW_download(struct work_struct *ois_work);
+#endif
+
 static struct i2c_driver msm_ois_i2c_driver;
 
 static int32_t data_type_to_num_bytes(
@@ -71,6 +86,10 @@ static int32_t msm_ois_download(struct msm_ois_ctrl_t *o_ctrl)
        struct device *dev = &(o_ctrl->pdev->dev);
        enum msm_camera_i2c_reg_addr_type save_addr_type;
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       return 1; /* disable ois download lib.so */
+#endif
+
        CDBG("Enter\n");
        save_addr_type = o_ctrl->i2c_client.addr_type;
        o_ctrl->i2c_client.addr_type = MSM_CAMERA_I2C_BYTE_ADDR;
@@ -338,6 +357,13 @@ static int32_t msm_ois_power_down(struct msm_ois_ctrl_t *o_ctrl)
        int32_t rc = 0;
        enum msm_sensor_power_seq_gpio_t gpio;
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       struct device_node *src_node = NULL;
+       int i = 0;
+       const char *ois_name;
+       struct device_node *of_node = o_ctrl->pdev->dev.of_node;
+#endif
+
        CDBG("Enter\n");
        if (o_ctrl->ois_state != OIS_DISABLE_STATE) {
 
@@ -383,10 +409,134 @@ static int32_t msm_ois_power_down(struct msm_ois_ctrl_t *o_ctrl)
                o_ctrl->i2c_tbl_index = 0;
                o_ctrl->ois_state = OIS_OPS_INACTIVE;
        }
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       else {
+               if (of_gpio_count(of_node)) {
+                       for (gpio = SENSOR_GPIO_AF_PWDM; gpio < SENSOR_GPIO_MAX;
+                               gpio++) {
+                               if (o_ctrl->gconf &&
+                                       o_ctrl->gconf->gpio_num_info &&
+                                       o_ctrl->gconf->gpio_num_info->valid[gpio] == 1) {
+                                       gpio_set_value_cansleep(
+                                               o_ctrl->gconf->gpio_num_info->gpio_num[gpio],
+                                               GPIOF_OUT_INIT_LOW);
+
+                                       if (o_ctrl->cam_pinctrl_status) {
+                                               rc = pinctrl_select_state(
+                                                       o_ctrl->pinctrl_info.pinctrl,
+                                                       o_ctrl->pinctrl_info.gpio_state_suspend);
+                                               if (rc < 0)
+                                                       pr_err("ERR:%s:%d cannot set pin to suspend state: %d",
+                                                               __func__, __LINE__, rc);
+                                               devm_pinctrl_put(o_ctrl->pinctrl_info.pinctrl);
+                                       }
+                                       o_ctrl->cam_pinctrl_status = 0;
+                                       rc = msm_camera_request_gpio_table(
+                                               o_ctrl->gconf->cam_gpio_req_tbl,
+                                               o_ctrl->gconf->cam_gpio_req_tbl_size,
+                                               0);
+                                       if (rc < 0)
+                                               pr_err("ERR:%s:Failed in selecting state in ois power down: %d\n",
+                                                       __func__, rc);
+                               }
+                       }
+               } else {
+                       for (i = 0; i < o_ctrl->vreg_cfg.num_vreg; i++) {
+                               src_node = of_parse_phandle(of_node, "cam_vaf-supply", 0);
+                               if (!src_node) {
+                                       pr_err("ois node is NULL\n");
+                                       continue;
+                               }
+                               rc = of_property_read_string(src_node, "regulator-name", &ois_name);
+                               if (rc < 0) {
+                                       if (strcmp(ois_name, "vaf_gpio_supply") == 0) {
+                                               pr_err("read regulator-name fail\n");
+                                               of_node_put(src_node);
+                                               src_node = NULL;
+                                               break;
+                                       }
+                               } else {
+                                       pr_err("ois regulator name = %s", ois_name);
+                                       if (strcmp(ois_name, "vaf_gpio_supply") == 0) {
+                                               if (gpio_get_value_cansleep(29)) {
+                                                       pr_err("ois power down again\n");
+                                                       for (i = 0; i < 3; i++) {
+                                                               rc = msm_ois_vreg_control(o_ctrl, 0);
+                                                               if (rc < 0)
+                                                                       pr_err("%s power down again failed %d\n", __func__, __LINE__);
+                                                       }
+                                               }
+                                       }
+                               }
+                               of_node_put(src_node);
+                               src_node = NULL;
+                       }
+                               }
+       }
+#endif
        CDBG("Exit\n");
        return rc;
 }
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+void msm_ois_shift_gain(int distance)
+{
+       if ((g_i2c_ctrl->ois_state != OIS_OPS_ACTIVE) || (g_i2c_ctrl == NULL))
+               return;
+
+       mutex_lock(g_i2c_ctrl->ois_mutex);
+       ChangeShiftOISGain(distance);
+       mutex_unlock(g_i2c_ctrl->ois_mutex);
+
+       return;
+}
+EXPORT_SYMBOL(msm_ois_shift_gain);
+
+static void msm_ois_FW_download(struct work_struct *ois_work)
+{
+       struct msm_camera_cci_client *cci_client = NULL;
+       struct msm_ois_ctrl_t *o_ctrl = NULL;
+       int rc = 0;
+       CDBG("ois Enter, work:%p\n", ois_work);
+
+       o_ctrl = container_of(ois_work, struct msm_ois_ctrl_t, ois_work);
+
+       mutex_lock(o_ctrl->ois_mutex);
+       cci_client = o_ctrl->i2c_client.cci_client;
+       cci_client->sid = 0x1C >> 1;
+       cci_client->retries = 3;
+       cci_client->id_map = 0;
+       cci_client->cci_i2c_master = o_ctrl->cci_master;
+       cci_client->i2c_freq_mode = I2C_FAST_MODE;
+
+       g_i2c_ctrl->i2c_client.addr_type = MSM_CAMERA_I2C_WORD_ADDR;
+       get_FADJ_MEM_from_non_volatile_memory();
+       VCOSET0();
+       rc = func_PROGRAM_DOWNLOAD();
+       if (rc < 0) {
+               pr_err("%d: download OIS FW fail\n", __LINE__);
+               goto exit;
+       }
+       rc = func_COEF_DOWNLOAD(0);
+       if (rc < 0) {
+               pr_err("%d: download OIS COEF fail\n", __LINE__);
+               goto exit;
+       }
+       VCOSET1();
+       I2C_OIS_spcl_cmnd(1, _cmd_8C_EI);
+       CDBG("%s ois goff 0x%x, 0x%x", __func__, FADJ_MEM.gl_GX_OFS, FADJ_MEM.gl_GY_OFS);
+
+       /* fadj_ois_gyro_offset_calibraion(); */
+       SET_FADJ_PARAM(&FADJ_MEM);
+       /* func_SET_SCENE_PARAM_for_NewGYRO_Fil(_SCENE_SPORT_3, 1, 0, 0, &FADJ_MEM); */
+       func_SET_SCENE_PARAM_for_NewGYRO_Fil(_SCENE_SPORT_3, 1, 0, 0, &FADJ_MEM);
+
+exit:
+       mutex_unlock(o_ctrl->ois_mutex);
+       CDBG("Exit\n");
+}
+#endif
+
 static int msm_ois_init(struct msm_ois_ctrl_t *o_ctrl)
 {
        int rc = 0;
@@ -404,6 +554,24 @@ static int msm_ois_init(struct msm_ois_ctrl_t *o_ctrl)
                        pr_err("cci_init failed\n");
        }
        o_ctrl->ois_state = OIS_OPS_ACTIVE;
+
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       if (g_i2c_ctrl == NULL) {
+               g_i2c_ctrl = o_ctrl;
+               o_ctrl->ois_work_queue = alloc_workqueue("ois_FW_download", WQ_HIGHPRI|WQ_UNBOUND, 0);
+
+               if (!o_ctrl->ois_work_queue) {
+                       pr_err("register ois FW workqueue fail\n");
+                       rc = -ENOMEM;
+                       goto error_alloc_workqueue;
+               }
+               INIT_WORK(&o_ctrl->ois_work, msm_ois_FW_download);
+               queue_work(o_ctrl->ois_work_queue, &o_ctrl->ois_work);
+       }
+
+error_alloc_workqueue:
+#endif
+
        CDBG("Exit\n");
        return rc;
 }
@@ -653,6 +821,18 @@ static int msm_ois_close(struct v4l2_subdev *sd,
                return -EINVAL;
        }
        mutex_lock(o_ctrl->ois_mutex);
+
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       if (o_ctrl->ois_work_queue) {
+               mutex_unlock(o_ctrl->ois_mutex);
+               destroy_workqueue(o_ctrl->ois_work_queue);
+               mutex_lock(o_ctrl->ois_mutex);
+               o_ctrl->ois_work_queue = NULL;
+       }
+
+       g_i2c_ctrl = NULL;
+#endif
+
        if (o_ctrl->ois_device_type == MSM_CAMERA_PLATFORM_DEVICE &&
                o_ctrl->ois_state != OIS_DISABLE_STATE) {
                rc = o_ctrl->i2c_client.i2c_func_tbl->i2c_util(
@@ -970,6 +1150,10 @@ static int32_t msm_ois_platform_probe(struct platform_device *pdev)
                (&pdev->dev)->of_node);
        if (rc < 0) {
                pr_err("%s: No/Error OIS GPIO\n", __func__);
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       } else if (!msm_ois_t->gconf) {
+               pr_err("%s: %d: OIS no GPIO control\n", __func__, __LINE__);
+#endif
        } else {
                msm_ois_t->cam_pinctrl_status = 1;
                rc = msm_camera_pinctrl_init(
index 614cc6c..4f9e2c9 100644 (file)
@@ -68,6 +68,10 @@ struct msm_ois_ctrl_t {
        struct msm_pinctrl_info pinctrl_info;
        uint8_t cam_pinctrl_status;
        struct msm_ois_board_info *oboard_info;
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       struct workqueue_struct *ois_work_queue;
+       struct work_struct ois_work;
+#endif
 };
 
 #endif
index 2c8b651..93a3e9c 100644 (file)
@@ -216,6 +216,14 @@ struct sensorb_cfg_data32 {
        } cfg;
 };
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+struct sensorb_info_fusion_id32 {
+       char sensor_type;
+       compat_uptr_t data_buffer;
+       char data_nums;
+};
+#endif
+
 struct msm_ois_params_t32 {
        uint16_t data_size;
        uint16_t setting_size;
@@ -289,6 +297,11 @@ struct msm_flash_cfg_data_t32 {
 #define VIDIOC_MSM_LASER_LED_CFG32 \
        _IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct msm_laser_led_cfg_data_t32)
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+#define VIDIOC_MSM_READ_FUSION_ID32 \
+       _IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct sensorb_info_fusion_id32)
+#endif
+
 #endif
 
 #endif
index e4b4554..69677d7 100644 (file)
@@ -242,6 +242,14 @@ struct sensorb_cfg_data {
        } cfg;
 };
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+struct sensorb_info_fusion_id {
+       char sensor_type;
+       char *data_buffer;
+       char data_nums;
+};
+#endif
+
 struct csid_cfg_data {
        enum csid_cfg_type_t cfgtype;
        union {
@@ -357,6 +365,9 @@ enum msm_sensor_cfg_type_t {
        CFG_WRITE_I2C_ARRAY_ASYNC,
        CFG_WRITE_I2C_ARRAY_SYNC,
        CFG_WRITE_I2C_ARRAY_SYNC_BLOCK,
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       CFG_GET_SENSOR_FUSION_ID,
+#endif
 };
 
 enum msm_actuator_cfg_type_t {
@@ -630,6 +641,14 @@ struct sensor_init_cfg_data {
 #define VIDIOC_MSM_IR_CUT_CFG \
        _IOWR('V', BASE_VIDIOC_PRIVATE + 15, struct msm_ir_cut_cfg_data_t)
 
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+#define VIDIOC_MSM_READ_FUSION_ID \
+       _IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct sensorb_info_fusion_id)
+
+#define VIDIOC_MSM_READ_FUSION_ID_LEN \
+       _IOR('V', BASE_VIDIOC_PRIVATE + 16, uint8_t)
+#endif
+
 #define VIDIOC_MSM_LASER_LED_CFG \
        _IOWR('V', BASE_VIDIOC_PRIVATE + 16, struct msm_laser_led_cfg_data_t)
 
index 40731a9..db1b83f 100644 (file)
@@ -176,6 +176,9 @@ enum msm_actuator_write_type {
 enum msm_actuator_i2c_operation {
        MSM_ACT_WRITE = 0,
        MSM_ACT_POLL,
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       MSM_ACT_POLL_RESULT,
+#endif
 };
 
 enum actuator_type {
index d532037..85c673c 100644 (file)
@@ -113,11 +113,17 @@ struct msm_ispif_param_data_ext {
        struct msm_ispif_right_param_entry right_entries[MAX_PARAM_ENTRIES];
        uint32_t stereo_enable;
        uint16_t line_width[VFE_MAX];
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       uint32_t reserved_param;
+#endif
 };
 
 struct msm_ispif_param_data {
        uint32_t num;
        struct msm_ispif_params_entry entries[MAX_PARAM_ENTRIES];
+#ifdef CONFIG_MACH_XIAOMI_MSM8998
+       uint32_t reserved_param;
+#endif
 };
 
 struct msm_isp_info {