hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/power/supply/rk818_battery.c
....@@ -170,7 +170,7 @@
170170 struct wake_lock wake_lock;
171171 struct notifier_block fb_nb;
172172 struct timer_list caltimer;
173
- time_t rtc_base;
173
+ time64_t rtc_base;
174174 int bat_res;
175175 int chrg_status;
176176 bool is_initialized;
....@@ -262,9 +262,9 @@
262262
263263 static u64 get_boot_sec(void)
264264 {
265
- struct timespec ts;
265
+ struct timespec64 ts;
266266
267
- get_monotonic_boottime(&ts);
267
+ ktime_get_boottime_ts64(&ts);
268268
269269 return ts.tv_sec;
270270 }
....@@ -1206,13 +1206,13 @@
12061206 struct rk818_battery *di;
12071207 struct fb_event *evdata = data;
12081208
1209
- if (event != FB_EARLY_EVENT_BLANK && event != FB_EVENT_BLANK)
1210
- return NOTIFY_OK;
1209
+ if (event != FB_EVENT_BLANK)
1210
+ return NOTIFY_DONE;
12111211
12121212 di = container_of(nb, struct rk818_battery, fb_nb);
12131213 di->fb_blank = *(int *)evdata->data;
12141214
1215
- return 0;
1215
+ return NOTIFY_OK;
12161216 }
12171217
12181218 static int rk818_bat_register_fb_notify(struct rk818_battery *di)
....@@ -1740,7 +1740,7 @@
17401740 di->zero_linek = 1200;
17411741 else
17421742 di->zero_linek = 800;
1743
- DBG("ZERO-new: zero_linek adjust step6...\n");
1743
+ DBG("ZERO-new: zero_linek adjust step6...\n");
17441744 }
17451745 } else {
17461746 /* xsoc < 0 */
....@@ -3127,13 +3127,11 @@
31273127 SAMPLE_RES_DIV1 : SAMPLE_RES_DIV2;
31283128 }
31293129
3130
-static time_t rk818_get_rtc_sec(void)
3130
+static time64_t rk818_get_rtc_sec(void)
31313131 {
31323132 int err;
31333133 struct rtc_time tm;
3134
- struct timespec tv = { .tv_nsec = NSEC_PER_SEC >> 1, };
31353134 struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
3136
- time_t sec;
31373135
31383136 err = rtc_read_time(rtc, &tm);
31393137 if (err) {
....@@ -3147,10 +3145,7 @@
31473145 return 0;
31483146 }
31493147
3150
- rtc_tm_to_time(&tm, &tv.tv_sec);
3151
- sec = tv.tv_sec;
3152
-
3153
- return sec;
3148
+ return rtc_tm_to_time64(&tm);
31543149 }
31553150
31563151 static int rk818_bat_rtc_sleep_sec(struct rk818_battery *di)