예제 #1
0
static int s5k6aafx13_set_exposure(int exposure)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	CDBG("%s exposure=%d\n", __func__, exposure);

	switch (exposure) {
	case 1: pid = SI2C_EXPOSURE_AVERAGE; break;
	case 2: 
	case 3: pid = SI2C_EXPOSURE_CENTER; break;
	default:
		CERR("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, s5k6aafx13_params);
	if (rc < 0) {
		CERR("%s err(%d)\n", __func__, rc);
		return rc;
	}

	CDBG("%s X\n", __func__);
	return 0;
}
예제 #2
0
static int mt9v113_sensor_set_reflect(struct msm_sensor_ctrl_t *s_ctrl ,int8_t reflect)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	printk("%s reflect=%d\n", __func__, reflect);

	switch (reflect) {
	case 0: pid = SI2C_REFLECT_OFF; break;
	case 1: pid = SI2C_REFLECT_MIRROR; break;
	case 2: pid = SI2C_REFLECT_WATER; break;
	case 3: pid = SI2C_REFLECT_MIRROR_WATER; break;
	default:
		printk("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, mt9v113_params);
	if (rc < 0) {
		printk("%s err(%d)\n", __func__, rc);
		return rc;
	}

	printk("%s X\n", __func__);
	return 0;

}
예제 #3
0
static int s5k6aafx13_set_brightness(int brightness)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	CDBG("%s brightness=%d\n", __func__, brightness);

	switch (brightness) {
	case 0: pid = SI2C_BRIGHTNESS_M4; break;
	case 1: pid = SI2C_BRIGHTNESS_M3; break;
	case 2: pid = SI2C_BRIGHTNESS_M2; break;
	case 3: pid = SI2C_BRIGHTNESS_M1; break;
	case 4: pid = SI2C_BRIGHTNESS_0; break;
	case 5: pid = SI2C_BRIGHTNESS_P1; break;
	case 6: pid = SI2C_BRIGHTNESS_P2; break;
	case 7: pid = SI2C_BRIGHTNESS_P3; break;
	case 8: pid = SI2C_BRIGHTNESS_P4; break;
	default:
		CERR("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, s5k6aafx13_params);
	if (rc < 0) {
		CERR("%s err(%d)\n", __func__, rc);
		return rc;
	}

	CDBG("%s X\n", __func__);
	return 0;
}
예제 #4
0
int mt9v113_sensor_set_brightness(struct msm_sensor_ctrl_t *s_ctrl, int8_t brightness)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	printk("%s brightness=%d\n", __func__, brightness);

	switch (brightness) {
	case 0: pid = SI2C_BRIGHTNESS_M4; break;
	case 1: pid = SI2C_BRIGHTNESS_M3; break;
	case 2: pid = SI2C_BRIGHTNESS_M2; break;
	case 3: pid = SI2C_BRIGHTNESS_M1; break;
	case 4: pid = SI2C_BRIGHTNESS_0; break;
	case 5: pid = SI2C_BRIGHTNESS_P1; break;
	case 6: pid = SI2C_BRIGHTNESS_P2; break;
	case 7: pid = SI2C_BRIGHTNESS_P3; break;
	case 8: pid = SI2C_BRIGHTNESS_P4; break;
	default:
		printk("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, mt9v113_params);
	if (rc < 0) {
		printk("%s err(%d)\n", __func__, rc);
		return rc;
	}

	printk("%s X\n", __func__);
	return 0;

}
예제 #5
0
int mt9v113_sensor_set_effect(struct msm_sensor_ctrl_t *s_ctrl, int8_t effect)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	printk("%s effect=%d\n", __func__, effect);

	switch (effect) {
	case 0: pid = SI2C_EFFECT_OFF; break;
	case 1: pid = SI2C_EFFECT_MONO; break;
	case 2: pid = SI2C_EFFECT_NEGATIVE; break;
	case 3: pid = SI2C_EFFECT_SOLARIZE; break;
	case 4: pid = SI2C_EFFECT_SEPIA; break;
	default:
		printk("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, mt9v113_params);
	if (rc < 0) {
		printk("%s err(%d)\n", __func__, rc);
		return rc;
	}

	printk("%s X\n", __func__);
	return 0;

}
예제 #6
0
static int s5k6aafx13_set_preview_fps(int preview_fps)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	CDBG("%s preview_fps=%d\n", __func__, preview_fps);

	switch (preview_fps) {
	case  0: pid = SI2C_FPS_VARIABLE; break;
	case  7: pid = SI2C_FPS_FIXED7; break;
	case  8: pid = SI2C_FPS_FIXED8; break;
	case 10: pid = SI2C_FPS_FIXED10; break;
	case 15: pid = SI2C_FPS_FIXED15; break;
	case 20: pid = SI2C_FPS_FIXED20; break;
	case 24: pid = SI2C_FPS_FIXED24; break;
	default:
		//PANTECH_CAMERA_TODO
		return 0;
		//CERR("%s err(-EINVAL)\n", __func__);
		//return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, s5k6aafx13_params);
	if (rc < 0) {
		CERR("%s err(%d)\n", __func__, rc);
		return rc;
	}

	CDBG("%s X\n", __func__);
	return 0;
}
예제 #7
0
int mt9v113_sensor_set_wb(struct msm_sensor_ctrl_t *s_ctrl, int8_t wb)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	printk("%s wb=%d\n", __func__, wb);

	switch (wb) {
	case 1: pid = SI2C_WB_AUTO; break;
	case 3: pid = SI2C_WB_INCANDESCENT; break;
	case 4: pid = SI2C_WB_FLUORESCENT; break;
	case 5: pid = SI2C_WB_DAYLIGHT; break;
	case 6: pid = SI2C_WB_CLOUDY; break;
	default:
		printk("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, mt9v113_params);
	if (rc < 0) {
		printk("%s err(%d)\n", __func__, rc);
		return rc;
	}

	printk("%s X\n", __func__);
	return 0;

}
예제 #8
0
static int s5k6aafx13_set_effect(int effect)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	CDBG("%s effect=%d\n", __func__, effect);

	switch (effect) {
	case CAMERA_EFFECT_OFF: pid = SI2C_EFFECT_OFF; break;
	case CAMERA_EFFECT_MONO: pid = SI2C_EFFECT_MONO; break;
	//case CAMERA_EFFECT_NEGATIVE: pid = SI2C_EFFECT_NEGATIVE; break;//pangya _120510 EF39S don't use negative of effect.
	case CAMERA_EFFECT_SEPIA: pid = SI2C_EFFECT_SEPIA; break;
	case CAMERA_EFFECT_AQUA: pid = SI2C_EFFECT_AQUA; break; //pangya _120510 Effect added aqua.
	default:
		CERR("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, s5k6aafx13_params);
	if (rc < 0) {
		CERR("%s err(%d)\n", __func__, rc);
		return rc;
	}

	CDBG("%s X\n", __func__);
	return 0;
}
예제 #9
0
int mt9v113_set_preview_fps(struct msm_sensor_ctrl_t *s_ctrl, int8_t preview_fps)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	printk("%s preview_fps=%d\n", __func__, preview_fps);

	switch (preview_fps) {
	case  0: pid = SI2C_FPS_VARIABLE; break;
	case  7: pid = SI2C_FPS_FIXED7; break;
	case  8: pid = SI2C_FPS_FIXED8; break;
	case 10: pid = SI2C_FPS_FIXED10; break;
	case 15: pid = SI2C_FPS_FIXED15; break;
	case 20: pid = SI2C_FPS_FIXED15; break;
	case 30: pid = SI2C_FPS_FIXED15; break;
	case 31: pid = SI2C_FPS_VARIABLE; break;
	default:
		//PANTECH_CAMERA_TODO
		return 0;
		//SKYCERR("%s err(-EINVAL)\n", __func__);
		//return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, mt9v113_params);
	if (rc < 0) {
		printk("%s err(%d)\n", __func__, rc);
		return rc;
	}

	printk("%s X\n", __func__);
	return 0;
}
static int mt9d113_sensor_set_reflect(struct msm_sensor_ctrl_t *s_ctrl ,int8_t reflect)
{
    si2c_pid_t pid = SI2C_PID_MAX;
    int rc = 0;

    CDBG("%s reflect=%d\n", __func__, reflect);

    switch (reflect) {
#ifdef CONFIG_MACH_MSM8X60_EF65L 
    case 0: pid = SI2C_REFLECT_MIRROR_WATER; break;
    case 1: pid = SI2C_REFLECT_WATER; break;
    case 2: pid = SI2C_REFLECT_MIRROR; break;
    case 3: pid = SI2C_REFLECT_OFF; break;
#else
    case 0: pid = SI2C_REFLECT_OFF; break;
    case 1: pid = SI2C_REFLECT_MIRROR; break;
    case 2: pid = SI2C_REFLECT_WATER; break;
    case 3: pid = SI2C_REFLECT_MIRROR_WATER; break;
#endif
    default:
        SKYCDBG("%s err(-EINVAL)\n", __func__);
        return -EINVAL;
    }

    rc = si2c_write_param(SI2C_SA, pid, mt9d113_params);
    if (rc < 0) {
        SKYCDBG("%s err(%d)\n", __func__, rc);
        return rc;
    }

    CDBG("%s X\n", __func__);
    return 0;
}
예제 #11
0
int mt9v113_set_exposure(struct msm_sensor_ctrl_t *s_ctrl, int8_t exposure)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	printk("%s exposure=%d\n", __func__, exposure);

	switch (exposure) {
	case 0: 		
	case 1: pid = SI2C_EXPOSURE_AVERAGE; break;	
	case 2: 
	case 3: pid = SI2C_EXPOSURE_CENTER; break;
	default:
		printk("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, mt9v113_params);
	if (rc < 0) {
		printk("%s err(%d)\n", __func__, rc);
		return rc;
	}

	printk("%s X\n", __func__);
	return 0;
}
예제 #12
0
static int32_t s5k6aafx13_set_wb(int wb)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	CDBG("%s wb=%d\n", __func__, wb);

	switch (wb) {
	case 1: pid = SI2C_WB_AUTO; break;
	case 3: pid = SI2C_WB_INCANDESCENT; break;
	case 4: pid = SI2C_WB_FLUORESCENT; break;
	case 5: pid = SI2C_WB_DAYLIGHT; break;
	case 6: pid = SI2C_WB_CLOUDY; break;
	default:
		CERR("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, s5k6aafx13_params);
	if (rc < 0) {
		CERR("%s err(%d)\n", __func__, rc);
		return rc;
	}

	CDBG("%s X\n", __func__);
	return 0;
}
예제 #13
0
static int s5k6aafx13_set_reflect(int reflect)
{
	si2c_pid_t pid = SI2C_PID_MAX;
	int rc = 0;

	CDBG("%s reflect=%d\n", __func__, reflect);

	switch (reflect) {
	case 0: pid = SI2C_REFLECT_OFF; break;
	case 1: pid = SI2C_REFLECT_MIRROR; break;
	case 2: pid = SI2C_REFLECT_WATER; break;
	case 3: pid = SI2C_REFLECT_MIRROR_WATER; break;
	default:
		CERR("%s err(-EINVAL)\n", __func__);
		return -EINVAL;
	}

	rc = si2c_write_param(SI2C_SA, pid, s5k6aafx13_params);
	if (rc < 0) {
		CERR("%s err(%d)\n", __func__, rc);
		return rc;
	}

	CDBG("%s X\n", __func__);
	return 0;
}
int mt9d113_sensor_init(struct msm_sensor_ctrl_t *s_ctrl)
{
	int rc = 0;
	//uint8_t data_buf[4];

	SKYCDBG("%s: E\n",__func__);



#if 1//needtocheck
	//sensor_mode = ??;//SENSOR_PREVIEW_MODE;

//	memset(mt9d113_params, 0, sizeof(mt9d113_params));

    //s_ctrl->sensor_i2c_client->client->adapter,
//	rc = si2c_init(s5k6aafx13_client->adapter, s5k6aafx13_const_params, s5k6aafx13_params);

#if 0
    rc = si2c_init(mt9d113_client->adapter, 
            mt9d113_const_params, mt9d113_params);
    
	if (!mt9d113_ctrl) {
		SKYCDBG("%s err(-ENOMEM)\n", __func__);
		goto sensor_init_fail;
	}
#endif


    rc = si2c_write_param(SI2C_SA, SI2C_INIT, mt9d113_params);
SKYCDBG("%s: si2c_write_param / rc:%d \n",__func__, rc);
    if (rc < 0)
        goto sensor_init_fail;

#endif
    sensor_mode = 1;

    SKYCDBG("%s: X\n",__func__);    
    return rc;
    
#if 1//needtocheck    
sensor_init_fail:

#if 0
	if (mt9d113_ctrl) {
		kfree(mt9d113_ctrl);
		mt9d113_ctrl = NULL;
	}
	(void)mt9d113_power_off();
	svreg_release(svregs, CAMV_MAX);
	sgpio_release(sgpios, CAMIO_MAX);
#endif    
SKYCDBG("%s: sensor_init_fail / si2c_release(); \n",__func__);
    si2c_release();
    
	SKYCDBG("%s err(%d)\n", __func__, rc);
	return rc;
#endif    
}
예제 #15
0
int mt9v113_video_config(void)
{
	int rc = 0;

	CDBG("%s E\n", __func__);

	rc = si2c_write_param(SI2C_SA, SI2C_PREVIEW, mt9v113_params);
	if (rc < 0) {
		SKYCERR("%s video config err(%d)\n", __func__, rc);
		return rc;
	}

	//sensor_mode = SENSOR_PREVIEW_MODE;

	CDBG("%s X\n", __func__);
	return 0;
}
예제 #16
0
int mt9v113_snapshot_config(void)
{
	int rc = 0;

	CDBG("%s E\n", __func__);

	rc = si2c_write_param(SI2C_SA, SI2C_SNAPSHOT, mt9v113_params);
	if (rc < 0) {
		SKYCERR("%s err(%d)\n", __func__, rc);
		return rc;
	}

	//sensor_mode = SENSOR_SNAPSHOT_MODE;

	CDBG("%s X\n", __func__);
	return 0;
}
예제 #17
0
static int s5k6aafx13_set_mode(int mode)
{
	int rc = 0;

	CDBG("%s mode=%d\n", __func__, mode);

	if (!config_csi_done) {
#ifdef CONFIG_PANTECH_CAMERA_TUNER
		rc = si2c_write_param(SI2C_SA, SI2C_INIT, s5k6aafx13_params);
		if (rc < 0) {
			CERR("%s init err(%d)\n", __func__, rc);
			return rc;
		}
#endif
		rc = s5k6aafx13_config_csi();
		if (rc < 0) {
			CERR("%s err(-EIO)\n", __func__);
			return -EIO;
		}
	}

	switch (mode) {
	case SENSOR_PREVIEW_MODE:
		if (sensor_mode != SENSOR_PREVIEW_MODE)
			rc = s5k6aafx13_video_config();
		break;
		
	case SENSOR_SNAPSHOT_MODE:
		if (sensor_mode != SENSOR_SNAPSHOT_MODE)
			rc = s5k6aafx13_snapshot_config();
		break;

	default:
		rc = -EINVAL;
		break;
	}

	CDBG("%s X (%d)\n", __func__, rc);
	return rc;
}
static int mt9d113_sensor_set_preview_fps(struct msm_sensor_ctrl_t *s_ctrl ,int8_t preview_fps)
{
    si2c_pid_t pid = SI2C_PID_MAX;
    int rc = 0;

    SKYCDBG("%s preview_fps=%d\n", __func__, preview_fps);
	
    switch (preview_fps) {
	case 31:
    case  0: pid = SI2C_FPS_VARIABLE; break;
    case  7: pid = SI2C_FPS_FIXED7; break;
    case  8: pid = SI2C_FPS_FIXED8; break;
    case 10: pid = SI2C_FPS_FIXED10; break;
    case 15: pid = SI2C_FPS_FIXED15; break;
	case 30:
    case 20: pid = SI2C_FPS_FIXED20; break;
    case 24: pid = SI2C_FPS_FIXED24; break;
    case 25: pid = SI2C_FPS_FIXED25; break;
    default:
        //PANTECH_CAMERA_TODO
		SKYCDBG("%s preview_fps: %d default return 0\n", __func__, preview_fps);  
        return 0;
        //SKYCDBG("%s err(-EINVAL)\n", __func__);
        //return -EINVAL;
    }

    SKYCDBG("%s preview_fps:%d/ pid :%d\n", __func__, preview_fps, pid); 

    rc = si2c_write_param(SI2C_SA, pid, mt9d113_params);
    if (rc < 0) {
        SKYCDBG("%s err(%d)\n", __func__, rc);
        return rc;
    }

	current_fps = preview_fps;

    CDBG("%s X\n", __func__);
    return 0;
}
예제 #19
0
int mt9v113_sensor_init(struct msm_sensor_ctrl_t *s_ctrl)
{
	int rc = 0;

	memset(mt9v113_params, 0, sizeof(mt9v113_params));
	
	rc = si2c_init(s_ctrl->sensor_i2c_client->client->adapter, mt9v113_const_params, mt9v113_params);
	if (rc < 0) {
		printk("%s err(%d)\n", __func__, rc);
		si2c_release();		
		return rc;
	}	
	
	rc = si2c_write_param(SI2C_SA, SI2C_INIT, mt9v113_params);
	if (rc < 0) {
		printk("%s err(%d)\n", __func__, rc);
		si2c_release();		
		return rc;
	}	
	
	return rc;	
}
static int32_t mt9d113_sensor_set_awb_lock(struct msm_sensor_ctrl_t *s_ctrl ,int8_t is_lock)
{
    si2c_pid_t pid = SI2C_PID_MAX;
    int rc = 0;

    CDBG("%s is_lock = %d\n",__func__, is_lock);
    
    switch (is_lock) {
    case 0: pid = SI2C_AWB_ON;break;
    case 1: pid = SI2C_AWB_OFF;break;
    default:
        SKYCDBG("%s err(-EINVAL)\n", __func__);
        return -EINVAL;
    }

    rc = si2c_write_param(SI2C_SA, pid, mt9d113_params);
    if (rc < 0) {
        SKYCDBG("%s err(%d)\n", __func__, rc);
        return rc;
    }
    
    CDBG("%s X\n", __func__);
    return 0;
}
int32_t mt9d113_sensor_setting1(struct msm_sensor_ctrl_t *s_ctrl,
			int update_type, int res)
{
	int32_t rc = 0;
	static int csi_config;
    SKYCDBG("%s: update_type = %d, res=%d E\n", __func__, update_type, res);

	s_ctrl->func_tbl->sensor_stop_stream(s_ctrl);
	msleep(30);
	if (update_type == MSM_SENSOR_REG_INIT) {
		CDBG("Register INIT\n");
		s_ctrl->curr_csi_params = NULL;
		msm_sensor_enable_debugfs(s_ctrl);
//needtocheck//        
		mt9d113_sensor_init(s_ctrl);//msm_sensor_write_init_settings(s_ctrl);
		
		csi_config = 0;
	} else if (update_type == MSM_SENSOR_UPDATE_PERIODIC) {
		CDBG("PERIODIC : %d\n", res);
		//msm_sensor_write_conf_array(
		//	s_ctrl->sensor_i2c_client,
		//	s_ctrl->msm_sensor_reg->mode_settings, res);
		msleep(30);
		if (!csi_config) {
            SKYCDBG("%s: ==> MIPI setting  E %d\n", __func__, update_type);
			s_ctrl->curr_csic_params = s_ctrl->csic_params[res];
			CDBG("CSI config in progress\n");
			v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
				NOTIFY_CSIC_CFG,
				s_ctrl->curr_csic_params);
			CDBG("CSI config is done\n");
			mb();
			msleep(30);
			csi_config = 1;
            SKYCDBG("%s: ==> MIPI setting  X %d\n", __func__, update_type);	
		}
		v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
			NOTIFY_PCLK_CHANGE,
			&s_ctrl->sensordata->pdata->ioclk.vfe_clk_rate);

		//s_ctrl->func_tbl->sensor_start_stream(s_ctrl);
#if 1//needtocheck		
        switch (res) {
            case 0:
//              rc = ce1612_snapshot_config(s_ctrl);  
                rc = si2c_write_param(SI2C_SA, SI2C_SNAPSHOT, mt9d113_params);
                if (rc < 0) {
                    SKYCDBG("%s snapshot config err(%d)\n", __func__, rc);
                    return rc;
                }

                SKYCDBG("Sensor setting : Case 0 snapshot config"); 

                break;

            case 1:
//              rc = ce1612_video_config(s_ctrl);
                rc = si2c_write_param(SI2C_SA, SI2C_PREVIEW, mt9d113_params);
                if (rc < 0) {
                    SKYCDBG("%s video config err(%d)\n", __func__, rc);
                    return rc;
                }
#if 1//for_test
                if(current_fps != 31)
                    mt9d113_sensor_set_preview_fps(s_ctrl ,current_fps);
#else                
                if ((previewFPS > C_PANTECH_CAMERA_MIN_PREVIEW_FPS) && (previewFPS < C_PANTECH_CAMERA_MAX_PREVIEW_FPS)) 
	            {  
			       SKYCDBG("%s: preview_fps=%d\n", __func__, previewFPS);
                   mt9d113_sensor_set_preview_fps(NULL ,previewFPS);
                }
#endif
                SKYCDBG("Sensor setting : Case 1 Video config"); 
                break;

          //case 2: 
            //  rc = ce1612_1080p_config(s_ctrl);   
            //  break;

            case 3: 
//              rc = ce1612_ZSL_config(s_ctrl); 
                SKYCDBG("Sensor setting : Case 3 ZSL config");              
                break;  
                 
            default:
//              rc = ce1612_video_config(s_ctrl);
                SKYCDBG("Sensor setting : Default Video config"); 
                break;
        }
#endif
		sensor_mode = res;
		SKYCDBG("Sensor setting : Res = %d\n", res);

		
		msleep(50);
	}
	return rc;
}
예제 #22
0
int s5k6aafx13_sensor_init(const struct msm_camera_sensor_info *sinfo)
{
	int rc = 0;

	CDBG("%s E\n", __func__);

	config_csi_done = false;
	sensor_mode = SENSOR_PREVIEW_MODE;

	memset(s5k6aafx13_params, 0, sizeof(s5k6aafx13_params));
#ifdef CONFIG_PANTECH_CAMERA_TUNER
	memset(s5k6aafx13_tuner_params, 0, sizeof(s5k6aafx13_tuner_params));
#endif

	//PANTECH_CAMERA_TODO, adapter 설정과 param 설정을 분리할 것. ugly 하다...
	rc = si2c_init(s5k6aafx13_client->adapter, 
			s5k6aafx13_const_params, s5k6aafx13_params);
	if (rc < 0)
		goto sensor_init_fail;

	s5k6aafx13_ctrl = kzalloc(sizeof(s5k6aafx13_ctrl_t), GFP_KERNEL);
	if (!s5k6aafx13_ctrl) {
		CERR("%s err(-ENOMEM)\n", __func__);
		goto sensor_init_fail;
	}

	if (sinfo)
		s5k6aafx13_ctrl->sinfo = sinfo;

	rc = sgpio_init(sgpios, CAMIO_MAX);
	if (rc < 0)
		goto sensor_init_fail;

	rc = svreg_init(svregs, CAMV_MAX);
	if (rc < 0)
		goto sensor_init_fail;

	rc = s5k6aafx13_power_on();
	if (rc < 0)
		goto sensor_init_fail;

#ifdef CONFIG_PANTECH_CAMERA_TUNER
	CERR("%s tuner is enabled, skip writing INIT param!\n", __func__);
#else
	rc = si2c_write_param(SI2C_SA, SI2C_INIT, s5k6aafx13_params);
	if (rc < 0)
		goto sensor_init_fail;
#endif

	CDBG("%s X\n", __func__);
	return 0;

sensor_init_fail:

	if (s5k6aafx13_ctrl) {
		kfree(s5k6aafx13_ctrl);
		s5k6aafx13_ctrl = NULL;
	}
	(void)s5k6aafx13_power_off();
	svreg_release(svregs, CAMV_MAX);
	sgpio_release(sgpios, CAMIO_MAX);
	si2c_release();

	CERR("%s err(%d)\n", __func__, rc);
	return rc;
}
//mt9d113_sensor_setting
int32_t mt9d113_sensor_setting(struct msm_sensor_ctrl_t *s_ctrl,
			int update_type, int res)
{
	int32_t rc = 0;

SKYCDBG("%s: update_type = %d, res=%d E\n", __func__, update_type, res);
	s_ctrl->func_tbl->sensor_stop_stream(s_ctrl);
	msleep(30);
	if (update_type == MSM_SENSOR_REG_INIT) {
		s_ctrl->curr_csi_params = NULL;
		msm_sensor_enable_debugfs(s_ctrl);
//needtocheck//        
		mt9d113_sensor_init(s_ctrl);//msm_sensor_write_init_settings(s_ctrl);
	} else if (update_type == MSM_SENSOR_UPDATE_PERIODIC) {
//needtocheck// 	
		//msm_sensor_write_res_settings(s_ctrl, res);
		if (s_ctrl->curr_csi_params != s_ctrl->csi_params[res]) {
            SKYCDBG("%s: ==> MIPI setting  E %d\n", __func__, update_type);
			s_ctrl->curr_csi_params = s_ctrl->csi_params[res];
			s_ctrl->curr_csi_params->csid_params.lane_assign =
				s_ctrl->sensordata->sensor_platform_info->
				csi_lane_params->csi_lane_assign;
			s_ctrl->curr_csi_params->csiphy_params.lane_mask =
				s_ctrl->sensordata->sensor_platform_info->
				csi_lane_params->csi_lane_mask;
			v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
				NOTIFY_CSID_CFG,
				&s_ctrl->curr_csi_params->csid_params);
			mb();
			v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
				NOTIFY_CSIPHY_CFG,
				&s_ctrl->curr_csi_params->csiphy_params);
			mb();
			msleep(20);
            SKYCDBG("%s: ==> MIPI setting  X %d\n", __func__, update_type);		
		}

		v4l2_subdev_notify(&s_ctrl->sensor_v4l2_subdev,
			NOTIFY_PCLK_CHANGE, &s_ctrl->msm_sensor_reg->
			output_settings[res].op_pixel_clk);
		//s_ctrl->func_tbl->sensor_start_stream(s_ctrl);
#if 0//needtocheck		
		switch (res) {
			case 0:
//				rc = ce1612_snapshot_config(s_ctrl);	
				break;

			case 1:
//				rc = ce1612_video_config(s_ctrl);
                si2c_write_param(SI2C_SA, SI2C_INIT, s5k6aafx13_params);

				SKYCDBG("Sensor setting : Case 1 Video config"); 
				break;

	      //case 2: 
			//	rc = ce1612_1080p_config(s_ctrl);	
			//	break;

			case 3: 
//				rc = ce1612_ZSL_config(s_ctrl);	
				SKYCDBG("Sensor setting : Case 3 ZSL config");				
				break;	
				 
			default:
//				rc = ce1612_video_config(s_ctrl);
				SKYCDBG("Sensor setting : Default Video config"); 
				break;
		}
#endif
		sensor_mode = res;
		SKYCDBG("Sensor setting : Res = %d\n", res);
        
		msleep(30);
	}
	SKYCDBG("%s: %d x\n", __func__, __LINE__);
	return rc;
}