Skip to contentSkip to conversation

Stop setting max_user_freq in rtc drivers

PATCH In review Alexandre Belloni 4 participants 15 messages Nov 1, 2025 – Nov 2, 2025

Subsystems (3)
lore
Share & tools
lore

Alexandre Belloni

author maintainer
#0 lore raw

cover Stop setting max_user_freq in rtc drivers

max_user_freq has not been related to the hardware RTC since 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). It is not limited by the hardware capabilities and so it is not necessary to set it from the RTC drivers as a user with sufficient rights will be able to change the value. Also, max_user_freq is always clamped to 5000, there is not point in setting an higher value.

---
Alexandre Belloni (11):
rtc: sa1100: stop setting max_user_freq
rtc: ds1685: stop setting max_user_freq
rtc: pic32: stop setting max_user_freq
rtc: renesas-rtca3: stop setting max_user_freq
rtc: rv3028: stop setting max_user_freq
rtc: rv3032: stop setting max_user_freq
rtc: rv8803: stop setting max_user_freq
rtc: rx6110: stop setting max_user_freq
rtc: rx8010: stop setting max_user_freq
rtc: rx8025: stop setting max_user_freq
rtc: sh: stop setting max_user_freq

 drivers/rtc/rtc-ds1685.c        | 3 ---
 drivers/rtc/rtc-pic32.c         | 2 --
 drivers/rtc/rtc-renesas-rtca3.c | 1 -
 drivers/rtc/rtc-rv3028.c        | 2 --
 drivers/rtc/rtc-rv3032.c        | 2 --
 drivers/rtc/rtc-rv8803.c        | 2 --
 drivers/rtc/rtc-rx6110.c        | 2 --
 drivers/rtc/rtc-rx8010.c        | 1 -
 drivers/rtc/rtc-rx8025.c        | 2 --
 drivers/rtc/rtc-sa1100.c        | 3 ---
 drivers/rtc/rtc-sh.c            | 1 -
 include/linux/rtc/ds1685.h      | 1 -
 12 files changed, 22 deletions(-)

---
base-commit: 384150d7a5b60c1086790a8ee07b0629f906cca2
change-id: 20251031-max_user_freq-53e362de297e

Best regards,

Signature · 1 line
Alexandre Belloni <[email protected]>
author maintainer
#1 lore raw

PATCH 1/11 rtc: sa1100: stop setting max_user_freq

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-sa1100.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/rtc/rtc-sa1100.c +0 -3
index 1ad93648d69c..26b2f4184ecc 100644
@@ -40,8 +40,6 @@
 
 #define RTC_DEF_DIVIDER		(32768 - 1)
 #define RTC_DEF_TRIM		0
-#define RTC_FREQ		1024
-
 
 static irqreturn_t sa1100_rtc_interrupt(int irq, void *dev_id)
 {
@@ -202,7 +200,6 @@ int sa1100_rtc_init(struct platform_device *pdev, struct sa1100_rtc *info)
 	}
 
 	info->rtc->ops = &sa1100_rtc_ops;
-	info->rtc->max_user_freq = RTC_FREQ;
 	info->rtc->range_max = U32_MAX;
 
 	ret = devm_rtc_register_device(info->rtc);
Signature · 1 line
2.51.1
author maintainer
#2 lore raw

PATCH 2/11 rtc: ds1685: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-ds1685.c   | 3 ---
 include/linux/rtc/ds1685.h | 1 -
 2 files changed, 4 deletions(-)
drivers/rtc/rtc-ds1685.c +0 -3
index 97423f1d0361..5fc8e36b1abf 100644
@@ -1268,9 +1268,6 @@ ds1685_rtc_probe(struct platform_device *pdev)
 	rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000;
 	rtc_dev->range_max = RTC_TIMESTAMP_END_2099;
 
-	/* Maximum periodic rate is 8192Hz (0.122070ms). */
-	rtc_dev->max_user_freq = RTC_MAX_USER_FREQ;
-
 	/* See if the platform doesn't support UIE. */
 	if (pdata->uie_unsupported)
 		clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc_dev->features);
