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

Commit 8a1a1d4a authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: ais: free gpio and irq when force shutdown"

parents 07209e9e 5b493c6a
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
/* Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
/* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -746,6 +746,7 @@ void cam_sensor_shutdown(struct cam_sensor_ctrl_t *s_ctrl)
	struct cam_sensor_power_ctrl_t *power_info =
		&s_ctrl->sensordata->power_info;
	int rc = 0;
	int idx = 0;

	if ((s_ctrl->sensor_state == CAM_SENSOR_INIT) &&
		(s_ctrl->is_probe_succeed == 0))
@@ -774,6 +775,16 @@ void cam_sensor_shutdown(struct cam_sensor_ctrl_t *s_ctrl)
	s_ctrl->is_probe_succeed = 0;
	s_ctrl->last_flush_req = 0;
	s_ctrl->sensor_state = CAM_SENSOR_INIT;

	for (idx = 0; idx < AIS_MAX_INTR_GPIO; idx++) {
		if (s_ctrl->s_intr[idx].work_inited == 1) {
			gpio_free(s_ctrl->s_intr[idx].gpio_array[0].gpio);
			free_irq(gpio_to_irq(
				s_ctrl->s_intr[idx].gpio_array[0].gpio),
				&s_ctrl->s_intr[idx]);
			s_ctrl->s_intr[idx].work_inited = 0;
		}
	}
}

int cam_sensor_match_id(struct cam_sensor_ctrl_t *s_ctrl)