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

Commit ba4a18c3 authored by Vijay kumar Tumati's avatar Vijay kumar Tumati
Browse files

msm: camera: vreg: Fix vreg power up issue



In cases when userspace sensor driver requests
for a specific voltage regulator and if same is
not present in DTSI file, we should not touch
that regulator. This change ensures that. Else,
we may power up default regulator unnecessarily.

Change-Id: I3163ee0ab747899bacd7aab0dac0ac5a6ac5bfa6
Signed-off-by: default avatarVijay kumar Tumati <vtumati@codeaurora.org>
parent dc9078ea
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -67,6 +67,8 @@ int msm_camera_fill_vreg_params(struct camera_vreg_t *cam_vreg,
					break;
				}
			}
			if (j == num_vreg)
				power_setting[i].seq_val = INVALID_VREG;
			break;

		case CAM_VIO:
@@ -86,6 +88,8 @@ int msm_camera_fill_vreg_params(struct camera_vreg_t *cam_vreg,
					break;
				}
			}
			if (j == num_vreg)
				power_setting[i].seq_val = INVALID_VREG;
			break;

		case CAM_VANA:
@@ -105,6 +109,8 @@ int msm_camera_fill_vreg_params(struct camera_vreg_t *cam_vreg,
					break;
				}
			}
			if (j == num_vreg)
				power_setting[i].seq_val = INVALID_VREG;
			break;

		case CAM_VAF:
@@ -124,6 +130,8 @@ int msm_camera_fill_vreg_params(struct camera_vreg_t *cam_vreg,
					break;
				}
			}
			if (j == num_vreg)
				power_setting[i].seq_val = INVALID_VREG;
			break;

		case CAM_V_CUSTOM1:
@@ -144,7 +152,9 @@ int msm_camera_fill_vreg_params(struct camera_vreg_t *cam_vreg,
					break;
				}
			}

			if (j == num_vreg)
				power_setting[i].seq_val = INVALID_VREG;
			break;
		case CAM_V_CUSTOM2:
			for (j = 0; j < num_vreg; j++) {
				if (!strcmp(cam_vreg[j].reg_name,
@@ -163,6 +173,8 @@ int msm_camera_fill_vreg_params(struct camera_vreg_t *cam_vreg,
					break;
				}
			}
			if (j == num_vreg)
				power_setting[i].seq_val = INVALID_VREG;
			break;

		default:
@@ -1401,6 +1413,9 @@ int msm_camera_power_up(struct msm_camera_power_ctrl_t *ctrl,
				(int) power_setting->config_val);
			break;
		case SENSOR_VREG:
			if (power_setting->seq_val == INVALID_VREG)
				break;

			if (power_setting->seq_val >= CAM_VREG_MAX) {
				pr_err("%s vreg index %d >= max %d\n", __func__,
					power_setting->seq_val,