Merge "msm: camera: Add support for TOF sensor on msm8998 QVR"
This commit is contained in:
commit
a89a16f8e3
3 changed files with 29 additions and 1 deletions
|
@ -123,6 +123,9 @@ Optional properties:
|
||||||
- qcom,gpio-vdig : should contain index to gpio used by sensors digital vreg enable
|
- 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-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-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-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-flags : should contain direction of gpios present in
|
||||||
qcom,gpio-req-tbl-num property (in the same order)
|
qcom,gpio-req-tbl-num property (in the same order)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* 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
|
* 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
|
* 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;
|
ps[i].seq_val = SENSOR_GPIO_CUSTOM1;
|
||||||
else if (!strcmp(seq_name, "sensor_gpio_custom2"))
|
else if (!strcmp(seq_name, "sensor_gpio_custom2"))
|
||||||
ps[i].seq_val = 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
|
else
|
||||||
rc = -EILSEQ;
|
rc = -EILSEQ;
|
||||||
break;
|
break;
|
||||||
|
@ -1078,6 +1080,27 @@ int msm_camera_init_gpio_pin_tbl(struct device_node *of_node,
|
||||||
rc = 0;
|
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;
|
return rc;
|
||||||
|
|
||||||
ERROR:
|
ERROR:
|
||||||
|
|
|
@ -113,8 +113,10 @@ enum msm_sensor_power_seq_gpio_t {
|
||||||
SENSOR_GPIO_FL_RESET,
|
SENSOR_GPIO_FL_RESET,
|
||||||
SENSOR_GPIO_CUSTOM1,
|
SENSOR_GPIO_CUSTOM1,
|
||||||
SENSOR_GPIO_CUSTOM2,
|
SENSOR_GPIO_CUSTOM2,
|
||||||
|
SENSOR_GPIO_CUSTOM3,
|
||||||
SENSOR_GPIO_MAX,
|
SENSOR_GPIO_MAX,
|
||||||
};
|
};
|
||||||
|
#define SENSOR_GPIO_CUSTOM3 SENSOR_GPIO_CUSTOM3
|
||||||
|
|
||||||
enum msm_ir_cut_filter_gpio_t {
|
enum msm_ir_cut_filter_gpio_t {
|
||||||
IR_CUT_FILTER_GPIO_P = 0,
|
IR_CUT_FILTER_GPIO_P = 0,
|
||||||
|
|
Loading…
Add table
Reference in a new issue