From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Thu, 04 Jan 2024 10:08:02 +0000
Subject: [PATCH] disable FB

---
 kernel/drivers/media/platform/rockchip/isp/isp_stats_v21.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/kernel/drivers/media/platform/rockchip/isp/isp_stats_v21.c b/kernel/drivers/media/platform/rockchip/isp/isp_stats_v21.c
index 98e27c6..c630864 100644
--- a/kernel/drivers/media/platform/rockchip/isp/isp_stats_v21.c
+++ b/kernel/drivers/media/platform/rockchip/isp/isp_stats_v21.c
@@ -33,6 +33,14 @@
 
 #define ISP2X_RAWAF_INT_LINE0_EN	BIT(27)
 
+static void isp_module_done(struct rkisp_isp_stats_vdev *stats_vdev,
+			    u32 reg, u32 value)
+{
+	void __iomem *base = stats_vdev->dev->hw_dev->base_addr;
+
+	writel(value, base + reg);
+}
+
 static int
 rkisp_stats_get_rawawb_meas_reg(struct rkisp_isp_stats_vdev *stats_vdev,
 				struct rkisp_isp21_stat_buffer *pbuf)
@@ -789,7 +797,7 @@
 
 	value = rkisp_read(stats_vdev->dev, ISP21_RAWAWB_CTRL, true);
 	if (value & ISP2X_3A_MEAS_DONE)
-		rkisp_write(stats_vdev->dev, ISP21_RAWAWB_CTRL, value, true);
+		isp_module_done(stats_vdev, ISP21_RAWAWB_CTRL, value);
 	return 0;
 }
 
@@ -800,8 +808,8 @@
 
 	value = rkisp_read(stats_vdev->dev, ISP_RAWAF_CTRL, true);
 	if (value & ISP2X_3A_MEAS_DONE) {
-		rkisp_write(stats_vdev->dev, ISP_RAWAF_CTRL, value, true);
 		rkisp_write(stats_vdev->dev, ISP_RAWAF_INT_STATE, 0, true);
+		isp_module_done(stats_vdev, ISP_RAWAF_CTRL, value);
 	}
 	return 0;
 }
@@ -828,7 +836,7 @@
 
 	value = rkisp_read(stats_vdev->dev, addr + RAWAE_BIG_CTRL, true);
 	if (value & ISP2X_3A_MEAS_DONE)
-		rkisp_write(stats_vdev->dev, addr + RAWAE_BIG_CTRL, value, true);
+		isp_module_done(stats_vdev, addr + RAWAE_BIG_CTRL, value);
 	return 0;
 }
 
@@ -854,7 +862,7 @@
 
 	value = rkisp_read(stats_vdev->dev, addr + ISP_RAWHIST_BIG_CTRL, true);
 	if (value & ISP2X_3A_MEAS_DONE)
-		rkisp_write(stats_vdev->dev, addr + ISP_RAWHIST_BIG_CTRL, value, true);
+		isp_module_done(stats_vdev, addr + ISP_RAWHIST_BIG_CTRL, value);
 	return 0;
 }
 
@@ -901,7 +909,7 @@
 
 	value = rkisp_read(stats_vdev->dev, ISP_RAWAE_LITE_CTRL, true);
 	if (value & ISP2X_3A_MEAS_DONE)
-		rkisp_write(stats_vdev->dev, ISP_RAWAE_LITE_CTRL, value, true);
+		isp_module_done(stats_vdev, ISP_RAWAE_LITE_CTRL, value);
 	return 0;
 }
 
@@ -912,7 +920,7 @@
 
 	value = rkisp_read(stats_vdev->dev, ISP_RAWHIST_LITE_CTRL, true);
 	if (value & ISP2X_3A_MEAS_DONE)
-		rkisp_write(stats_vdev->dev, ISP_RAWHIST_LITE_CTRL, value, true);
+		isp_module_done(stats_vdev, ISP_RAWHIST_LITE_CTRL, value);
 	return 0;
 }
 
@@ -1092,7 +1100,7 @@
 		work.frame_id = cur_frame_id;
 		work.isp_ris = temp_isp_ris | isp_ris;
 		work.isp3a_ris = temp_isp3a_ris | iq_3a_mask;
-		work.timestamp = ktime_get_ns();
+		work.timestamp = rkisp_time_get_ns(dev);
 
 		rkisp_stats_send_meas_v21(stats_vdev, &work);
 	}

--
Gitblit v1.6.2