Lines Matching defs:txrx_buf
50 u8 txrx_buf[9]; /* cmd + 8 registers */
77 chip->txrx_buf[0] = address & 0x7f;
79 status = spi_write_then_read(spi, chip->txrx_buf, 1, chip->txrx_buf, 1);
83 *data = chip->txrx_buf[0];
134 chip->txrx_buf[0] = DS1390_REG_SECONDS;
137 status = spi_write_then_read(spi, chip->txrx_buf, 1, chip->txrx_buf, 8);
143 dt->tm_sec = bcd2bin(chip->txrx_buf[0]);
144 dt->tm_min = bcd2bin(chip->txrx_buf[1]);
145 dt->tm_hour = bcd2bin(chip->txrx_buf[2]);
146 dt->tm_wday = bcd2bin(chip->txrx_buf[3]);
147 dt->tm_mday = bcd2bin(chip->txrx_buf[4]);
149 dt->tm_mon = bcd2bin(chip->txrx_buf[5] & 0x7f) - 1;
151 dt->tm_year = bcd2bin(chip->txrx_buf[6]) + ((chip->txrx_buf[5] & 0x80) ? 100 : 0);
162 chip->txrx_buf[0] = DS1390_REG_SECONDS | 0x80;
163 chip->txrx_buf[1] = bin2bcd(dt->tm_sec);
164 chip->txrx_buf[2] = bin2bcd(dt->tm_min);
165 chip->txrx_buf[3] = bin2bcd(dt->tm_hour);
166 chip->txrx_buf[4] = bin2bcd(dt->tm_wday);
167 chip->txrx_buf[5] = bin2bcd(dt->tm_mday);
168 chip->txrx_buf[6] = bin2bcd(dt->tm_mon + 1) |
170 chip->txrx_buf[7] = bin2bcd(dt->tm_year % 100);
173 return spi_write_then_read(spi, chip->txrx_buf, 8, NULL, 0);