linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] MVME: Adopt standard RTC driver
@ 2024-11-12 22:32 Finn Thain
  2024-11-12 22:32 ` [PATCH v4 2/2] m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver Finn Thain
  2024-11-12 22:32 ` [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value Finn Thain
  0 siblings, 2 replies; 12+ messages in thread
From: Finn Thain @ 2024-11-12 22:32 UTC (permalink / raw)
  To: Alexandre Belloni, Andreas Larsson, David S. Miller,
	Geert Uytterhoeven
  Cc: Daniel Palmer, linux-kernel, linux-m68k, linux-rtc,
	Michael Pavone, sparclinux

This series removes some duplicated RTC driver code.
First rtc-m48t59 is tweaked to bring it into equivalence with the RTC
drivers in arch/m68k/mvme*. Then platform devices are added for the
former driver and the latter drivers are removed.

---
Changed since v1: 
 - Instead of adding ifdefs to the portable driver, store the year offset
   in struct m48t59_plat_data.

Changed since v2: 
 - Use an int for the year offset in struct m48t59_plat_data.

Changed since v3:
 - Re-ordered m68k defconfig symbols.
 - Added reviewed-by tag from Geert.


Finn Thain (2):
  rtc: m48t59: Use platform_data struct for year offset value
  m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver

 arch/m68k/configs/multi_defconfig   |   1 +
 arch/m68k/configs/mvme147_defconfig |   1 +
 arch/m68k/configs/mvme16x_defconfig |   1 +
 arch/m68k/include/asm/mvme147hw.h   |  19 +---
 arch/m68k/include/asm/mvme16xhw.h   |  18 +--
 arch/m68k/mvme147/config.c          |  55 ++++------
 arch/m68k/mvme16x/Makefile          |   2 +-
 arch/m68k/mvme16x/config.c          |  57 ++++------
 arch/m68k/mvme16x/rtc.c             | 165 ----------------------------
 arch/sparc/kernel/time_32.c         |   1 +
 arch/sparc/kernel/time_64.c         |   1 +
 drivers/rtc/rtc-m48t59.c            |  26 +----
 include/linux/rtc/m48t59.h          |   3 +
 13 files changed, 63 insertions(+), 287 deletions(-)
 delete mode 100644 arch/m68k/mvme16x/rtc.c

-- 
2.44.2


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value
  2024-11-12 22:32 [PATCH v4 0/2] MVME: Adopt standard RTC driver Finn Thain
  2024-11-12 22:32 ` [PATCH v4 2/2] m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver Finn Thain
@ 2024-11-12 22:32 ` Finn Thain
  2024-11-15 15:49   ` Andreas Larsson
  2024-11-18 13:32   ` (subset) " Alexandre Belloni
  1 sibling, 2 replies; 12+ messages in thread
From: Finn Thain @ 2024-11-12 22:32 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson, Alexandre Belloni
  Cc: Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc, sparclinux,
	linux-kernel

Instead of hard-coded values and ifdefs, store the year offset in the
platform_data struct.

Tested-by: Daniel Palmer <daniel@0x0f.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
David, Andreas - with your acknowledgement, I will ask Alexandre to merge
this.
---
I tested this for regressions using qemu-system-sparc64.
Also, Daniel tested the RTC functionality on his MVME147 system.

Changed since v2:
 - Use an int for the year offset in struct m48t59_plat_data.

Changed since v3:
 - Added reviewed-by tag from Geert.
---
 arch/sparc/kernel/time_32.c |  1 +
 arch/sparc/kernel/time_64.c |  1 +
 drivers/rtc/rtc-m48t59.c    | 26 ++++----------------------
 include/linux/rtc/m48t59.h  |  3 +++
 4 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 08bbdc458596..578fd0d49f30 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -255,6 +255,7 @@ static void mostek_write_byte(struct device *dev, u32 ofs, u8 val)
 static struct m48t59_plat_data m48t59_data = {
 	.read_byte = mostek_read_byte,
 	.write_byte = mostek_write_byte,
+	.yy_offset = 68,
 };
 
 /* resource is set at runtime */
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 60f1c8cc5363..b32f27f929d1 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -544,6 +544,7 @@ static void mostek_write_byte(struct device *dev, u32 ofs, u8 val)
 static struct m48t59_plat_data m48t59_data = {
 	.read_byte	= mostek_read_byte,
 	.write_byte	= mostek_write_byte,
+	.yy_offset	= 68,
 };
 
 static struct platform_device m48t59_rtc = {
diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
index 5d30ce8e13ca..4e608bc8bbd3 100644
--- a/drivers/rtc/rtc-m48t59.c
+++ b/drivers/rtc/rtc-m48t59.c
@@ -71,7 +71,7 @@ static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm)
 	/* Issue the READ command */
 	M48T59_SET_BITS(M48T59_CNTL_READ, M48T59_CNTL);
 
-	tm->tm_year	= bcd2bin(M48T59_READ(M48T59_YEAR));
+	tm->tm_year	= bcd2bin(M48T59_READ(M48T59_YEAR)) + pdata->yy_offset;
 	/* tm_mon is 0-11 */
 	tm->tm_mon	= bcd2bin(M48T59_READ(M48T59_MONTH)) - 1;
 	tm->tm_mday	= bcd2bin(M48T59_READ(M48T59_MDAY));
@@ -82,10 +82,6 @@ static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm)
 		dev_dbg(dev, "Century bit is enabled\n");
 		tm->tm_year += 100;	/* one century */
 	}
-#ifdef CONFIG_SPARC
-	/* Sun SPARC machines count years since 1968 */
-	tm->tm_year += 68;
-#endif
 
 	tm->tm_wday	= bcd2bin(val & 0x07);
 	tm->tm_hour	= bcd2bin(M48T59_READ(M48T59_HOUR) & 0x3F);
