git: 3d2ccc352db5 - main - arm64: rockchip: rk3399_pmucru: Use GATE macro

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Thu, 21 Sep 2023 16:00:17 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=3d2ccc352db54b9fb11c4c1373a577e3e9d25114

commit 3d2ccc352db54b9fb11c4c1373a577e3e9d25114
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2023-09-21 10:58:48 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2023-09-21 15:49:32 +0000

    arm64: rockchip: rk3399_pmucru: Use GATE macro
    
    It make it easier to read the code and the register number
---
 sys/arm64/rockchip/clk/rk3399_pmucru.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/sys/arm64/rockchip/clk/rk3399_pmucru.c b/sys/arm64/rockchip/clk/rk3399_pmucru.c
index 64df47468efd..9af438254a02 100644
--- a/sys/arm64/rockchip/clk/rk3399_pmucru.c
+++ b/sys/arm64/rockchip/clk/rk3399_pmucru.c
@@ -46,6 +46,8 @@
 
 #include <arm64/rockchip/clk/rk_cru.h>
 
+#define	CRU_CLKGATE_CON(x)	(0x100 + (x) * 0x4)
+
 /* GATES */
 
 #define	PCLK_PMU		20
@@ -58,13 +60,13 @@
 
 static struct rk_cru_gate rk3399_pmu_gates[] = {
 	/* PMUCRU_CLKGATE_CON1 */
-	CRU_GATE(PCLK_PMU, "pclk_pmu", "pclk_pmu_src", 0x104, 0)
-	CRU_GATE(PCLK_GPIO0_PMU, "pclk_gpio0_pmu", "pclk_pmu_src", 0x104, 3)
-	CRU_GATE(PCLK_GPIO1_PMU, "pclk_gpio1_pmu", "pclk_pmu_src", 0x104, 4)
-	CRU_GATE(PCLK_I2C0_PMU, "pclk_i2c0_pmu", "pclk_pmu_src", 0x104, 7)
-	CRU_GATE(PCLK_I2C4_PMU, "pclk_i2c4_pmu", "pclk_pmu_src", 0x104, 8)
-	CRU_GATE(PCLK_I2C8_PMU, "pclk_i2c8_pmu", "pclk_pmu_src", 0x104, 9)
-	CRU_GATE(PCLK_RKPWM_PMU, "pclk_rkpwm_pmu", "pclk_pmu_src", 0x104, 10)
+	GATE(PCLK_PMU, "pclk_pmu", "pclk_pmu_src", 1, 0),
+	GATE(PCLK_GPIO0_PMU, "pclk_gpio0_pmu", "pclk_pmu_src", 1, 3),
+	GATE(PCLK_GPIO1_PMU, "pclk_gpio1_pmu", "pclk_pmu_src", 1, 4),
+	GATE(PCLK_I2C0_PMU, "pclk_i2c0_pmu", "pclk_pmu_src", 1, 7),
+	GATE(PCLK_I2C4_PMU, "pclk_i2c4_pmu", "pclk_pmu_src", 1, 8),
+	GATE(PCLK_I2C8_PMU, "pclk_i2c8_pmu", "pclk_pmu_src", 1, 9),
+	GATE(PCLK_RKPWM_PMU, "pclk_rkpwm_pmu", "pclk_pmu_src", 1, 10)
 };
 
 /*