msm: camera: Bypass redundant creation of video node in stereo
In stereo mode two sensors use one video node so we need to bypass the creation of second one. Change-Id: I4a16d664afd3d2f67ff13cb62cd8265144d64caf Signed-off-by: Angel Hitov <ahitov@codeaurora.org> Signed-off-by: Iliya Varadzhakov <ivarad@codeaurora.org>
This commit is contained in:
parent
89bfd053bf
commit
f977e44aea
4 changed files with 26 additions and 9 deletions
|
@ -89,6 +89,7 @@ struct msm_sensor_ctrl_t {
|
|||
uint32_t set_mclk_23880000;
|
||||
uint8_t is_csid_tg_mode;
|
||||
uint32_t is_secure;
|
||||
uint8_t bypass_video_node_creation;
|
||||
};
|
||||
|
||||
int msm_sensor_config(struct msm_sensor_ctrl_t *s_ctrl, void __user *argp);
|
||||
|
|
|
@ -86,11 +86,14 @@ 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);
|
||||
rc = camera_init_v4l2(&client->dev, &session_id);
|
||||
if (rc < 0) {
|
||||
pr_err("failed: camera_init_i2c_v4l2 rc %d", rc);
|
||||
return rc;
|
||||
if (s_ctrl->bypass_video_node_creation == 0) {
|
||||
rc = camera_init_v4l2(&client->dev, &session_id);
|
||||
if (rc < 0) {
|
||||
pr_err("failed: camera_init_i2c_v4l2 rc %d", rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
CDBG("%s rc %d session_id %d\n", __func__, rc, session_id);
|
||||
snprintf(s_ctrl->msm_sd.sd.name,
|
||||
sizeof(s_ctrl->msm_sd.sd.name), "%s",
|
||||
|
@ -123,11 +126,14 @@ static int32_t msm_sensor_driver_create_v4l_subdev
|
|||
int32_t rc = 0;
|
||||
uint32_t session_id = 0;
|
||||
|
||||
rc = camera_init_v4l2(&s_ctrl->pdev->dev, &session_id);
|
||||
if (rc < 0) {
|
||||
pr_err("failed: camera_init_v4l2 rc %d", rc);
|
||||
return rc;
|
||||
if (s_ctrl->bypass_video_node_creation == 0) {
|
||||
rc = camera_init_v4l2(&s_ctrl->pdev->dev, &session_id);
|
||||
if (rc < 0) {
|
||||
pr_err("failed: camera_init_v4l2 rc %d", rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
CDBG("rc %d session_id %d", rc, session_id);
|
||||
s_ctrl->sensordata->sensor_info->session_id = session_id;
|
||||
|
||||
|
@ -773,6 +779,8 @@ int32_t msm_sensor_driver_probe(void *setting,
|
|||
slave_info32->sensor_init_params;
|
||||
slave_info->output_format =
|
||||
slave_info32->output_format;
|
||||
slave_info->bypass_video_node_creation =
|
||||
!!slave_info32->bypass_video_node_creation;
|
||||
kfree(slave_info32);
|
||||
} else
|
||||
#endif
|
||||
|
@ -800,7 +808,8 @@ int32_t msm_sensor_driver_probe(void *setting,
|
|||
slave_info->sensor_init_params.position);
|
||||
CDBG("mount %d",
|
||||
slave_info->sensor_init_params.sensor_mount_angle);
|
||||
|
||||
CDBG("bypass video node creation %d",
|
||||
slave_info->bypass_video_node_creation);
|
||||
/* Validate camera id */
|
||||
if (slave_info->camera_id >= MAX_CAMERAS) {
|
||||
pr_err("failed: invalid camera id %d max %d",
|
||||
|
@ -980,6 +989,9 @@ CSID_TG:
|
|||
*/
|
||||
s_ctrl->is_probe_succeed = 1;
|
||||
|
||||
s_ctrl->bypass_video_node_creation =
|
||||
slave_info->bypass_video_node_creation;
|
||||
|
||||
/*
|
||||
* Create /dev/videoX node, comment for now until dummy /dev/videoX
|
||||
* node is created and used by HAL
|
||||
|
|
|
@ -41,6 +41,7 @@ struct msm_camera_sensor_slave_info32 {
|
|||
uint8_t is_init_params_valid;
|
||||
struct msm_sensor_init_params sensor_init_params;
|
||||
enum msm_sensor_output_format_t output_format;
|
||||
uint8_t bypass_video_node_creation;
|
||||
};
|
||||
|
||||
struct msm_camera_csid_lut_params32 {
|
||||
|
|
|
@ -48,6 +48,8 @@
|
|||
#define MSM_EEPROM_MEMORY_MAP_MAX_SIZE 80
|
||||
#define MSM_EEPROM_MAX_MEM_MAP_CNT 8
|
||||
|
||||
#define MSM_SENSOR_BYPASS_VIDEO_NODE 1
|
||||
|
||||
enum msm_sensor_camera_id_t {
|
||||
CAMERA_0,
|
||||
CAMERA_1,
|
||||
|
@ -300,6 +302,7 @@ struct msm_camera_sensor_slave_info {
|
|||
unsigned char is_init_params_valid;
|
||||
struct msm_sensor_init_params sensor_init_params;
|
||||
enum msm_sensor_output_format_t output_format;
|
||||
uint8_t bypass_video_node_creation;
|
||||
};
|
||||
|
||||
struct msm_camera_i2c_reg_array {
|
||||
|
|
Loading…
Add table
Reference in a new issue