@@ -106,12 +102,7 @@ static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm)
 	struct m48t59_private *m48t59 = dev_get_drvdata(dev);
 	unsigned long flags;
 	u8 val = 0;
-	int year = tm->tm_year;
-
-#ifdef CONFIG_SPARC
-	/* Sun SPARC machines count years since 1968 */
-	year -= 68;
-#endif
+	int year = tm->tm_year - pdata->yy_offset;
 
 	dev_dbg(dev, "RTC set time %04d-%02d-%02d %02d/%02d/%02d\n",
 		year + 1900, tm->tm_mon, tm->tm_mday,
@@ -162,11 +153,7 @@ static int m48t59_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
 	/* Issue the READ command */
 	M48T59_SET_BITS(M48T59_CNTL_READ, M48T59_CNTL);
 
-	tm->tm_year = bcd2bin(M48T59_READ(M48T59_YEAR));
-#ifdef CONFIG_SPARC
-	/* Sun SPARC machines count years since 1968 */
-	tm->tm_year += 68;
-#endif
+	tm->tm_year = bcd2bin(M48T59_READ(M48T59_YEAR)) + pdata->yy_offset;
 	/* tm_mon is 0-11 */
 	tm->tm_mon = bcd2bin(M48T59_READ(M48T59_MONTH)) - 1;
 
@@ -197,12 +184,7 @@ static int m48t59_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
 	struct rtc_time *tm = &alrm->time;
 	u8 mday, hour, min, sec;
 	unsigned long flags;
-	int year = tm->tm_year;
-
-#ifdef CONFIG_SPARC
-	/* Sun SPARC machines count years since 1968 */
-	year -= 68;
-#endif
+	int year = tm->tm_year - pdata->yy_offset;
 
 	/* If no irq, we don't support ALARM */
 	if (m48t59->irq == NO_IRQ)
diff --git a/include/linux/rtc/m48t59.h b/include/linux/rtc/m48t59.h
index 9465d5405fe2..373ba77071c6 100644
--- a/include/linux/rtc/m48t59.h
+++ b/include/linux/rtc/m48t59.h
@@ -56,6 +56,9 @@ struct m48t59_plat_data {
 	void __iomem *ioaddr;
 	/* offset to RTC registers, automatically set according to the type */
 	unsigned int offset;
+
+	/* YY digits (in RTC) are offset, i.e. year is 1900 + yy_offset + YY */
+	int yy_offset;
 };
 
 #endif /* _LINUX_RTC_M48T59_H_ */
-- 
2.44.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v4 2/2] m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver
  2024-11-12 22:32 [PATCH v4 0/2] MVME: Adopt standard RTC driver Finn Thain
