Lines Matching refs:buf
87 unsigned char length, unsigned char *buf) in pcf8563_read_block_data() argument
93 .buf = ®, in pcf8563_read_block_data()
99 .buf = buf in pcf8563_read_block_data()
113 unsigned char *buf) in pcf8563_write_block_data() argument
118 unsigned char data[2] = { reg + i, buf[i] }; in pcf8563_write_block_data()
134 unsigned char buf; in pcf8563_set_alarm_mode() local
137 err = pcf8563_read_block_data(client, PCF8563_REG_ST2, 1, &buf); in pcf8563_set_alarm_mode()
142 buf |= PCF8563_BIT_AIE; in pcf8563_set_alarm_mode()
144 buf &= ~PCF8563_BIT_AIE; in pcf8563_set_alarm_mode()
146 buf &= ~(PCF8563_BIT_AF | PCF8563_BITS_ST2_N); in pcf8563_set_alarm_mode()
148 err = pcf8563_write_block_data(client, PCF8563_REG_ST2, 1, &buf); in pcf8563_set_alarm_mode()
160 unsigned char buf; in pcf8563_get_alarm_mode() local
163 err = pcf8563_read_block_data(client, PCF8563_REG_ST2, 1, &buf); in pcf8563_get_alarm_mode()
168 *en = !!(buf & PCF8563_BIT_AIE); in pcf8563_get_alarm_mode()
170 *pen = !!(buf & PCF8563_BIT_AF); in pcf8563_get_alarm_mode()
202 unsigned char buf[9]; in pcf8563_rtc_read_time() local
205 err = pcf8563_read_block_data(client, PCF8563_REG_ST1, 9, buf); in pcf8563_rtc_read_time()
209 if (buf[PCF8563_REG_SC] & PCF8563_SC_LV) { in pcf8563_rtc_read_time()
219 buf[0], buf[1], buf[2], buf[3], in pcf8563_rtc_read_time()
220 buf[4], buf[5], buf[6], buf[7], in pcf8563_rtc_read_time()
221 buf[8]); in pcf8563_rtc_read_time()
224 tm->tm_sec = bcd2bin(buf[PCF8563_REG_SC] & 0x7F); in pcf8563_rtc_read_time()
225 tm->tm_min = bcd2bin(buf[PCF8563_REG_MN] & 0x7F); in pcf8563_rtc_read_time()
226 tm->tm_hour = bcd2bin(buf[PCF8563_REG_HR] & 0x3F); /* rtc hr 0-23 */ in pcf8563_rtc_read_time()
227 tm->tm_mday = bcd2bin(buf[PCF8563_REG_DM] & 0x3F); in pcf8563_rtc_read_time()
228 tm->tm_wday = buf[PCF8563_REG_DW] & 0x07; in pcf8563_rtc_read_time()
229 tm->tm_mon = bcd2bin(buf[PCF8563_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ in pcf8563_rtc_read_time()
230 tm->tm_year = bcd2bin(buf[PCF8563_REG_YR]) + 100; in pcf8563_rtc_read_time()
232 pcf8563->c_polarity = (buf[PCF8563_REG_MO] & PCF8563_MO_C) ? in pcf8563_rtc_read_time()
248 unsigned char buf[9]; in pcf8563_rtc_set_time() local
257 buf[PCF8563_REG_SC] = bin2bcd(tm->tm_sec); in pcf8563_rtc_set_time()
258 buf[PCF8563_REG_MN] = bin2bcd(tm->tm_min); in pcf8563_rtc_set_time()
259 buf[PCF8563_REG_HR] = bin2bcd(tm->tm_hour); in pcf8563_rtc_set_time()
261 buf[PCF8563_REG_DM] = bin2bcd(tm->tm_mday); in pcf8563_rtc_set_time()
264 buf[PCF8563_REG_MO] = bin2bcd(tm->tm_mon + 1); in pcf8563_rtc_set_time()
267 buf[PCF8563_REG_YR] = bin2bcd(tm->tm_year - 100); in pcf8563_rtc_set_time()
269 buf[PCF8563_REG_MO] |= PCF8563_MO_C; in pcf8563_rtc_set_time()
271 buf[PCF8563_REG_DW] = tm->tm_wday & 0x07; in pcf8563_rtc_set_time()
274 9 - PCF8563_REG_SC, buf + PCF8563_REG_SC); in pcf8563_rtc_set_time()
298 unsigned char buf[4]; in pcf8563_rtc_read_alarm() local
301 err = pcf8563_read_block_data(client, PCF8563_REG_AMN, 4, buf); in pcf8563_rtc_read_alarm()
307 __func__, buf[0], buf[1], buf[2], buf[3]); in pcf8563_rtc_read_alarm()
310 tm->time.tm_min = bcd2bin(buf[0] & 0x7F); in pcf8563_rtc_read_alarm()
311 tm->time.tm_hour = bcd2bin(buf[1] & 0x3F); in pcf8563_rtc_read_alarm()
312 tm->time.tm_mday = bcd2bin(buf[2] & 0x3F); in pcf8563_rtc_read_alarm()
313 tm->time.tm_wday = bcd2bin(buf[3] & 0x7); in pcf8563_rtc_read_alarm()
330 unsigned char buf[4]; in pcf8563_rtc_set_alarm() local
346 buf[0] = bin2bcd(tm->time.tm_min); in pcf8563_rtc_set_alarm()
347 buf[1] = bin2bcd(tm->time.tm_hour); in pcf8563_rtc_set_alarm()
348 buf[2] = bin2bcd(tm->time.tm_mday); in pcf8563_rtc_set_alarm()
349 buf[3] = tm->time.tm_wday & 0x07; in pcf8563_rtc_set_alarm()
351 err = pcf8563_write_block_data(client, PCF8563_REG_AMN, 4, buf); in pcf8563_rtc_set_alarm()
383 unsigned char buf; in pcf8563_clkout_recalc_rate() local
384 int ret = pcf8563_read_block_data(client, PCF8563_REG_CLKO, 1, &buf); in pcf8563_clkout_recalc_rate()
389 buf &= PCF8563_REG_CLKO_F_MASK; in pcf8563_clkout_recalc_rate()
390 return clkout_rates[buf]; in pcf8563_clkout_recalc_rate()
410 unsigned char buf; in pcf8563_clkout_set_rate() local
411 int ret = pcf8563_read_block_data(client, PCF8563_REG_CLKO, 1, &buf); in pcf8563_clkout_set_rate()
419 buf &= ~PCF8563_REG_CLKO_F_MASK; in pcf8563_clkout_set_rate()
420 buf |= i; in pcf8563_clkout_set_rate()
423 &buf); in pcf8563_clkout_set_rate()
434 unsigned char buf; in pcf8563_clkout_control() local
435 int ret = pcf8563_read_block_data(client, PCF8563_REG_CLKO, 1, &buf); in pcf8563_clkout_control()
441 buf |= PCF8563_REG_CLKO_FE; in pcf8563_clkout_control()
443 buf &= ~PCF8563_REG_CLKO_FE; in pcf8563_clkout_control()
445 ret = pcf8563_write_block_data(client, PCF8563_REG_CLKO, 1, &buf); in pcf8563_clkout_control()
463 unsigned char buf; in pcf8563_clkout_is_prepared() local
464 int ret = pcf8563_read_block_data(client, PCF8563_REG_CLKO, 1, &buf); in pcf8563_clkout_is_prepared()
469 return !!(buf & PCF8563_REG_CLKO_FE); in pcf8563_clkout_is_prepared()
488 unsigned char buf; in pcf8563_clkout_register_clk() local
491 buf = 0; in pcf8563_clkout_register_clk()
492 ret = pcf8563_write_block_data(client, PCF8563_REG_CLKO, 1, &buf); in pcf8563_clkout_register_clk()
530 unsigned char buf; in pcf8563_probe() local
547 buf = PCF8563_TMRC_1_60; in pcf8563_probe()
548 err = pcf8563_write_block_data(client, PCF8563_REG_TMRC, 1, &buf); in pcf8563_probe()
555 buf = 0; in pcf8563_probe()
556 err = pcf8563_write_block_data(client, PCF8563_REG_ST2, 1, &buf); in pcf8563_probe()