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

Commit 625bc315 authored by Shen Wu's avatar Shen Wu Committed by John.Wei
Browse files

[ALPS05430245] cam: Fix dual cam bug in imgsensor oc hanlder for mt6765



Fix dual cam bug in imgsensor oc hanlder for mt6765.

MTK-Commit-Id: 0a6109a9515dc6deb9f82666cb8533264dea9c03

Change-Id: Ib75d3b8cc636c019d44e5742ff1a9f7b06663779
Signed-off-by: default avatarShen Wu <Hsi-hsuan.Wu@mediatek.com>
CR-Id: ALPS05430245
Feature: Image Sensor(imgsensor)
parent 40934574
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -411,6 +411,10 @@ imgsensor_sensor_close(struct IMGSENSOR_SENSOR *psensor)

		psensor_func->psensor_inst = psensor_inst;

		if (pgimgsensor->imgsensor_oc_irq_enable != NULL)
			pgimgsensor->imgsensor_oc_irq_enable(
					psensor->inst.sensor_idx, false);

		ret = psensor_func->SensorClose();
		if (ret != ERROR_NONE) {
			PK_DBG(" [%s]error : %d\n", __func__, ret);
+10 −10
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ struct reg_oc_debug_t {
	bool is_md_reg;
};

static struct reg_oc_debug_t reg_oc_debug[REGULATOR_TYPE_MAX_NUM];
static struct reg_oc_debug_t
	reg_oc_debug[IMGSENSOR_SENSOR_IDX_MAX_NUM][REGULATOR_TYPE_MAX_NUM];

static const int regulator_voltage[] = {
	REGULATOR_VOLTAGE_0,
@@ -93,16 +94,15 @@ enum IMGSENSOR_RETURN imgsensor_oc_interrupt(
					!Is_Notify_call[sensor_idx][i]
				) {
				/* oc notifier callback function */
				if (reg_oc_debug[i].name == NULL)
					reg_oc_debug[i].name = regulator_control[i].pregulator_type;
				if (reg_oc_debug[i].regulator == NULL)
					reg_oc_debug[i].regulator =
				reg_oc_debug[sensor_idx][i].name =
					regulator_control[i].pregulator_type;
				reg_oc_debug[sensor_idx][i].regulator =
					preg_own->pregulator[sensor_idx][i];
				reg_oc_debug[i].nb.notifier_call =
				reg_oc_debug[sensor_idx][i].nb.notifier_call =
					regulator_oc_notify;
				ret = devm_regulator_register_notifier(
					preg_own->pregulator[sensor_idx][i],
					&reg_oc_debug[i].nb);
					&reg_oc_debug[sensor_idx][i].nb);
				Is_Notify_call[sensor_idx][i] = true;

				if (ret) {
@@ -126,13 +126,13 @@ enum IMGSENSOR_RETURN imgsensor_oc_interrupt(

		for (i = 0; i < REGULATOR_TYPE_MAX_NUM; i++) {
			if (preg_own->pregulator[sensor_idx][i] &&
				!regulator_is_enabled(preg_own->pregulator[sensor_idx][i]) &&
				regulator_is_enabled(preg_own->pregulator[sensor_idx][i]) &&
				Is_Notify_call[sensor_idx][i]
				) {
				/* oc notifier callback function */
				devm_regulator_unregister_notifier(
					preg_own->pregulator[sensor_idx][i],
					&reg_oc_debug[i].nb);
					&reg_oc_debug[sensor_idx][i].nb);
				Is_Notify_call[sensor_idx][i] = false;
				pr_info("Unregister OC notifier");
			}