hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/rtc/rtc-rx6110.c
....@@ -1,17 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Driver for the Epson RTC module RX-6110 SA
34 *
45 * Copyright(C) 2015 Pengutronix, Steffen Trumtrar <kernel@pengutronix.de>
56 * Copyright(C) SEIKO EPSON CORPORATION 2013. All rights reserved.
6
- *
7
- * This driver software is distributed as is, without any warranty of any kind,
8
- * either express or implied as further specified in the GNU Public License.
9
- * This software may be used and distributed according to the terms of the GNU
10
- * Public License, version 2 as published by the Free Software Foundation.
11
- * See the file COPYING in the main directory of this archive for more details.
12
- *
13
- * You should have received a copy of the GNU General Public License along with
14
- * this program. If not, see <http://www.gnu.org/licenses/>.
157 */
168
179 #include <linux/bcd.h>
....@@ -21,6 +13,8 @@
2113 #include <linux/of_gpio.h>
2214 #include <linux/regmap.h>
2315 #include <linux/rtc.h>
16
+#include <linux/of.h>
17
+#include <linux/of_device.h>
2418 #include <linux/spi/spi.h>
2519
2620 /* RX-6110 Register definitions */
....@@ -114,9 +108,7 @@
114108 */
115109 static int rx6110_rtc_tm_to_data(struct rtc_time *tm, u8 *data)
116110 {
117
- pr_debug("%s: date %ds %dm %dh %dmd %dm %dy\n", __func__,
118
- tm->tm_sec, tm->tm_min, tm->tm_hour,
119
- tm->tm_mday, tm->tm_mon, tm->tm_year);
111
+ pr_debug("%s: date %ptRr\n", __func__, tm);
120112
121113 /*
122114 * The year in the RTC is a value between 0 and 99.
....@@ -154,9 +146,7 @@
154146 tm->tm_mon = bcd2bin(data[RTC_MONTH] & 0x1f) - 1;
155147 tm->tm_year = bcd2bin(data[RTC_YEAR]) + 100;
156148
157
- pr_debug("%s: date %ds %dm %dh %dmd %dm %dy\n", __func__,
158
- tm->tm_sec, tm->tm_min, tm->tm_hour,
159
- tm->tm_mday, tm->tm_mon, tm->tm_year);
149
+ pr_debug("%s: date %ptRr\n", __func__, tm);
160150
161151 /*
162152 * The year in the RTC is a value between 0 and 99.
....@@ -248,9 +238,7 @@
248238 if (ret)
249239 return ret;
250240
251
- dev_dbg(dev, "%s: date %ds %dm %dh %dmd %dm %dy\n", __func__,
252
- tm->tm_sec, tm->tm_min, tm->tm_hour,
253
- tm->tm_mday, tm->tm_mon, tm->tm_year);
241
+ dev_dbg(dev, "%s: date %ptRr\n", __func__, tm);
254242
255243 return 0;
256244 }
....@@ -374,23 +362,24 @@
374362 return 0;
375363 }
376364
377
-static int rx6110_remove(struct spi_device *spi)
378
-{
379
- return 0;
380
-}
381
-
382365 static const struct spi_device_id rx6110_id[] = {
383366 { "rx6110", 0 },
384367 { }
385368 };
386369 MODULE_DEVICE_TABLE(spi, rx6110_id);
387370
371
+static const struct of_device_id rx6110_spi_of_match[] = {
372
+ { .compatible = "epson,rx6110" },
373
+ { },
374
+};
375
+MODULE_DEVICE_TABLE(of, rx6110_spi_of_match);
376
+
388377 static struct spi_driver rx6110_driver = {
389378 .driver = {
390379 .name = RX6110_DRIVER_NAME,
380
+ .of_match_table = of_match_ptr(rx6110_spi_of_match),
391381 },
392382 .probe = rx6110_probe,
393
- .remove = rx6110_remove,
394383 .id_table = rx6110_id,
395384 };
396385