hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/clocksource/timer-npcm7xx.c
....@@ -32,7 +32,7 @@
3232 #define NPCM7XX_Tx_INTEN BIT(29)
3333 #define NPCM7XX_Tx_COUNTEN BIT(30)
3434 #define NPCM7XX_Tx_ONESHOT 0x0
35
-#define NPCM7XX_Tx_OPER GENMASK(3, 27)
35
+#define NPCM7XX_Tx_OPER GENMASK(28, 27)
3636 #define NPCM7XX_Tx_MIN_PRESCALE 0x1
3737 #define NPCM7XX_Tx_TDR_MASK_BITS 24
3838 #define NPCM7XX_Tx_MAX_CNT 0xFFFFFF
....@@ -84,8 +84,6 @@
8484
8585 val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0);
8686 val &= ~NPCM7XX_Tx_OPER;
87
-
88
- val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0);
8987 val |= NPCM7XX_START_ONESHOT_Tx;
9088 writel(val, timer_of_base(to) + NPCM7XX_REG_TCSR0);
9189
....@@ -97,12 +95,11 @@
9795 struct timer_of *to = to_timer_of(evt);
9896 u32 val;
9997
98
+ writel(timer_of_period(to), timer_of_base(to) + NPCM7XX_REG_TICR0);
99
+
100100 val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0);
101101 val &= ~NPCM7XX_Tx_OPER;
102
-
103
- writel(timer_of_period(to), timer_of_base(to) + NPCM7XX_REG_TICR0);
104102 val |= NPCM7XX_START_PERIODIC_Tx;
105
-
106103 writel(val, timer_of_base(to) + NPCM7XX_REG_TCSR0);
107104
108105 return 0;