msm: camera: flash: Get the flash on wait time from userspace

This change gets the flash on wait time from userspace to
control the precise flash.

CRs-Fixed: 2929276
Change-Id: Ieac18f6e049b446c5a7b20dcfdff013aa9838575
Signed-off-by: Depeng Shao <depengs@codeaurora.org>
This commit is contained in:
Depeng Shao
2021-04-23 13:00:39 +08:00
parent 8b6740991b
commit 0118523efd
3 changed files with 19 additions and 15 deletions

View File

@@ -11,9 +11,6 @@
#include "cam_common_util.h" #include "cam_common_util.h"
#include "cam_packet_util.h" #include "cam_packet_util.h"
static uint default_on_timer = 2;
module_param(default_on_timer, uint, 0644);
int cam_flash_led_prepare(struct led_trigger *trigger, int options, int cam_flash_led_prepare(struct led_trigger *trigger, int options,
int *max_current, bool is_wled) int *max_current, bool is_wled)
{ {
@@ -428,8 +425,7 @@ static int cam_flash_ops(struct cam_flash_ctrl *flash_ctrl,
param.off_time_ms = param.off_time_ms =
flash_data->flash_active_time_ms; flash_data->flash_active_time_ms;
/* This is to dynamically change the turn on time */ param.on_time_ms = flash_data->flash_on_wait_time_ms;
param.on_time_ms = default_on_timer;
CAM_DBG(CAM_FLASH, CAM_DBG(CAM_FLASH,
"Precise flash_on time: %u, Precise flash_off time: %u", "Precise flash_on time: %u, Precise flash_off time: %u",
param.on_time_ms, param.off_time_ms); param.on_time_ms, param.off_time_ms);
@@ -1559,8 +1555,12 @@ int cam_flash_pmic_pkt_parser(struct cam_flash_ctrl *fctrl, void *arg)
flash_data->flash_active_time_ms = flash_data->flash_active_time_ms =
(flash_operation_info->time_on_duration_ns) (flash_operation_info->time_on_duration_ns)
/ 1000000; / 1000000;
flash_data->flash_on_wait_time_ms =
(flash_operation_info->led_on_wait_time_ns)
/ 1000000;
CAM_DBG(CAM_FLASH, CAM_DBG(CAM_FLASH,
"PRECISE FLASH: active_time: %llu", "PRECISE FLASH: active wait tme:%llu duration: %llu",
flash_data->flash_on_wait_time_ms,
flash_data->flash_active_time_ms); flash_data->flash_active_time_ms);
} }
} }

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* 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_ #ifndef _CAM_FLASH_DEV_H_
@@ -108,13 +108,14 @@ struct cam_flash_init_packet {
/** /**
* struct flash_frame_setting * struct flash_frame_setting
* @cmn_attr : Provides common attributes * @cmn_attr : Provides common attributes
* @num_iterations : Iterations used to perform RER * @num_iterations : Iterations used to perform RER
* @led_on_delay_ms : LED on time in milisec * @led_on_delay_ms : LED on time in milisec
* @led_off_delay_ms : LED off time in milisec * @led_off_delay_ms : LED off time in milisec
* @opcode : Command buffer opcode * @opcode : Command buffer opcode
* @led_current_ma[] : LED current array in miliamps * @led_current_ma[] : LED current array in miliamps
* @flash_active_time_ms : Flash_On time with precise flash * @flash_active_time_ms : Flash_On time with precise flash
* @flash_on_wait_time_ms : Flash on wait time with precise flash
*/ */
struct cam_flash_frame_setting { struct cam_flash_frame_setting {
struct cam_flash_common_attr cmn_attr; struct cam_flash_common_attr cmn_attr;
@@ -124,6 +125,7 @@ struct cam_flash_frame_setting {
int8_t opcode; int8_t opcode;
uint32_t led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS]; uint32_t led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS];
uint64_t flash_active_time_ms; uint64_t flash_active_time_ms;
uint64_t flash_on_wait_time_ms;
}; };
/** /**

View File

@@ -547,7 +547,8 @@ struct cam_flash_set_rer {
* CAM_FLASH_OFF * CAM_FLASH_OFF
* @cmd_type : Command buffer operation type * @cmd_type : Command buffer operation type
* @led_current_ma : Flash led current in ma * @led_current_ma : Flash led current in ma
* @time_on_duration_ms : Flash time on duration in ns * @time_on_duration_ns : Flash time on duration in ns
* @led_on_wait_time_ns : Flash led turn on wait time in ns
* *
*/ */
struct cam_flash_set_on_off { struct cam_flash_set_on_off {
@@ -557,6 +558,7 @@ struct cam_flash_set_on_off {
__u16 reserved; __u16 reserved;
__u32 led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS]; __u32 led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS];
__u64 time_on_duration_ns; __u64 time_on_duration_ns;
__u64 led_on_wait_time_ns;
} __attribute__((packed)); } __attribute__((packed));
/** /**