Lines Matching +full:real +full:- +full:time

1 // SPDX-License-Identifier: GPL-2.0
3 * Real Time Clock interface for Linux on the MVME16x
46 case RTC_RD_TIME: /* Read the time/date from RTC */ in rtc_ioctl()
49 /* Ensure clock and real-time-mode-register are accessible */ in rtc_ioctl()
50 rtc->ctrl = RTC_READ; in rtc_ioctl()
52 wtime.tm_sec = bcd2bin(rtc->bcd_sec); in rtc_ioctl()
53 wtime.tm_min = bcd2bin(rtc->bcd_min); in rtc_ioctl()
54 wtime.tm_hour = bcd2bin(rtc->bcd_hr); in rtc_ioctl()
55 wtime.tm_mday = bcd2bin(rtc->bcd_dom); in rtc_ioctl()
56 wtime.tm_mon = bcd2bin(rtc->bcd_mth)-1; in rtc_ioctl()
57 wtime.tm_year = bcd2bin(rtc->bcd_year); in rtc_ioctl()
60 wtime.tm_wday = bcd2bin(rtc->bcd_dow)-1; in rtc_ioctl()
61 rtc->ctrl = 0; in rtc_ioctl()
64 -EFAULT : 0; in rtc_ioctl()
73 return -EACCES; in rtc_ioctl()
76 return -EFAULT; in rtc_ioctl()
90 return -EINVAL; in rtc_ioctl()
93 return -EINVAL; in rtc_ioctl()
96 return -EINVAL; in rtc_ioctl()
99 return -EINVAL; in rtc_ioctl()
102 rtc->ctrl = RTC_WRITE; in rtc_ioctl()
104 rtc->bcd_sec = bin2bcd(sec); in rtc_ioctl()
105 rtc->bcd_min = bin2bcd(min); in rtc_ioctl()
106 rtc->bcd_hr = bin2bcd(hrs); in rtc_ioctl()
107 rtc->bcd_dom = bin2bcd(day); in rtc_ioctl()
108 rtc->bcd_mth = bin2bcd(mon); in rtc_ioctl()
109 rtc->bcd_year = bin2bcd(yrs%100); in rtc_ioctl()
111 rtc->ctrl = 0; in rtc_ioctl()
116 return -EINVAL; in rtc_ioctl()
121 * We enforce only one user at a time here with the open/close.
128 return -EBUSY; in rtc_open()
160 return -ENODEV; in rtc_MK48T08_init()
162 pr_info("MK48T08 Real Time Clock Driver v%s\n", RTC_VERSION); in rtc_MK48T08_init()