@@ -168,6 +168,11 @@
#define RKISP1_CIF_RSZ_CTRL_CFG_UPD_AUTO BIT(9)
#define RKISP1_CIF_RSZ_SCALER_FACTOR BIT(16)
+/* For resizer instances that support cropping */
+#define RKISP1_CIF_RSZ_CTRL_CROP_ENABLE BIT(8)
+#define RKISP1_CIF_RSZ_CTRL_CROP_CFG_UPD BIT(9)
+#define RKISP1_CIF_RSZ_CTRL_CROP_CFG_UPD_AUTO BIT(10)
+
/* MI_IMSC - MI_MIS - MI_RIS - MI_ICR - MI_ISR */
#define RKISP1_CIF_MI_FRAME(stream) BIT((stream)->id)
#define RKISP1_CIF_MI_MBLK_LINE BIT(2)
@@ -178,10 +178,17 @@ static void rkisp1_rsz_update_shadow(struct rkisp1_resizer *rsz,
{
u32 ctrl_cfg = rkisp1_rsz_read(rsz, RKISP1_CIF_RSZ_CTRL);
- if (when == RKISP1_SHADOW_REGS_ASYNC)
- ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CFG_UPD_AUTO;
- else
- ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CFG_UPD;
+ if (when == RKISP1_SHADOW_REGS_ASYNC) {
+ if (rkisp1_has_feature(rsz->rkisp1, DUAL_CROP))
+ ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CFG_UPD_AUTO;
+ else
+ ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CROP_CFG_UPD_AUTO;
+ } else {
+ if (rkisp1_has_feature(rsz->rkisp1, DUAL_CROP))
+ ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CFG_UPD;
+ else
+ ctrl_cfg |= RKISP1_CIF_RSZ_CTRL_CROP_CFG_UPD;
+ }
rkisp1_rsz_write(rsz, RKISP1_CIF_RSZ_CTRL, ctrl_cfg);
}