Lines Matching refs:buf
38 u8 buf[8]; /* write cmd + 7 registers */ in rtc_set() local
50 buf[0] = 0x80 | M41T94_REG_SECONDS; /* write time + date */ in rtc_set()
51 buf[M41T94_REG_SECONDS] = bin2bcd(tm->tm_sec); in rtc_set()
52 buf[M41T94_REG_MINUTES] = bin2bcd(tm->tm_min); in rtc_set()
53 buf[M41T94_REG_HOURS] = bin2bcd(tm->tm_hour); in rtc_set()
54 buf[M41T94_REG_WDAY] = bin2bcd(tm->tm_wday + 1); in rtc_set()
55 buf[M41T94_REG_DAY] = bin2bcd(tm->tm_mday); in rtc_set()
56 buf[M41T94_REG_MONTH] = bin2bcd(tm->tm_mon + 1); in rtc_set()
58 buf[M41T94_REG_HOURS] |= M41T94_BIT_CEB; in rtc_set()
60 buf[M41T94_REG_HOURS] |= M41T94_BIT_CB; in rtc_set()
61 buf[M41T94_REG_YEAR] = bin2bcd(tm->tm_year % 100); in rtc_set()
63 ret = spi_xfer(slave, 64, buf, NULL, SPI_XFER_BEGIN | SPI_XFER_END); in rtc_set()
70 u8 buf[2]; in rtc_get() local
87 buf[0] = 0x80 | M41T94_REG_HT; in rtc_get()
88 buf[1] = ret & ~M41T94_BIT_HALT; in rtc_get()
89 spi_xfer(slave, 16, buf, NULL, SPI_XFER_BEGIN | SPI_XFER_END); in rtc_get()
97 buf[0] = 0x80 | M41T94_REG_SECONDS; in rtc_get()
98 buf[1] = ret & ~M41T94_BIT_STOP; in rtc_get()
99 spi_xfer(slave, 16, buf, NULL, SPI_XFER_BEGIN | SPI_XFER_END); in rtc_get()