@ 2024-11-12 22:32 ` Finn Thain
  2024-11-22 14:44   ` Geert Uytterhoeven
  2024-11-12 22:32 ` [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value Finn Thain
  1 sibling, 1 reply; 12+ messages in thread
From: Finn Thain @ 2024-11-12 22:32 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc,
	linux-kernel

Both mvme147 and mvme16x platforms have their own RTC driver
implementations that duplicate functionality provided by the rtc-m48t59
driver. Adopt the rtc-m48t59 driver and remove the other ones.

Tested-by: Daniel Palmer <daniel@0x0f.com>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
This patch depends upon the m48t59 driver changes in the preceding patch.

Changed since v1:
 - Initialize yy_offset in struct m48t59_plat_data.

Changed Since v3:
 - Re-ordered defconfig symbols.
 - Added reviewed-by tag from arch maintainer.
---
 arch/m68k/configs/multi_defconfig   |   1 +
 arch/m68k/configs/mvme147_defconfig |   1 +
 arch/m68k/configs/mvme16x_defconfig |   1 +
 arch/m68k/include/asm/mvme147hw.h   |  19 +---
 arch/m68k/include/asm/mvme16xhw.h   |  18 +--
 arch/m68k/mvme147/config.c          |  55 ++++------
 arch/m68k/mvme16x/Makefile          |   2 +-
 arch/m68k/mvme16x/config.c          |  57 ++++------
 arch/m68k/mvme16x/rtc.c             | 165 ----------------------------
 9 files changed, 54 insertions(+), 265 deletions(-)
 delete mode 100644 arch/m68k/mvme16x/rtc.c

diff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig
index 6f5ca3f85ea1..b34936391707 100644
--- a/arch/m68k/configs/multi_defconfig
+++ b/arch/m68k/configs/multi_defconfig
@@ -503,6 +503,7 @@ CONFIG_UHID=m
 # CONFIG_USB_SUPPORT is not set
 CONFIG_RTC_CLASS=y
 # CONFIG_RTC_NVMEM is not set
+CONFIG_RTC_DRV_M48T59=m
 CONFIG_RTC_DRV_MSM6242=m
 CONFIG_RTC_DRV_RP5C01=m
 CONFIG_RTC_DRV_GENERIC=m
diff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig
index d16b328c7136..0cf6d05b9013 100644
--- a/arch/m68k/configs/mvme147_defconfig
+++ b/arch/m68k/configs/mvme147_defconfig
@@ -391,6 +391,7 @@ CONFIG_UHID=m
 # CONFIG_USB_SUPPORT is not set
 CONFIG_RTC_CLASS=y
 # CONFIG_RTC_NVMEM is not set
+CONFIG_RTC_DRV_M48T59=y
 CONFIG_RTC_DRV_GENERIC=m
 # CONFIG_VIRTIO_MENU is not set
 # CONFIG_VHOST_MENU is not set
diff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig
index 80f6c15a5ed5..a4f2169bcde8 100644
--- a/arch/m68k/configs/mvme16x_defconfig
+++ b/arch/m68k/configs/mvme16x_defconfig
@@ -392,6 +392,7 @@ CONFIG_UHID=m
 # CONFIG_USB_SUPPORT is not set
 CONFIG_RTC_CLASS=y
 # CONFIG_RTC_NVMEM is not set
+CONFIG_RTC_DRV_M48T59=y
 CONFIG_RTC_DRV_GENERIC=m
 # CONFIG_VIRTIO_MENU is not set
 # CONFIG_VHOST_MENU is not set
diff --git a/arch/m68k/include/asm/mvme147hw.h b/arch/m68k/include/asm/mvme147hw.h
index dbf88059e47a..6ad93bac06f9 100644
--- a/arch/m68k/include/asm/mvme147hw.h
+++ b/arch/m68k/include/asm/mvme147hw.h
@@ -4,24 +4,7 @@
 
 #include <asm/irq.h>
 
-typedef struct {
-	unsigned char
-		ctrl,
-		bcd_sec,
-		bcd_min,
-		bcd_hr,
-		bcd_dow,
-		bcd_dom,
-		bcd_mth,
-		bcd_year;
-} MK48T02;
-
-#define RTC_WRITE	0x80
-#define RTC_READ	0x40
-#define RTC_STOP	0x20
-
-#define m147_rtc ((MK48T02 * volatile)0xfffe07f8)
-
+#define MVME147_RTC_BASE	0xfffe0000
 
 struct pcc_regs {
    volatile u_long	dma_tadr;
diff --git a/arch/m68k/include/asm/mvme16xhw.h b/arch/m68k/include/asm/mvme16xhw.h
index cc7f5ae1220f..ff1126a51fbe 100644
--- a/arch/m68k/include/asm/mvme16xhw.h
+++ b/arch/m68k/include/asm/mvme16xhw.h
@@ -24,23 +24,7 @@ typedef struct {
 
 #define mvmelp   ((*(volatile MVMElpPtr)(MVME_LPR_BASE)))
 
-typedef struct {
-	unsigned char
-		ctrl,
-		bcd_sec,
-		bcd_min,
-		bcd_hr,
-		bcd_dow,
-		bcd_dom,
-		bcd_mth,
-		bcd_year;
-} MK48T08_t, *MK48T08ptr_t;
-
-#define RTC_WRITE	0x80
-#define RTC_READ	0x40
-#define RTC_STOP	0x20
-
-#define MVME_RTC_BASE	0xfffc1ff8
+#define MVME_RTC_BASE	0xfffc0000
 
 #define MVME_I596_BASE	0xfff46000
 
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index cc2fb0a83cf0..eccca04ceb7b 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -19,8 +19,9 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <linux/major.h>
-#include <linux/rtc.h>
 #include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/rtc/m48t59.h>
 
 #include <asm/bootinfo.h>
 #include <asm/bootinfo-vme.h>
@@ -36,13 +37,9 @@
 
 static void mvme147_get_model(char *model);
 extern void mvme147_sched_init(void);
-extern int mvme147_hwclk (int, struct rtc_time *);
 extern void mvme147_reset (void);
 
 
-static int bcd2int (unsigned char b);
-
-
 int __init mvme147_parse_bootinfo(const struct bi_record *bi)
 {
 	uint16_t tag = be16_to_cpu(bi->tag);
@@ -80,7 +77,6 @@ void __init config_mvme147(void)
 {
 	mach_sched_init		= mvme147_sched_init;
 	mach_init_IRQ		= mvme147_init_IRQ;
-	mach_hwclk		= mvme147_hwclk;
 	mach_reset		= mvme147_reset;
 	mach_get_model		= mvme147_get_model;
 
@@ -89,6 +85,28 @@ void __init config_mvme147(void)
 		vme_brdtype = VME_TYPE_MVME147;
 }
 
+static struct resource m48t59_rsrc[] = {
+	DEFINE_RES_MEM(MVME147_RTC_BASE, 0x800),
+};
+
+static struct m48t59_plat_data m48t59_data = {
+	.type = M48T59RTC_TYPE_M48T02,
+	.yy_offset = 70,
+};
+
+static int __init mvme147_platform_init(void)
+{
+	if (!MACH_IS_MVME147)
+		return 0;
+
+	platform_device_register_resndata(NULL, "rtc-m48t59", -1,
+					  m48t59_rsrc, ARRAY_SIZE(m48t59_rsrc),
+					  &m48t59_data, sizeof(m48t59_data));
+	return 0;
+}
+
+arch_initcall(mvme147_platform_init);
+
 static u64 mvme147_read_clk(struct clocksource *cs);
 
 static struct clocksource mvme147_clk = {
@@ -162,31 +180,6 @@ static u64 mvme147_read_clk(struct clocksource *cs)
 	return ticks;
 }
 
-static int bcd2int (unsigned char b)
-{
-	return ((b>>4)*10 + (b&15));
-}
-
-int mvme147_hwclk(int op, struct rtc_time *t)
-{
-	if (!op) {
-		m147_rtc->ctrl = RTC_READ;
-		t->tm_year = bcd2int (m147_rtc->bcd_year);
-		t->tm_mon  = bcd2int(m147_rtc->bcd_mth) - 1;
-		t->tm_mday = bcd2int (m147_rtc->bcd_dom);
-		t->tm_hour = bcd2int (m147_rtc->bcd_hr);
-		t->tm_min  = bcd2int (m147_rtc->bcd_min);
-		t->tm_sec  = bcd2int (m147_rtc->bcd_sec);
-		m147_rtc->ctrl = 0;
-		if (t->tm_year < 70)
-			t->tm_year += 100;
-	} else {
-		/* FIXME Setting the time is not yet supported */
-		return -EOPNOTSUPP;
-	}
-	return 0;
-}
-
 static void scc_delay(void)
 {
 	__asm__ __volatile__ ("nop; nop;");
diff --git a/arch/m68k/mvme16x/Makefile b/arch/m68k/mvme16x/Makefile
index a8a368c2cbea..02f9e4ad8209 100644
--- a/arch/m68k/mvme16x/Makefile
+++ b/arch/m68k/mvme16x/Makefile
@@ -3,4 +3,4 @@
 # Makefile for Linux arch/m68k/mvme16x source directory
 #
 
-obj-y		:= config.o rtc.o
+obj-y		:= config.o
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index d1fbd1704d65..99768fe8da73 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -21,9 +21,10 @@
 #include <linux/linkage.h>
 #include <linux/init.h>
 #include <linux/major.h>
-#include <linux/rtc.h>
 #include <linux/interrupt.h>
 #include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/rtc/m48t59.h>
 
 #include <asm/bootinfo.h>
 #include <asm/bootinfo-vme.h>
@@ -39,16 +40,10 @@
 
 extern t_bdid mvme_bdid;
 
-static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE;
-
 static void mvme16x_get_model(char *model);
 extern void mvme16x_sched_init(void);
-extern int mvme16x_hwclk (int, struct rtc_time *);
 extern void mvme16x_reset (void);
 
-int bcd2int (unsigned char b);
-
-
 unsigned short mvme16x_config;
 EXPORT_SYMBOL(mvme16x_config);
 
@@ -268,7 +263,6 @@ void __init config_mvme16x(void)
 
     mach_sched_init      = mvme16x_sched_init;
     mach_init_IRQ        = mvme16x_init_IRQ;
-    mach_hwclk           = mvme16x_hwclk;
     mach_reset		 = mvme16x_reset;
     mach_get_model       = mvme16x_get_model;
     mach_get_hardware_list = mvme16x_get_hardware_list;
@@ -312,6 +306,28 @@ void __init config_mvme16x(void)
     }
 }
 
+static struct resource m48t59_rsrc[] = {
+	DEFINE_RES_MEM(MVME_RTC_BASE, 0x2000),
+};
+
+static struct m48t59_plat_data m48t59_data = {
+	.type = M48T59RTC_TYPE_M48T08,
+	.yy_offset = 70,
+};
+
+static int __init mvme16x_platform_init(void)
+{
+	if (!MACH_IS_MVME16x)
+		return 0;
+
+	platform_device_register_resndata(NULL, "rtc-m48t59", -1,
+					  m48t59_rsrc, ARRAY_SIZE(m48t59_rsrc),
+					  &m48t59_data, sizeof(m48t59_data));
+	return 0;
+}
+
+arch_initcall(mvme16x_platform_init);
+
 static irqreturn_t mvme16x_abort_int (int irq, void *dev_id)
 {
 	unsigned long *new = (unsigned long *)vectors;
@@ -426,28 +442,3 @@ static u64 mvme16x_read_clk(struct clocksource *cs)
 
 	return ticks;
 }
-
-int bcd2int (unsigned char b)
-{
-	return ((b>>4)*10 + (b&15));
-}
-
-int mvme16x_hwclk(int op, struct rtc_time *t)
-{
-	if (!op) {
-		rtc->ctrl = RTC_READ;
-		t->tm_year = bcd2int (rtc->bcd_year);
-		t->tm_mon  = bcd2int(rtc->bcd_mth) - 1;
-		t->tm_mday = bcd2int (rtc->bcd_dom);
-		t->tm_hour = bcd2int (rtc->bcd_hr);
-		t->tm_min  = bcd2int (rtc->bcd_min);
-		t->tm_sec  = bcd2int (rtc->bcd_sec);
-		rtc->ctrl = 0;
-		if (t->tm_year < 70)
-			t->tm_year += 100;
-	} else {
-		/* FIXME Setting the time is not yet supported */
-		return -EOPNOTSUPP;
-	}
-	return 0;
-}
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c
deleted file mode 100644
index ccbaae1125e6..000000000000
--- a/arch/m68k/mvme16x/rtc.c
+++ /dev/null
@@ -1,165 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- *	Real Time Clock interface for Linux on the MVME16x
- *
- * Based on the PC driver by Paul Gortmaker.
- */
-
-#define RTC_VERSION		"1.00"
-
-#include <linux/types.h>
-#include <linux/errno.h>
-#include <linux/miscdevice.h>
-#include <linux/ioport.h>
-#include <linux/capability.h>
-#include <linux/fcntl.h>
-#include <linux/init.h>
-#include <linux/poll.h>
-#include <linux/rtc.h>	/* For struct rtc_time and ioctls, etc */
-#include <linux/bcd.h>
-#include <asm/mvme16xhw.h>
-
-#include <asm/io.h>
-#include <linux/uaccess.h>
-#include <asm/setup.h>
-
-/*
- *	We sponge a minor off of the misc major. No need slurping
- *	up another valuable major dev number for this. If you add
- *	an ioctl, make sure you don't conflict with SPARC's RTC
- *	ioctls.
- */
-
-static const unsigned char days_in_mo[] =
-{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-
-static atomic_t rtc_ready = ATOMIC_INIT(1);
-
-static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-{
-	volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE;
-	unsigned long flags;
-	struct rtc_time wtime;
-	void __user *argp = (void __user *)arg;
-
-	switch (cmd) {
-	case RTC_RD_TIME:	/* Read the time/date from RTC	*/
-	{
-		local_irq_save(flags);
-		/* Ensure clock and real-time-mode-register are accessible */
-		rtc->ctrl = RTC_READ;
-		memset(&wtime, 0, sizeof(struct rtc_time));
-		wtime.tm_sec =  bcd2bin(rtc->bcd_sec);
-		wtime.tm_min =  bcd2bin(rtc->bcd_min);
-		wtime.tm_hour = bcd2bin(rtc->bcd_hr);
-		wtime.tm_mday =  bcd2bin(rtc->bcd_dom);
-		wtime.tm_mon =  bcd2bin(rtc->bcd_mth)-1;
-		wtime.tm_year = bcd2bin(rtc->bcd_year);
-		if (wtime.tm_year < 70)
-			wtime.tm_year += 100;
-		wtime.tm_wday = bcd2bin(rtc->bcd_dow)-1;
-		rtc->ctrl = 0;
-		local_irq_restore(flags);
-		return copy_to_user(argp, &wtime, sizeof wtime) ?
-								-EFAULT : 0;
-	}
-	case RTC_SET_TIME:	/* Set the RTC */
-	{
-		struct rtc_time rtc_tm;
-		unsigned char mon, day, hrs, min, sec, leap_yr;
-		unsigned int yrs;
-
-		if (!capable(CAP_SYS_ADMIN))
-			return -EACCES;
-
-		if (copy_from_user(&rtc_tm, argp, sizeof(struct rtc_time)))
-			return -EFAULT;
-
-		yrs = rtc_tm.tm_year;
-		if (yrs < 1900)
-			yrs += 1900;
-		mon = rtc_tm.tm_mon + 1;   /* tm_mon starts at zero */
-		day = rtc_tm.tm_mday;
-		hrs = rtc_tm.tm_hour;
-		min = rtc_tm.tm_min;
-		sec = rtc_tm.tm_sec;
-
-		leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400));
-
-		if ((mon > 12) || (day == 0))
-			return -EINVAL;
-
-		if (day > (days_in_mo[mon] + ((mon == 2) && leap_yr)))
-			return -EINVAL;
-
-		if ((hrs >= 24) || (min >= 60) || (sec >= 60))
-			return -EINVAL;
-
-		if (yrs >= 2070)
-			return -EINVAL;
-
-		local_irq_save(flags);
-		rtc->ctrl     = RTC_WRITE;
-
-		rtc->bcd_sec  = bin2bcd(sec);
-		rtc->bcd_min  = bin2bcd(min);
-		rtc->bcd_hr   = bin2bcd(hrs);
-		rtc->bcd_dom  = bin2bcd(day);
-		rtc->bcd_mth  = bin2bcd(mon);
-		rtc->bcd_year = bin2bcd(yrs%100);
-
-		rtc->ctrl     = 0;
-		local_irq_restore(flags);
-		return 0;
-	}
-	default:
-		return -EINVAL;
-	}
-}
-
-/*
- * We enforce only one user at a time here with the open/close.
- */
-static int rtc_open(struct inode *inode, struct file *file)
-{
-	if( !atomic_dec_and_test(&rtc_ready) )
-	{
-		atomic_inc( &rtc_ready );
-		return -EBUSY;
-	}
-	return 0;
-}
-
-static int rtc_release(struct inode *inode, struct file *file)
-{
-	atomic_inc( &rtc_ready );
-	return 0;
-}
-
-/*
- *	The various file operations we support.
- */
-
-static const struct file_operations rtc_fops = {
-	.unlocked_ioctl	= rtc_ioctl,
-	.open		= rtc_open,
-	.release	= rtc_release,
-	.llseek		= noop_llseek,
-};
-
-static struct miscdevice rtc_dev=
-{
-	.minor =	RTC_MINOR,
-	.name =		"rtc",
-	.fops =		&rtc_fops
-};
-
-static int __init rtc_MK48T08_init(void)
-{
-	if (!MACH_IS_MVME16x)
-		return -ENODEV;
-
-	pr_info("MK48T08 Real Time Clock Driver v%s\n", RTC_VERSION);
-	return misc_register(&rtc_dev);
-}
-device_initcall(rtc_MK48T08_init);
-- 
2.44.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value
  2024-11-12 22:32 ` [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value Finn Thain
@ 2024-11-15 15:49   ` Andreas Larsson
  2024-11-18 13:32   ` (subset) " Alexandre Belloni
  1 sibling, 0 replies; 12+ messages in thread
From: Andreas Larsson @ 2024-11-15 15:49 UTC (permalink / raw)
  To: Finn Thain, David S. Miller, Alexandre Belloni
  Cc: Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc, sparclinux,
	linux-kernel

On 2024-11-12 23:32, Finn Thain wrote:
> Instead of hard-coded values and ifdefs, store the year offset in the
> platform_data struct.
> 
> Tested-by: Daniel Palmer <daniel@0x0f.com>
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Finn Thain <fthain@linux-m68k.org>
> ---
> David, Andreas - with your acknowledgement, I will ask Alexandre to merge
> this.
> ---
> I tested this for regressions using qemu-system-sparc64.
> Also, Daniel tested the RTC functionality on his MVME147 system.
> 
> Changed since v2:
>  - Use an int for the year offset in struct m48t59_plat_data.
> 
> Changed since v3:
>  - Added reviewed-by tag from Geert.
> ---
>  arch/sparc/kernel/time_32.c |  1 +
>  arch/sparc/kernel/time_64.c |  1 +
>  drivers/rtc/rtc-m48t59.c    | 26 ++++----------------------
>  include/linux/rtc/m48t59.h  |  3 +++
>  4 files changed, 9 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
> index 08bbdc458596..578fd0d49f30 100644
> --- a/arch/sparc/kernel/time_32.c
> +++ b/arch/sparc/kernel/time_32.c
> @@ -255,6 +255,7 @@ static void mostek_write_byte(struct device *dev, u32 ofs, u8 val)
>  static struct m48t59_plat_data m48t59_data = {
>  	.read_byte = mostek_read_byte,
>  	.write_byte = mostek_write_byte,
> +	.yy_offset = 68,
>  };
>  
>  /* resource is set at runtime */
> diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
> index 60f1c8cc5363..b32f27f929d1 100644
> --- a/arch/sparc/kernel/time_64.c
> +++ b/arch/sparc/kernel/time_64.c
> @@ -544,6 +544,7 @@ static void mostek_write_byte(struct device *dev, u32 ofs, u8 val)
>  static struct m48t59_plat_data m48t59_data = {
>  	.read_byte	= mostek_read_byte,
>  	.write_byte	= mostek_write_byte,
> +	.yy_offset	= 68,
>  };
>  
>  static struct platform_device m48t59_rtc = {
> diff --git a/drivers/rtc/rtc-m48t59.c b/drivers/rtc/rtc-m48t59.c
> index 5d30ce8e13ca..4e608bc8bbd3 100644
> --- a/drivers/rtc/rtc-m48t59.c
> +++ b/drivers/rtc/rtc-m48t59.c
> @@ -71,7 +71,7 @@ static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm)
>  	/* Issue the READ command */
>  	M48T59_SET_BITS(M48T59_CNTL_READ, M48T59_CNTL);
>  
> -	tm->tm_year	= bcd2bin(M48T59_READ(M48T59_YEAR));
> +	tm->tm_year	= bcd2bin(M48T59_READ(M48T59_YEAR)) + pdata->yy_offset;
>  	/* tm_mon is 0-11 */
>  	tm->tm_mon	= bcd2bin(M48T59_READ(M48T59_MONTH)) - 1;
>  	tm->tm_mday	= bcd2bin(M48T59_READ(M48T59_MDAY));
> @@ -82,10 +82,6 @@ static int m48t59_rtc_read_time(struct device *dev, struct rtc_time *tm)
>  		dev_dbg(dev, "Century bit is enabled\n");
>  		tm->tm_year += 100;	/* one century */
>  	}
> -#ifdef CONFIG_SPARC
> -	/* Sun SPARC machines count years since 1968 */
> -	tm->tm_year += 68;
> -#endif
>  
>  	tm->tm_wday	= bcd2bin(val & 0x07);
>  	tm->tm_hour	= bcd2bin(M48T59_READ(M48T59_HOUR) & 0x3F);
> @@ -106,12 +102,7 @@ static int m48t59_rtc_set_time(struct device *dev, struct rtc_time *tm)
>  	struct m48t59_private *m48t59 = dev_get_drvdata(dev);
>  	unsigned long flags;
>  	u8 val = 0;
> -	int year = tm->tm_year;
> -
> -#ifdef CONFIG_SPARC
> -	/* Sun SPARC machines count years since 1968 */
> -	year -= 68;
> -#endif
> +	int year = tm->tm_year - pdata->yy_offset;
>  
>  	dev_dbg(dev, "RTC set time %04d-%02d-%02d %02d/%02d/%02d\n",
>  		year + 1900, tm->tm_mon, tm->tm_mday,
> @@ -162,11 +153,7 @@ static int m48t59_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
>  	/* Issue the READ command */
>  	M48T59_SET_BITS(M48T59_CNTL_READ, M48T59_CNTL);
>  
> -	tm->tm_year = bcd2bin(M48T59_READ(M48T59_YEAR));
> -#ifdef CONFIG_SPARC
> -	/* Sun SPARC machines count years since 1968 */
> -	tm->tm_year += 68;
> -#endif
> +	tm->tm_year = bcd2bin(M48T59_READ(M48T59_YEAR)) + pdata->yy_offset;
>  	/* tm_mon is 0-11 */
>  	tm->tm_mon = bcd2bin(M48T59_READ(M48T59_MONTH)) - 1;
>  
> @@ -197,12 +184,7 @@ static int m48t59_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)
>  	struct rtc_time *tm = &alrm->time;
>  	u8 mday, hour, min, sec;
>  	unsigned long flags;
> -	int year = tm->tm_year;
> -
> -#ifdef CONFIG_SPARC
> -	/* Sun SPARC machines count years since 1968 */
> -	year -= 68;
> -#endif
> +	int year = tm->tm_year - pdata->yy_offset;
>  
>  	/* If no irq, we don't support ALARM */
>  	if (m48t59->irq == NO_IRQ)
> diff --git a/include/linux/rtc/m48t59.h b/include/linux/rtc/m48t59.h
> index 9465d5405fe2..373ba77071c6 100644
> --- a/include/linux/rtc/m48t59.h
> +++ b/include/linux/rtc/m48t59.h
> @@ -56,6 +56,9 @@ struct m48t59_plat_data {
>  	void __iomem *ioaddr;
>  	/* offset to RTC registers, automatically set according to the type */
>  	unsigned int offset;
> +
> +	/* YY digits (in RTC) are offset, i.e. year is 1900 + yy_offset + YY */
> +	int yy_offset;
>  };
>  
>  #endif /* _LINUX_RTC_M48T59_H_ */

