Lines Matching refs:buf
64 u8 buf; in ds3232_rtc_read8() local
74 ret = dm_i2c_read(dev, reg, &buf, sizeof(buf)); in ds3232_rtc_read8()
78 return buf; in ds3232_rtc_read8()
83 u8 buf = (u8)val; in ds3232_rtc_write8() local
93 return dm_i2c_write(dev, reg, &buf, sizeof(buf)); in ds3232_rtc_write8()
143 u8 buf[RTC_DATE_TIME_REG_SIZE]; in ds3232_rtc_set() local
151 buf[RTC_SEC_REG_ADDR] = bin2bcd(tm->tm_sec); in ds3232_rtc_set()
152 buf[RTC_MIN_REG_ADDR] = bin2bcd(tm->tm_min); in ds3232_rtc_set()
153 buf[RTC_HR_REG_ADDR] = bin2bcd(tm->tm_hour); in ds3232_rtc_set()
154 buf[RTC_DAY_REG_ADDR] = bin2bcd(tm->tm_wday + 1); in ds3232_rtc_set()
155 buf[RTC_DATE_REG_ADDR] = bin2bcd(tm->tm_mday); in ds3232_rtc_set()
156 buf[RTC_MON_REG_ADDR] = bin2bcd(tm->tm_mon) | is_century; in ds3232_rtc_set()
157 buf[RTC_YR_REG_ADDR] = bin2bcd(tm->tm_year % 100); in ds3232_rtc_set()
159 return dm_i2c_write(dev, 0, buf, sizeof(buf)); in ds3232_rtc_set()
165 u8 buf[RTC_DATE_TIME_REG_SIZE]; in ds3232_rtc_get() local
174 ret = dm_i2c_read(dev, 0, buf, sizeof(buf)); in ds3232_rtc_get()
179 is_twelve_hr = buf[RTC_HR_REG_ADDR] & 0x40; in ds3232_rtc_get()
180 is_pm = buf[RTC_HR_REG_ADDR] & 0x20; in ds3232_rtc_get()
181 is_century = buf[RTC_MON_REG_ADDR] & 0x80; in ds3232_rtc_get()
183 tm->tm_sec = bcd2bin(buf[RTC_SEC_REG_ADDR] & 0x7F); in ds3232_rtc_get()
184 tm->tm_min = bcd2bin(buf[RTC_MIN_REG_ADDR] & 0x7F); in ds3232_rtc_get()
187 tm->tm_hour = bcd2bin(buf[RTC_HR_REG_ADDR] & 0x1F) in ds3232_rtc_get()
190 tm->tm_hour = bcd2bin(buf[RTC_HR_REG_ADDR]); in ds3232_rtc_get()
192 tm->tm_wday = bcd2bin((buf[RTC_DAY_REG_ADDR] & 0x07) - 1); in ds3232_rtc_get()
193 tm->tm_mday = bcd2bin(buf[RTC_DATE_REG_ADDR] & 0x3F); in ds3232_rtc_get()
194 tm->tm_mon = bcd2bin((buf[RTC_MON_REG_ADDR] & 0x7F)); in ds3232_rtc_get()
195 tm->tm_year = bcd2bin(buf[RTC_YR_REG_ADDR]) in ds3232_rtc_get()