Loading drivers/cam_sensor_module/cam_flash/cam_flash_dev.c +16 −1 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl, CAM_DBG(CAM_FLASH, "CAM_QUERY_CAP"); flash_cap.slot_info = fctrl->soc_info.index; flash_cap.flash_type = soc_private->flash_type; for (i = 0; i < fctrl->flash_num_sources; i++) { flash_cap.max_current_flash[i] = soc_private->flash_max_current[i]; Loading Loading @@ -412,6 +413,7 @@ static int cam_flash_component_bind(struct device *dev, struct cam_flash_ctrl *fctrl = NULL; struct device_node *of_parent = NULL; struct platform_device *pdev = to_platform_device(dev); struct cam_hw_soc_info *soc_info = NULL; CAM_DBG(CAM_FLASH, "Binding flash component"); if (!pdev->dev.of_node) { Loading Loading @@ -467,6 +469,19 @@ static int cam_flash_component_bind(struct device *dev, fctrl->io_master_info.cci_client->cci_device = fctrl->cci_num; CAM_DBG(CAM_FLASH, "cci-index %d", fctrl->cci_num, rc); soc_info = &fctrl->soc_info; rc = cam_sensor_util_init_gpio_pin_tbl(soc_info, &fctrl->power_info.gpio_num_info); if ((rc < 0) || (!fctrl->power_info.gpio_num_info)) { CAM_ERR(CAM_FLASH, "No/Error Flash GPIOs"); return -EINVAL; } rc = cam_sensor_util_regulator_powerup(soc_info); if (rc < 0) { CAM_ERR(CAM_FLASH, "regulator power up for flash failed %d", rc); return rc; } fctrl->i2c_data.per_frame = kzalloc(sizeof(struct i2c_settings_array) * MAX_PER_FRAME_ARRAY, GFP_KERNEL); Loading drivers/cam_sensor_module/cam_flash/cam_flash_dev.h +4 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #ifndef _CAM_FLASH_DEV_H_ Loading Loading @@ -30,6 +30,7 @@ #include "cam_subdev.h" #include "cam_mem_mgr.h" #include "cam_sensor_cmn_header.h" #include "cam_sensor_util.h" #include "cam_soc_util.h" #include "cam_debug_util.h" #include "cam_sensor_io.h" Loading Loading @@ -137,6 +138,7 @@ struct cam_flash_frame_setting { * @torch_op_current : Torch operational current * @torch_max_current : Max supported current for LED in torch mode * @is_wled_flash : Detection between WLED/LED flash * @flash_type : Flash type */ struct cam_flash_private_soc { Loading @@ -149,6 +151,7 @@ struct cam_flash_private_soc { uint32_t torch_op_current[CAM_FLASH_MAX_LED_TRIGGERS]; uint32_t torch_max_current[CAM_FLASH_MAX_LED_TRIGGERS]; bool is_wled_flash; uint32_t flash_type; }; struct cam_flash_func_tbl { Loading drivers/cam_sensor_module/cam_flash/cam_flash_soc.c +7 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #include <linux/of.h> Loading Loading @@ -73,6 +73,12 @@ static int32_t cam_get_source_node_info( soc_private->is_wled_flash = of_property_read_bool(of_node, "wled-flash-support"); rc = of_property_read_u32(of_node, "flash-type", &soc_private->flash_type); if (rc) { CAM_ERR(CAM_FLASH, "flash-type read failed rc=%d", rc); } switch_src_node = of_parse_phandle(of_node, "switch-source", 0); if (!switch_src_node) { CAM_WARN(CAM_FLASH, "switch_src_node NULL"); Loading drivers/cam_sensor_module/cam_sensor_utils/cam_sensor_util.c +4 −0 Original line number Diff line number Diff line Loading @@ -2407,6 +2407,10 @@ int cam_sensor_util_power_down(struct cam_sensor_power_ctrl_t *ctrl, case SENSOR_CUSTOM_GPIO1: case SENSOR_CUSTOM_GPIO2: if (!gpio_num_info) { CAM_ERR(CAM_SENSOR, "failed: No gpio"); continue; } if (!gpio_num_info->valid[pd->seq_type]) continue; Loading include/uapi/camera/media/cam_sensor.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #ifndef __UAPI_CAM_SENSOR_H__ Loading Loading @@ -476,6 +476,7 @@ struct cam_flash_query_curr { * @max_current_flash : max supported current for flash * @max_duration_flash : max flash turn on duration * @max_current_torch : max supported current for torch * @flash_type : Indicates about the flash type -I2C,GPIO,PMIC * */ struct cam_flash_query_cap_info { Loading @@ -483,6 +484,7 @@ struct cam_flash_query_cap_info { __u32 max_current_flash[CAM_FLASH_MAX_LED_TRIGGERS]; __u32 max_duration_flash[CAM_FLASH_MAX_LED_TRIGGERS]; __u32 max_current_torch[CAM_FLASH_MAX_LED_TRIGGERS]; __u32 flash_type; } __attribute__ ((packed)); #endif Loading
drivers/cam_sensor_module/cam_flash/cam_flash_dev.c +16 −1 Original line number Diff line number Diff line Loading @@ -134,6 +134,7 @@ static int32_t cam_flash_driver_cmd(struct cam_flash_ctrl *fctrl, CAM_DBG(CAM_FLASH, "CAM_QUERY_CAP"); flash_cap.slot_info = fctrl->soc_info.index; flash_cap.flash_type = soc_private->flash_type; for (i = 0; i < fctrl->flash_num_sources; i++) { flash_cap.max_current_flash[i] = soc_private->flash_max_current[i]; Loading Loading @@ -412,6 +413,7 @@ static int cam_flash_component_bind(struct device *dev, struct cam_flash_ctrl *fctrl = NULL; struct device_node *of_parent = NULL; struct platform_device *pdev = to_platform_device(dev); struct cam_hw_soc_info *soc_info = NULL; CAM_DBG(CAM_FLASH, "Binding flash component"); if (!pdev->dev.of_node) { Loading Loading @@ -467,6 +469,19 @@ static int cam_flash_component_bind(struct device *dev, fctrl->io_master_info.cci_client->cci_device = fctrl->cci_num; CAM_DBG(CAM_FLASH, "cci-index %d", fctrl->cci_num, rc); soc_info = &fctrl->soc_info; rc = cam_sensor_util_init_gpio_pin_tbl(soc_info, &fctrl->power_info.gpio_num_info); if ((rc < 0) || (!fctrl->power_info.gpio_num_info)) { CAM_ERR(CAM_FLASH, "No/Error Flash GPIOs"); return -EINVAL; } rc = cam_sensor_util_regulator_powerup(soc_info); if (rc < 0) { CAM_ERR(CAM_FLASH, "regulator power up for flash failed %d", rc); return rc; } fctrl->i2c_data.per_frame = kzalloc(sizeof(struct i2c_settings_array) * MAX_PER_FRAME_ARRAY, GFP_KERNEL); Loading
drivers/cam_sensor_module/cam_flash/cam_flash_dev.h +4 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #ifndef _CAM_FLASH_DEV_H_ Loading Loading @@ -30,6 +30,7 @@ #include "cam_subdev.h" #include "cam_mem_mgr.h" #include "cam_sensor_cmn_header.h" #include "cam_sensor_util.h" #include "cam_soc_util.h" #include "cam_debug_util.h" #include "cam_sensor_io.h" Loading Loading @@ -137,6 +138,7 @@ struct cam_flash_frame_setting { * @torch_op_current : Torch operational current * @torch_max_current : Max supported current for LED in torch mode * @is_wled_flash : Detection between WLED/LED flash * @flash_type : Flash type */ struct cam_flash_private_soc { Loading @@ -149,6 +151,7 @@ struct cam_flash_private_soc { uint32_t torch_op_current[CAM_FLASH_MAX_LED_TRIGGERS]; uint32_t torch_max_current[CAM_FLASH_MAX_LED_TRIGGERS]; bool is_wled_flash; uint32_t flash_type; }; struct cam_flash_func_tbl { Loading
drivers/cam_sensor_module/cam_flash/cam_flash_soc.c +7 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. */ #include <linux/of.h> Loading Loading @@ -73,6 +73,12 @@ static int32_t cam_get_source_node_info( soc_private->is_wled_flash = of_property_read_bool(of_node, "wled-flash-support"); rc = of_property_read_u32(of_node, "flash-type", &soc_private->flash_type); if (rc) { CAM_ERR(CAM_FLASH, "flash-type read failed rc=%d", rc); } switch_src_node = of_parse_phandle(of_node, "switch-source", 0); if (!switch_src_node) { CAM_WARN(CAM_FLASH, "switch_src_node NULL"); Loading
drivers/cam_sensor_module/cam_sensor_utils/cam_sensor_util.c +4 −0 Original line number Diff line number Diff line Loading @@ -2407,6 +2407,10 @@ int cam_sensor_util_power_down(struct cam_sensor_power_ctrl_t *ctrl, case SENSOR_CUSTOM_GPIO1: case SENSOR_CUSTOM_GPIO2: if (!gpio_num_info) { CAM_ERR(CAM_SENSOR, "failed: No gpio"); continue; } if (!gpio_num_info->valid[pd->seq_type]) continue; Loading
include/uapi/camera/media/cam_sensor.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ /* * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. */ #ifndef __UAPI_CAM_SENSOR_H__ Loading Loading @@ -476,6 +476,7 @@ struct cam_flash_query_curr { * @max_current_flash : max supported current for flash * @max_duration_flash : max flash turn on duration * @max_current_torch : max supported current for torch * @flash_type : Indicates about the flash type -I2C,GPIO,PMIC * */ struct cam_flash_query_cap_info { Loading @@ -483,6 +484,7 @@ struct cam_flash_query_cap_info { __u32 max_current_flash[CAM_FLASH_MAX_LED_TRIGGERS]; __u32 max_duration_flash[CAM_FLASH_MAX_LED_TRIGGERS]; __u32 max_current_torch[CAM_FLASH_MAX_LED_TRIGGERS]; __u32 flash_type; } __attribute__ ((packed)); #endif