|
@@ -534,6 +534,7 @@ static int cam_ife_csid_global_reset(struct cam_ife_csid_hw *csid_hw)
|
|
CAM_ERR(CAM_ISP, "CSID:%d IRQ value after reset rc = %d",
|
|
CAM_ERR(CAM_ISP, "CSID:%d IRQ value after reset rc = %d",
|
|
csid_hw->hw_intf->hw_idx, val);
|
|
csid_hw->hw_intf->hw_idx, val);
|
|
csid_hw->error_irq_count = 0;
|
|
csid_hw->error_irq_count = 0;
|
|
|
|
+ csid_hw->prev_boot_timestamp = 0;
|
|
|
|
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
@@ -1329,6 +1330,7 @@ static int cam_ife_csid_disable_hw(struct cam_ife_csid_hw *csid_hw)
|
|
spin_unlock_irqrestore(&csid_hw->lock_state, flags);
|
|
spin_unlock_irqrestore(&csid_hw->lock_state, flags);
|
|
csid_hw->hw_info->hw_state = CAM_HW_STATE_POWER_DOWN;
|
|
csid_hw->hw_info->hw_state = CAM_HW_STATE_POWER_DOWN;
|
|
csid_hw->error_irq_count = 0;
|
|
csid_hw->error_irq_count = 0;
|
|
|
|
+ csid_hw->prev_boot_timestamp = 0;
|
|
|
|
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
@@ -2928,6 +2930,7 @@ static int cam_ife_csid_get_time_stamp(
|
|
const struct cam_ife_csid_udi_reg_offset *udi_reg;
|
|
const struct cam_ife_csid_udi_reg_offset *udi_reg;
|
|
struct timespec64 ts;
|
|
struct timespec64 ts;
|
|
uint32_t time_32, id;
|
|
uint32_t time_32, id;
|
|
|
|
+ uint64_t time_delta;
|
|
|
|
|
|
time_stamp = (struct cam_csid_get_time_stamp_args *)cmd_args;
|
|
time_stamp = (struct cam_csid_get_time_stamp_args *)cmd_args;
|
|
res = time_stamp->node_res;
|
|
res = time_stamp->node_res;
|
|
@@ -2999,9 +3002,22 @@ static int cam_ife_csid_get_time_stamp(
|
|
CAM_IFE_CSID_QTIMER_MUL_FACTOR,
|
|
CAM_IFE_CSID_QTIMER_MUL_FACTOR,
|
|
CAM_IFE_CSID_QTIMER_DIV_FACTOR);
|
|
CAM_IFE_CSID_QTIMER_DIV_FACTOR);
|
|
|
|
|
|
- get_monotonic_boottime64(&ts);
|
|
|
|
- time_stamp->boot_timestamp = (uint64_t)((ts.tv_sec * 1000000000) +
|
|
|
|
- ts.tv_nsec);
|
|
|
|
|
|
+ if (!csid_hw->prev_boot_timestamp) {
|
|
|
|
+ get_monotonic_boottime64(&ts);
|
|
|
|
+ time_stamp->boot_timestamp =
|
|
|
|
+ (uint64_t)((ts.tv_sec * 1000000000) +
|
|
|
|
+ ts.tv_nsec);
|
|
|
|
+ csid_hw->prev_qtimer_ts = 0;
|
|
|
|
+ CAM_DBG(CAM_ISP, "timestamp:%lld",
|
|
|
|
+ time_stamp->boot_timestamp);
|
|
|
|
+ } else {
|
|
|
|
+ time_delta = time_stamp->time_stamp_val -
|
|
|
|
+ csid_hw->prev_qtimer_ts;
|
|
|
|
+ time_stamp->boot_timestamp =
|
|
|
|
+ csid_hw->prev_boot_timestamp + time_delta;
|
|
|
|
+ }
|
|
|
|
+ csid_hw->prev_qtimer_ts = time_stamp->time_stamp_val;
|
|
|
|
+ csid_hw->prev_boot_timestamp = time_stamp->boot_timestamp;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|