Lines Matching full:read

35  *  Standard read/write
40 * ds1685_read - read a value from an rtc register.
42 * @reg: the register address to read.
66 * Indirect read/write functions
71 * ds1685_indirect_read - read a value from an rtc register.
73 * @reg: the register address to read.
162 (rtc->read(rtc, RTC_CTRL_A) & ~(RTC_CTRL_A_DV0))); in ds1685_rtc_switch_to_bank0()
173 (rtc->read(rtc, RTC_CTRL_A) | RTC_CTRL_A_DV0)); in ds1685_rtc_switch_to_bank1()
185 * is read again in a loop until INCR is inactive.
194 (rtc->read(rtc, RTC_CTRL_B) | RTC_CTRL_B_SET)); in ds1685_rtc_begin_data_access()
199 /* Read Ext Ctrl 4A and check the INCR bit to avoid a lockout. */ in ds1685_rtc_begin_data_access()
200 while (rtc->read(rtc, RTC_EXT_CTRL_4A) & RTC_CTRL_4A_INCR) in ds1685_rtc_begin_data_access()
220 (rtc->read(rtc, RTC_CTRL_B) & ~(RTC_CTRL_B_SET))); in ds1685_rtc_end_data_access()
234 * called first before calling this function, else data will be read out of
240 ssn[0] = rtc->read(rtc, RTC_BANK1_SSN_MODEL); in ds1685_rtc_get_ssn()
241 ssn[1] = rtc->read(rtc, RTC_BANK1_SSN_BYTE_1); in ds1685_rtc_get_ssn()
242 ssn[2] = rtc->read(rtc, RTC_BANK1_SSN_BYTE_2); in ds1685_rtc_get_ssn()
243 ssn[3] = rtc->read(rtc, RTC_BANK1_SSN_BYTE_3); in ds1685_rtc_get_ssn()
244 ssn[4] = rtc->read(rtc, RTC_BANK1_SSN_BYTE_4); in ds1685_rtc_get_ssn()
245 ssn[5] = rtc->read(rtc, RTC_BANK1_SSN_BYTE_5); in ds1685_rtc_get_ssn()
246 ssn[6] = rtc->read(rtc, RTC_BANK1_SSN_BYTE_6); in ds1685_rtc_get_ssn()
247 ssn[7] = rtc->read(rtc, RTC_BANK1_SSN_CRC); in ds1685_rtc_get_ssn()
253 /* Read/Set Time & Alarm functions */
269 seconds = rtc->read(rtc, RTC_SECS); in ds1685_rtc_read_time()
270 minutes = rtc->read(rtc, RTC_MINS); in ds1685_rtc_read_time()
271 hours = rtc->read(rtc, RTC_HRS); in ds1685_rtc_read_time()
272 wday = rtc->read(rtc, RTC_WDAY); in ds1685_rtc_read_time()
273 mday = rtc->read(rtc, RTC_MDAY); in ds1685_rtc_read_time()
274 month = rtc->read(rtc, RTC_MONTH); in ds1685_rtc_read_time()
275 years = rtc->read(rtc, RTC_YEAR); in ds1685_rtc_read_time()
276 century = rtc->read(rtc, RTC_CENTURY); in ds1685_rtc_read_time()
353 ctrlb = rtc->read(rtc, RTC_CTRL_B); in ds1685_rtc_set_time()
393 seconds = rtc->read(rtc, RTC_SECS_ALARM); in ds1685_rtc_read_alarm()
394 minutes = rtc->read(rtc, RTC_MINS_ALARM); in ds1685_rtc_read_alarm()
395 hours = rtc->read(rtc, RTC_HRS_ALARM); in ds1685_rtc_read_alarm()
396 mday = rtc->read(rtc, RTC_MDAY_ALARM); in ds1685_rtc_read_alarm()
397 ctrlb = rtc->read(rtc, RTC_CTRL_B); in ds1685_rtc_read_alarm()
398 ctrlc = rtc->read(rtc, RTC_CTRL_C); in ds1685_rtc_read_alarm()
493 ctrlb = rtc->read(rtc, RTC_CTRL_B); in ds1685_rtc_set_alarm()
496 /* Read ctrlc to clear RTC_CTRL_C_AF. */ in ds1685_rtc_set_alarm()
497 rtc->read(rtc, RTC_CTRL_C); in ds1685_rtc_set_alarm()
503 ctrlb = rtc->read(rtc, RTC_CTRL_B); in ds1685_rtc_set_alarm()
516 ctrlb = rtc->read(rtc, RTC_CTRL_B); in ds1685_rtc_set_alarm()
544 rtc->write(rtc, RTC_CTRL_B, (rtc->read(rtc, RTC_CTRL_B) | in ds1685_rtc_alarm_irq_enable()
547 rtc->write(rtc, RTC_CTRL_B, (rtc->read(rtc, RTC_CTRL_B) & in ds1685_rtc_alarm_irq_enable()
550 /* Read Control C to clear all the flag bits. */ in ds1685_rtc_alarm_irq_enable()
551 rtc->read(rtc, RTC_CTRL_C); in ds1685_rtc_alarm_irq_enable()
572 ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A); in ds1685_rtc_extended_irq()
573 ctrl4b = rtc->read(rtc, RTC_EXT_CTRL_4B); in ds1685_rtc_extended_irq()
583 (rtc->read(rtc, RTC_EXT_CTRL_4B) & in ds1685_rtc_extended_irq()
598 (rtc->read(rtc, RTC_EXT_CTRL_4B) | in ds1685_rtc_extended_irq()
672 ctrlb = rtc->read(rtc, RTC_CTRL_B); in ds1685_rtc_irq_handler()
673 ctrlc = rtc->read(rtc, RTC_CTRL_C); in ds1685_rtc_irq_handler()
758 /* Read all the relevant data from the control registers. */ in ds1685_rtc_proc()
761 ctrla = rtc->read(rtc, RTC_CTRL_A); in ds1685_rtc_proc()
762 ctrlb = rtc->read(rtc, RTC_CTRL_B); in ds1685_rtc_proc()
763 ctrld = rtc->read(rtc, RTC_CTRL_D); in ds1685_rtc_proc()
764 ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A); in ds1685_rtc_proc()
765 ctrl4b = rtc->read(rtc, RTC_EXT_CTRL_4B); in ds1685_rtc_proc()
855 /* Read NVRAM in time and bank0 registers. */ in ds1685_nvram_read()
859 *buf++ = rtc->read(rtc, (NVRAM_TIME_BASE + pos++)); in ds1685_nvram_read()
861 *buf++ = rtc->read(rtc, (NVRAM_BANK0_BASE + pos++)); in ds1685_nvram_read()
871 (rtc->read(rtc, RTC_EXT_CTRL_4A) | in ds1685_nvram_read()
880 /* Read NVRAM in bank1 registers. */ in ds1685_nvram_read()
885 * before each read. */ in ds1685_nvram_read()
889 *buf++ = rtc->read(rtc, RTC_BANK1_RAM_DATA_PORT); in ds1685_nvram_read()
896 (rtc->read(rtc, RTC_EXT_CTRL_4A) & in ds1685_nvram_read()
938 (rtc->read(rtc, RTC_EXT_CTRL_4A) | in ds1685_nvram_write()
952 * before each read. */ in ds1685_nvram_write()
963 (rtc->read(rtc, RTC_EXT_CTRL_4A) & in ds1685_nvram_write()
990 ctrld = rtc->read(rtc, RTC_CTRL_D); in ds1685_rtc_sysfs_battery_show()
1011 ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A); in ds1685_rtc_sysfs_auxbatt_show()
1099 rtc->read = ds1685_read; in ds1685_rtc_probe()
1109 rtc->read = ds1685_indirect_read; in ds1685_rtc_probe()
1114 if (!rtc->read || !rtc->write) in ds1685_rtc_probe()
1139 ctrla = rtc->read(rtc, RTC_CTRL_A); in ds1685_rtc_probe()
1158 (rtc->read(rtc, RTC_EXT_CTRL_4B) | RTC_CTRL_4B_E32K)); in ds1685_rtc_probe()
1162 (rtc->read(rtc, RTC_CTRL_B) | RTC_CTRL_B_SET)); in ds1685_rtc_probe()
1164 /* Read Ext Ctrl 4A and check the INCR bit to avoid a lockout. */ in ds1685_rtc_probe()
1165 while (rtc->read(rtc, RTC_EXT_CTRL_4A) & RTC_CTRL_4A_INCR) in ds1685_rtc_probe()
1172 ctrlb = rtc->read(rtc, RTC_CTRL_B); in ds1685_rtc_probe()
1190 hours = rtc->read(rtc, RTC_HRS); in ds1685_rtc_probe()
1209 hours = rtc->read(rtc, RTC_HRS_ALARM); in ds1685_rtc_probe()
1227 (rtc->read(rtc, RTC_CTRL_B) & ~(RTC_CTRL_B_SET))); in ds1685_rtc_probe()
1230 if (!(rtc->read(rtc, RTC_CTRL_D) & RTC_CTRL_D_VRT)) in ds1685_rtc_probe()
1235 if (!(rtc->read(rtc, RTC_EXT_CTRL_4A) & RTC_CTRL_4A_VRT2)) in ds1685_rtc_probe()
1239 /* Read Ctrl B and clear PIE/AIE/UIE. */ in ds1685_rtc_probe()
1241 (rtc->read(rtc, RTC_CTRL_B) & ~(RTC_CTRL_B_PAU_MASK))); in ds1685_rtc_probe()
1244 rtc->read(rtc, RTC_CTRL_C); in ds1685_rtc_probe()
1246 /* Read Ctrl 4B and clear RIE/WIE/KSE. */ in ds1685_rtc_probe()
1248 (rtc->read(rtc, RTC_EXT_CTRL_4B) & ~(RTC_CTRL_4B_RWK_MASK))); in ds1685_rtc_probe()
1252 (rtc->read(rtc, RTC_EXT_CTRL_4A) & ~(RTC_CTRL_4A_RWK_MASK))); in ds1685_rtc_probe()
1259 (rtc->read(rtc, RTC_EXT_CTRL_4B) | RTC_CTRL_4B_KSE)); in ds1685_rtc_probe()
1330 /* Read Ctrl B and clear PIE/AIE/UIE. */ in ds1685_rtc_remove()
1332 (rtc->read(rtc, RTC_CTRL_B) & in ds1685_rtc_remove()
1336 rtc->read(rtc, RTC_CTRL_C); in ds1685_rtc_remove()
1338 /* Read Ctrl 4B and clear RIE/WIE/KSE. */ in ds1685_rtc_remove()
1340 (rtc->read(rtc, RTC_EXT_CTRL_4B) & in ds1685_rtc_remove()
1345 (rtc->read(rtc, RTC_EXT_CTRL_4A) & in ds1685_rtc_remove()
1395 ctrla = rtc->read(rtc, RTC_CTRL_A); in ds1685_rtc_poweroff()
1401 * Read Control 4A and check the status of the auxillary in ds1685_rtc_poweroff()
1406 ctrl4a = rtc->read(rtc, RTC_EXT_CTRL_4A); in ds1685_rtc_poweroff()
1418 ctrl4b = rtc->read(rtc, RTC_EXT_CTRL_4B); in ds1685_rtc_poweroff()