Loading Documentation/devicetree/bindings/media/video/msm-camera-flash.txt +4 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ Optional properties: -pm8941_torch - qcom,slave-id : should contain i2c slave address, device id address and expected id read value. - qcom,max-current: Max current in mA supported by flash - qcom,max-duration: Max duration in milliseconds the flash can glow. Example: qcom,led-flash@60 { Loading @@ -57,4 +58,6 @@ qcom,led-flash@60 { qcom,gpio-req-tbl-flags = <0 0>; qcom,gpio-req-tbl-label = "FLASH_EN", "FLASH_NOW"; qcom,max-current = <750>; qcom,max-duration = <1600>; }; drivers/media/platform/msm/camera_v2/sensor/flash/msm_led_flash.h +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ struct msm_led_flash_ctrl_t { struct led_trigger *flash_trigger[MAX_LED_TRIGGERS]; uint32_t flash_op_current[MAX_LED_TRIGGERS]; uint32_t flash_max_current[MAX_LED_TRIGGERS]; uint32_t flash_max_duration[MAX_LED_TRIGGERS]; const char *torch_trigger_name; struct led_trigger *torch_trigger; uint32_t torch_op_current; Loading drivers/media/platform/msm/camera_v2/sensor/flash/msm_led_i2c_trigger.c +51 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ int32_t msm_led_i2c_trigger_config(struct msm_led_flash_ctrl_t *fctrl, void *data) { int rc = 0; int i = 0; struct msm_camera_led_cfg_t *cfg = (struct msm_camera_led_cfg_t *)data; CDBG("called led_state %d\n", cfg->cfgtype); Loading @@ -56,6 +57,12 @@ int32_t msm_led_i2c_trigger_config(struct msm_led_flash_ctrl_t *fctrl, case MSM_CAMERA_LED_INIT: if (fctrl->func_tbl->flash_led_init) rc = fctrl->func_tbl->flash_led_init(fctrl); for (i = 0; i < MAX_LED_TRIGGERS; i++) { cfg->flash_current[i] = fctrl->flash_max_current[i]; cfg->flash_duration[i] = fctrl->flash_max_duration[i]; } break; case MSM_CAMERA_LED_RELEASE: Loading Loading @@ -418,6 +425,50 @@ static int32_t msm_led_get_dt_data(struct device_node *of_node, } } /* Read the max current for an LED if present */ if (of_get_property(of_node, "qcom,max-current", &count)) { count /= sizeof(uint32_t); if (count > MAX_LED_TRIGGERS) { pr_err("failed\n"); rc = -EINVAL; goto ERROR8; } rc = of_property_read_u32_array(of_node, "qcom,max-current", fctrl->flash_max_current, count); if (rc < 0) { pr_err("%s failed %d\n", __func__, __LINE__); goto ERROR8; } for (; count < MAX_LED_TRIGGERS; count++) fctrl->flash_max_current[count] = 0; } /* Read the max duration for an LED if present */ if (of_get_property(of_node, "qcom,max-duration", &count)) { count /= sizeof(uint32_t); if (count > MAX_LED_TRIGGERS) { pr_err("failed\n"); rc = -EINVAL; goto ERROR8; } rc = of_property_read_u32_array(of_node, "qcom,max-duration", fctrl->flash_max_duration, count); if (rc < 0) { pr_err("%s failed %d\n", __func__, __LINE__); goto ERROR8; } for (; count < MAX_LED_TRIGGERS; count++) fctrl->flash_max_duration[count] = 0; } flashdata->slave_info = kzalloc(sizeof(struct msm_camera_slave_info), GFP_KERNEL); Loading include/media/msm_cam_sensor.h +1 −0 Original line number Diff line number Diff line Loading @@ -737,6 +737,7 @@ struct msm_camera_led_cfg_t { enum msm_camera_led_config_t cfgtype; uint32_t torch_current; uint32_t flash_current[MAX_LED_TRIGGERS]; uint32_t flash_duration[MAX_LED_TRIGGERS]; }; /* sensor init structures and enums */ Loading Loading
Documentation/devicetree/bindings/media/video/msm-camera-flash.txt +4 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,8 @@ Optional properties: -pm8941_torch - qcom,slave-id : should contain i2c slave address, device id address and expected id read value. - qcom,max-current: Max current in mA supported by flash - qcom,max-duration: Max duration in milliseconds the flash can glow. Example: qcom,led-flash@60 { Loading @@ -57,4 +58,6 @@ qcom,led-flash@60 { qcom,gpio-req-tbl-flags = <0 0>; qcom,gpio-req-tbl-label = "FLASH_EN", "FLASH_NOW"; qcom,max-current = <750>; qcom,max-duration = <1600>; };
drivers/media/platform/msm/camera_v2/sensor/flash/msm_led_flash.h +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ struct msm_led_flash_ctrl_t { struct led_trigger *flash_trigger[MAX_LED_TRIGGERS]; uint32_t flash_op_current[MAX_LED_TRIGGERS]; uint32_t flash_max_current[MAX_LED_TRIGGERS]; uint32_t flash_max_duration[MAX_LED_TRIGGERS]; const char *torch_trigger_name; struct led_trigger *torch_trigger; uint32_t torch_op_current; Loading
drivers/media/platform/msm/camera_v2/sensor/flash/msm_led_i2c_trigger.c +51 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ int32_t msm_led_i2c_trigger_config(struct msm_led_flash_ctrl_t *fctrl, void *data) { int rc = 0; int i = 0; struct msm_camera_led_cfg_t *cfg = (struct msm_camera_led_cfg_t *)data; CDBG("called led_state %d\n", cfg->cfgtype); Loading @@ -56,6 +57,12 @@ int32_t msm_led_i2c_trigger_config(struct msm_led_flash_ctrl_t *fctrl, case MSM_CAMERA_LED_INIT: if (fctrl->func_tbl->flash_led_init) rc = fctrl->func_tbl->flash_led_init(fctrl); for (i = 0; i < MAX_LED_TRIGGERS; i++) { cfg->flash_current[i] = fctrl->flash_max_current[i]; cfg->flash_duration[i] = fctrl->flash_max_duration[i]; } break; case MSM_CAMERA_LED_RELEASE: Loading Loading @@ -418,6 +425,50 @@ static int32_t msm_led_get_dt_data(struct device_node *of_node, } } /* Read the max current for an LED if present */ if (of_get_property(of_node, "qcom,max-current", &count)) { count /= sizeof(uint32_t); if (count > MAX_LED_TRIGGERS) { pr_err("failed\n"); rc = -EINVAL; goto ERROR8; } rc = of_property_read_u32_array(of_node, "qcom,max-current", fctrl->flash_max_current, count); if (rc < 0) { pr_err("%s failed %d\n", __func__, __LINE__); goto ERROR8; } for (; count < MAX_LED_TRIGGERS; count++) fctrl->flash_max_current[count] = 0; } /* Read the max duration for an LED if present */ if (of_get_property(of_node, "qcom,max-duration", &count)) { count /= sizeof(uint32_t); if (count > MAX_LED_TRIGGERS) { pr_err("failed\n"); rc = -EINVAL; goto ERROR8; } rc = of_property_read_u32_array(of_node, "qcom,max-duration", fctrl->flash_max_duration, count); if (rc < 0) { pr_err("%s failed %d\n", __func__, __LINE__); goto ERROR8; } for (; count < MAX_LED_TRIGGERS; count++) fctrl->flash_max_duration[count] = 0; } flashdata->slave_info = kzalloc(sizeof(struct msm_camera_slave_info), GFP_KERNEL); Loading
include/media/msm_cam_sensor.h +1 −0 Original line number Diff line number Diff line Loading @@ -737,6 +737,7 @@ struct msm_camera_led_cfg_t { enum msm_camera_led_config_t cfgtype; uint32_t torch_current; uint32_t flash_current[MAX_LED_TRIGGERS]; uint32_t flash_duration[MAX_LED_TRIGGERS]; }; /* sensor init structures and enums */ Loading