Lines Matching refs:buf

50 	unsigned char buf[10] = { PCF2127_REG_CTRL1 };  in pcf2127_get_datetime()  local
53 if (i2c_master_send(client, buf, 1) != 1 || in pcf2127_get_datetime()
54 i2c_master_recv(client, buf, sizeof(buf)) != sizeof(buf)) { in pcf2127_get_datetime()
59 if (buf[PCF2127_REG_CTRL3] & 0x04) { in pcf2127_get_datetime()
70 buf[0], buf[1], buf[2], in pcf2127_get_datetime()
71 buf[3], buf[4], buf[5], in pcf2127_get_datetime()
72 buf[6], buf[7], buf[8], buf[9]); in pcf2127_get_datetime()
75 tm->tm_sec = bcd2bin(buf[PCF2127_REG_SC] & 0x7F); in pcf2127_get_datetime()
76 tm->tm_min = bcd2bin(buf[PCF2127_REG_MN] & 0x7F); in pcf2127_get_datetime()
77 tm->tm_hour = bcd2bin(buf[PCF2127_REG_HR] & 0x3F); /* rtc hr 0-23 */ in pcf2127_get_datetime()
78 tm->tm_mday = bcd2bin(buf[PCF2127_REG_DM] & 0x3F); in pcf2127_get_datetime()
79 tm->tm_wday = buf[PCF2127_REG_DW] & 0x07; in pcf2127_get_datetime()
80 tm->tm_mon = bcd2bin(buf[PCF2127_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ in pcf2127_get_datetime()
81 tm->tm_year = bcd2bin(buf[PCF2127_REG_YR]); in pcf2127_get_datetime()
102 unsigned char buf[8]; in pcf2127_set_datetime() local
112 buf[i++] = PCF2127_REG_SC; in pcf2127_set_datetime()
115 buf[i++] = bin2bcd(tm->tm_sec); in pcf2127_set_datetime()
116 buf[i++] = bin2bcd(tm->tm_min); in pcf2127_set_datetime()
117 buf[i++] = bin2bcd(tm->tm_hour); in pcf2127_set_datetime()
118 buf[i++] = bin2bcd(tm->tm_mday); in pcf2127_set_datetime()
119 buf[i++] = tm->tm_wday & 0x07; in pcf2127_set_datetime()
122 buf[i++] = bin2bcd(tm->tm_mon + 1); in pcf2127_set_datetime()
125 buf[i++] = bin2bcd(tm->tm_year % 100); in pcf2127_set_datetime()
128 err = i2c_master_send(client, buf, i); in pcf2127_set_datetime()