rtc-pcf8563.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * An I2C driver for the Philips PCF8563 RTC
  4. * Copyright 2005-06 Tower Technologies
  5. *
  6. * Author: Alessandro Zummo <a.zummo@towertech.it>
  7. * Maintainers: http://www.nslu2-linux.org/
  8. *
  9. * based on the other drivers in this same directory.
  10. *
  11. * https://www.nxp.com/docs/en/data-sheet/PCF8563.pdf
  12. */
  13. #include <linux/bcd.h>
  14. #include <linux/clk-provider.h>
  15. #include <linux/err.h>
  16. #include <linux/i2c.h>
  17. #include <linux/module.h>
  18. #include <linux/of.h>
  19. #include <linux/regmap.h>
  20. #include <linux/rtc.h>
  21. #include <linux/slab.h>
  22. #define PCF8563_REG_ST1 0x00 /* status */
  23. #define PCF8563_REG_ST2 0x01
  24. #define PCF8563_BIT_AIE BIT(1)
  25. #define PCF8563_BIT_AF BIT(3)
  26. #define PCF8563_BITS_ST2_N (7 << 5)
  27. #define PCF8563_REG_SC 0x02 /* datetime */
  28. #define PCF8563_REG_MN 0x03
  29. #define PCF8563_REG_HR 0x04
  30. #define PCF8563_REG_DM 0x05
  31. #define PCF8563_REG_DW 0x06
  32. #define PCF8563_REG_MO 0x07
  33. #define PCF8563_REG_YR 0x08
  34. #define PCF8563_REG_AMN 0x09 /* alarm */
  35. #define PCF8563_REG_CLKO 0x0D /* clock out */
  36. #define PCF8563_REG_CLKO_FE 0x80 /* clock out enabled */
  37. #define PCF8563_REG_CLKO_F_MASK 0x03 /* frequenc mask */
  38. #define PCF8563_REG_CLKO_F_32768HZ 0x00
  39. #define PCF8563_REG_CLKO_F_1024HZ 0x01
  40. #define PCF8563_REG_CLKO_F_32HZ 0x02
  41. #define PCF8563_REG_CLKO_F_1HZ 0x03
  42. #define PCF8563_REG_TMRC 0x0E /* timer control */
  43. #define PCF8563_TMRC_ENABLE BIT(7)
  44. #define PCF8563_TMRC_4096 0
  45. #define PCF8563_TMRC_64 1
  46. #define PCF8563_TMRC_1 2
  47. #define PCF8563_TMRC_1_60 3
  48. #define PCF8563_TMRC_MASK 3
  49. #define PCF8563_REG_TMR 0x0F /* timer */
  50. #define PCF8563_SC_LV 0x80 /* low voltage */
  51. #define PCF8563_MO_C 0x80 /* century */
  52. static struct i2c_driver pcf8563_driver;
  53. struct pcf8563 {
  54. struct rtc_device *rtc;
  55. /*
  56. * The meaning of MO_C bit varies by the chip type.
  57. * From PCF8563 datasheet: this bit is toggled when the years
  58. * register overflows from 99 to 00
  59. * 0 indicates the century is 20xx
  60. * 1 indicates the century is 19xx
  61. * From RTC8564 datasheet: this bit indicates change of
  62. * century. When the year digit data overflows from 99 to 00,
  63. * this bit is set. By presetting it to 0 while still in the
  64. * 20th century, it will be set in year 2000, ...
  65. * There seems no reliable way to know how the system use this
  66. * bit. So let's do it heuristically, assuming we are live in
  67. * 1970...2069.
  68. */
  69. int c_polarity; /* 0: MO_C=1 means 19xx, otherwise MO_C=1 means 20xx */
  70. struct regmap *regmap;
  71. #ifdef CONFIG_COMMON_CLK
  72. struct clk_hw clkout_hw;
  73. #endif
  74. };
  75. static int pcf8563_set_alarm_mode(struct pcf8563 *pcf8563, bool on)
  76. {
  77. u32 buf;
  78. int err;
  79. err = regmap_read(pcf8563->regmap, PCF8563_REG_ST2, &buf);
  80. if (err < 0)
  81. return err;
  82. if (on)
  83. buf |= PCF8563_BIT_AIE;
  84. else
  85. buf &= ~PCF8563_BIT_AIE;
  86. buf &= ~(PCF8563_BIT_AF | PCF8563_BITS_ST2_N);
  87. return regmap_write(pcf8563->regmap, PCF8563_REG_ST2, buf);
  88. }
  89. static int pcf8563_get_alarm_mode(struct pcf8563 *pcf8563, unsigned char *en,
  90. unsigned char *pen)
  91. {
  92. u32 buf;
  93. int err;
  94. err = regmap_read(pcf8563->regmap, PCF8563_REG_ST2, &buf);
  95. if (err < 0)
  96. return err;
  97. if (en)
  98. *en = !!(buf & PCF8563_BIT_AIE);
  99. if (pen)
  100. *pen = !!(buf & PCF8563_BIT_AF);
  101. return 0;
  102. }
  103. static irqreturn_t pcf8563_irq(int irq, void *dev_id)
  104. {
  105. struct pcf8563 *pcf8563 = dev_id;
  106. char pending;
  107. int err;
  108. err = pcf8563_get_alarm_mode(pcf8563, NULL, &pending);
  109. if (err)
  110. return IRQ_NONE;
  111. if (pending) {
  112. rtc_update_irq(pcf8563->rtc, 1, RTC_IRQF | RTC_AF);
  113. pcf8563_set_alarm_mode(pcf8563, 1);
  114. return IRQ_HANDLED;
  115. }
  116. return IRQ_NONE;
  117. }
  118. /*
  119. * In the routines that deal directly with the pcf8563 hardware, we use
  120. * rtc_time -- month 0-11, hour 0-23, yr = calendar year-epoch.
  121. */
  122. static int pcf8563_rtc_read_time(struct device *dev, struct rtc_time *tm)
  123. {
  124. struct pcf8563 *pcf8563 = dev_get_drvdata(dev);
  125. unsigned char buf[9];
  126. int err;
  127. err = regmap_bulk_read(pcf8563->regmap, PCF8563_REG_ST1, buf,
  128. sizeof(buf));
  129. if (err < 0)
  130. return err;
  131. if (buf[PCF8563_REG_SC] & PCF8563_SC_LV) {
  132. dev_err(dev,
  133. "low voltage detected, date/time is not reliable.\n");
  134. return -EINVAL;
  135. }
  136. dev_dbg(dev,
  137. "%s: raw data is st1=%02x, st2=%02x, sec=%02x, min=%02x, hr=%02x, "
  138. "mday=%02x, wday=%02x, mon=%02x, year=%02x\n",
  139. __func__,
  140. buf[0], buf[1], buf[2], buf[3],
  141. buf[4], buf[5], buf[6], buf[7],
  142. buf[8]);
  143. tm->tm_sec = bcd2bin(buf[PCF8563_REG_SC] & 0x7F);
  144. tm->tm_min = bcd2bin(buf[PCF8563_REG_MN] & 0x7F);
  145. tm->tm_hour = bcd2bin(buf[PCF8563_REG_HR] & 0x3F); /* rtc hr 0-23 */
  146. tm->tm_mday = bcd2bin(buf[PCF8563_REG_DM] & 0x3F);
  147. tm->tm_wday = buf[PCF8563_REG_DW] & 0x07;
  148. tm->tm_mon = bcd2bin(buf[PCF8563_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */
  149. tm->tm_year = bcd2bin(buf[PCF8563_REG_YR]) + 100;
  150. /* detect the polarity heuristically. see note above. */
  151. pcf8563->c_polarity = (buf[PCF8563_REG_MO] & PCF8563_MO_C) ?
  152. (tm->tm_year >= 100) : (tm->tm_year < 100);
  153. dev_dbg(dev, "%s: tm is secs=%d, mins=%d, hours=%d, "
  154. "mday=%d, mon=%d, year=%d, wday=%d\n",
  155. __func__,
  156. tm->tm_sec, tm->tm_min, tm->tm_hour,
  157. tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday);
  158. return 0;
  159. }
  160. static int pcf8563_rtc_set_time(struct device *dev, struct rtc_time *tm)
  161. {
  162. struct pcf8563 *pcf8563 = dev_get_drvdata(dev);
  163. unsigned char buf[9];
  164. dev_dbg(dev, "%s: secs=%d, mins=%d, hours=%d, "
  165. "mday=%d, mon=%d, year=%d, wday=%d\n",
  166. __func__,
  167. tm->tm_sec, tm->tm_min, tm->tm_hour,
  168. tm->tm_mday, tm->tm_mon, tm->tm_year, tm->tm_wday);
  169. /* hours, minutes and seconds */
  170. buf[PCF8563_REG_SC] = bin2bcd(tm->tm_sec);
  171. buf[PCF8563_REG_MN] = bin2bcd(tm->tm_min);
  172. buf[PCF8563_REG_HR] = bin2bcd(tm->tm_hour);
  173. buf[PCF8563_REG_DM] = bin2bcd(tm->tm_mday);
  174. /* month, 1 - 12 */
  175. buf[PCF8563_REG_MO] = bin2bcd(tm->tm_mon + 1);
  176. /* year and century */
  177. buf[PCF8563_REG_YR] = bin2bcd(tm->tm_year - 100);
  178. if (pcf8563->c_polarity ? (tm->tm_year >= 100) : (tm->tm_year < 100))
  179. buf[PCF8563_REG_MO] |= PCF8563_MO_C;
  180. buf[PCF8563_REG_DW] = tm->tm_wday & 0x07;
  181. return regmap_bulk_write(pcf8563->regmap, PCF8563_REG_SC,
  182. buf + PCF8563_REG_SC,
  183. sizeof(buf) - PCF8563_REG_SC);
  184. }
  185. static int pcf8563_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long arg)
  186. {
  187. struct pcf8563 *pcf8563 = dev_get_drvdata(dev);
  188. int ret;
  189. switch (cmd) {
  190. case RTC_VL_READ:
  191. ret = regmap_test_bits(pcf8563->regmap, PCF8563_REG_SC,
  192. PCF8563_SC_LV);
  193. if (ret < 0)
  194. return ret;
  195. return put_user(ret ? RTC_VL_DATA_INVALID : 0,
  196. (unsigned int __user *)arg);
  197. default:
  198. return -ENOIOCTLCMD;
  199. }
  200. }
  201. static int pcf8563_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *tm)
  202. {
  203. struct pcf8563 *pcf8563 = dev_get_drvdata(dev);
  204. unsigned char buf[4];
  205. int err;
  206. err = regmap_bulk_read(pcf8563->regmap, PCF8563_REG_AMN, buf,
  207. sizeof(buf));
  208. if (err < 0)
  209. return err;
  210. dev_dbg(dev,
  211. "%s: raw data is min=%02x, hr=%02x, mday=%02x, wday=%02x\n",
  212. __func__, buf[0], buf[1], buf[2], buf[3]);
  213. tm->time.tm_sec = 0;
  214. tm->time.tm_min = bcd2bin(buf[0] & 0x7F);
  215. tm->time.tm_hour = bcd2bin(buf[1] & 0x3F);
  216. tm->time.tm_mday = bcd2bin(buf[2] & 0x3F);
  217. tm->time.tm_wday = bcd2bin(buf[3] & 0x7);
  218. err = pcf8563_get_alarm_mode(pcf8563, &tm->enabled, &tm->pending);
  219. if (err < 0)
  220. return err;
  221. dev_dbg(dev, "%s: tm is mins=%d, hours=%d, mday=%d, wday=%d,"
  222. " enabled=%d, pending=%d\n", __func__, tm->time.tm_min,
  223. tm->time.tm_hour, tm->time.tm_mday, tm->time.tm_wday,
  224. tm->enabled, tm->pending);
  225. return 0;
  226. }
  227. static int pcf8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *tm)
  228. {
  229. struct pcf8563 *pcf8563 = dev_get_drvdata(dev);
  230. unsigned char buf[4];
  231. int err;
  232. buf[0] = bin2bcd(tm->time.tm_min);
  233. buf[1] = bin2bcd(tm->time.tm_hour);
  234. buf[2] = bin2bcd(tm->time.tm_mday);
  235. buf[3] = tm->time.tm_wday & 0x07;
  236. err = regmap_bulk_write(pcf8563->regmap, PCF8563_REG_AMN, buf,
  237. sizeof(buf));
  238. if (err)
  239. return err;
  240. return pcf8563_set_alarm_mode(pcf8563, !!tm->enabled);
  241. }
  242. static int pcf8563_irq_enable(struct device *dev, unsigned int enabled)
  243. {
  244. struct pcf8563 *pcf8563 = dev_get_drvdata(dev);
  245. dev_dbg(dev, "%s: en=%d\n", __func__, enabled);
  246. return pcf8563_set_alarm_mode(pcf8563, !!enabled);
  247. }
  248. #ifdef CONFIG_COMMON_CLK
  249. /*
  250. * Handling of the clkout
  251. */
  252. #define clkout_hw_to_pcf8563(_hw) container_of(_hw, struct pcf8563, clkout_hw)
  253. static const int clkout_rates[] = {
  254. 32768,
  255. 1024,
  256. 32,
  257. 1,
  258. };
  259. static unsigned long pcf8563_clkout_recalc_rate(struct clk_hw *hw,
  260. unsigned long parent_rate)
  261. {
  262. struct pcf8563 *pcf8563 = clkout_hw_to_pcf8563(hw);
  263. u32 buf;
  264. int ret;
  265. ret = regmap_read(pcf8563->regmap, PCF8563_REG_CLKO, &buf);
  266. if (ret < 0)
  267. return 0;
  268. buf &= PCF8563_REG_CLKO_F_MASK;
  269. return clkout_rates[buf];
  270. }
  271. static int pcf8563_clkout_determine_rate(struct clk_hw *hw,
  272. struct clk_rate_request *req)
  273. {
  274. int i;
  275. for (i = 0; i < ARRAY_SIZE(clkout_rates); i++)
  276. if (clkout_rates[i] <= req->rate) {
  277. req->rate = clkout_rates[i];
  278. return 0;
  279. }
  280. req->rate = clkout_rates[0];
  281. return 0;
  282. }
  283. static int pcf8563_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
  284. unsigned long parent_rate)
  285. {
  286. struct pcf8563 *pcf8563 = clkout_hw_to_pcf8563(hw);
  287. int i, ret;
  288. u32 buf;
  289. ret = regmap_read(pcf8563->regmap, PCF8563_REG_CLKO, &buf);
  290. if (ret < 0)
  291. return ret;
  292. for (i = 0; i < ARRAY_SIZE(clkout_rates); i++)
  293. if (clkout_rates[i] == rate) {
  294. buf &= ~PCF8563_REG_CLKO_F_MASK;
  295. buf |= i;
  296. return regmap_update_bits(pcf8563->regmap,
  297. PCF8563_REG_CLKO,
  298. PCF8563_REG_CLKO_F_MASK,
  299. buf);
  300. }
  301. return -EINVAL;
  302. }
  303. static int pcf8563_clkout_control(struct clk_hw *hw, bool enable)
  304. {
  305. struct pcf8563 *pcf8563 = clkout_hw_to_pcf8563(hw);
  306. u32 buf;
  307. int ret;
  308. ret = regmap_read(pcf8563->regmap, PCF8563_REG_CLKO, &buf);
  309. if (ret < 0)
  310. return ret;
  311. if (enable)
  312. buf |= PCF8563_REG_CLKO_FE;
  313. else
  314. buf &= ~PCF8563_REG_CLKO_FE;
  315. return regmap_update_bits(pcf8563->regmap, PCF8563_REG_CLKO,
  316. PCF8563_REG_CLKO_FE, buf);
  317. }
  318. static int pcf8563_clkout_prepare(struct clk_hw *hw)
  319. {
  320. return pcf8563_clkout_control(hw, 1);
  321. }
  322. static void pcf8563_clkout_unprepare(struct clk_hw *hw)
  323. {
  324. pcf8563_clkout_control(hw, 0);
  325. }
  326. static int pcf8563_clkout_is_prepared(struct clk_hw *hw)
  327. {
  328. struct pcf8563 *pcf8563 = clkout_hw_to_pcf8563(hw);
  329. u32 buf;
  330. int ret;
  331. ret = regmap_read(pcf8563->regmap, PCF8563_REG_CLKO, &buf);
  332. if (ret < 0)
  333. return ret;
  334. return !!(buf & PCF8563_REG_CLKO_FE);
  335. }
  336. static const struct clk_ops pcf8563_clkout_ops = {
  337. .prepare = pcf8563_clkout_prepare,
  338. .unprepare = pcf8563_clkout_unprepare,
  339. .is_prepared = pcf8563_clkout_is_prepared,
  340. .recalc_rate = pcf8563_clkout_recalc_rate,
  341. .determine_rate = pcf8563_clkout_determine_rate,
  342. .set_rate = pcf8563_clkout_set_rate,
  343. };
  344. static struct clk *pcf8563_clkout_register_clk(struct pcf8563 *pcf8563)
  345. {
  346. struct device_node *node = pcf8563->rtc->dev.parent->of_node;
  347. struct clk_init_data init;
  348. struct clk *clk;
  349. int ret;
  350. /* disable the clkout output */
  351. ret = regmap_clear_bits(pcf8563->regmap, PCF8563_REG_CLKO,
  352. PCF8563_REG_CLKO_FE);
  353. if (ret < 0)
  354. return ERR_PTR(ret);
  355. init.name = "pcf8563-clkout";
  356. init.ops = &pcf8563_clkout_ops;
  357. init.flags = 0;
  358. init.parent_names = NULL;
  359. init.num_parents = 0;
  360. pcf8563->clkout_hw.init = &init;
  361. /* optional override of the clockname */
  362. of_property_read_string(node, "clock-output-names", &init.name);
  363. /* register the clock */
  364. clk = devm_clk_register(&pcf8563->rtc->dev, &pcf8563->clkout_hw);
  365. if (!IS_ERR(clk))
  366. of_clk_add_provider(node, of_clk_src_simple_get, clk);
  367. return clk;
  368. }
  369. #endif
  370. static const struct rtc_class_ops pcf8563_rtc_ops = {
  371. .ioctl = pcf8563_rtc_ioctl,
  372. .read_time = pcf8563_rtc_read_time,
  373. .set_time = pcf8563_rtc_set_time,
  374. .read_alarm = pcf8563_rtc_read_alarm,
  375. .set_alarm = pcf8563_rtc_set_alarm,
  376. .alarm_irq_enable = pcf8563_irq_enable,
  377. };
  378. static const struct regmap_config regmap_config = {
  379. .reg_bits = 8,
  380. .val_bits = 8,
  381. .max_register = 0xF,
  382. };
  383. static int pcf8563_probe(struct i2c_client *client)
  384. {
  385. struct pcf8563 *pcf8563;
  386. int err;
  387. dev_dbg(&client->dev, "%s\n", __func__);
  388. if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
  389. return -ENODEV;
  390. pcf8563 = devm_kzalloc(&client->dev, sizeof(struct pcf8563),
  391. GFP_KERNEL);
  392. if (!pcf8563)
  393. return -ENOMEM;
  394. pcf8563->regmap = devm_regmap_init_i2c(client, &regmap_config);
  395. if (IS_ERR(pcf8563->regmap))
  396. return PTR_ERR(pcf8563->regmap);
  397. i2c_set_clientdata(client, pcf8563);
  398. device_set_wakeup_capable(&client->dev, 1);
  399. /* Set timer to lowest frequency to save power (ref Haoyu datasheet) */
  400. err = regmap_set_bits(pcf8563->regmap, PCF8563_REG_TMRC,
  401. PCF8563_TMRC_1_60);
  402. if (err < 0) {
  403. dev_err(&client->dev, "%s: write error\n", __func__);
  404. return err;
  405. }
  406. /* Clear flags and disable interrupts */
  407. err = regmap_write(pcf8563->regmap, PCF8563_REG_ST2, 0);
  408. if (err < 0) {
  409. dev_err(&client->dev, "%s: write error\n", __func__);
  410. return err;
  411. }
  412. pcf8563->rtc = devm_rtc_allocate_device(&client->dev);
  413. if (IS_ERR(pcf8563->rtc))
  414. return PTR_ERR(pcf8563->rtc);
  415. pcf8563->rtc->ops = &pcf8563_rtc_ops;
  416. /* the pcf8563 alarm only supports a minute accuracy */
  417. set_bit(RTC_FEATURE_ALARM_RES_MINUTE, pcf8563->rtc->features);
  418. clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, pcf8563->rtc->features);
  419. clear_bit(RTC_FEATURE_ALARM, pcf8563->rtc->features);
  420. pcf8563->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
  421. pcf8563->rtc->range_max = RTC_TIMESTAMP_END_2099;
  422. pcf8563->rtc->set_start_time = true;
  423. if (client->irq > 0) {
  424. unsigned long irqflags = IRQF_TRIGGER_LOW;
  425. if (dev_fwnode(&client->dev))
  426. irqflags = 0;
  427. err = devm_request_threaded_irq(&client->dev, client->irq,
  428. NULL, pcf8563_irq,
  429. IRQF_SHARED | IRQF_ONESHOT | irqflags,
  430. pcf8563_driver.driver.name, client);
  431. if (err) {
  432. dev_err(&client->dev, "unable to request IRQ %d\n",
  433. client->irq);
  434. return err;
  435. }
  436. } else {
  437. client->irq = 0;
  438. }
  439. if (client->irq > 0 || device_property_read_bool(&client->dev, "wakeup-source")) {
  440. device_init_wakeup(&client->dev, true);
  441. set_bit(RTC_FEATURE_ALARM, pcf8563->rtc->features);
  442. }
  443. err = devm_rtc_register_device(pcf8563->rtc);
  444. if (err)
  445. return err;
  446. #ifdef CONFIG_COMMON_CLK
  447. /* register clk in common clk framework */
  448. pcf8563_clkout_register_clk(pcf8563);
  449. #endif
  450. return 0;
  451. }
  452. static const struct i2c_device_id pcf8563_id[] = {
  453. { "pcf8563" },
  454. { "rtc8564" },
  455. { "pca8565" },
  456. { }
  457. };
  458. MODULE_DEVICE_TABLE(i2c, pcf8563_id);
  459. #ifdef CONFIG_OF
  460. static const struct of_device_id pcf8563_of_match[] = {
  461. { .compatible = "nxp,pcf8563" },
  462. { .compatible = "epson,rtc8564" },
  463. { .compatible = "microcrystal,rv8564" },
  464. { .compatible = "nxp,pca8565" },
  465. {}
  466. };
  467. MODULE_DEVICE_TABLE(of, pcf8563_of_match);
  468. #endif
  469. static struct i2c_driver pcf8563_driver = {
  470. .driver = {
  471. .name = "rtc-pcf8563",
  472. .of_match_table = of_match_ptr(pcf8563_of_match),
  473. },
  474. .probe = pcf8563_probe,
  475. .id_table = pcf8563_id,
  476. };
  477. module_i2c_driver(pcf8563_driver);
  478. MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
  479. MODULE_DESCRIPTION("Philips PCF8563/Epson RTC8564 RTC driver");
  480. MODULE_LICENSE("GPL");