return tgain;
}
+u32 fimc_is_sensor_calculate_sensitivity_by_tgain(u32 tgain)
+{
+ /* ISO(sensitivity) 40 = gain 1x */
+ return (tgain * 40) / 1000;
+}
+
u32 fimc_is_sensor_ctl_get_csi_vsync_cnt(struct fimc_is_device_sensor *device)
{
struct fimc_is_device_csi *csi = NULL;
return ret;
}
-static int fimc_is_sensor_ctl_update_gains(struct fimc_is_device_sensor *device,
+int fimc_is_sensor_ctl_update_gains(struct fimc_is_device_sensor *device,
struct fimc_is_sensor_ctl *module_ctl,
u32 *dm_index,
struct ae_param adj_again,
return ret;
}
-static int fimc_is_sensor_ctl_update_exposure(struct fimc_is_device_sensor *device,
+int fimc_is_sensor_ctl_update_exposure(struct fimc_is_device_sensor *device,
u32 *dm_index,
struct ae_param expo)
{
u64 fimc_is_sensor_convert_us_to_ns(u32 usec);
u32 fimc_is_sensor_convert_ns_to_us(u64 nsec);
u32 fimc_is_sensor_calculate_tgain(u32 dgain, u32 again);
+u32 fimc_is_sensor_calculate_sensitivity_by_tgain(u32 tgain);
struct fimc_is_device_sensor;
void fimc_is_sensor_ctl_frame_evt(struct fimc_is_device_sensor *device);
void fimc_is_sensor_ctl_update_gain_to_uctl(camera2_sensor_uctl_t *sensor_uctl,
enum fimc_is_exposure_gain_count num_data,
u32 *analog_gain, u32 *digital_gain);
+int fimc_is_sensor_ctl_update_gains(struct fimc_is_device_sensor *device,
+ struct fimc_is_sensor_ctl *module_ctl,
+ u32 *dm_index,
+ struct ae_param adj_again,
+ struct ae_param adj_dgain);
+int fimc_is_sensor_ctl_update_exposure(struct fimc_is_device_sensor *device,
+ u32 *dm_index,
+ struct ae_param expo);
/* Actuator funtion */
int fimc_is_actuator_ctl_set_position(struct fimc_is_device_sensor *device, u32 position);
struct fimc_is_device_sensor_peri *sensor_peri;
struct v4l2_subdev *subdev_flash;
struct ae_param expo, dgain, again;
+ struct fimc_is_sensor_ctl module_ctl;
+ u32 m_fcount[2];
u32 tgain[EXPOSURE_GAIN_MAX];
u32 step = 0;
FIMC_BUG_VOID(!data);
&dgain.val);
}
+ /* update exp/gain/sensitivity meta for apply flash capture frame */
+ m_fcount[0] = m_fcount[1] = (device->fcount + 1) % EXPECT_DM_NUM;
+ module_ctl.cur_cam20_sensor_udctrl.sensitivity =
+ fimc_is_sensor_calculate_sensitivity_by_tgain(tgain[0]);
+ module_ctl.valid_sensor_ctrl = false;
+ fimc_is_sensor_ctl_update_gains(device, &module_ctl, m_fcount, again, dgain);
+ fimc_is_sensor_ctl_update_exposure(device, m_fcount, expo);
+
dbg_flash("[%s][FLASH] mode %d, intensity %d, firing time %d us, step %d\n", __func__,
flash->flash_data.mode,
flash->flash_data.intensity,