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

Commit 4d787882 authored by Depeng Shao's avatar Depeng Shao
Browse files

msm: camera: Configure the shared pinctrl properly



The dtsi node of some sensor sub devices don't have the pinctrl
configuration, the shared gpio's pinctrl control can't depends
on the sub device's pinctrl. Need always call the shared pinctrl
interface to control the shared pinctrl.

Change-Id: Ib24e4a5104599d2439e3a733366f8771c2727551
Signed-off-by: default avatarDepeng Shao <depengs@codeaurora.org>
parent cc9760d5
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -1179,12 +1179,6 @@ int msm_camera_pinctrl_init(
		return -EINVAL;
	}

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

	return 0;
}

@@ -1247,6 +1241,12 @@ int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl,
		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);
	if (rc < 0)
		no_gpio = rc;
@@ -1257,18 +1257,13 @@ int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl,
			ctrl->pinctrl_info.gpio_state_active);
		if (ret)
			CAM_ERR(CAM_SENSOR, "cannot set pin to active state");
	}

	ret = cam_res_mgr_shared_pinctrl_select_state(true);
	if (ret)
		CAM_ERR(CAM_SENSOR,
			"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++) {
		CAM_DBG(CAM_SENSOR, "index: %d", index);
		power_setting = &ctrl->power_setting[index];
@@ -1430,6 +1425,11 @@ int cam_sensor_core_power_up(struct cam_sensor_power_ctrl_t *ctrl,
				(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;
power_up_failed:
	CAM_ERR(CAM_SENSOR, "failed");