Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e0d99f9 authored by Jeyaprakash Soundrapandian's avatar Jeyaprakash Soundrapandian Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Configure the shared pinctrl properly" into dev/msm-4.9-camx

parents 59b7004f 4d787882
Loading
Loading
Loading
Loading
+16 −16
Original line number Original line Diff line number Diff line
@@ -1181,12 +1181,6 @@ int msm_camera_pinctrl_init(
		return -EINVAL;
		return -EINVAL;
	}
	}


	if (cam_res_mgr_shared_pinctrl_init()) {
		CAM_ERR(CAM_SENSOR,
			"Failed to init shared pinctrl");
		return -EINVAL;
	}

	return 0;
	return 0;
}
}


@@ -1249,6 +1243,12 @@ int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl,
		ctrl->cam_pinctrl_status = 1;
		ctrl->cam_pinctrl_status = 1;
	}
	}


	if (cam_res_mgr_shared_pinctrl_init()) {
		CAM_ERR(CAM_SENSOR,
			"Failed to init shared pinctrl");
		return -EINVAL;
	}

	rc = cam_sensor_util_request_gpio_table(soc_info, 1);
	rc = cam_sensor_util_request_gpio_table(soc_info, 1);
	if (rc < 0)
	if (rc < 0)
		no_gpio = rc;
		no_gpio = rc;
@@ -1259,18 +1259,13 @@ int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl,
			ctrl->pinctrl_info.gpio_state_active);
			ctrl->pinctrl_info.gpio_state_active);
		if (ret)
		if (ret)
			CAM_ERR(CAM_SENSOR, "cannot set pin to active state");
			CAM_ERR(CAM_SENSOR, "cannot set pin to active state");
	}


	ret = cam_res_mgr_shared_pinctrl_select_state(true);
	ret = cam_res_mgr_shared_pinctrl_select_state(true);
	if (ret)
	if (ret)
		CAM_ERR(CAM_SENSOR,
		CAM_ERR(CAM_SENSOR,
			"Cannot set shared pin to active state");
			"Cannot set shared pin to active state");


		ret = cam_res_mgr_shared_pinctrl_post_init();
		if (ret)
			CAM_ERR(CAM_SENSOR,
				"Failed to post init shared pinctrl");
	}

	for (index = 0; index < ctrl->power_setting_size; index++) {
	for (index = 0; index < ctrl->power_setting_size; index++) {
		CAM_DBG(CAM_SENSOR, "index: %d", index);
		CAM_DBG(CAM_SENSOR, "index: %d", index);
		power_setting = &ctrl->power_setting[index];
		power_setting = &ctrl->power_setting[index];
@@ -1432,6 +1427,11 @@ int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl,
				(power_setting->delay * 1000) + 1000);
				(power_setting->delay * 1000) + 1000);
	}
	}


	ret = cam_res_mgr_shared_pinctrl_post_init();
	if (ret)
		CAM_ERR(CAM_SENSOR,
			"Failed to post init shared pinctrl");

	return 0;
	return 0;
power_up_failed:
power_up_failed:
	CAM_ERR(CAM_SENSOR, "failed");
	CAM_ERR(CAM_SENSOR, "failed");