Lines Matching +full:read +full:- +full:write
1 /* SPDX-License-Identifier: GPL-2.0+ */
13 /* bcd<->bin functions are needed by almost all the RTC drivers, let's include
23 * get() - get the current time
25 * Returns the current time read from the RTC device. The driver
28 * @dev: Device to read from
29 * @time: Place to put the time that is read
34 * set() - set the current time
39 * @dev: Device to read from
40 * @time: Time to write
45 * reset() - reset the RTC to a known-good state
47 * This function resets the RTC to a known-good state. The time may
51 * @dev: Device to read from
52 * @return 0 if OK, -ve on error
57 * read8() - Read an 8-bit register
59 * @dev: Device to read from
60 * @reg: Register to read
61 * @return value read, or -ve on error
66 * write8() - Write an 8-bit register
68 * @dev: Device to write to
69 * @reg: Register to write
70 * @value: Value to write
71 * @return 0 if OK, -ve on error
77 #define rtc_get_ops(dev) ((struct rtc_ops *)(dev)->driver->ops)
80 * dm_rtc_get() - Read the time from an RTC
82 * @dev: Device to read from
84 * @return 0 if OK, -ve on error
89 * dm_rtc_set() - Write a time to an RTC
91 * @dev: Device to read from
92 * @time: Time to write into the RTC
93 * @return 0 if OK, -ve on error
98 * dm_rtc_reset() - reset the RTC to a known-good state
105 * @dev: Device to read from
106 * @return 0 if OK, -ve on error
111 * rtc_read8() - Read an 8-bit register
113 * @dev: Device to read from
114 * @reg: Register to read
115 * @return value read, or -ve on error
120 * rtc_write8() - Write an 8-bit register
122 * @dev: Device to write to
123 * @reg: Register to write
124 * @value: Value to write
125 * @return 0 if OK, -ve on error
130 * rtc_read16() - Read a 16-bit value from the RTC
132 * @dev: Device to read from
134 * @valuep: Place to put the value that is read
135 * @return 0 if OK, -ve on error
140 * rtc_write16() - Write a 16-bit value to the RTC
142 * @dev: Device to write to
144 * @value: Value to write
145 * @return 0 if OK, -ve on error
150 * rtc_read32() - Read a 32-bit value from the RTC
152 * @dev: Device to read from
154 * @valuep: Place to put the value that is read
155 * @return 0 if OK, -ve on error
160 * rtc_write32() - Write a 32-bit value to the RTC
162 * @dev: Device to write to
164 * @value: Value to write
165 * @return 0 if OK, -ve on error
176 * rtc_read8() - Read an 8-bit register
178 * @reg: Register to read
179 * @return value read
184 * rtc_write8() - Write an 8-bit register
186 * @reg: Register to write
187 * @value: Value to write
192 * rtc_read32() - Read a 32-bit value from the RTC
195 * @return value read
200 * rtc_write32() - Write a 32-bit value to the RTC
203 * @value: Value to write
208 * rtc_init() - Set up the real time clock ready for use
214 * is_leap_year - Check if year is a leap year
225 * rtc_calc_weekday() - Work out the weekday from a time
227 * This only works for the Gregorian calendar - i.e. after 1752 (in the UK).
228 * It sets time->tm_wdaay to the correct day of the week.
231 * @return 0 if OK, -EINVAL if the weekday could not be determined
236 * rtc_to_tm() - Convert a time_t value into a broken-out time
243 * @time_t: Number of seconds since 1970-01-01 00:00:00
244 * @time: Place to put the broken-out time
249 * rtc_mktime() - Convert a broken-out time into a time_t value
256 * @time: Broken-out time to convert
257 * @return corresponding time_t value, seconds since 1970-01-01 00:00:00