include/linux/rtc/ds1685.h +0 -1
index 01da4582db6d..8ec0ebfaef04 100644
@@ -324,7 +324,6 @@ struct ds1685_rtc_platform_data {
 #define RTC_SQW_2HZ		0x0f	/*  0    1   1   1   1  */
 #define RTC_SQW_0HZ		0x00	/*  0    0   0   0   0  */
 #define RTC_SQW_32768HZ		32768	/*  1    -   -   -   -  */
-#define RTC_MAX_USER_FREQ	8192
 
 
 /*
Signature · 1 line
2.51.1
maintainer Acked-by on v1 2/11
#3 lore raw

Re: [PATCH 02/11] rtc: ds1685: stop setting max_user_freq

Quoted 30 lines · Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
  drivers/rtc/rtc-ds1685.c   | 3 ---
  include/linux/rtc/ds1685.h | 1 -
  2 files changed, 4 deletions(-)
drivers/rtc/rtc-ds1685.c +0 -3
index 97423f1d0361..5fc8e36b1abf 100644
@@ -1268,9 +1268,6 @@ ds1685_rtc_probe(struct platform_device *pdev)
  	rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000;
  	rtc_dev->range_max = RTC_TIMESTAMP_END_2099;
 
-	/* Maximum periodic rate is 8192Hz (0.122070ms). */
-	rtc_dev->max_user_freq = RTC_MAX_USER_FREQ;
-
  	/* See if the platform doesn't support UIE. */
  	if (pdata->uie_unsupported)
  		clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc_dev->features);
include/linux/rtc/ds1685.h +0 -0
index 01da4582db6d..8ec0ebfaef04 100644

