Lines Matching defs:data
106 * @data: holds the encoding in rx6110 native form
108 static int rx6110_rtc_tm_to_data(struct rtc_time *tm, u8 *data)
120 data[RTC_SEC] = bin2bcd(tm->tm_sec);
121 data[RTC_MIN] = bin2bcd(tm->tm_min);
122 data[RTC_HOUR] = bin2bcd(tm->tm_hour);
123 data[RTC_WDAY] = BIT(bin2bcd(tm->tm_wday));
124 data[RTC_MDAY] = bin2bcd(tm->tm_mday);
125 data[RTC_MONTH] = bin2bcd(tm->tm_mon + 1);
126 data[RTC_YEAR] = bin2bcd(tm->tm_year % 100);
134 * @data: holds the encoding in rx6110 native form
137 static int rx6110_data_to_rtc_tm(u8 *data, struct rtc_time *tm)
139 tm->tm_sec = bcd2bin(data[RTC_SEC] & 0x7f);
140 tm->tm_min = bcd2bin(data[RTC_MIN] & 0x7f);
142 tm->tm_hour = bcd2bin(data[RTC_HOUR] & 0x3f);
143 tm->tm_wday = ffs(data[RTC_WDAY] & 0x7f);
144 tm->tm_mday = bcd2bin(data[RTC_MDAY] & 0x3f);
145 tm->tm_mon = bcd2bin(data[RTC_MONTH] & 0x1f) - 1;
146 tm->tm_year = bcd2bin(data[RTC_YEAR]) + 100;
177 u8 data[RTC_NR_TIME];
180 ret = rx6110_rtc_tm_to_data(tm, data);
190 ret = regmap_bulk_write(rx6110->regmap, RX6110_REG_SEC, data,
216 u8 data[RTC_NR_TIME];
226 dev_warn(dev, "Voltage low, data is invalid.\n");
231 ret = regmap_bulk_read(rx6110->regmap, RX6110_REG_SEC, data,
236 ret = rx6110_data_to_rtc_tm(data, tm);
283 dev_warn(&rtc->dev, "Voltage low, data loss detected.\n");