/linux-6.6.21/drivers/rtc/ |
D | rtc-rk808.c | 188 static int rk808_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) in rk808_rtc_readalarm() argument 203 alrm->time.tm_sec = bcd2bin(alrm_data[0] & SECONDS_REG_MSK); in rk808_rtc_readalarm() 204 alrm->time.tm_min = bcd2bin(alrm_data[1] & MINUTES_REG_MAK); in rk808_rtc_readalarm() 205 alrm->time.tm_hour = bcd2bin(alrm_data[2] & HOURS_REG_MSK); in rk808_rtc_readalarm() 206 alrm->time.tm_mday = bcd2bin(alrm_data[3] & DAYS_REG_MSK); in rk808_rtc_readalarm() 207 alrm->time.tm_mon = (bcd2bin(alrm_data[4] & MONTHS_REG_MSK)) - 1; in rk808_rtc_readalarm() 208 alrm->time.tm_year = (bcd2bin(alrm_data[5] & YEARS_REG_MSK)) + 100; in rk808_rtc_readalarm() 209 rockchip_to_gregorian(&alrm->time); in rk808_rtc_readalarm() 218 &alrm->time, alrm->time.tm_wday, &alrm->time); in rk808_rtc_readalarm() 220 alrm->enabled = (int_reg & BIT_RTC_INTERRUPTS_REG_IT_ALARM_M) ? 1 : 0; in rk808_rtc_readalarm() [all …]
|
D | rtc-asm9260.c | 191 static int asm9260_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in asm9260_rtc_read_alarm() argument 195 alrm->time.tm_year = ioread32(priv->iobase + HW_ALYEAR); in asm9260_rtc_read_alarm() 196 alrm->time.tm_mon = ioread32(priv->iobase + HW_ALMON); in asm9260_rtc_read_alarm() 197 alrm->time.tm_mday = ioread32(priv->iobase + HW_ALDOM); in asm9260_rtc_read_alarm() 198 alrm->time.tm_wday = ioread32(priv->iobase + HW_ALDOW); in asm9260_rtc_read_alarm() 199 alrm->time.tm_yday = ioread32(priv->iobase + HW_ALDOY); in asm9260_rtc_read_alarm() 200 alrm->time.tm_hour = ioread32(priv->iobase + HW_ALHOUR); in asm9260_rtc_read_alarm() 201 alrm->time.tm_min = ioread32(priv->iobase + HW_ALMIN); in asm9260_rtc_read_alarm() 202 alrm->time.tm_sec = ioread32(priv->iobase + HW_ALSEC); in asm9260_rtc_read_alarm() 204 alrm->enabled = ioread32(priv->iobase + HW_AMR) ? 1 : 0; in asm9260_rtc_read_alarm() [all …]
|
D | rtc-rc5t619.c | 224 static int rc5t619_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in rc5t619_rtc_read_alarm() argument 255 alrm->time.tm_sec = bcd2bin(buff[0]); in rc5t619_rtc_read_alarm() 256 alrm->time.tm_min = bcd2bin(buff[1]); in rc5t619_rtc_read_alarm() 259 alrm->time.tm_hour = bcd2bin(buff[2]); in rc5t619_rtc_read_alarm() 261 alrm->time.tm_hour = rtc5t619_12hour_bcd2bin(buff[2]); in rc5t619_rtc_read_alarm() 263 alrm->time.tm_mday = bcd2bin(buff[3]); in rc5t619_rtc_read_alarm() 264 alrm->time.tm_mon = bcd2bin(buff[4]) - 1; in rc5t619_rtc_read_alarm() 265 alrm->time.tm_year = bcd2bin(buff[5]) + 100 * cent_flag; in rc5t619_rtc_read_alarm() 266 alrm->enabled = !!(ctrl1 & CTRL1_ALARM_ENABLED); in rc5t619_rtc_read_alarm() 267 dev_dbg(dev, "read alarm: %ptR\n", &alrm->time); in rc5t619_rtc_read_alarm() [all …]
|
D | rtc-vt8500.c | 139 static int vt8500_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in vt8500_rtc_read_alarm() argument 147 alrm->time.tm_mday = bcd2bin((alarm & ALARM_DAY_MASK) >> ALARM_DAY_S); in vt8500_rtc_read_alarm() 148 alrm->time.tm_hour = bcd2bin((alarm & TIME_HOUR_MASK) >> TIME_HOUR_S); in vt8500_rtc_read_alarm() 149 alrm->time.tm_min = bcd2bin((alarm & TIME_MIN_MASK) >> TIME_MIN_S); in vt8500_rtc_read_alarm() 150 alrm->time.tm_sec = bcd2bin((alarm & TIME_SEC_MASK)); in vt8500_rtc_read_alarm() 152 alrm->enabled = (alarm & ALARM_ENABLE_MASK) ? 1 : 0; in vt8500_rtc_read_alarm() 153 alrm->pending = (isr & VT8500_RTC_IS_ALARM) ? 1 : 0; in vt8500_rtc_read_alarm() 155 return rtc_valid_tm(&alrm->time); in vt8500_rtc_read_alarm() 158 static int vt8500_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in vt8500_rtc_set_alarm() argument 162 writel((alrm->enabled ? ALARM_ENABLE_MASK : 0) in vt8500_rtc_set_alarm() [all …]
|
D | rtc-loongson.c | 216 static int loongson_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in loongson_rtc_read_alarm() argument 226 alrm->time.tm_sec = FIELD_GET(TOY_MATCH_SEC, alarm_data); in loongson_rtc_read_alarm() 227 alrm->time.tm_min = FIELD_GET(TOY_MATCH_MIN, alarm_data); in loongson_rtc_read_alarm() 228 alrm->time.tm_hour = FIELD_GET(TOY_MATCH_HOUR, alarm_data); in loongson_rtc_read_alarm() 229 alrm->time.tm_mday = FIELD_GET(TOY_MATCH_DAY, alarm_data); in loongson_rtc_read_alarm() 230 alrm->time.tm_mon = FIELD_GET(TOY_MATCH_MON, alarm_data) - 1; in loongson_rtc_read_alarm() 242 alrm->time.tm_year = FIELD_GET(TOY_MATCH_YEAR, alarm_data) + priv->fix_year; in loongson_rtc_read_alarm() 244 alrm->enabled = !!(readl(priv->pm_base + PM1_EN_REG) & RTC_EN); in loongson_rtc_read_alarm() 263 static int loongson_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in loongson_rtc_set_alarm() argument 269 alarm_data = FIELD_PREP(TOY_MATCH_SEC, alrm->time.tm_sec) in loongson_rtc_set_alarm() [all …]
|
D | proc.c | 44 struct rtc_wkalrm alrm; in rtc_proc_show() local 55 err = rtc_read_alarm(rtc, &alrm); in rtc_proc_show() 57 seq_printf(seq, "alrm_time\t: %ptRt\n", &alrm.time); in rtc_proc_show() 58 seq_printf(seq, "alrm_date\t: %ptRd\n", &alrm.time); in rtc_proc_show() 60 alrm.enabled ? "yes" : "no"); in rtc_proc_show() 62 alrm.pending ? "yes" : "no"); in rtc_proc_show()
|
D | rtc-goldfish.c | 23 struct rtc_wkalrm *alrm) in goldfish_rtc_read_alarm() argument 39 memset(alrm, 0, sizeof(struct rtc_wkalrm)); in goldfish_rtc_read_alarm() 41 rtc_time64_to_tm(rtc_alarm, &alrm->time); in goldfish_rtc_read_alarm() 44 alrm->enabled = 1; in goldfish_rtc_read_alarm() 46 alrm->enabled = 0; in goldfish_rtc_read_alarm() 52 struct rtc_wkalrm *alrm) in goldfish_rtc_set_alarm() argument 62 if (alrm->enabled) { in goldfish_rtc_set_alarm() 63 rtc_alarm64 = rtc_tm_to_time64(&alrm->time) * NSEC_PER_SEC; in goldfish_rtc_set_alarm()
|
D | rtc-pcf50633.c | 171 static int pcf50633_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pcf50633_rtc_read_alarm() argument 179 alrm->enabled = rtc->alarm_enabled; in pcf50633_rtc_read_alarm() 180 alrm->pending = rtc->alarm_pending; in pcf50633_rtc_read_alarm() 189 pcf2rtc_time(&alrm->time, &pcf_tm); in pcf50633_rtc_read_alarm() 191 return rtc_valid_tm(&alrm->time); in pcf50633_rtc_read_alarm() 194 static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pcf50633_rtc_set_alarm() argument 202 rtc2pcf_time(&pcf_tm, &alrm->time); in pcf50633_rtc_set_alarm() 216 if (!alrm->enabled) in pcf50633_rtc_set_alarm() 219 if (!alarm_masked || alrm->enabled) in pcf50633_rtc_set_alarm() 221 rtc->alarm_enabled = alrm->enabled; in pcf50633_rtc_set_alarm()
|
D | rtc-pcf85363.c | 210 static int pcf85363_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pcf85363_rtc_read_alarm() argument 222 alrm->time.tm_sec = bcd2bin(buf[0]); in pcf85363_rtc_read_alarm() 223 alrm->time.tm_min = bcd2bin(buf[1]); in pcf85363_rtc_read_alarm() 224 alrm->time.tm_hour = bcd2bin(buf[2]); in pcf85363_rtc_read_alarm() 225 alrm->time.tm_mday = bcd2bin(buf[3]); in pcf85363_rtc_read_alarm() 226 alrm->time.tm_mon = bcd2bin(buf[4]) - 1; in pcf85363_rtc_read_alarm() 232 alrm->enabled = !!(val & INT_A1IE); in pcf85363_rtc_read_alarm() 267 static int pcf85363_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pcf85363_rtc_set_alarm() argument 273 buf[0] = bin2bcd(alrm->time.tm_sec); in pcf85363_rtc_set_alarm() 274 buf[1] = bin2bcd(alrm->time.tm_min); in pcf85363_rtc_set_alarm() [all …]
|
D | rtc-ds1553.c | 151 static int ds1553_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in ds1553_rtc_set_alarm() argument 157 pdata->alrm_mday = alrm->time.tm_mday; in ds1553_rtc_set_alarm() 158 pdata->alrm_hour = alrm->time.tm_hour; in ds1553_rtc_set_alarm() 159 pdata->alrm_min = alrm->time.tm_min; in ds1553_rtc_set_alarm() 160 pdata->alrm_sec = alrm->time.tm_sec; in ds1553_rtc_set_alarm() 161 if (alrm->enabled) in ds1553_rtc_set_alarm() 167 static int ds1553_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in ds1553_rtc_read_alarm() argument 173 alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday; in ds1553_rtc_read_alarm() 174 alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour; in ds1553_rtc_read_alarm() 175 alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min; in ds1553_rtc_read_alarm() [all …]
|
D | rtc-rv8803.c | 345 static int rv8803_get_alarm(struct device *dev, struct rtc_wkalrm *alrm) in rv8803_get_alarm() argument 369 alrm->time.tm_sec = 0; in rv8803_get_alarm() 370 alrm->time.tm_min = bcd2bin(alarmvals[0]); in rv8803_get_alarm() 371 alrm->time.tm_hour = bcd2bin(alarmvals[1]); in rv8803_get_alarm() 372 alrm->time.tm_mday = bcd2bin(alarmvals[2]); in rv8803_get_alarm() 374 alrm->enabled = !!(rv8803->ctrl & RV8803_CTRL_AIE); in rv8803_get_alarm() 375 alrm->pending = (flags & RV8803_FLAG_AF) && alrm->enabled; in rv8803_get_alarm() 377 if ((unsigned int)alrm->time.tm_mday > 31 || in rv8803_get_alarm() 378 (unsigned int)alrm->time.tm_hour >= 24 || in rv8803_get_alarm() 379 (unsigned int)alrm->time.tm_min >= 60) in rv8803_get_alarm() [all …]
|
D | rtc-test.c | 24 static int test_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in test_rtc_read_alarm() argument 32 rtc_time64_to_tm(alarm, &alrm->time); in test_rtc_read_alarm() 33 alrm->enabled = rtd->alarm_en; in test_rtc_read_alarm() 38 static int test_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in test_rtc_set_alarm() argument 44 timeout = rtc_tm_to_time64(&alrm->time) - ktime_get_real_seconds(); in test_rtc_set_alarm() 55 if (alrm->enabled) in test_rtc_set_alarm() 58 rtd->alarm_en = alrm->enabled; in test_rtc_set_alarm()
|
D | rtc-stk17ta8.c | 159 static int stk17ta8_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in stk17ta8_rtc_set_alarm() argument 165 pdata->alrm_mday = alrm->time.tm_mday; in stk17ta8_rtc_set_alarm() 166 pdata->alrm_hour = alrm->time.tm_hour; in stk17ta8_rtc_set_alarm() 167 pdata->alrm_min = alrm->time.tm_min; in stk17ta8_rtc_set_alarm() 168 pdata->alrm_sec = alrm->time.tm_sec; in stk17ta8_rtc_set_alarm() 169 if (alrm->enabled) in stk17ta8_rtc_set_alarm() 175 static int stk17ta8_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in stk17ta8_rtc_read_alarm() argument 181 alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday; in stk17ta8_rtc_read_alarm() 182 alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour; in stk17ta8_rtc_read_alarm() 183 alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min; in stk17ta8_rtc_read_alarm() [all …]
|
D | rtc-ds1511.c | 306 ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in ds1511_rtc_set_alarm() argument 313 pdata->alrm_mday = alrm->time.tm_mday; in ds1511_rtc_set_alarm() 314 pdata->alrm_hour = alrm->time.tm_hour; in ds1511_rtc_set_alarm() 315 pdata->alrm_min = alrm->time.tm_min; in ds1511_rtc_set_alarm() 316 pdata->alrm_sec = alrm->time.tm_sec; in ds1511_rtc_set_alarm() 317 if (alrm->enabled) in ds1511_rtc_set_alarm() 325 ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in ds1511_rtc_read_alarm() argument 332 alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday; in ds1511_rtc_read_alarm() 333 alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour; in ds1511_rtc_read_alarm() 334 alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min; in ds1511_rtc_read_alarm() [all …]
|
D | rtc-88pm80x.c | 77 struct rtc_time *alrm) in rtc_next_alarm_time() argument 85 next->tm_hour = alrm->tm_hour; in rtc_next_alarm_time() 86 next->tm_min = alrm->tm_min; in rtc_next_alarm_time() 87 next->tm_sec = alrm->tm_sec; in rtc_next_alarm_time() 144 static int pm80x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pm80x_rtc_read_alarm() argument 163 rtc_time64_to_tm(ticks, &alrm->time); in pm80x_rtc_read_alarm() 165 alrm->enabled = (ret & PM800_ALARM1_EN) ? 1 : 0; in pm80x_rtc_read_alarm() 166 alrm->pending = (ret & (PM800_ALARM | PM800_ALARM_WAKEUP)) ? 1 : 0; in pm80x_rtc_read_alarm() 170 static int pm80x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pm80x_rtc_set_alarm() argument 195 rtc_next_alarm_time(&alarm_tm, &now_tm, &alrm->time); in pm80x_rtc_set_alarm() [all …]
|
D | rtc-max8925.c | 179 static int max8925_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8925_rtc_read_alarm() argument 188 ret = tm_calc(&alrm->time, buf, TIME_NUM); in max8925_rtc_read_alarm() 195 alrm->enabled = 0; in max8925_rtc_read_alarm() 201 alrm->enabled = 0; in max8925_rtc_read_alarm() 203 alrm->enabled = 1; in max8925_rtc_read_alarm() 209 alrm->pending = 1; in max8925_rtc_read_alarm() 211 alrm->pending = 0; in max8925_rtc_read_alarm() 217 static int max8925_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8925_rtc_set_alarm() argument 223 ret = data_calc(buf, &alrm->time, TIME_NUM); in max8925_rtc_set_alarm() 229 if (alrm->enabled) in max8925_rtc_set_alarm()
|
D | rtc-as3722.c | 104 static int as3722_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in as3722_rtc_read_alarm() argument 118 as3722_reg_to_time(as_time_array, &alrm->time); in as3722_rtc_read_alarm() 122 static int as3722_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in as3722_rtc_set_alarm() argument 129 if (alrm->time.tm_year < (AS3722_RTC_START_YEAR - 1900)) in as3722_rtc_set_alarm() 138 as3722_time_to_reg(as_time_array, &alrm->time); in as3722_rtc_set_alarm() 146 if (alrm->enabled) in as3722_rtc_set_alarm() 147 ret = as3722_rtc_alarm_irq_enable(dev, alrm->enabled); in as3722_rtc_set_alarm()
|
D | rtc-max8998.c | 136 static int max8998_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8998_rtc_read_alarm() argument 147 max8998_data_to_tm(data, &alrm->time); in max8998_rtc_read_alarm() 153 alrm->enabled = !!val; in max8998_rtc_read_alarm() 160 alrm->pending = 1; in max8998_rtc_read_alarm() 162 alrm->pending = 0; in max8998_rtc_read_alarm() 194 static int max8998_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8998_rtc_set_alarm() argument 200 max8998_tm_to_data(&alrm->time, data); in max8998_rtc_set_alarm() 213 if (alrm->enabled) in max8998_rtc_set_alarm()
|
D | rtc-at91rm9200.c | 246 static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) in at91_rtc_readalarm() argument 248 struct rtc_time *tm = &alrm->time; in at91_rtc_readalarm() 253 alrm->enabled = (at91_rtc_read_imr() & AT91_RTC_ALARM) in at91_rtc_readalarm() 257 alrm->enabled ? "en" : "dis"); in at91_rtc_readalarm() 265 static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) in at91_rtc_setalarm() argument 267 struct rtc_time tm = alrm->time; in at91_rtc_setalarm() 271 FIELD_PREP(AT91_RTC_SEC, bin2bcd(alrm->time.tm_sec)) in at91_rtc_setalarm() 272 | FIELD_PREP(AT91_RTC_MIN, bin2bcd(alrm->time.tm_min)) in at91_rtc_setalarm() 273 | FIELD_PREP(AT91_RTC_HOUR, bin2bcd(alrm->time.tm_hour)) in at91_rtc_setalarm() 276 FIELD_PREP(AT91_RTC_MONTH, bin2bcd(alrm->time.tm_mon + 1)) in at91_rtc_setalarm() [all …]
|
D | rtc-mxc.c | 152 static void rtc_update_alarm(struct device *dev, struct rtc_time *alrm) in rtc_update_alarm() argument 158 time = rtc_tm_to_time64(alrm); in rtc_update_alarm() 258 static int mxc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in mxc_rtc_read_alarm() argument 263 rtc_time64_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time); in mxc_rtc_read_alarm() 264 alrm->pending = ((readw(ioaddr + RTC_RTCISR) & RTC_ALM_BIT)) ? 1 : 0; in mxc_rtc_read_alarm() 272 static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in mxc_rtc_set_alarm() argument 276 rtc_update_alarm(dev, &alrm->time); in mxc_rtc_set_alarm() 278 memcpy(&pdata->g_rtc_alarm, &alrm->time, sizeof(struct rtc_time)); in mxc_rtc_set_alarm() 279 mxc_rtc_irq_enable(dev, RTC_ALM_BIT, alrm->enabled); in mxc_rtc_set_alarm()
|
D | rtc-max8907.c | 120 static int max8907_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8907_rtc_read_alarm() argument 132 regs_to_tm(regs, &alrm->time); in max8907_rtc_read_alarm() 138 alrm->enabled = !!(val & 0x7f); in max8907_rtc_read_alarm() 143 static int max8907_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8907_rtc_set_alarm() argument 149 tm_to_regs(&alrm->time, regs); in max8907_rtc_set_alarm() 161 if (alrm->enabled) in max8907_rtc_set_alarm()
|
D | rtc-nxp-bbnsm.c | 96 static int bbnsm_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in bbnsm_rtc_read_alarm() argument 102 rtc_time64_to_tm(bbnsm_ta, &alrm->time); in bbnsm_rtc_read_alarm() 105 alrm->pending = (bbnsm_events & BBNSM_EVENT_TA) ? 1 : 0; in bbnsm_rtc_read_alarm() 122 static int bbnsm_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in bbnsm_rtc_set_alarm() argument 125 unsigned long time = rtc_tm_to_time64(&alrm->time); in bbnsm_rtc_set_alarm() 133 return bbnsm_rtc_alarm_irq_enable(dev, alrm->enabled); in bbnsm_rtc_set_alarm()
|
D | rtc-sc27xx.c | 302 static int sprd_rtc_set_aux_alarm(struct device *dev, struct rtc_wkalrm *alrm) in sprd_rtc_set_aux_alarm() argument 305 time64_t secs = rtc_tm_to_time64(&alrm->time); in sprd_rtc_set_aux_alarm() 318 if (alrm->enabled) { in sprd_rtc_set_aux_alarm() 383 static int sprd_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in sprd_rtc_read_alarm() argument 398 rtc_time64_to_tm(secs, &alrm->time); in sprd_rtc_read_alarm() 404 alrm->enabled = !!(val & SPRD_RTC_ALARM_EN); in sprd_rtc_read_alarm() 410 alrm->pending = !!(val & SPRD_RTC_ALARM_EN); in sprd_rtc_read_alarm() 414 static int sprd_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in sprd_rtc_set_alarm() argument 417 time64_t secs = rtc_tm_to_time64(&alrm->time); in sprd_rtc_set_alarm() 435 if (!rtc->rtc->aie_timer.enabled || rtc_tm_sub(&aie_time, &alrm->time)) in sprd_rtc_set_alarm() [all …]
|
D | rtc-pcf85063.c | 160 static int pcf85063_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pcf85063_rtc_read_alarm() argument 172 alrm->time.tm_sec = bcd2bin(buf[0] & 0x7f); in pcf85063_rtc_read_alarm() 173 alrm->time.tm_min = bcd2bin(buf[1] & 0x7f); in pcf85063_rtc_read_alarm() 174 alrm->time.tm_hour = bcd2bin(buf[2] & 0x3f); in pcf85063_rtc_read_alarm() 175 alrm->time.tm_mday = bcd2bin(buf[3] & 0x3f); in pcf85063_rtc_read_alarm() 181 alrm->enabled = !!(val & PCF85063_CTRL2_AIE); in pcf85063_rtc_read_alarm() 186 static int pcf85063_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pcf85063_rtc_set_alarm() argument 192 buf[0] = bin2bcd(alrm->time.tm_sec); in pcf85063_rtc_set_alarm() 193 buf[1] = bin2bcd(alrm->time.tm_min); in pcf85063_rtc_set_alarm() 194 buf[2] = bin2bcd(alrm->time.tm_hour); in pcf85063_rtc_set_alarm() [all …]
|
/linux-6.6.21/arch/um/drivers/ |
D | rtc_kern.c | 44 static int uml_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in uml_rtc_read_alarm() argument 46 rtc_time64_to_tm(uml_rtc_alarm_time, &alrm->time); in uml_rtc_read_alarm() 47 alrm->enabled = uml_rtc_alarm_enabled; in uml_rtc_read_alarm() 82 static int uml_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in uml_rtc_set_alarm() argument 85 uml_rtc_alarm_time = rtc_tm_to_time64(&alrm->time); in uml_rtc_set_alarm() 86 uml_rtc_alarm_irq_enable(dev, alrm->enabled); in uml_rtc_set_alarm()
|