include/linux/rtc/ds1685.h struct ds1685_rtc_platform_data { · line 329

Quoted 7 lines
include/linux/rtc/ds1685.h +0 -1
@@ -324,7 +324,6 @@ struct ds1685_rtc_platform_data {
  #define RTC_SQW_2HZ		0x0f	/*  0    1   1   1   1  */
  #define RTC_SQW_0HZ		0x00	/*  0    0   0   0   0  */
  #define RTC_SQW_32768HZ		32768	/*  1    -   -   -   -  */
-#define RTC_MAX_USER_FREQ	8192
 
 
  /*
author maintainer
#4 lore raw

PATCH 3/11 rtc: pic32: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-pic32.c | 2 --
 1 file changed, 2 deletions(-)
drivers/rtc/rtc-pic32.c +0 -2
index 2812da2c50c5..52c11532bc3a 100644
@@ -340,8 +340,6 @@ static int pic32_rtc_probe(struct platform_device *pdev)
 	if (ret)
 		goto err_nortc;
 
-	pdata->rtc->max_user_freq = 128;
-
 	pic32_rtc_setfreq(&pdev->dev, 1);
 	ret = devm_request_irq(&pdev->dev, pdata->alarm_irq,
 			       pic32_rtc_alarmirq, 0,
Signature · 1 line
2.51.1
author maintainer
#5 lore raw

PATCH 4/11 rtc: renesas-rtca3: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-renesas-rtca3.c | 1 -
 1 file changed, 1 deletion(-)
drivers/rtc/rtc-renesas-rtca3.c +0 -1
index ab816bdf0d77..a238ead6cf1a 100644
@@ -772,7 +772,6 @@ static int rtca3_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->rtc_dev);
 
 	priv->rtc_dev->ops = &rtca3_ops;
-	priv->rtc_dev->max_user_freq = 256;
 	priv->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000;
 	priv->rtc_dev->range_max = RTC_TIMESTAMP_END_2099;
 
Signature · 1 line
2.51.1
Reviewed-by on v1 4/11
#6 lore raw

Re: [PATCH 04/11] rtc: renesas-rtca3: stop setting max_user_freq

Quoted 5 lines · Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

Quoted 17 lines
---
 drivers/rtc/rtc-renesas-rtca3.c | 1 -
 1 file changed, 1 deletion(-)
drivers/rtc/rtc-renesas-rtca3.c +0 -1
index ab816bdf0d77..a238ead6cf1a 100644
@@ -772,7 +772,6 @@ static int rtca3_probe(struct platform_device *pdev)
 		return PTR_ERR(priv->rtc_dev);
 
 	priv->rtc_dev->ops = &rtca3_ops;
-	priv->rtc_dev->max_user_freq = 256;
 	priv->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000;
 	priv->rtc_dev->range_max = RTC_TIMESTAMP_END_2099;
 
author maintainer
#7 lore raw

PATCH 5/11 rtc: rv3028: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-rv3028.c | 2 --
 1 file changed, 2 deletions(-)
drivers/rtc/rtc-rv3028.c +0 -2
index c2a531f0e125..d96f6bb68850 100644
@@ -1023,8 +1023,6 @@ static int rv3028_probe(struct i2c_client *client)
 	eeprom_cfg.priv = rv3028;
 	devm_rtc_nvmem_register(rv3028->rtc, &eeprom_cfg);
 
-	rv3028->rtc->max_user_freq = 1;
-
 #ifdef CONFIG_COMMON_CLK
 	rv3028_clkout_register_clk(rv3028, client);
 #endif
Signature · 1 line
2.51.1
author maintainer
#8 lore raw

PATCH 6/11 rtc: rv3032: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-rv3032.c | 2 --
 1 file changed, 2 deletions(-)
drivers/rtc/rtc-rv3032.c +0 -2
index b8376bd1d905..6c09da7738e1 100644
@@ -968,8 +968,6 @@ static int rv3032_probe(struct i2c_client *client)
 	eeprom_cfg.priv = rv3032;
 	devm_rtc_nvmem_register(rv3032->rtc, &eeprom_cfg);
 
-	rv3032->rtc->max_user_freq = 1;
-
 #ifdef CONFIG_COMMON_CLK
 	rv3032_clkout_register_clk(rv3032, client);
 #endif
Signature · 1 line
2.51.1
author maintainer
#9 lore raw

PATCH 7/11 rtc: rv8803: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-rv8803.c | 2 --
 1 file changed, 2 deletions(-)
drivers/rtc/rtc-rv8803.c +0 -2
index 1327251e527c..4e9e04cbec89 100644
@@ -738,8 +738,6 @@ static int rv8803_probe(struct i2c_client *client)
 
 	devm_rtc_nvmem_register(rv8803->rtc, &nvmem_cfg);
 
-	rv8803->rtc->max_user_freq = 1;
-
 	return 0;
 }
 
Signature · 1 line
2.51.1
author maintainer
#10 lore raw

PATCH 8/11 rtc: rx6110: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-rx6110.c | 2 --
 1 file changed, 2 deletions(-)
drivers/rtc/rtc-rx6110.c +0 -2
index 7c423d672adb..07bf35ac8d79 100644
@@ -324,8 +324,6 @@ static int rx6110_probe(struct rx6110_data *rx6110, struct device *dev)
 	if (err)
 		return err;
 
-	rx6110->rtc->max_user_freq = 1;
-
 	return 0;
 }
 
Signature · 1 line
2.51.1
author maintainer
#11 lore raw

PATCH 9/11 rtc: rx8010: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-rx8010.c | 1 -
 1 file changed, 1 deletion(-)
drivers/rtc/rtc-rx8010.c +0 -1
index 2b6198d1cf81..171240e50f48 100644
@@ -412,7 +412,6 @@ static int rx8010_probe(struct i2c_client *client)
 	}
 
 	rx8010->rtc->ops = &rx8010_rtc_ops;
-	rx8010->rtc->max_user_freq = 1;
 	rx8010->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
 	rx8010->rtc->range_max = RTC_TIMESTAMP_END_2099;
 
Signature · 1 line
2.51.1
author maintainer
#12 lore raw

PATCH 10/11 rtc: rx8025: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-rx8025.c | 2 --
 1 file changed, 2 deletions(-)
drivers/rtc/rtc-rx8025.c +0 -2
index aabe62c283a1..07119985fa83 100644
@@ -565,8 +565,6 @@ static int rx8025_probe(struct i2c_client *client)
 			clear_bit(RTC_FEATURE_ALARM, rx8025->rtc->features);
 	}
 
-	rx8025->rtc->max_user_freq = 1;
-
 	set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rx8025->rtc->features);
 	clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rx8025->rtc->features);
 
Signature · 1 line
2.51.1
author maintainer
#13 lore raw

PATCH 11/11 rtc: sh: stop setting max_user_freq

In reply to Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.

---
 drivers/rtc/rtc-sh.c | 1 -
 1 file changed, 1 deletion(-)
drivers/rtc/rtc-sh.c +0 -1
index 619800a00479..0510dc64c3e2 100644
@@ -423,7 +423,6 @@ static int __init sh_rtc_probe(struct platform_device *pdev)
 	writeb(tmp, rtc->regbase + RCR1);
 
 	rtc->rtc_dev->ops = &sh_rtc_ops;
-	rtc->rtc_dev->max_user_freq = 256;
 
 	if (rtc->capabilities & RTC_CAP_4_DIGIT_YEAR) {
 		rtc->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_1900;
Signature · 1 line
2.51.1
Reviewed-by on v1 11/11
#14 lore raw

Re: [PATCH 11/11] rtc: sh: stop setting max_user_freq

Quoted 5 lines · Alexandre Belloni

max_user_freq has not been related to the hardware RTC since commit 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events"). Stop setting it from individual driver to avoid confusing new contributors.