hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/rtc/rtc-msm6242.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Oki MSM6242 RTC Driver
34 *
....@@ -87,28 +88,16 @@
8788 __raw_writel(val, &priv->regs[reg]);
8889 }
8990
90
-static inline void msm6242_set(struct msm6242_priv *priv, unsigned int val,
91
- unsigned int reg)
92
-{
93
- msm6242_write(priv, msm6242_read(priv, reg) | val, reg);
94
-}
95
-
96
-static inline void msm6242_clear(struct msm6242_priv *priv, unsigned int val,
97
- unsigned int reg)
98
-{
99
- msm6242_write(priv, msm6242_read(priv, reg) & ~val, reg);
100
-}
101
-
10291 static void msm6242_lock(struct msm6242_priv *priv)
10392 {
10493 int cnt = 5;
10594
106
- msm6242_set(priv, MSM6242_CD_HOLD, MSM6242_CD);
95
+ msm6242_write(priv, MSM6242_CD_HOLD|MSM6242_CD_IRQ_FLAG, MSM6242_CD);
10796
10897 while ((msm6242_read(priv, MSM6242_CD) & MSM6242_CD_BUSY) && cnt) {
109
- msm6242_clear(priv, MSM6242_CD_HOLD, MSM6242_CD);
98
+ msm6242_write(priv, MSM6242_CD_IRQ_FLAG, MSM6242_CD);
11099 udelay(70);
111
- msm6242_set(priv, MSM6242_CD_HOLD, MSM6242_CD);
100
+ msm6242_write(priv, MSM6242_CD_HOLD|MSM6242_CD_IRQ_FLAG, MSM6242_CD);
112101 cnt--;
113102 }
114103
....@@ -119,7 +108,7 @@
119108
120109 static void msm6242_unlock(struct msm6242_priv *priv)
121110 {
122
- msm6242_clear(priv, MSM6242_CD_HOLD, MSM6242_CD);
111
+ msm6242_write(priv, MSM6242_CD_IRQ_FLAG, MSM6242_CD);
123112 }
124113
125114 static int msm6242_read_time(struct device *dev, struct rtc_time *tm)