Loading Documentation/devicetree/bindings/media/video/msm-cci.txt +2 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,8 @@ Optional properties: property should contain phandle of respective eeprom nodes - qcom,ois-src : if optical image stabilization is supported by this sensor, this property should contain phandle of respective ois node - qcom,special-support-sensors: if only some special sensors are supported on this board, add sensor name in this property. * Qualcomm MSM ACTUATOR Loading arch/arm/boot/dts/qcom/msm8929-camera-sensor-qrd.dtsi +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2014, The Linux Foundation. All rights reserved. * Copyright (c) 2014-2015, 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 Loading Loading @@ -209,6 +209,7 @@ cell-index = <0>; compatible = "qcom,camera"; reg = <0x0>; qcom,special-support-sensors="ov13850_q13v06k"; qcom,csiphy-sd-index = <0>; qcom,csid-sd-index = <0>; qcom,mount-angle = <90>; Loading drivers/media/platform/msm/camera_v2/sensor/msm_sensor_driver.c 100644 → 100755 +58 −2 Original line number Diff line number Diff line /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2013-2015, 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 Loading Loading @@ -625,6 +625,23 @@ static void msm_sensor_fill_sensor_info(struct msm_sensor_ctrl_t *s_ctrl, } /* static function definition */ int32_t msm_sensor_driver_is_special_support( struct msm_sensor_ctrl_t *s_ctrl, char* sensor_name) { int32_t rc = FALSE; int32_t i = 0; struct msm_camera_sensor_board_info *sensordata = s_ctrl->sensordata; for (i = 0; i < sensordata->special_support_size; i++) { if (!strcmp(sensordata->special_support_sensors[i], sensor_name)) { rc = TRUE; break ; } } return rc; } int32_t msm_sensor_driver_probe(void *setting, struct msm_sensor_info_t *probed_info, char *entity_name) { Loading Loading @@ -765,6 +782,16 @@ int32_t msm_sensor_driver_probe(void *setting, goto free_slave_info; } if (s_ctrl->sensordata->special_support_size > 0) { if (!msm_sensor_driver_is_special_support(s_ctrl, slave_info->sensor_name)) { pr_err("%s:%s is not support on this board\n", __func__, slave_info->sensor_name); rc = 0; goto free_slave_info; } } rc = msm_sensor_get_power_settings(setting, slave_info, &s_ctrl->sensordata->power_info); if (rc < 0) { Loading Loading @@ -1010,6 +1037,7 @@ static int32_t msm_sensor_driver_get_dt_data(struct msm_sensor_ctrl_t *s_ctrl) struct msm_camera_sensor_board_info *sensordata = NULL; struct device_node *of_node = s_ctrl->of_node; uint32_t cell_id; int32_t i; s_ctrl->sensordata = kzalloc(sizeof(*sensordata), GFP_KERNEL); if (!s_ctrl->sensordata) { Loading Loading @@ -1044,6 +1072,34 @@ static int32_t msm_sensor_driver_get_dt_data(struct msm_sensor_ctrl_t *s_ctrl) goto FREE_SENSOR_DATA; } sensordata->special_support_size = of_property_count_strings(of_node, "qcom,special-support-sensors"); if (sensordata->special_support_size < 0) sensordata->special_support_size = 0; if (sensordata->special_support_size > MAX_SPECIAL_SUPPORT_SIZE) { pr_err("%s:support_size exceed max support size\n",__func__); sensordata->special_support_size = MAX_SPECIAL_SUPPORT_SIZE; } if (sensordata->special_support_size) { for( i = 0; i < sensordata->special_support_size; i++) { rc = of_property_read_string_index(of_node, "qcom,special-support-sensors", i, &(sensordata->special_support_sensors[i])); if(rc < 0 ) { /* if read sensor support names failed, * set support all sensors, break; */ sensordata->special_support_size = 0; break ; } CDBG("%s special_support_sensors[%d] = %s\n", __func__, i, sensordata->special_support_sensors[i]); } } /* Read subdev info */ rc = msm_sensor_get_sub_module_index(of_node, &sensordata->sensor_info); if (rc < 0) { Loading include/media/camera2.h +4 −1 Original line number Diff line number Diff line /* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2015, 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 Loading @@ -19,6 +19,7 @@ #include <linux/of_platform.h> #include <linux/of_device.h> #include <linux/of.h> #define MAX_SPECIAL_SUPPORT_SIZE 10 enum msm_camera_device_type_t { MSM_CAMERA_I2C_DEVICE, Loading Loading @@ -93,6 +94,8 @@ struct msm_camera_sensor_board_info { const char *eeprom_name; const char *actuator_name; const char *ois_name; const char *special_support_sensors[MAX_SPECIAL_SUPPORT_SIZE]; int32_t special_support_size ; struct msm_camera_slave_info *slave_info; struct msm_camera_csi_lane_params *csi_lane_params; struct msm_camera_sensor_strobe_flash_data *strobe_flash_data; Loading include/soc/qcom/camera2.h +4 −2 Original line number Diff line number Diff line /* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2015, 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 Loading @@ -19,7 +19,7 @@ #include <linux/of_platform.h> #include <linux/of_device.h> #include <linux/of.h> #define MAX_SPECIAL_SUPPORT_SIZE 10 enum msm_camera_device_type_t { MSM_CAMERA_I2C_DEVICE, Loading Loading @@ -147,6 +147,8 @@ struct msm_camera_sensor_board_info { const char *eeprom_name; const char *actuator_name; const char *ois_name; const char *special_support_sensors[MAX_SPECIAL_SUPPORT_SIZE]; int32_t special_support_size; struct msm_camera_slave_info *slave_info; struct msm_camera_csi_lane_params *csi_lane_params; struct msm_camera_sensor_strobe_flash_data *strobe_flash_data; Loading Loading
Documentation/devicetree/bindings/media/video/msm-cci.txt +2 −0 Original line number Diff line number Diff line Loading @@ -167,6 +167,8 @@ Optional properties: property should contain phandle of respective eeprom nodes - qcom,ois-src : if optical image stabilization is supported by this sensor, this property should contain phandle of respective ois node - qcom,special-support-sensors: if only some special sensors are supported on this board, add sensor name in this property. * Qualcomm MSM ACTUATOR Loading
arch/arm/boot/dts/qcom/msm8929-camera-sensor-qrd.dtsi +2 −1 Original line number Diff line number Diff line /* * Copyright (c) 2014, The Linux Foundation. All rights reserved. * Copyright (c) 2014-2015, 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 Loading Loading @@ -209,6 +209,7 @@ cell-index = <0>; compatible = "qcom,camera"; reg = <0x0>; qcom,special-support-sensors="ov13850_q13v06k"; qcom,csiphy-sd-index = <0>; qcom,csid-sd-index = <0>; qcom,mount-angle = <90>; Loading
drivers/media/platform/msm/camera_v2/sensor/msm_sensor_driver.c 100644 → 100755 +58 −2 Original line number Diff line number Diff line /* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2013-2015, 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 Loading Loading @@ -625,6 +625,23 @@ static void msm_sensor_fill_sensor_info(struct msm_sensor_ctrl_t *s_ctrl, } /* static function definition */ int32_t msm_sensor_driver_is_special_support( struct msm_sensor_ctrl_t *s_ctrl, char* sensor_name) { int32_t rc = FALSE; int32_t i = 0; struct msm_camera_sensor_board_info *sensordata = s_ctrl->sensordata; for (i = 0; i < sensordata->special_support_size; i++) { if (!strcmp(sensordata->special_support_sensors[i], sensor_name)) { rc = TRUE; break ; } } return rc; } int32_t msm_sensor_driver_probe(void *setting, struct msm_sensor_info_t *probed_info, char *entity_name) { Loading Loading @@ -765,6 +782,16 @@ int32_t msm_sensor_driver_probe(void *setting, goto free_slave_info; } if (s_ctrl->sensordata->special_support_size > 0) { if (!msm_sensor_driver_is_special_support(s_ctrl, slave_info->sensor_name)) { pr_err("%s:%s is not support on this board\n", __func__, slave_info->sensor_name); rc = 0; goto free_slave_info; } } rc = msm_sensor_get_power_settings(setting, slave_info, &s_ctrl->sensordata->power_info); if (rc < 0) { Loading Loading @@ -1010,6 +1037,7 @@ static int32_t msm_sensor_driver_get_dt_data(struct msm_sensor_ctrl_t *s_ctrl) struct msm_camera_sensor_board_info *sensordata = NULL; struct device_node *of_node = s_ctrl->of_node; uint32_t cell_id; int32_t i; s_ctrl->sensordata = kzalloc(sizeof(*sensordata), GFP_KERNEL); if (!s_ctrl->sensordata) { Loading Loading @@ -1044,6 +1072,34 @@ static int32_t msm_sensor_driver_get_dt_data(struct msm_sensor_ctrl_t *s_ctrl) goto FREE_SENSOR_DATA; } sensordata->special_support_size = of_property_count_strings(of_node, "qcom,special-support-sensors"); if (sensordata->special_support_size < 0) sensordata->special_support_size = 0; if (sensordata->special_support_size > MAX_SPECIAL_SUPPORT_SIZE) { pr_err("%s:support_size exceed max support size\n",__func__); sensordata->special_support_size = MAX_SPECIAL_SUPPORT_SIZE; } if (sensordata->special_support_size) { for( i = 0; i < sensordata->special_support_size; i++) { rc = of_property_read_string_index(of_node, "qcom,special-support-sensors", i, &(sensordata->special_support_sensors[i])); if(rc < 0 ) { /* if read sensor support names failed, * set support all sensors, break; */ sensordata->special_support_size = 0; break ; } CDBG("%s special_support_sensors[%d] = %s\n", __func__, i, sensordata->special_support_sensors[i]); } } /* Read subdev info */ rc = msm_sensor_get_sub_module_index(of_node, &sensordata->sensor_info); if (rc < 0) { Loading
include/media/camera2.h +4 −1 Original line number Diff line number Diff line /* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2015, 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 Loading @@ -19,6 +19,7 @@ #include <linux/of_platform.h> #include <linux/of_device.h> #include <linux/of.h> #define MAX_SPECIAL_SUPPORT_SIZE 10 enum msm_camera_device_type_t { MSM_CAMERA_I2C_DEVICE, Loading Loading @@ -93,6 +94,8 @@ struct msm_camera_sensor_board_info { const char *eeprom_name; const char *actuator_name; const char *ois_name; const char *special_support_sensors[MAX_SPECIAL_SUPPORT_SIZE]; int32_t special_support_size ; struct msm_camera_slave_info *slave_info; struct msm_camera_csi_lane_params *csi_lane_params; struct msm_camera_sensor_strobe_flash_data *strobe_flash_data; Loading
include/soc/qcom/camera2.h +4 −2 Original line number Diff line number Diff line /* Copyright (c) 2011-2014, The Linux Foundation. All rights reserved. /* Copyright (c) 2011-2015, 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 Loading @@ -19,7 +19,7 @@ #include <linux/of_platform.h> #include <linux/of_device.h> #include <linux/of.h> #define MAX_SPECIAL_SUPPORT_SIZE 10 enum msm_camera_device_type_t { MSM_CAMERA_I2C_DEVICE, Loading Loading @@ -147,6 +147,8 @@ struct msm_camera_sensor_board_info { const char *eeprom_name; const char *actuator_name; const char *ois_name; const char *special_support_sensors[MAX_SPECIAL_SUPPORT_SIZE]; int32_t special_support_size; struct msm_camera_slave_info *slave_info; struct msm_camera_csi_lane_params *csi_lane_params; struct msm_camera_sensor_strobe_flash_data *strobe_flash_data; Loading