Home
last modified time | relevance | path

Searched refs:alrm (Results 1 – 25 of 39) sorted by relevance

12

/drivers/rtc/
Drtc-proc.c47 struct rtc_wkalrm alrm; in rtc_proc_show() local
59 err = rtc_read_alarm(rtc, &alrm); in rtc_proc_show()
62 if ((unsigned int)alrm.time.tm_hour <= 24) in rtc_proc_show()
63 seq_printf(seq, "%02d:", alrm.time.tm_hour); in rtc_proc_show()
66 if ((unsigned int)alrm.time.tm_min <= 59) in rtc_proc_show()
67 seq_printf(seq, "%02d:", alrm.time.tm_min); in rtc_proc_show()
70 if ((unsigned int)alrm.time.tm_sec <= 59) in rtc_proc_show()
71 seq_printf(seq, "%02d\n", alrm.time.tm_sec); in rtc_proc_show()
76 if ((unsigned int)alrm.time.tm_year <= 200) in rtc_proc_show()
77 seq_printf(seq, "%04d-", alrm.time.tm_year + 1900); in rtc_proc_show()
[all …]
Drtc-tps80031.c143 static int tps80031_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in tps80031_rtc_set_alarm() argument
148 buff[0] = bin2bcd(alrm->time.tm_sec); in tps80031_rtc_set_alarm()
149 buff[1] = bin2bcd(alrm->time.tm_min); in tps80031_rtc_set_alarm()
150 buff[2] = bin2bcd(alrm->time.tm_hour); in tps80031_rtc_set_alarm()
151 buff[3] = bin2bcd(alrm->time.tm_mday); in tps80031_rtc_set_alarm()
152 buff[4] = bin2bcd(alrm->time.tm_mon + 1); in tps80031_rtc_set_alarm()
153 buff[5] = bin2bcd(alrm->time.tm_year % RTC_YEAR_OFFSET); in tps80031_rtc_set_alarm()
161 return tps80031_rtc_alarm_irq_enable(dev, alrm->enabled); in tps80031_rtc_set_alarm()
164 static int tps80031_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in tps80031_rtc_read_alarm() argument
178 alrm->time.tm_sec = bcd2bin(buff[0]); in tps80031_rtc_read_alarm()
[all …]
Drtc-vt8500.c154 static int vt8500_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in vt8500_rtc_read_alarm() argument
162 alrm->time.tm_mday = bcd2bin((alarm & ALARM_DAY_MASK) >> ALARM_DAY_S); in vt8500_rtc_read_alarm()
163 alrm->time.tm_hour = bcd2bin((alarm & TIME_HOUR_MASK) >> TIME_HOUR_S); in vt8500_rtc_read_alarm()
164 alrm->time.tm_min = bcd2bin((alarm & TIME_MIN_MASK) >> TIME_MIN_S); in vt8500_rtc_read_alarm()
165 alrm->time.tm_sec = bcd2bin((alarm & TIME_SEC_MASK)); in vt8500_rtc_read_alarm()
167 alrm->enabled = (alarm & ALARM_ENABLE_MASK) ? 1 : 0; in vt8500_rtc_read_alarm()
168 alrm->pending = (isr & VT8500_RTC_IS_ALARM) ? 1 : 0; in vt8500_rtc_read_alarm()
170 return rtc_valid_tm(&alrm->time); in vt8500_rtc_read_alarm()
173 static int vt8500_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in vt8500_rtc_set_alarm() argument
177 writel((alrm->enabled ? ALARM_ENABLE_MASK : 0) in vt8500_rtc_set_alarm()
[all …]
Drtc-tx4939.c94 static int tx4939_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in tx4939_rtc_set_alarm() argument
102 if (alrm->time.tm_sec < 0 || in tx4939_rtc_set_alarm()
103 alrm->time.tm_min < 0 || in tx4939_rtc_set_alarm()
104 alrm->time.tm_hour < 0 || in tx4939_rtc_set_alarm()
105 alrm->time.tm_mday < 0 || in tx4939_rtc_set_alarm()
106 alrm->time.tm_mon < 0 || in tx4939_rtc_set_alarm()
107 alrm->time.tm_year < 0) in tx4939_rtc_set_alarm()
109 rtc_tm_to_time(&alrm->time, &sec); in tx4939_rtc_set_alarm()
121 (alrm->enabled ? TX4939_RTCCTL_ALME : 0)); in tx4939_rtc_set_alarm()
126 static int tx4939_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in tx4939_rtc_read_alarm() argument
[all …]
Drtc-pcf50633.c180 static int pcf50633_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pcf50633_rtc_read_alarm() argument
188 alrm->enabled = rtc->alarm_enabled; in pcf50633_rtc_read_alarm()
189 alrm->pending = rtc->alarm_pending; in pcf50633_rtc_read_alarm()
198 pcf2rtc_time(&alrm->time, &pcf_tm); in pcf50633_rtc_read_alarm()
200 return rtc_valid_tm(&alrm->time); in pcf50633_rtc_read_alarm()
203 static int pcf50633_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pcf50633_rtc_set_alarm() argument
211 rtc2pcf_time(&pcf_tm, &alrm->time); in pcf50633_rtc_set_alarm()
225 if (!alrm->enabled) in pcf50633_rtc_set_alarm()
228 if (!alarm_masked || alrm->enabled) in pcf50633_rtc_set_alarm()
230 rtc->alarm_enabled = alrm->enabled; in pcf50633_rtc_set_alarm()
Drtc-88pm80x.c91 struct rtc_time *alrm) in rtc_next_alarm_time() argument
99 next->tm_hour = alrm->tm_hour; in rtc_next_alarm_time()
100 next->tm_min = alrm->tm_min; in rtc_next_alarm_time()
101 next->tm_sec = alrm->tm_sec; in rtc_next_alarm_time()
160 static int pm80x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pm80x_rtc_read_alarm() argument
177 rtc_time_to_tm(ticks, &alrm->time); in pm80x_rtc_read_alarm()
179 alrm->enabled = (ret & PM800_ALARM1_EN) ? 1 : 0; in pm80x_rtc_read_alarm()
180 alrm->pending = (ret & (PM800_ALARM | PM800_ALARM_WAKEUP)) ? 1 : 0; in pm80x_rtc_read_alarm()
184 static int pm80x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pm80x_rtc_set_alarm() argument
207 rtc_next_alarm_time(&alarm_tm, &now_tm, &alrm->time); in pm80x_rtc_set_alarm()
[all …]
Drtc-puv3.c114 static int puv3_rtc_getalarm(struct device *dev, struct rtc_wkalrm *alrm) in puv3_rtc_getalarm() argument
116 struct rtc_time *alm_tm = &alrm->time; in puv3_rtc_getalarm()
120 alrm->enabled = readl(RTC_RTSR) & RTC_RTSR_ALE; in puv3_rtc_getalarm()
123 alrm->enabled, in puv3_rtc_getalarm()
130 static int puv3_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) in puv3_rtc_setalarm() argument
132 struct rtc_time *tm = &alrm->time; in puv3_rtc_setalarm()
136 alrm->enabled, in puv3_rtc_setalarm()
143 puv3_rtc_setaie(alrm->enabled); in puv3_rtc_setalarm()
145 if (alrm->enabled) in puv3_rtc_setalarm()
Drtc-max8925.c182 static int max8925_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8925_rtc_read_alarm() argument
191 ret = tm_calc(&alrm->time, buf, TIME_NUM); in max8925_rtc_read_alarm()
198 alrm->enabled = 0; in max8925_rtc_read_alarm()
204 alrm->enabled = 0; in max8925_rtc_read_alarm()
206 alrm->enabled = 1; in max8925_rtc_read_alarm()
212 alrm->pending = 1; in max8925_rtc_read_alarm()
214 alrm->pending = 0; in max8925_rtc_read_alarm()
220 static int max8925_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8925_rtc_set_alarm() argument
226 ret = data_calc(buf, &alrm->time, TIME_NUM); in max8925_rtc_set_alarm()
232 if (alrm->enabled) in max8925_rtc_set_alarm()
Drtc-ds1553.c162 static int ds1553_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in ds1553_rtc_set_alarm() argument
169 pdata->alrm_mday = alrm->time.tm_mday; in ds1553_rtc_set_alarm()
170 pdata->alrm_hour = alrm->time.tm_hour; in ds1553_rtc_set_alarm()
171 pdata->alrm_min = alrm->time.tm_min; in ds1553_rtc_set_alarm()
172 pdata->alrm_sec = alrm->time.tm_sec; in ds1553_rtc_set_alarm()
173 if (alrm->enabled) in ds1553_rtc_set_alarm()
179 static int ds1553_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in ds1553_rtc_read_alarm() argument
186 alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday; in ds1553_rtc_read_alarm()
187 alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour; in ds1553_rtc_read_alarm()
188 alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min; in ds1553_rtc_read_alarm()
[all …]
Drtc-stk17ta8.c170 static int stk17ta8_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in stk17ta8_rtc_set_alarm() argument
177 pdata->alrm_mday = alrm->time.tm_mday; in stk17ta8_rtc_set_alarm()
178 pdata->alrm_hour = alrm->time.tm_hour; in stk17ta8_rtc_set_alarm()
179 pdata->alrm_min = alrm->time.tm_min; in stk17ta8_rtc_set_alarm()
180 pdata->alrm_sec = alrm->time.tm_sec; in stk17ta8_rtc_set_alarm()
181 if (alrm->enabled) in stk17ta8_rtc_set_alarm()
187 static int stk17ta8_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in stk17ta8_rtc_read_alarm() argument
194 alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday; in stk17ta8_rtc_read_alarm()
195 alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour; in stk17ta8_rtc_read_alarm()
196 alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min; in stk17ta8_rtc_read_alarm()
[all …]
Drtc-mxc.c176 static int rtc_update_alarm(struct device *dev, struct rtc_time *alrm) in rtc_update_alarm() argument
189 alarm_tm.tm_hour = alrm->tm_hour; in rtc_update_alarm()
190 alarm_tm.tm_min = alrm->tm_min; in rtc_update_alarm()
191 alarm_tm.tm_sec = alrm->tm_sec; in rtc_update_alarm()
330 static int mxc_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in mxc_rtc_read_alarm() argument
336 rtc_time_to_tm(get_alarm_or_time(dev, MXC_RTC_ALARM), &alrm->time); in mxc_rtc_read_alarm()
337 alrm->pending = ((readw(ioaddr + RTC_RTCISR) & RTC_ALM_BIT)) ? 1 : 0; in mxc_rtc_read_alarm()
345 static int mxc_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in mxc_rtc_set_alarm() argument
351 ret = rtc_update_alarm(dev, &alrm->time); in mxc_rtc_set_alarm()
355 memcpy(&pdata->g_rtc_alarm, &alrm->time, sizeof(struct rtc_time)); in mxc_rtc_set_alarm()
[all …]
Drtc-max8998.c141 static int max8998_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8998_rtc_read_alarm() argument
152 max8998_data_to_tm(data, &alrm->time); in max8998_rtc_read_alarm()
158 alrm->enabled = !!val; in max8998_rtc_read_alarm()
165 alrm->pending = 1; in max8998_rtc_read_alarm()
167 alrm->pending = 0; in max8998_rtc_read_alarm()
199 static int max8998_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8998_rtc_set_alarm() argument
205 max8998_tm_to_data(&alrm->time, data); in max8998_rtc_set_alarm()
218 if (alrm->enabled) in max8998_rtc_set_alarm()
Drtc-ds1511.c326 ds1511_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in ds1511_rtc_set_alarm() argument
334 pdata->alrm_mday = alrm->time.tm_mday; in ds1511_rtc_set_alarm()
335 pdata->alrm_hour = alrm->time.tm_hour; in ds1511_rtc_set_alarm()
336 pdata->alrm_min = alrm->time.tm_min; in ds1511_rtc_set_alarm()
337 pdata->alrm_sec = alrm->time.tm_sec; in ds1511_rtc_set_alarm()
338 if (alrm->enabled) { in ds1511_rtc_set_alarm()
346 ds1511_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in ds1511_rtc_read_alarm() argument
354 alrm->time.tm_mday = pdata->alrm_mday < 0 ? 0 : pdata->alrm_mday; in ds1511_rtc_read_alarm()
355 alrm->time.tm_hour = pdata->alrm_hour < 0 ? 0 : pdata->alrm_hour; in ds1511_rtc_read_alarm()
356 alrm->time.tm_min = pdata->alrm_min < 0 ? 0 : pdata->alrm_min; in ds1511_rtc_read_alarm()
[all …]
Drtc-88pm860x.c87 struct rtc_time *alrm) in rtc_next_alarm_time() argument
95 next->tm_hour = alrm->tm_hour; in rtc_next_alarm_time()
96 next->tm_min = alrm->tm_min; in rtc_next_alarm_time()
97 next->tm_sec = alrm->tm_sec; in rtc_next_alarm_time()
163 static int pm860x_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pm860x_rtc_read_alarm() argument
181 rtc_time_to_tm(ticks, &alrm->time); in pm860x_rtc_read_alarm()
183 alrm->enabled = (ret & ALARM_EN) ? 1 : 0; in pm860x_rtc_read_alarm()
184 alrm->pending = (ret & (ALARM | ALARM_WAKEUP)) ? 1 : 0; in pm860x_rtc_read_alarm()
188 static int pm860x_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pm860x_rtc_set_alarm() argument
211 rtc_next_alarm_time(&alarm_tm, &now_tm, &alrm->time); in pm860x_rtc_set_alarm()
[all …]
Drtc-jz4740.c137 static int jz4740_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in jz4740_rtc_read_alarm() argument
147 alrm->enabled = !!(ctrl & JZ_RTC_CTRL_AE); in jz4740_rtc_read_alarm()
148 alrm->pending = !!(ctrl & JZ_RTC_CTRL_AF); in jz4740_rtc_read_alarm()
150 rtc_time_to_tm(secs, &alrm->time); in jz4740_rtc_read_alarm()
152 return rtc_valid_tm(&alrm->time); in jz4740_rtc_read_alarm()
155 static int jz4740_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in jz4740_rtc_set_alarm() argument
161 rtc_tm_to_time(&alrm->time, &secs); in jz4740_rtc_set_alarm()
166 JZ_RTC_CTRL_AE | JZ_RTC_CTRL_AF_IRQ, alrm->enabled); in jz4740_rtc_set_alarm()
Drtc-test.c19 struct rtc_wkalrm *alrm) in test_rtc_read_alarm() argument
25 struct rtc_wkalrm *alrm) in test_rtc_set_alarm() argument
84 struct rtc_wkalrm alrm; in test_irq_store() local
85 int err = rtc_read_alarm(rtc, &alrm); in test_irq_store()
87 if (!err && alrm.enabled) in test_irq_store()
Drtc-pl030.c38 static int pl030_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pl030_read_alarm() argument
42 rtc_time_to_tm(readl(rtc->base + RTC_MR), &alrm->time); in pl030_read_alarm()
46 static int pl030_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pl030_set_alarm() argument
55 ret = rtc_valid_tm(&alrm->time); in pl030_set_alarm()
57 ret = rtc_tm_to_time(&alrm->time, &time); in pl030_set_alarm()
Drtc-at32ap700x.c94 static int at32_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) in at32_rtc_readalarm() argument
99 rtc_time_to_tm(rtc->alarm_time, &alrm->time); in at32_rtc_readalarm()
100 alrm->enabled = rtc_readl(rtc, IMR) & RTC_BIT(IMR_TOPI) ? 1 : 0; in at32_rtc_readalarm()
101 alrm->pending = rtc_readl(rtc, ISR) & RTC_BIT(ISR_TOPI) ? 1 : 0; in at32_rtc_readalarm()
107 static int at32_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) in at32_rtc_setalarm() argument
116 ret = rtc_tm_to_time(&alrm->time, &alarm_unix_time); in at32_rtc_setalarm()
126 if (alrm->enabled) in at32_rtc_setalarm()
Drtc-bfin.c290 static int bfin_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in bfin_rtc_read_alarm() argument
294 alrm->time = rtc->rtc_alarm; in bfin_rtc_read_alarm()
296 alrm->enabled = !!(bfin_read_RTC_ICTL() & (RTC_ISTAT_ALARM | RTC_ISTAT_ALARM_DAY)); in bfin_rtc_read_alarm()
300 static int bfin_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in bfin_rtc_set_alarm() argument
307 if (rtc_tm_to_time(&alrm->time, &rtc_alarm)) in bfin_rtc_set_alarm()
310 rtc->rtc_alarm = alrm->time; in bfin_rtc_set_alarm()
314 if (alrm->enabled) in bfin_rtc_set_alarm()
Drtc-max8907.c124 static int max8907_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8907_rtc_read_alarm() argument
136 regs_to_tm(regs, &alrm->time); in max8907_rtc_read_alarm()
142 alrm->enabled = !!(val & 0x7f); in max8907_rtc_read_alarm()
147 static int max8907_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8907_rtc_set_alarm() argument
153 tm_to_regs(&alrm->time, regs); in max8907_rtc_set_alarm()
165 if (alrm->enabled) in max8907_rtc_set_alarm()
Drtc-wm831x.c236 static int wm831x_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) in wm831x_rtc_readalarm() argument
252 rtc_time_to_tm(time, &alrm->time); in wm831x_rtc_readalarm()
261 alrm->enabled = 1; in wm831x_rtc_readalarm()
263 alrm->enabled = 0; in wm831x_rtc_readalarm()
284 static int wm831x_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) in wm831x_rtc_setalarm() argument
291 ret = rtc_tm_to_time(&alrm->time, &time); in wm831x_rtc_setalarm()
316 if (alrm->enabled) { in wm831x_rtc_setalarm()
Drtc-at91sam9.c157 static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) in at91_rtc_readalarm() argument
160 struct rtc_time *tm = &alrm->time; in at91_rtc_readalarm()
168 memset(alrm, 0, sizeof(*alrm)); in at91_rtc_readalarm()
177 alrm->enabled = 1; in at91_rtc_readalarm()
183 static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) in at91_rtc_setalarm() argument
186 struct rtc_time *tm = &alrm->time; in at91_rtc_setalarm()
212 if (alrm->enabled) in at91_rtc_setalarm()
Drtc-pxa.c260 static int pxa_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pxa_rtc_read_alarm() argument
267 tm_calc(ryar, rdar, &alrm->time); in pxa_rtc_read_alarm()
270 alrm->enabled = (rtsr & RTSR_RDALE1) ? 1 : 0; in pxa_rtc_read_alarm()
271 alrm->pending = (rtsr & RTSR_RDAL1) ? 1 : 0; in pxa_rtc_read_alarm()
275 static int pxa_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in pxa_rtc_set_alarm() argument
282 rtc_writel(pxa_rtc, RYAR1, ryxr_calc(&alrm->time)); in pxa_rtc_set_alarm()
283 rtc_writel(pxa_rtc, RDAR1, rdxr_calc(&alrm->time)); in pxa_rtc_set_alarm()
286 if (alrm->enabled) in pxa_rtc_set_alarm()
Drtc-at91rm9200.c195 static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm) in at91_rtc_readalarm() argument
197 struct rtc_time *tm = &alrm->time; in at91_rtc_readalarm()
203 alrm->enabled = (at91_rtc_read_imr() & AT91_RTC_ALARM) in at91_rtc_readalarm()
216 static int at91_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm) in at91_rtc_setalarm() argument
224 tm.tm_hour = alrm->time.tm_hour; in at91_rtc_setalarm()
225 tm.tm_min = alrm->time.tm_min; in at91_rtc_setalarm()
226 tm.tm_sec = alrm->time.tm_sec; in at91_rtc_setalarm()
239 if (alrm->enabled) { in at91_rtc_setalarm()
Drtc-max8997.c182 static int max8997_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8997_rtc_read_alarm() argument
199 max8997_rtc_data_to_tm(data, &alrm->time, info->rtc_24hr_mode); in max8997_rtc_read_alarm()
201 alrm->enabled = 0; in max8997_rtc_read_alarm()
204 alrm->enabled = 1; in max8997_rtc_read_alarm()
209 alrm->pending = 0; in max8997_rtc_read_alarm()
218 alrm->pending = 1; in max8997_rtc_read_alarm()
296 static int max8997_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) in max8997_rtc_set_alarm() argument
302 ret = max8997_rtc_tm_to_data(&alrm->time, data); in max8997_rtc_set_alarm()
328 if (alrm->enabled) in max8997_rtc_set_alarm()

12