Lines Matching defs:data
107 * @data: holds the encoding in rx6110 native form
109 static int rx6110_rtc_tm_to_data(struct rtc_time *tm, u8 *data)
121 data[RTC_SEC] = bin2bcd(tm->tm_sec);
122 data[RTC_MIN] = bin2bcd(tm->tm_min);
123 data[RTC_HOUR] = bin2bcd(tm->tm_hour);
124 data[RTC_WDAY] = BIT(bin2bcd(tm->tm_wday));
125 data[RTC_MDAY] = bin2bcd(tm->tm_mday);
126 data[RTC_MONTH] = bin2bcd(tm->tm_mon + 1);
127 data[RTC_YEAR] = bin2bcd(tm->tm_year % 100);
135 * @data: holds the encoding in rx6110 native form
138 static int rx6110_data_to_rtc_tm(u8 *data, struct rtc_time *tm)
140 tm->tm_sec = bcd2bin(data[RTC_SEC] & 0x7f);
141 tm->tm_min = bcd2bin(data[RTC_MIN] & 0x7f);
143 tm->tm_hour = bcd2bin(data[RTC_HOUR] & 0x3f);
144 tm->tm_wday = ffs(data[RTC_WDAY] & 0x7f);
145 tm->tm_mday = bcd2bin(data[RTC_MDAY] & 0x3f);
146 tm->tm_mon = bcd2bin(data[RTC_MONTH] & 0x1f) - 1;
147 tm->tm_year = bcd2bin(data[RTC_YEAR]) + 100;
178 u8 data[RTC_NR_TIME];
181 ret = rx6110_rtc_tm_to_data(tm, data);
191 ret = regmap_bulk_write(rx6110->regmap, RX6110_REG_SEC, data,
217 u8 data[RTC_NR_TIME];
227 dev_warn(dev, "Voltage low, data is invalid.\n");
232 ret = regmap_bulk_read(rx6110->regmap, RX6110_REG_SEC, data,
237 ret = rx6110_data_to_rtc_tm(data, tm);
284 dev_warn(&rtc->dev, "Voltage low, data loss detected.\n");