Tested-by: Andreas Larsson <andreas@gaisler.com>
Acked-by: Andreas Larsson <andreas@gaisler.com>

Thanks,
Andreas

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: (subset) [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value
  2024-11-12 22:32 ` [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value Finn Thain
  2024-11-15 15:49   ` Andreas Larsson
@ 2024-11-18 13:32   ` Alexandre Belloni
  2024-11-20 22:13     ` Finn Thain
  1 sibling, 1 reply; 12+ messages in thread
From: Alexandre Belloni @ 2024-11-18 13:32 UTC (permalink / raw)
  To: David S. Miller, Andreas Larsson, Finn Thain
  Cc: Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc, sparclinux,
	linux-kernel

On Wed, 13 Nov 2024 09:32:15 +1100, Finn Thain wrote:
> Instead of hard-coded values and ifdefs, store the year offset in the
> platform_data struct.
> 
> 

Applied, thanks!

[1/2] rtc: m48t59: Use platform_data struct for year offset value
      https://git.kernel.org/abelloni/c/a06e4a93067c

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: (subset) [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value
  2024-11-18 13:32   ` (subset) " Alexandre Belloni
@ 2024-11-20 22:13     ` Finn Thain
  2024-11-21 17:46       ` Alexandre Belloni
  0 siblings, 1 reply; 12+ messages in thread
From: Finn Thain @ 2024-11-20 22:13 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Geert Uytterhoeven, David S. Miller, Andreas Larsson,
	Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc, sparclinux,
	linux-kernel


On Mon, 18 Nov 2024, Alexandre Belloni wrote:

> On Wed, 13 Nov 2024 09:32:15 +1100, Finn Thain wrote:
> > Instead of hard-coded values and ifdefs, store the year offset in the
> > platform_data struct.
> > 
> > 
> 
> Applied, thanks!
> 
> [1/2] rtc: m48t59: Use platform_data struct for year offset value
>       https://git.kernel.org/abelloni/c/a06e4a93067c
> 

Thanks, Alexandre. Would you also take patch 2/2, please? Geert has sent a 
reviewed-by tag for that one too.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: (subset) [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value
  2024-11-20 22:13     ` Finn Thain
@ 2024-11-21 17:46       ` Alexandre Belloni
  2024-11-21 18:52         ` Geert Uytterhoeven
  2024-11-21 22:24         ` Finn Thain
  0 siblings, 2 replies; 12+ messages in thread
From: Alexandre Belloni @ 2024-11-21 17:46 UTC (permalink / raw)
  To: Finn Thain
  Cc: Geert Uytterhoeven, David S. Miller, Andreas Larsson,
	Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc, sparclinux,
	linux-kernel

On 21/11/2024 09:13:32+1100, Finn Thain wrote:
> 
> On Mon, 18 Nov 2024, Alexandre Belloni wrote:
> 
> > On Wed, 13 Nov 2024 09:32:15 +1100, Finn Thain wrote:
> > > Instead of hard-coded values and ifdefs, store the year offset in the
> > > platform_data struct.
> > > 
> > > 
> > 
> > Applied, thanks!
> > 
> > [1/2] rtc: m48t59: Use platform_data struct for year offset value
> >       https://git.kernel.org/abelloni/c/a06e4a93067c
> > 
> 
> Thanks, Alexandre. Would you also take patch 2/2, please? Geert has sent a 
> reviewed-by tag for that one too.

I thought Geert would take it as this only touches arch/m68k

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: (subset) [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value
  2024-11-21 17:46       ` Alexandre Belloni
@ 2024-11-21 18:52         ` Geert Uytterhoeven
  2024-11-21 22:24         ` Finn Thain
  1 sibling, 0 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2024-11-21 18:52 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Finn Thain, David S. Miller, Andreas Larsson, Daniel Palmer,
	Michael Pavone, linux-m68k, linux-rtc, sparclinux, linux-kernel

Hi Alexandre,

On Thu, Nov 21, 2024 at 6:46 PM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> On 21/11/2024 09:13:32+1100, Finn Thain wrote:
> > On Mon, 18 Nov 2024, Alexandre Belloni wrote:
> > > On Wed, 13 Nov 2024 09:32:15 +1100, Finn Thain wrote:
> > > > Instead of hard-coded values and ifdefs, store the year offset in the
> > > > platform_data struct.
> > >
> > > Applied, thanks!
> > >
> > > [1/2] rtc: m48t59: Use platform_data struct for year offset value
> > >       https://git.kernel.org/abelloni/c/a06e4a93067c
> >
> > Thanks, Alexandre. Would you also take patch 2/2, please? Geert has sent a
> > reviewed-by tag for that one too.
>
> I thought Geert would take it as this only touches arch/m68k

I can do that only after v6.13-rc1 has been released, due to the hard
dependency on the new m48t59_plat_data.yy_offset member.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: (subset) [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value
  2024-11-21 17:46       ` Alexandre Belloni
  2024-11-21 18:52         ` Geert Uytterhoeven
@ 2024-11-21 22:24         ` Finn Thain
  1 sibling, 0 replies; 12+ messages in thread
From: Finn Thain @ 2024-11-21 22:24 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Geert Uytterhoeven, David S. Miller, Andreas Larsson,
	Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc, sparclinux,
	linux-kernel


On Thu, 21 Nov 2024, Alexandre Belloni wrote:

> On 21/11/2024 09:13:32+1100, Finn Thain wrote:
> > 
> > On Mon, 18 Nov 2024, Alexandre Belloni wrote:
> > 
> > > On Wed, 13 Nov 2024 09:32:15 +1100, Finn Thain wrote:
> > > > Instead of hard-coded values and ifdefs, store the year offset in the
> > > > platform_data struct.
> > > > 
> > > > 
> > > 
> > > Applied, thanks!
> > > 
> > > [1/2] rtc: m48t59: Use platform_data struct for year offset value
> > >       https://git.kernel.org/abelloni/c/a06e4a93067c
> > > 
> > 
> > Thanks, Alexandre. Would you also take patch 2/2, please? Geert has sent a 
> > reviewed-by tag for that one too.
> 
> I thought Geert would take it as this only touches arch/m68k
> 

That's quite understandable -- I accidentally addressed it "To: Geert". 
Sorry for any confusion caused.

Anyway, would you please pick up patch 2/2 also? After all, patch 2/2 is 
the reason why patch 1/2 exists. Indeed, 1/2 was written several years 
after 2/2, in response to your recent review of 2/2.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 2/2] m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver
  2024-11-12 22:32 ` [PATCH v4 2/2] m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver Finn Thain
@ 2024-11-22 14:44   ` Geert Uytterhoeven
  2024-11-22 23:03     ` Alexandre Belloni
  0 siblings, 1 reply; 12+ messages in thread
From: Geert Uytterhoeven @ 2024-11-22 14:44 UTC (permalink / raw)
  To: Finn Thain, Alexandre Belloni
  Cc: Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc,
	linux-kernel

On Tue, Nov 12, 2024 at 11:51 PM Finn Thain <fthain@linux-m68k.org> wrote:
> Both mvme147 and mvme16x platforms have their own RTC driver
> implementations that duplicate functionality provided by the rtc-m48t59
> driver. Adopt the rtc-m48t59 driver and remove the other ones.
>
> Tested-by: Daniel Palmer <daniel@0x0f.com>
> Signed-off-by: Finn Thain <fthain@linux-m68k.org>
> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> This patch depends upon the m48t59 driver changes in the preceding patch.
>
> Changed since v1:
>  - Initialize yy_offset in struct m48t59_plat_data.
>
> Changed Since v3:
>  - Re-ordered defconfig symbols.
>  - Added reviewed-by tag from arch maintainer.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
so it still can make it into v6.13-rc1 via RTC?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 2/2] m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver
  2024-11-22 14:44   ` Geert Uytterhoeven
@ 2024-11-22 23:03     ` Alexandre Belloni
  2024-11-24  9:42       ` Geert Uytterhoeven
  0 siblings, 1 reply; 12+ messages in thread
From: Alexandre Belloni @ 2024-11-22 23:03 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Finn Thain, Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc,
	linux-kernel

On 22/11/2024 15:44:33+0100, Geert Uytterhoeven wrote:
> On Tue, Nov 12, 2024 at 11:51 PM Finn Thain <fthain@linux-m68k.org> wrote:
> > Both mvme147 and mvme16x platforms have their own RTC driver
> > implementations that duplicate functionality provided by the rtc-m48t59
> > driver. Adopt the rtc-m48t59 driver and remove the other ones.
> >
> > Tested-by: Daniel Palmer <daniel@0x0f.com>
> > Signed-off-by: Finn Thain <fthain@linux-m68k.org>
> > Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > ---
> > This patch depends upon the m48t59 driver changes in the preceding patch.
> >
> > Changed since v1:
> >  - Initialize yy_offset in struct m48t59_plat_data.
> >
> > Changed Since v3:
> >  - Re-ordered defconfig symbols.
> >  - Added reviewed-by tag from arch maintainer.
> 
> Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> so it still can make it into v6.13-rc1 via RTC?

It is now applied, it is going to conflict with your tree as it didn't
cleanly apply. I don't think this is going to cause issues but I'll let
it sit in linux-next for a few days before sending to Linus.


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v4 2/2] m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver
  2024-11-22 23:03     ` Alexandre Belloni
@ 2024-11-24  9:42       ` Geert Uytterhoeven
  0 siblings, 0 replies; 12+ messages in thread
From: Geert Uytterhoeven @ 2024-11-24  9:42 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Finn Thain, Daniel Palmer, Michael Pavone, linux-m68k, linux-rtc,
	linux-kernel

Hi Alexandre,

On Sat, Nov 23, 2024 at 12:03 AM Alexandre Belloni
<alexandre.belloni@bootlin.com> wrote:
> On 22/11/2024 15:44:33+0100, Geert Uytterhoeven wrote:
> > On Tue, Nov 12, 2024 at 11:51 PM Finn Thain <fthain@linux-m68k.org> wrote:
> > > Both mvme147 and mvme16x platforms have their own RTC driver
> > > implementations that duplicate functionality provided by the rtc-m48t59
> > > driver. Adopt the rtc-m48t59 driver and remove the other ones.
> > >
> > > Tested-by: Daniel Palmer <daniel@0x0f.com>
> > > Signed-off-by: Finn Thain <fthain@linux-m68k.org>
> > > Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > > ---
> > > This patch depends upon the m48t59 driver changes in the preceding patch.
> > >
> > > Changed since v1:
> > >  - Initialize yy_offset in struct m48t59_plat_data.
> > >
> > > Changed Since v3:
> > >  - Re-ordered defconfig symbols.
> > >  - Added reviewed-by tag from arch maintainer.
> >
> > Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
> > so it still can make it into v6.13-rc1 via RTC?
>
> It is now applied, it is going to conflict with your tree as it didn't
> cleanly apply. I don't think this is going to cause issues but I'll let
> it sit in linux-next for a few days before sending to Linus.

Thanks! It indeed conflicts with what I sent to Linus, and thus with
Linus' current tree, due to nearby changes. If you think the conflict
is too serious, feel free to drop the commit, and I'll pick it up
for v6.14-rc1.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-11-24  9:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 22:32 [PATCH v4 0/2] MVME: Adopt standard RTC driver Finn Thain
2024-11-12 22:32 ` [PATCH v4 2/2] m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver Finn Thain
2024-11-22 14:44   ` Geert Uytterhoeven
2024-11-22 23:03     ` Alexandre Belloni
2024-11-24  9:42       ` Geert Uytterhoeven
2024-11-12 22:32 ` [PATCH v4 1/2] rtc: m48t59: Use platform_data struct for year offset value Finn Thain
2024-11-15 15:49   ` Andreas Larsson
2024-11-18 13:32   ` (subset) " Alexandre Belloni
2024-11-20 22:13     ` Finn Thain
2024-11-21 17:46       ` Alexandre Belloni
2024-11-21 18:52         ` Geert Uytterhoeven
2024-11-21 22:24         ` Finn Thain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).