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

Commit a89a16f8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: camera: Add support for TOF sensor on msm8998 QVR"

parents 1680902b 54c5eaaa
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -123,6 +123,9 @@ Optional properties:
- qcom,gpio-vdig : should contain index to gpio used by sensors digital vreg enable
- qcom,gpio-vaf : should contain index to gpio used by sensors af vreg enable
- qcom,gpio-af-pwdm : should contain index to gpio used by sensors af pwdm_n
- qcom,gpio-custom1 : should contain index to gpio used by sensors specific to usecase
- qcom,gpio-custom2 : should contain index to gpio used by sensors specific to usecase
- qcom,gpio-custom3 : should contain index to gpio used by sensors specific to usecase
- qcom,gpio-req-tbl-num : should contain index to gpios specific to this sensor
- qcom,gpio-req-tbl-flags : should contain direction of gpios present in
    qcom,gpio-req-tbl-num property (in the same order)
+24 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2017, 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
@@ -575,6 +575,8 @@ int msm_camera_get_dt_power_setting_data(struct device_node *of_node,
				ps[i].seq_val = SENSOR_GPIO_CUSTOM1;
			else if (!strcmp(seq_name, "sensor_gpio_custom2"))
				ps[i].seq_val = SENSOR_GPIO_CUSTOM2;
			else if (!strcmp(seq_name, "sensor_gpio_custom3"))
				ps[i].seq_val = SENSOR_GPIO_CUSTOM3;
			else
				rc = -EILSEQ;
			break;
@@ -1078,6 +1080,27 @@ int msm_camera_init_gpio_pin_tbl(struct device_node *of_node,
		rc = 0;
	}

	rc = of_property_read_u32(of_node, "qcom,gpio-custom3", &val);
	if (rc != -EINVAL) {
		if (rc < 0) {
			pr_err("%s:%d read qcom,gpio-custom3 failed rc %d\n",
				__func__, __LINE__, rc);
			goto ERROR;
		} else if (val >= gpio_array_size) {
			pr_err("%s:%d qcom,gpio-custom3 invalid %d\n",
				__func__, __LINE__, val);
			rc = -EINVAL;
			goto ERROR;
		}
		gconf->gpio_num_info->gpio_num[SENSOR_GPIO_CUSTOM3] =
			gpio_array[val];
		gconf->gpio_num_info->valid[SENSOR_GPIO_CUSTOM3] = 1;
		CDBG("%s qcom,gpio-custom3 %d\n", __func__,
			gconf->gpio_num_info->gpio_num[SENSOR_GPIO_CUSTOM3]);
	} else {
		rc = 0;
	}

	return rc;

ERROR:
+2 −0
Original line number Diff line number Diff line
@@ -113,8 +113,10 @@ enum msm_sensor_power_seq_gpio_t {
	SENSOR_GPIO_FL_RESET,
	SENSOR_GPIO_CUSTOM1,
	SENSOR_GPIO_CUSTOM2,
	SENSOR_GPIO_CUSTOM3,
	SENSOR_GPIO_MAX,
};
#define SENSOR_GPIO_CUSTOM3 SENSOR_GPIO_CUSTOM3

enum msm_ir_cut_filter_gpio_t {
	IR_CUT_FILTER_GPIO_P = 0,