Thomas Gleixner | d2912cb | 2019-06-04 10:11:33 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0-only |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Driver for Epson's RTC module RX-8025 SA/NB |
| 4 | * |
| 5 | * Copyright (C) 2009 Wolfgang Grandegger <wg@grandegger.com> |
| 6 | * |
| 7 | * Copyright (C) 2005 by Digi International Inc. |
| 8 | * All rights reserved. |
| 9 | * |
| 10 | * Modified by fengjh at rising.com.cn |
Leslie Lau | d00cd81 | 2016-01-28 21:17:22 -0800 | [diff] [blame] | 11 | * <lm-sensors@lm-sensors.org> |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 12 | * 2006.11 |
| 13 | * |
| 14 | * Code cleanup by Sergei Poselenov, <sposelenov@emcraft.com> |
| 15 | * Converted to new style by Wolfgang Grandegger <wg@grandegger.com> |
| 16 | * Alarm and periodic interrupt added by Dmitry Rakhchev <rda@emcraft.com> |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 17 | */ |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 18 | #include <linux/bcd.h> |
Alexandre Belloni | 2ddd186 | 2015-07-25 11:50:22 +0200 | [diff] [blame] | 19 | #include <linux/bitops.h> |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 20 | #include <linux/i2c.h> |
Alexandre Belloni | 15d3bdc | 2015-07-24 15:50:23 +0200 | [diff] [blame] | 21 | #include <linux/kernel.h> |
| 22 | #include <linux/module.h> |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 23 | #include <linux/rtc.h> |
| 24 | |
| 25 | /* Register definitions */ |
| 26 | #define RX8025_REG_SEC 0x00 |
| 27 | #define RX8025_REG_MIN 0x01 |
| 28 | #define RX8025_REG_HOUR 0x02 |
| 29 | #define RX8025_REG_WDAY 0x03 |
| 30 | #define RX8025_REG_MDAY 0x04 |
| 31 | #define RX8025_REG_MONTH 0x05 |
| 32 | #define RX8025_REG_YEAR 0x06 |
| 33 | #define RX8025_REG_DIGOFF 0x07 |
| 34 | #define RX8025_REG_ALWMIN 0x08 |
| 35 | #define RX8025_REG_ALWHOUR 0x09 |
| 36 | #define RX8025_REG_ALWWDAY 0x0a |
| 37 | #define RX8025_REG_ALDMIN 0x0b |
| 38 | #define RX8025_REG_ALDHOUR 0x0c |
| 39 | /* 0x0d is reserved */ |
| 40 | #define RX8025_REG_CTRL1 0x0e |
| 41 | #define RX8025_REG_CTRL2 0x0f |
| 42 | |
| 43 | #define RX8025_BIT_CTRL1_CT (7 << 0) |
| 44 | /* 1 Hz periodic level irq */ |
| 45 | #define RX8025_BIT_CTRL1_CT_1HZ 4 |
Alexandre Belloni | 2ddd186 | 2015-07-25 11:50:22 +0200 | [diff] [blame] | 46 | #define RX8025_BIT_CTRL1_TEST BIT(3) |
| 47 | #define RX8025_BIT_CTRL1_1224 BIT(5) |
| 48 | #define RX8025_BIT_CTRL1_DALE BIT(6) |
| 49 | #define RX8025_BIT_CTRL1_WALE BIT(7) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 50 | |
Alexandre Belloni | 2ddd186 | 2015-07-25 11:50:22 +0200 | [diff] [blame] | 51 | #define RX8025_BIT_CTRL2_DAFG BIT(0) |
| 52 | #define RX8025_BIT_CTRL2_WAFG BIT(1) |
| 53 | #define RX8025_BIT_CTRL2_CTFG BIT(2) |
| 54 | #define RX8025_BIT_CTRL2_PON BIT(4) |
| 55 | #define RX8025_BIT_CTRL2_XST BIT(5) |
| 56 | #define RX8025_BIT_CTRL2_VDET BIT(6) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 57 | |
| 58 | /* Clock precision adjustment */ |
| 59 | #define RX8025_ADJ_RESOLUTION 3050 /* in ppb */ |
| 60 | #define RX8025_ADJ_DATA_MAX 62 |
| 61 | #define RX8025_ADJ_DATA_MIN -62 |
| 62 | |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 63 | enum rx_model { |
| 64 | model_rx_unknown, |
| 65 | model_rx_8025, |
| 66 | model_rx_8035, |
| 67 | model_last |
| 68 | }; |
| 69 | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 70 | static const struct i2c_device_id rx8025_id[] = { |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 71 | { "rx8025", model_rx_8025 }, |
| 72 | { "rx8035", model_rx_8035 }, |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 73 | { } |
| 74 | }; |
| 75 | MODULE_DEVICE_TABLE(i2c, rx8025_id); |
| 76 | |
| 77 | struct rx8025_data { |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 78 | struct rtc_device *rtc; |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 79 | enum rx_model model; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 80 | u8 ctrl1; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 81 | }; |
| 82 | |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 83 | static s32 rx8025_read_reg(const struct i2c_client *client, u8 number) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 84 | { |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 85 | return i2c_smbus_read_byte_data(client, number << 4); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 86 | } |
| 87 | |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 88 | static int rx8025_read_regs(const struct i2c_client *client, |
| 89 | u8 number, u8 length, u8 *values) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 90 | { |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 91 | int ret = i2c_smbus_read_i2c_block_data(client, number << 4, length, |
| 92 | values); |
| 93 | if (ret != length) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 94 | return ret < 0 ? ret : -EIO; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 95 | |
| 96 | return 0; |
| 97 | } |
| 98 | |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 99 | static s32 rx8025_write_reg(const struct i2c_client *client, u8 number, |
| 100 | u8 value) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 101 | { |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 102 | return i2c_smbus_write_byte_data(client, number << 4, value); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 103 | } |
| 104 | |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 105 | static s32 rx8025_write_regs(const struct i2c_client *client, |
| 106 | u8 number, u8 length, const u8 *values) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 107 | { |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 108 | return i2c_smbus_write_i2c_block_data(client, number << 4, |
| 109 | length, values); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 110 | } |
| 111 | |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 112 | static int rx8025_is_osc_stopped(enum rx_model model, int ctrl2) |
| 113 | { |
| 114 | int xstp = ctrl2 & RX8025_BIT_CTRL2_XST; |
| 115 | /* XSTP bit has different polarity on RX-8025 vs RX-8035. |
| 116 | * RX-8025: 0 == oscillator stopped |
| 117 | * RX-8035: 1 == oscillator stopped |
| 118 | */ |
| 119 | |
| 120 | if (model == model_rx_8025) |
| 121 | xstp = !xstp; |
| 122 | |
| 123 | return xstp; |
| 124 | } |
| 125 | |
Alexandre Belloni | efbbb4f | 2015-08-04 11:33:59 +0200 | [diff] [blame] | 126 | static int rx8025_check_validity(struct device *dev) |
| 127 | { |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 128 | struct i2c_client *client = to_i2c_client(dev); |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 129 | struct rx8025_data *drvdata = dev_get_drvdata(dev); |
Alexandre Belloni | efbbb4f | 2015-08-04 11:33:59 +0200 | [diff] [blame] | 130 | int ctrl2; |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 131 | int xstp; |
Alexandre Belloni | efbbb4f | 2015-08-04 11:33:59 +0200 | [diff] [blame] | 132 | |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 133 | ctrl2 = rx8025_read_reg(client, RX8025_REG_CTRL2); |
Alexandre Belloni | efbbb4f | 2015-08-04 11:33:59 +0200 | [diff] [blame] | 134 | if (ctrl2 < 0) |
| 135 | return ctrl2; |
| 136 | |
| 137 | if (ctrl2 & RX8025_BIT_CTRL2_VDET) |
| 138 | dev_warn(dev, "power voltage drop detected\n"); |
| 139 | |
| 140 | if (ctrl2 & RX8025_BIT_CTRL2_PON) { |
| 141 | dev_warn(dev, "power-on reset detected, date is invalid\n"); |
| 142 | return -EINVAL; |
| 143 | } |
| 144 | |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 145 | xstp = rx8025_is_osc_stopped(drvdata->model, ctrl2); |
| 146 | if (xstp) { |
Alexandre Belloni | efbbb4f | 2015-08-04 11:33:59 +0200 | [diff] [blame] | 147 | dev_warn(dev, "crystal stopped, date is invalid\n"); |
| 148 | return -EINVAL; |
| 149 | } |
| 150 | |
| 151 | return 0; |
| 152 | } |
| 153 | |
Alexandre Belloni | 8c4a446 | 2015-08-04 10:48:20 +0200 | [diff] [blame] | 154 | static int rx8025_reset_validity(struct i2c_client *client) |
| 155 | { |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 156 | struct rx8025_data *drvdata = i2c_get_clientdata(client); |
Alexandre Belloni | 8c4a446 | 2015-08-04 10:48:20 +0200 | [diff] [blame] | 157 | int ctrl2 = rx8025_read_reg(client, RX8025_REG_CTRL2); |
| 158 | |
| 159 | if (ctrl2 < 0) |
| 160 | return ctrl2; |
| 161 | |
| 162 | ctrl2 &= ~(RX8025_BIT_CTRL2_PON | RX8025_BIT_CTRL2_VDET); |
| 163 | |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 164 | if (drvdata->model == model_rx_8025) |
| 165 | ctrl2 |= RX8025_BIT_CTRL2_XST; |
| 166 | else |
| 167 | ctrl2 &= ~(RX8025_BIT_CTRL2_XST); |
| 168 | |
Alexandre Belloni | 8c4a446 | 2015-08-04 10:48:20 +0200 | [diff] [blame] | 169 | return rx8025_write_reg(client, RX8025_REG_CTRL2, |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 170 | ctrl2); |
Alexandre Belloni | 8c4a446 | 2015-08-04 10:48:20 +0200 | [diff] [blame] | 171 | } |
| 172 | |
Alexandre Belloni | b6a57c9 | 2015-07-24 15:59:43 +0200 | [diff] [blame] | 173 | static irqreturn_t rx8025_handle_irq(int irq, void *dev_id) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 174 | { |
| 175 | struct i2c_client *client = dev_id; |
| 176 | struct rx8025_data *rx8025 = i2c_get_clientdata(client); |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 177 | int status, xstp; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 178 | |
Alexandre Belloni | 3124754 | 2021-01-19 23:06:51 +0100 | [diff] [blame] | 179 | rtc_lock(rx8025->rtc); |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 180 | status = rx8025_read_reg(client, RX8025_REG_CTRL2); |
| 181 | if (status < 0) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 182 | goto out; |
| 183 | |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 184 | xstp = rx8025_is_osc_stopped(rx8025->model, status); |
| 185 | if (xstp) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 186 | dev_warn(&client->dev, "Oscillation stop was detected," |
| 187 | "you may have to readjust the clock\n"); |
| 188 | |
| 189 | if (status & RX8025_BIT_CTRL2_CTFG) { |
| 190 | /* periodic */ |
| 191 | status &= ~RX8025_BIT_CTRL2_CTFG; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 192 | rtc_update_irq(rx8025->rtc, 1, RTC_PF | RTC_IRQF); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | if (status & RX8025_BIT_CTRL2_DAFG) { |
| 196 | /* alarm */ |
| 197 | status &= RX8025_BIT_CTRL2_DAFG; |
| 198 | if (rx8025_write_reg(client, RX8025_REG_CTRL1, |
| 199 | rx8025->ctrl1 & ~RX8025_BIT_CTRL1_DALE)) |
| 200 | goto out; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 201 | rtc_update_irq(rx8025->rtc, 1, RTC_AF | RTC_IRQF); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 202 | } |
| 203 | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 204 | out: |
Alexandre Belloni | 3124754 | 2021-01-19 23:06:51 +0100 | [diff] [blame] | 205 | rtc_unlock(rx8025->rtc); |
Akinobu Mita | 9dbe385 | 2016-02-15 23:49:07 +0900 | [diff] [blame] | 206 | |
Alexandre Belloni | b6a57c9 | 2015-07-24 15:59:43 +0200 | [diff] [blame] | 207 | return IRQ_HANDLED; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 208 | } |
| 209 | |
| 210 | static int rx8025_get_time(struct device *dev, struct rtc_time *dt) |
| 211 | { |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 212 | struct i2c_client *client = to_i2c_client(dev); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 213 | struct rx8025_data *rx8025 = dev_get_drvdata(dev); |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 214 | u8 date[7]; |
Alexandre Belloni | efbbb4f | 2015-08-04 11:33:59 +0200 | [diff] [blame] | 215 | int err; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 216 | |
Alexandre Belloni | efbbb4f | 2015-08-04 11:33:59 +0200 | [diff] [blame] | 217 | err = rx8025_check_validity(dev); |
| 218 | if (err) |
| 219 | return err; |
Alexandre Belloni | 6f0a8cf | 2015-07-26 10:13:31 +0200 | [diff] [blame] | 220 | |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 221 | err = rx8025_read_regs(client, RX8025_REG_SEC, 7, date); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 222 | if (err) |
| 223 | return err; |
| 224 | |
Andy Shevchenko | 1921cab | 2018-12-04 23:23:24 +0200 | [diff] [blame] | 225 | dev_dbg(dev, "%s: read %7ph\n", __func__, date); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 226 | |
| 227 | dt->tm_sec = bcd2bin(date[RX8025_REG_SEC] & 0x7f); |
| 228 | dt->tm_min = bcd2bin(date[RX8025_REG_MIN] & 0x7f); |
| 229 | if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) |
| 230 | dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x3f); |
| 231 | else |
| 232 | dt->tm_hour = bcd2bin(date[RX8025_REG_HOUR] & 0x1f) % 12 |
| 233 | + (date[RX8025_REG_HOUR] & 0x20 ? 12 : 0); |
| 234 | |
| 235 | dt->tm_mday = bcd2bin(date[RX8025_REG_MDAY] & 0x3f); |
| 236 | dt->tm_mon = bcd2bin(date[RX8025_REG_MONTH] & 0x1f) - 1; |
Alexandre Belloni | 32672c5 | 2015-07-25 12:07:37 +0200 | [diff] [blame] | 237 | dt->tm_year = bcd2bin(date[RX8025_REG_YEAR]) + 100; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 238 | |
Andy Shevchenko | 1921cab | 2018-12-04 23:23:24 +0200 | [diff] [blame] | 239 | dev_dbg(dev, "%s: date %ptRr\n", __func__, dt); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 240 | |
Alexandre Belloni | 22652ba | 2018-02-19 16:23:56 +0100 | [diff] [blame] | 241 | return 0; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 242 | } |
| 243 | |
| 244 | static int rx8025_set_time(struct device *dev, struct rtc_time *dt) |
| 245 | { |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 246 | struct i2c_client *client = to_i2c_client(dev); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 247 | struct rx8025_data *rx8025 = dev_get_drvdata(dev); |
| 248 | u8 date[7]; |
Alexandre Belloni | 8c4a446 | 2015-08-04 10:48:20 +0200 | [diff] [blame] | 249 | int ret; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 250 | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 251 | /* |
| 252 | * Here the read-only bits are written as "0". I'm not sure if that |
| 253 | * is sound. |
| 254 | */ |
| 255 | date[RX8025_REG_SEC] = bin2bcd(dt->tm_sec); |
| 256 | date[RX8025_REG_MIN] = bin2bcd(dt->tm_min); |
| 257 | if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) |
| 258 | date[RX8025_REG_HOUR] = bin2bcd(dt->tm_hour); |
| 259 | else |
| 260 | date[RX8025_REG_HOUR] = (dt->tm_hour >= 12 ? 0x20 : 0) |
| 261 | | bin2bcd((dt->tm_hour + 11) % 12 + 1); |
| 262 | |
| 263 | date[RX8025_REG_WDAY] = bin2bcd(dt->tm_wday); |
| 264 | date[RX8025_REG_MDAY] = bin2bcd(dt->tm_mday); |
| 265 | date[RX8025_REG_MONTH] = bin2bcd(dt->tm_mon + 1); |
Alexandre Belloni | 32672c5 | 2015-07-25 12:07:37 +0200 | [diff] [blame] | 266 | date[RX8025_REG_YEAR] = bin2bcd(dt->tm_year - 100); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 267 | |
Andy Shevchenko | 1921cab | 2018-12-04 23:23:24 +0200 | [diff] [blame] | 268 | dev_dbg(dev, "%s: write %7ph\n", __func__, date); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 269 | |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 270 | ret = rx8025_write_regs(client, RX8025_REG_SEC, 7, date); |
Alexandre Belloni | 8c4a446 | 2015-08-04 10:48:20 +0200 | [diff] [blame] | 271 | if (ret < 0) |
| 272 | return ret; |
| 273 | |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 274 | return rx8025_reset_validity(client); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 275 | } |
| 276 | |
Alexandre Belloni | 6f0a8cf | 2015-07-26 10:13:31 +0200 | [diff] [blame] | 277 | static int rx8025_init_client(struct i2c_client *client) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 278 | { |
| 279 | struct rx8025_data *rx8025 = i2c_get_clientdata(client); |
| 280 | u8 ctrl[2], ctrl2; |
| 281 | int need_clear = 0; |
| 282 | int err; |
| 283 | |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 284 | err = rx8025_read_regs(client, RX8025_REG_CTRL1, 2, ctrl); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 285 | if (err) |
| 286 | goto out; |
| 287 | |
| 288 | /* Keep test bit zero ! */ |
| 289 | rx8025->ctrl1 = ctrl[0] & ~RX8025_BIT_CTRL1_TEST; |
| 290 | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 291 | if (ctrl[1] & (RX8025_BIT_CTRL2_DAFG | RX8025_BIT_CTRL2_WAFG)) { |
| 292 | dev_warn(&client->dev, "Alarm was detected\n"); |
| 293 | need_clear = 1; |
| 294 | } |
| 295 | |
Alexandre Belloni | 5c66e1e | 2015-08-04 11:24:33 +0200 | [diff] [blame] | 296 | if (ctrl[1] & RX8025_BIT_CTRL2_CTFG) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 297 | need_clear = 1; |
| 298 | |
Alexandre Belloni | 6f0a8cf | 2015-07-26 10:13:31 +0200 | [diff] [blame] | 299 | if (need_clear) { |
Alexandre Belloni | a27c7bf | 2015-08-04 10:46:22 +0200 | [diff] [blame] | 300 | ctrl2 = ctrl[1]; |
Alexandre Belloni | 8c4a446 | 2015-08-04 10:48:20 +0200 | [diff] [blame] | 301 | ctrl2 &= ~(RX8025_BIT_CTRL2_CTFG | RX8025_BIT_CTRL2_WAFG | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 302 | RX8025_BIT_CTRL2_DAFG); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 303 | |
| 304 | err = rx8025_write_reg(client, RX8025_REG_CTRL2, ctrl2); |
| 305 | } |
| 306 | out: |
| 307 | return err; |
| 308 | } |
| 309 | |
| 310 | /* Alarm support */ |
| 311 | static int rx8025_read_alarm(struct device *dev, struct rtc_wkalrm *t) |
| 312 | { |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 313 | struct i2c_client *client = to_i2c_client(dev); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 314 | struct rx8025_data *rx8025 = dev_get_drvdata(dev); |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 315 | u8 ald[2]; |
| 316 | int ctrl2, err; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 317 | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 318 | err = rx8025_read_regs(client, RX8025_REG_ALDMIN, 2, ald); |
| 319 | if (err) |
| 320 | return err; |
| 321 | |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 322 | ctrl2 = rx8025_read_reg(client, RX8025_REG_CTRL2); |
| 323 | if (ctrl2 < 0) |
| 324 | return ctrl2; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 325 | |
| 326 | dev_dbg(dev, "%s: read alarm 0x%02x 0x%02x ctrl2 %02x\n", |
| 327 | __func__, ald[0], ald[1], ctrl2); |
| 328 | |
| 329 | /* Hardware alarms precision is 1 minute! */ |
| 330 | t->time.tm_sec = 0; |
| 331 | t->time.tm_min = bcd2bin(ald[0] & 0x7f); |
| 332 | if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) |
| 333 | t->time.tm_hour = bcd2bin(ald[1] & 0x3f); |
| 334 | else |
| 335 | t->time.tm_hour = bcd2bin(ald[1] & 0x1f) % 12 |
| 336 | + (ald[1] & 0x20 ? 12 : 0); |
| 337 | |
Andy Shevchenko | 862cac1 | 2019-04-10 17:05:59 +0300 | [diff] [blame] | 338 | dev_dbg(dev, "%s: date: %ptRr\n", __func__, &t->time); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 339 | t->enabled = !!(rx8025->ctrl1 & RX8025_BIT_CTRL1_DALE); |
| 340 | t->pending = (ctrl2 & RX8025_BIT_CTRL2_DAFG) && t->enabled; |
| 341 | |
| 342 | return err; |
| 343 | } |
| 344 | |
| 345 | static int rx8025_set_alarm(struct device *dev, struct rtc_wkalrm *t) |
| 346 | { |
| 347 | struct i2c_client *client = to_i2c_client(dev); |
| 348 | struct rx8025_data *rx8025 = dev_get_drvdata(dev); |
| 349 | u8 ald[2]; |
| 350 | int err; |
| 351 | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 352 | ald[0] = bin2bcd(t->time.tm_min); |
| 353 | if (rx8025->ctrl1 & RX8025_BIT_CTRL1_1224) |
| 354 | ald[1] = bin2bcd(t->time.tm_hour); |
| 355 | else |
| 356 | ald[1] = (t->time.tm_hour >= 12 ? 0x20 : 0) |
| 357 | | bin2bcd((t->time.tm_hour + 11) % 12 + 1); |
| 358 | |
| 359 | dev_dbg(dev, "%s: write 0x%02x 0x%02x\n", __func__, ald[0], ald[1]); |
| 360 | |
| 361 | if (rx8025->ctrl1 & RX8025_BIT_CTRL1_DALE) { |
| 362 | rx8025->ctrl1 &= ~RX8025_BIT_CTRL1_DALE; |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 363 | err = rx8025_write_reg(client, RX8025_REG_CTRL1, |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 364 | rx8025->ctrl1); |
| 365 | if (err) |
| 366 | return err; |
| 367 | } |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 368 | err = rx8025_write_regs(client, RX8025_REG_ALDMIN, 2, ald); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 369 | if (err) |
| 370 | return err; |
| 371 | |
| 372 | if (t->enabled) { |
| 373 | rx8025->ctrl1 |= RX8025_BIT_CTRL1_DALE; |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 374 | err = rx8025_write_reg(client, RX8025_REG_CTRL1, |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 375 | rx8025->ctrl1); |
| 376 | if (err) |
| 377 | return err; |
| 378 | } |
| 379 | |
| 380 | return 0; |
| 381 | } |
| 382 | |
| 383 | static int rx8025_alarm_irq_enable(struct device *dev, unsigned int enabled) |
| 384 | { |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 385 | struct i2c_client *client = to_i2c_client(dev); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 386 | struct rx8025_data *rx8025 = dev_get_drvdata(dev); |
| 387 | u8 ctrl1; |
| 388 | int err; |
| 389 | |
| 390 | ctrl1 = rx8025->ctrl1; |
| 391 | if (enabled) |
| 392 | ctrl1 |= RX8025_BIT_CTRL1_DALE; |
| 393 | else |
| 394 | ctrl1 &= ~RX8025_BIT_CTRL1_DALE; |
| 395 | |
| 396 | if (ctrl1 != rx8025->ctrl1) { |
| 397 | rx8025->ctrl1 = ctrl1; |
Nobuhiro Iwamatsu | 47a3c04 | 2019-12-18 17:16:24 +0900 | [diff] [blame] | 398 | err = rx8025_write_reg(client, RX8025_REG_CTRL1, |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 399 | rx8025->ctrl1); |
| 400 | if (err) |
| 401 | return err; |
| 402 | } |
| 403 | return 0; |
| 404 | } |
| 405 | |
Julia Lawall | 34c7b3a | 2016-08-31 10:05:25 +0200 | [diff] [blame] | 406 | static const struct rtc_class_ops rx8025_rtc_ops = { |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 407 | .read_time = rx8025_get_time, |
| 408 | .set_time = rx8025_set_time, |
| 409 | .read_alarm = rx8025_read_alarm, |
| 410 | .set_alarm = rx8025_set_alarm, |
| 411 | .alarm_irq_enable = rx8025_alarm_irq_enable, |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 412 | }; |
| 413 | |
| 414 | /* |
| 415 | * Clock precision adjustment support |
| 416 | * |
| 417 | * According to the RX8025 SA/NB application manual the frequency and |
Thomas Weber | b770ffd | 2010-07-19 08:22:43 +0200 | [diff] [blame] | 418 | * temperature characteristics can be approximated using the following |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 419 | * equation: |
| 420 | * |
| 421 | * df = a * (ut - t)**2 |
| 422 | * |
| 423 | * df: Frequency deviation in any temperature |
| 424 | * a : Coefficient = (-35 +-5) * 10**-9 |
| 425 | * ut: Ultimate temperature in degree = +25 +-5 degree |
| 426 | * t : Any temperature in degree |
| 427 | * |
| 428 | * Note that the clock adjustment in ppb must be entered (which is |
| 429 | * the negative value of the deviation). |
| 430 | */ |
| 431 | static int rx8025_get_clock_adjust(struct device *dev, int *adj) |
| 432 | { |
| 433 | struct i2c_client *client = to_i2c_client(dev); |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 434 | int digoff; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 435 | |
Alexandre Belloni | fd9061f | 2015-08-04 00:40:25 +0200 | [diff] [blame] | 436 | digoff = rx8025_read_reg(client, RX8025_REG_DIGOFF); |
| 437 | if (digoff < 0) |
| 438 | return digoff; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 439 | |
| 440 | *adj = digoff >= 64 ? digoff - 128 : digoff; |
| 441 | if (*adj > 0) |
| 442 | (*adj)--; |
| 443 | *adj *= -RX8025_ADJ_RESOLUTION; |
| 444 | |
| 445 | return 0; |
| 446 | } |
| 447 | |
| 448 | static int rx8025_set_clock_adjust(struct device *dev, int adj) |
| 449 | { |
| 450 | struct i2c_client *client = to_i2c_client(dev); |
| 451 | u8 digoff; |
| 452 | int err; |
| 453 | |
| 454 | adj /= -RX8025_ADJ_RESOLUTION; |
| 455 | if (adj > RX8025_ADJ_DATA_MAX) |
| 456 | adj = RX8025_ADJ_DATA_MAX; |
| 457 | else if (adj < RX8025_ADJ_DATA_MIN) |
| 458 | adj = RX8025_ADJ_DATA_MIN; |
| 459 | else if (adj > 0) |
| 460 | adj++; |
| 461 | else if (adj < 0) |
| 462 | adj += 128; |
| 463 | digoff = adj; |
| 464 | |
| 465 | err = rx8025_write_reg(client, RX8025_REG_DIGOFF, digoff); |
| 466 | if (err) |
| 467 | return err; |
| 468 | |
| 469 | dev_dbg(dev, "%s: write 0x%02x\n", __func__, digoff); |
| 470 | |
| 471 | return 0; |
| 472 | } |
| 473 | |
| 474 | static ssize_t rx8025_sysfs_show_clock_adjust(struct device *dev, |
| 475 | struct device_attribute *attr, |
| 476 | char *buf) |
| 477 | { |
| 478 | int err, adj; |
| 479 | |
| 480 | err = rx8025_get_clock_adjust(dev, &adj); |
| 481 | if (err) |
| 482 | return err; |
| 483 | |
| 484 | return sprintf(buf, "%d\n", adj); |
| 485 | } |
| 486 | |
| 487 | static ssize_t rx8025_sysfs_store_clock_adjust(struct device *dev, |
| 488 | struct device_attribute *attr, |
| 489 | const char *buf, size_t count) |
| 490 | { |
| 491 | int adj, err; |
| 492 | |
| 493 | if (sscanf(buf, "%i", &adj) != 1) |
| 494 | return -EINVAL; |
| 495 | |
| 496 | err = rx8025_set_clock_adjust(dev, adj); |
| 497 | |
| 498 | return err ? err : count; |
| 499 | } |
| 500 | |
| 501 | static DEVICE_ATTR(clock_adjust_ppb, S_IRUGO | S_IWUSR, |
| 502 | rx8025_sysfs_show_clock_adjust, |
| 503 | rx8025_sysfs_store_clock_adjust); |
| 504 | |
| 505 | static int rx8025_sysfs_register(struct device *dev) |
| 506 | { |
| 507 | return device_create_file(dev, &dev_attr_clock_adjust_ppb); |
| 508 | } |
| 509 | |
| 510 | static void rx8025_sysfs_unregister(struct device *dev) |
| 511 | { |
| 512 | device_remove_file(dev, &dev_attr_clock_adjust_ppb); |
| 513 | } |
| 514 | |
Greg Kroah-Hartman | 5a167f4 | 2012-12-21 13:09:38 -0800 | [diff] [blame] | 515 | static int rx8025_probe(struct i2c_client *client, |
| 516 | const struct i2c_device_id *id) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 517 | { |
Wolfram Sang | 110036b | 2019-06-08 12:56:09 +0200 | [diff] [blame] | 518 | struct i2c_adapter *adapter = client->adapter; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 519 | struct rx8025_data *rx8025; |
Alexandre Belloni | 6f0a8cf | 2015-07-26 10:13:31 +0200 | [diff] [blame] | 520 | int err = 0; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 521 | |
| 522 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA |
| 523 | | I2C_FUNC_SMBUS_I2C_BLOCK)) { |
| 524 | dev_err(&adapter->dev, |
| 525 | "doesn't support required functionality\n"); |
Alexandre Belloni | dbcce7c | 2015-07-24 16:12:10 +0200 | [diff] [blame] | 526 | return -EIO; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 527 | } |
| 528 | |
Jingoo Han | fac42b4 | 2013-07-03 15:07:10 -0700 | [diff] [blame] | 529 | rx8025 = devm_kzalloc(&client->dev, sizeof(*rx8025), GFP_KERNEL); |
Alexandre Belloni | b1f9d79 | 2015-09-26 16:25:28 +0200 | [diff] [blame] | 530 | if (!rx8025) |
Alexandre Belloni | dbcce7c | 2015-07-24 16:12:10 +0200 | [diff] [blame] | 531 | return -ENOMEM; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 532 | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 533 | i2c_set_clientdata(client, rx8025); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 534 | |
Mathew McBride | f120e2e | 2021-07-09 04:45:17 +0000 | [diff] [blame] | 535 | if (id) |
| 536 | rx8025->model = id->driver_data; |
| 537 | |
Alexandre Belloni | 6f0a8cf | 2015-07-26 10:13:31 +0200 | [diff] [blame] | 538 | err = rx8025_init_client(client); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 539 | if (err) |
Alexandre Belloni | dbcce7c | 2015-07-24 16:12:10 +0200 | [diff] [blame] | 540 | return err; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 541 | |
Alexandre Belloni | 5e7f635 | 2021-11-07 23:54:52 +0100 | [diff] [blame] | 542 | rx8025->rtc = devm_rtc_allocate_device(&client->dev); |
| 543 | if (IS_ERR(rx8025->rtc)) |
Alexandre Belloni | dbcce7c | 2015-07-24 16:12:10 +0200 | [diff] [blame] | 544 | return PTR_ERR(rx8025->rtc); |
Alexandre Belloni | 5e7f635 | 2021-11-07 23:54:52 +0100 | [diff] [blame] | 545 | |
| 546 | rx8025->rtc->ops = &rx8025_rtc_ops; |
Alexandre Belloni | 1709d7e | 2021-11-07 23:54:54 +0100 | [diff] [blame] | 547 | rx8025->rtc->range_min = RTC_TIMESTAMP_BEGIN_1900; |
| 548 | rx8025->rtc->range_max = RTC_TIMESTAMP_END_2099; |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 549 | |
| 550 | if (client->irq > 0) { |
| 551 | dev_info(&client->dev, "IRQ %d supplied\n", client->irq); |
Alexandre Belloni | f0b63a1 | 2015-07-24 16:07:30 +0200 | [diff] [blame] | 552 | err = devm_request_threaded_irq(&client->dev, client->irq, NULL, |
Akinobu Mita | 0a966c0 | 2016-02-15 23:49:06 +0900 | [diff] [blame] | 553 | rx8025_handle_irq, |
| 554 | IRQF_ONESHOT, |
| 555 | "rx8025", client); |
Alexandre Belloni | 5be3933 | 2021-11-07 23:54:55 +0100 | [diff] [blame^] | 556 | if (err) |
| 557 | clear_bit(RTC_FEATURE_ALARM, rx8025->rtc->features); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 558 | } |
| 559 | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 560 | rx8025->rtc->max_user_freq = 1; |
| 561 | |
Alexandre Belloni | 8670558f | 2021-11-07 23:54:53 +0100 | [diff] [blame] | 562 | set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rx8025->rtc->features); |
| 563 | clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rx8025->rtc->features); |
Akinobu Mita | ef5f4a9 | 2016-02-15 23:49:09 +0900 | [diff] [blame] | 564 | |
Alexandre Belloni | 5e7f635 | 2021-11-07 23:54:52 +0100 | [diff] [blame] | 565 | err = devm_rtc_register_device(rx8025->rtc); |
| 566 | if (err) |
| 567 | return err; |
| 568 | |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 569 | err = rx8025_sysfs_register(&client->dev); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 570 | return err; |
| 571 | } |
| 572 | |
Greg Kroah-Hartman | 5a167f4 | 2012-12-21 13:09:38 -0800 | [diff] [blame] | 573 | static int rx8025_remove(struct i2c_client *client) |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 574 | { |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 575 | rx8025_sysfs_unregister(&client->dev); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 576 | return 0; |
| 577 | } |
| 578 | |
| 579 | static struct i2c_driver rx8025_driver = { |
| 580 | .driver = { |
| 581 | .name = "rtc-rx8025", |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 582 | }, |
| 583 | .probe = rx8025_probe, |
Greg Kroah-Hartman | 5a167f4 | 2012-12-21 13:09:38 -0800 | [diff] [blame] | 584 | .remove = rx8025_remove, |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 585 | .id_table = rx8025_id, |
| 586 | }; |
| 587 | |
Axel Lin | 0abc920 | 2012-03-23 15:02:31 -0700 | [diff] [blame] | 588 | module_i2c_driver(rx8025_driver); |
Wolfgang Grandegger | 3c2b907 | 2009-06-17 16:26:11 -0700 | [diff] [blame] | 589 | |
| 590 | MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>"); |
| 591 | MODULE_DESCRIPTION("RX-8025 SA/NB RTC driver"); |
| 592 | MODULE_LICENSE("GPL"); |