Lines Matching refs:buf
49 unsigned char buf[13] = { PCF85063_REG_CTRL1 }; in pcf85063_get_datetime() local
54 .buf = buf in pcf85063_get_datetime()
60 .buf = buf in pcf85063_get_datetime()
70 tm->tm_sec = bcd2bin(buf[PCF85063_REG_SC] & 0x7F); in pcf85063_get_datetime()
71 tm->tm_min = bcd2bin(buf[PCF85063_REG_MN] & 0x7F); in pcf85063_get_datetime()
72 tm->tm_hour = bcd2bin(buf[PCF85063_REG_HR] & 0x3F); /* rtc hr 0-23 */ in pcf85063_get_datetime()
73 tm->tm_mday = bcd2bin(buf[PCF85063_REG_DM] & 0x3F); in pcf85063_get_datetime()
74 tm->tm_wday = buf[PCF85063_REG_DW] & 0x07; in pcf85063_get_datetime()
75 tm->tm_mon = bcd2bin(buf[PCF85063_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ in pcf85063_get_datetime()
76 tm->tm_year = bcd2bin(buf[PCF85063_REG_YR]); in pcf85063_get_datetime()
80 pcf85063->c_polarity = (buf[PCF85063_REG_MO] & PCF85063_MO_C) ? in pcf85063_get_datetime()
89 unsigned char buf[11]; in pcf85063_set_datetime() local
92 buf[PCF85063_REG_CTRL1] = 0; in pcf85063_set_datetime()
93 buf[PCF85063_REG_CTRL2] = 5; in pcf85063_set_datetime()
96 buf[PCF85063_REG_SC] = bin2bcd(tm->tm_sec) & 0x7F; in pcf85063_set_datetime()
98 buf[PCF85063_REG_MN] = bin2bcd(tm->tm_min); in pcf85063_set_datetime()
99 buf[PCF85063_REG_HR] = bin2bcd(tm->tm_hour); in pcf85063_set_datetime()
102 buf[PCF85063_REG_DM] = bin2bcd(tm->tm_mday); in pcf85063_set_datetime()
105 buf[PCF85063_REG_DW] = tm->tm_wday & 0x07; in pcf85063_set_datetime()
108 buf[PCF85063_REG_MO] = bin2bcd(tm->tm_mon + 1); in pcf85063_set_datetime()
111 buf[PCF85063_REG_YR] = bin2bcd(tm->tm_year % 100); in pcf85063_set_datetime()
114 for (i = 0; i < sizeof(buf); i++) { in pcf85063_set_datetime()
115 unsigned char data[2] = { i, buf[i] }; in pcf85063_set_datetime()