History

Merge tag 'rtc-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux

Pull RTC updates from Alexandre Belloni: "Not much this cycle, there are multiple small fixes. Core: - use boolean values with device_init_wakeup() Drivers: - pcf2127: add BSM support - pcf85063: fix possible out of bounds write" * tag 'rtc-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: pcf2127: add BSM support rtc: Remove hpet_rtc_dropped_irq() dt-bindings: rtc: mxc: Document fsl,imx31-rtc rtc: stm32: Use syscon_regmap_lookup_by_phandle_args rtc: zynqmp: Fix optional clock name property rtc: loongson: clear TOY_MATCH0_REG in loongson_rtc_isr() rtc: pcf85063: fix potential OOB write in PCF85063 NVMEM read rtc: tps6594: Fix integer overflow on 32bit systems rtc: use boolean values with device_init_wakeup() rtc: RTC_DRV_SPEAR should not default to y when compile-testing

Linus Torvalds committed 1 year ago

Commit 2a9f04b2 parents a4b5e48 972745261 files · +180 −102Browse files

Unified · Split

61 files
  1. Documentation/devicetree/bindings/rtc/rtc-mxc.yaml +7 −3
  2. arch/x86/include/asm/hpet.h +0 −1
  3. arch/x86/kernel/hpet.c +0 −6
  4. drivers/rtc/Kconfig +1 −1
  5. drivers/rtc/rtc-88pm80x.c +1 −1
  6. drivers/rtc/rtc-88pm860x.c +1 −1
  7. drivers/rtc/rtc-amlogic-a4.c +3 −3
  8. drivers/rtc/rtc-armada38x.c +1 −1
  9. drivers/rtc/rtc-as3722.c +1 −1
  10. drivers/rtc/rtc-at91rm9200.c +1 −1
  11. drivers/rtc/rtc-at91sam9.c +1 −1
  12. drivers/rtc/rtc-cadence.c +1 −1
  13. drivers/rtc/rtc-cmos.c +1 −6
  14. drivers/rtc/rtc-cpcap.c +1 −1
  15. drivers/rtc/rtc-cros-ec.c +1 −1
  16. drivers/rtc/rtc-da9055.c +1 −1
  17. drivers/rtc/rtc-ds3232.c +1 −1
  18. drivers/rtc/rtc-isl1208.c +1 −1
  19. drivers/rtc/rtc-jz4740.c +1 −1
  20. drivers/rtc/rtc-loongson.c +10 −7
  21. drivers/rtc/rtc-lp8788.c +1 −1
  22. drivers/rtc/rtc-lpc32xx.c +1 −1
  23. drivers/rtc/rtc-max77686.c +1 −1
  24. drivers/rtc/rtc-max8925.c +1 −1
  25. drivers/rtc/rtc-max8997.c +1 −1
  26. drivers/rtc/rtc-meson-vrtc.c +1 −1
  27. drivers/rtc/rtc-mpc5121.c +1 −1
  28. drivers/rtc/rtc-mt6397.c +1 −1
  29. drivers/rtc/rtc-mv.c +2 −2
  30. drivers/rtc/rtc-mxc.c +1 −1
  31. drivers/rtc/rtc-mxc_v2.c +1 −1
  32. drivers/rtc/rtc-omap.c +1 −1
  33. drivers/rtc/rtc-palmas.c +1 −1
  34. drivers/rtc/rtc-pcf2127.c +82 −0
  35. drivers/rtc/rtc-pcf85063.c +10 −1
  36. drivers/rtc/rtc-pic32.c +1 −1
  37. drivers/rtc/rtc-pm8xxx.c +1 −1
  38. drivers/rtc/rtc-pxa.c +1 −1
  39. drivers/rtc/rtc-rc5t583.c +1 −1
  40. drivers/rtc/rtc-rc5t619.c +1 −1
  41. drivers/rtc/rtc-renesas-rtca3.c +1 −1
  42. drivers/rtc/rtc-rk808.c +1 −1
  43. drivers/rtc/rtc-s3c.c +1 −1
  44. drivers/rtc/rtc-s5m.c +1 −1
  45. drivers/rtc/rtc-sa1100.c +1 −1
  46. drivers/rtc/rtc-sc27xx.c +2 −2
  47. drivers/rtc/rtc-sh.c +1 −1
  48. drivers/rtc/rtc-spear.c +2 −2
  49. drivers/rtc/rtc-stm32.c +7 −15
  50. drivers/rtc/rtc-sun6i.c +1 −1
  51. drivers/rtc/rtc-sunplus.c +2 −2
  52. drivers/rtc/rtc-tegra.c +1 −1
  53. drivers/rtc/rtc-test.c +1 −1
  54. drivers/rtc/rtc-tps6586x.c +1 −1
  55. drivers/rtc/rtc-tps65910.c +1 −1
  56. drivers/rtc/rtc-tps6594.c +1 −1
  57. drivers/rtc/rtc-twl.c +1 −1
  58. drivers/rtc/rtc-wm831x.c +1 −1
  59. drivers/rtc/rtc-wm8350.c +1 −1
  60. drivers/rtc/rtc-xgene.c +2 −2
  61. drivers/rtc/rtc-zynqmp.c +4 −4
Documentation/devicetree/bindings/rtc/rtc-mxc.yaml+7−3
@@ -14,9 +14,13 @@ maintainers: · 13 unmodified lines
1414
1515 properties:
1616 compatible:
17− enum:
18− - fsl,imx1-rtc
19− - fsl,imx21-rtc
17+ oneOf:
18+ - const: fsl,imx1-rtc
19+ - const: fsl,imx21-rtc
20+ - items:
21+ - enum:
22+ - fsl,imx31-rtc
23+ - const: fsl,imx21-rtc
2024
2125 reg:
2226 maxItems: 1
arch/x86/include/asm/hpet.h+0−1
@@ -84,7 +84,6 @@ extern int hpet_set_rtc_irq_bit(unsigned long bit_mask); · 83 unmodified lines
8484 extern int hpet_set_alarm_time(unsigned char hrs, unsigned char min,
8585 unsigned char sec);
8686 extern int hpet_set_periodic_freq(unsigned long freq);
87−extern int hpet_rtc_dropped_irq(void);
8887 extern int hpet_rtc_timer_init(void);
8988 extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
9089 extern int hpet_register_irq_handler(rtc_irq_handler handler);
arch/x86/kernel/hpet.c+0−6
@@ -1382,12 +1382,6 @@ int hpet_set_periodic_freq(unsigned long freq) · 1381 unmodified lines
13821382 }
13831383 EXPORT_SYMBOL_GPL(hpet_set_periodic_freq);
13841384
1385−int hpet_rtc_dropped_irq(void)
1386−{
1387− return is_hpet_enabled();
1388−}
1389−EXPORT_SYMBOL_GPL(hpet_rtc_dropped_irq);
1390−
13911385 static void hpet_rtc_timer_reinit(void)
13921386 {
13931387 unsigned int delta;
drivers/rtc/Kconfig+1−1
@@ -1316,7 +1316,7 @@ config RTC_DRV_SC27XX · 1315 unmodified lines
13161316 config RTC_DRV_SPEAR
13171317 tristate "SPEAR ST RTC"
13181318 depends on PLAT_SPEAR || COMPILE_TEST
1319− default y
1319+ default PLAT_SPEAR
13201320 help
13211321 If you say Y here you will get support for the RTC found on
13221322 spear
drivers/rtc/rtc-88pm80x.c+1−1
@@ -308,7 +308,7 @@ static int pm80x_rtc_probe(struct platform_device *pdev) · 307 unmodified lines
308308 /* remember whether this power up is caused by PMIC RTC or not */
309309 info->rtc_dev->dev.platform_data = &pdata->rtc_wakeup;
310310
311− device_init_wakeup(&pdev->dev, 1);
311+ device_init_wakeup(&pdev->dev, true);
312312
313313 return 0;
314314 out_rtc:
drivers/rtc/rtc-88pm860x.c+1−1
@@ -326,7 +326,7 @@ static int pm860x_rtc_probe(struct platform_device *pdev) · 325 unmodified lines
326326 schedule_delayed_work(&info->calib_work, VRTC_CALIB_INTERVAL);
327327 #endif /* VRTC_CALIBRATION */
328328
329− device_init_wakeup(&pdev->dev, 1);
329+ device_init_wakeup(&pdev->dev, true);
330330
331331 return 0;
332332 }
drivers/rtc/rtc-amlogic-a4.c+3−3
@@ -361,7 +361,7 @@ static int aml_rtc_probe(struct platform_device *pdev) · 360 unmodified lines
361361 "failed to get_enable rtc sys clk\n");
362362 aml_rtc_init(rtc);
363363
364− device_init_wakeup(dev, 1);
364+ device_init_wakeup(dev, true);
365365 platform_set_drvdata(pdev, rtc);
366366
367367 rtc->rtc_dev = devm_rtc_allocate_device(dev);
@@ -391,7 +391,7 @@ static int aml_rtc_probe(struct platform_device *pdev) · 23 unmodified lines
391391 return 0;
392392 err_clk:
393393 clk_disable_unprepare(rtc->sys_clk);
394− device_init_wakeup(dev, 0);
394+ device_init_wakeup(dev, false);
395395
396396 return ret;
397397 }
@@ -426,7 +426,7 @@ static void aml_rtc_remove(struct platform_device *pdev) · 28 unmodified lines
426426 struct aml_rtc_data *rtc = dev_get_drvdata(&pdev->dev);
427427
428428 clk_disable_unprepare(rtc->sys_clk);
429− device_init_wakeup(&pdev->dev, 0);
429+ device_init_wakeup(&pdev->dev, false);
430430 }
431431
432432 static const struct aml_rtc_config a5_rtc_config = {
drivers/rtc/rtc-armada38x.c+1−1
@@ -527,7 +527,7 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev) · 526 unmodified lines
527527 platform_set_drvdata(pdev, rtc);
528528
529529 if (rtc->irq != -1)
530− device_init_wakeup(&pdev->dev, 1);
530+ device_init_wakeup(&pdev->dev, true);
531531 else
532532 clear_bit(RTC_FEATURE_ALARM, rtc->rtc_dev->features);
533533
drivers/rtc/rtc-as3722.c+1−1
@@ -187,7 +187,7 @@ static int as3722_rtc_probe(struct platform_device *pdev) · 186 unmodified lines
187187 return ret;
188188 }
189189
190− device_init_wakeup(&pdev->dev, 1);
190+ device_init_wakeup(&pdev->dev, true);
191191
192192 as3722_rtc->rtc = devm_rtc_device_register(&pdev->dev, "as3722-rtc",
193193 &as3722_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-at91rm9200.c+1−1
@@ -528,7 +528,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev) · 527 unmodified lines
528528 * being wake-capable; if it didn't, do that here.
529529 */
530530 if (!device_can_wakeup(&pdev->dev))
531− device_init_wakeup(&pdev->dev, 1);
531+ device_init_wakeup(&pdev->dev, true);
532532
533533 if (at91_rtc_config->has_correction)
534534 rtc->ops = &sama5d4_rtc_ops;
drivers/rtc/rtc-at91sam9.c+1−1
@@ -353,7 +353,7 @@ static int at91_rtc_probe(struct platform_device *pdev) · 352 unmodified lines
353353
354354 /* platform setup code should have handled this; sigh */
355355 if (!device_can_wakeup(&pdev->dev))
356− device_init_wakeup(&pdev->dev, 1);
356+ device_init_wakeup(&pdev->dev, true);
357357
358358 platform_set_drvdata(pdev, rtc);
359359
drivers/rtc/rtc-cadence.c+1−1
@@ -359,7 +359,7 @@ static void cdns_rtc_remove(struct platform_device *pdev) · 358 unmodified lines
359359 struct cdns_rtc *crtc = platform_get_drvdata(pdev);
360360
361361 cdns_rtc_alarm_irq_enable(&pdev->dev, 0);
362− device_init_wakeup(&pdev->dev, 0);
362+ device_init_wakeup(&pdev->dev, false);
363363
364364 clk_disable_unprepare(crtc->pclk);
365365 clk_disable_unprepare(crtc->ref_clk);
drivers/rtc/rtc-cmos.c+1−6
@@ -151,11 +151,6 @@ static inline int hpet_set_periodic_freq(unsigned long freq) · 150 unmodified lines
151151 return 0;
152152 }
153153
154−static inline int hpet_rtc_dropped_irq(void)
155−{
156− return 0;
157−}
158−
159154 static inline int hpet_rtc_timer_init(void)
160155 {
161156 return 0;
@@ -864,7 +859,7 @@ static void acpi_cmos_wake_setup(struct device *dev) · 702 unmodified lines
864859 dev_info(dev, "RTC can wake from S4\n");
865860
866861 /* RTC always wakes from S1/S2/S3, and often S4/STD */
867− device_init_wakeup(dev, 1);
862+ device_init_wakeup(dev, true);
868863 }
869864
870865 static void cmos_check_acpi_rtc_status(struct device *dev,
drivers/rtc/rtc-cpcap.c+1−1
@@ -295,7 +295,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev) · 294 unmodified lines
295295 }
296296 disable_irq(rtc->update_irq);
297297
298− err = device_init_wakeup(dev, 1);
298+ err = device_init_wakeup(dev, true);
299299 if (err) {
300300 dev_err(dev, "wakeup initialization failed (%d)\n", err);
301301 /* ignore error and continue without wakeup support */
drivers/rtc/rtc-cros-ec.c+1−1
@@ -337,7 +337,7 @@ static int cros_ec_rtc_probe(struct platform_device *pdev) · 336 unmodified lines
337337 return ret;
338338 }
339339
340− ret = device_init_wakeup(&pdev->dev, 1);
340+ ret = device_init_wakeup(&pdev->dev, true);
341341 if (ret) {
342342 dev_err(&pdev->dev, "failed to initialize wakeup\n");
343343 return ret;
drivers/rtc/rtc-da9055.c+1−1
@@ -288,7 +288,7 @@ static int da9055_rtc_probe(struct platform_device *pdev) · 287 unmodified lines
288288 if (ret & DA9055_RTC_ALM_EN)
289289 rtc->alarm_enable = 1;
290290
291− device_init_wakeup(&pdev->dev, 1);
291+ device_init_wakeup(&pdev->dev, true);
292292
293293 rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
294294 &da9055_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-ds3232.c+1−1
@@ -508,7 +508,7 @@ static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq, · 507 unmodified lines
508508 return ret;
509509
510510 if (ds3232->irq > 0)
511− device_init_wakeup(dev, 1);
511+ device_init_wakeup(dev, true);
512512
513513 ds3232_hwmon_register(dev, name);
514514
drivers/rtc/rtc-isl1208.c+1−1
@@ -830,7 +830,7 @@ static int isl1208_setup_irq(struct i2c_client *client, int irq) · 829 unmodified lines
830830 isl1208_driver.driver.name,
831831 client);
832832 if (!rc) {
833− device_init_wakeup(&client->dev, 1);
833+ device_init_wakeup(&client->dev, true);
834834 enable_irq_wake(irq);
835835 } else {
836836 dev_err(&client->dev,
drivers/rtc/rtc-jz4740.c+1−1
@@ -367,7 +367,7 @@ static int jz4740_rtc_probe(struct platform_device *pdev) · 366 unmodified lines
367367
368368 platform_set_drvdata(pdev, rtc);
369369
370− device_init_wakeup(dev, 1);
370+ device_init_wakeup(dev, true);
371371
372372 ret = dev_pm_set_wake_irq(dev, irq);
373373 if (ret)
drivers/rtc/rtc-loongson.c+10−7
@@ -114,6 +114,13 @@ static irqreturn_t loongson_rtc_isr(int irq, void *id) · 113 unmodified lines
114114 struct loongson_rtc_priv *priv = (struct loongson_rtc_priv *)id;
115115
116116 rtc_update_irq(priv->rtcdev, 1, RTC_AF | RTC_IRQF);
117+
118+ /*
119+ * The TOY_MATCH0_REG should be cleared 0 here,
120+ * otherwise the interrupt cannot be cleared.
121+ */
122+ regmap_write(priv->regmap, TOY_MATCH0_REG, 0);
123+
117124 return IRQ_HANDLED;
118125 }
119126
@@ -131,11 +138,7 @@ static u32 loongson_rtc_handler(void *id) · 11 unmodified lines
131138 writel(RTC_STS, priv->pm_base + PM1_STS_REG);
132139 spin_unlock(&priv->lock);
133140
134− /*
135− * The TOY_MATCH0_REG should be cleared 0 here,
136− * otherwise the interrupt cannot be cleared.
137− */
138− return regmap_write(priv->regmap, TOY_MATCH0_REG, 0);
141+ return ACPI_INTERRUPT_HANDLED;
139142 }
140143
141144 static int loongson_rtc_set_enabled(struct device *dev)
@@ -329,7 +332,7 @@ static int loongson_rtc_probe(struct platform_device *pdev) · 187 unmodified lines
329332 alarm_irq);
330333
331334 priv->pm_base = regs - priv->config->pm_offset;
332− device_init_wakeup(dev, 1);
335+ device_init_wakeup(dev, true);
333336
334337 if (has_acpi_companion(dev))
335338 acpi_install_fixed_event_handler(ACPI_EVENT_RTC,
@@ -360,7 +363,7 @@ static void loongson_rtc_remove(struct platform_device *pdev) · 24 unmodified lines
360363 acpi_remove_fixed_event_handler(ACPI_EVENT_RTC,
361364 loongson_rtc_handler);
362365
363− device_init_wakeup(dev, 0);
366+ device_init_wakeup(dev, false);
364367 loongson_rtc_alarm_irq_enable(dev, 0);
365368 }
366369
drivers/rtc/rtc-lp8788.c+1−1
@@ -293,7 +293,7 @@ static int lp8788_rtc_probe(struct platform_device *pdev) · 292 unmodified lines
293293 rtc->alarm = lp->pdata ? lp->pdata->alarm_sel : DEFAULT_ALARM_SEL;
294294 platform_set_drvdata(pdev, rtc);
295295
296− device_init_wakeup(dev, 1);
296+ device_init_wakeup(dev, true);
297297
298298 rtc->rdev = devm_rtc_device_register(dev, "lp8788_rtc",
299299 &lp8788_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-lpc32xx.c+1−1
@@ -257,7 +257,7 @@ static int lpc32xx_rtc_probe(struct platform_device *pdev) · 256 unmodified lines
257257 dev_warn(&pdev->dev, "Can't request interrupt.\n");
258258 rtc->irq = -1;
259259 } else {
260− device_init_wakeup(&pdev->dev, 1);
260+ device_init_wakeup(&pdev->dev, true);
261261 }
262262 }
263263
drivers/rtc/rtc-max77686.c+1−1
@@ -770,7 +770,7 @@ static int max77686_rtc_probe(struct platform_device *pdev) · 769 unmodified lines
770770 goto err_rtc;
771771 }
772772
773− device_init_wakeup(&pdev->dev, 1);
773+ device_init_wakeup(&pdev->dev, true);
774774
775775 info->rtc_dev = devm_rtc_device_register(&pdev->dev, id->name,
776776 &max77686_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-max8925.c+1−1
@@ -270,7 +270,7 @@ static int max8925_rtc_probe(struct platform_device *pdev) · 269 unmodified lines
270270 /* XXX - isn't this redundant? */
271271 platform_set_drvdata(pdev, info);
272272
273− device_init_wakeup(&pdev->dev, 1);
273+ device_init_wakeup(&pdev->dev, true);
274274
275275 info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max8925-rtc",
276276 &max8925_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-max8997.c+1−1
@@ -473,7 +473,7 @@ static int max8997_rtc_probe(struct platform_device *pdev) · 472 unmodified lines
473473 max8997_rtc_enable_wtsr(info, true);
474474 max8997_rtc_enable_smpl(info, true);
475475
476− device_init_wakeup(&pdev->dev, 1);
476+ device_init_wakeup(&pdev->dev, true);
477477
478478 info->rtc_dev = devm_rtc_device_register(&pdev->dev, "max8997-rtc",
479479 &max8997_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-meson-vrtc.c+1−1
@@ -74,7 +74,7 @@ static int meson_vrtc_probe(struct platform_device *pdev) · 73 unmodified lines
7474 if (IS_ERR(vrtc->io_alarm))
7575 return PTR_ERR(vrtc->io_alarm);
7676
77− device_init_wakeup(&pdev->dev, 1);
77+ device_init_wakeup(&pdev->dev, true);
7878
7979 platform_set_drvdata(pdev, vrtc);
8080
drivers/rtc/rtc-mpc5121.c+1−1
@@ -303,7 +303,7 @@ static int mpc5121_rtc_probe(struct platform_device *op) · 302 unmodified lines
303303 return PTR_ERR(rtc->regs);
304304 }
305305
306− device_init_wakeup(&op->dev, 1);
306+ device_init_wakeup(&op->dev, true);
307307
308308 platform_set_drvdata(op, rtc);
309309
drivers/rtc/rtc-mt6397.c+1−1
@@ -286,7 +286,7 @@ static int mtk_rtc_probe(struct platform_device *pdev) · 285 unmodified lines
286286 return ret;
287287 }
288288
289− device_init_wakeup(&pdev->dev, 1);
289+ device_init_wakeup(&pdev->dev, true);
290290
291291 rtc->rtc_dev->ops = &mtk_rtc_ops;
292292 rtc->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_1900;
drivers/rtc/rtc-mv.c+2−2
@@ -264,7 +264,7 @@ static int __init mv_rtc_probe(struct platform_device *pdev) · 263 unmodified lines
264264 }
265265
266266 if (pdata->irq >= 0)
267− device_init_wakeup(&pdev->dev, 1);
267+ device_init_wakeup(&pdev->dev, true);
268268 else
269269 clear_bit(RTC_FEATURE_ALARM, pdata->rtc->features);
270270
@@ -287,7 +287,7 @@ static void __exit mv_rtc_remove(struct platform_device *pdev) · 16 unmodified lines
287287 struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
288288
289289 if (pdata->irq >= 0)
290− device_init_wakeup(&pdev->dev, 0);
290+ device_init_wakeup(&pdev->dev, false);
291291
292292 if (!IS_ERR(pdata->clk))
293293 clk_disable_unprepare(pdata->clk);
drivers/rtc/rtc-mxc.c+1−1
@@ -377,7 +377,7 @@ static int mxc_rtc_probe(struct platform_device *pdev) · 376 unmodified lines
377377 }
378378
379379 if (pdata->irq >= 0) {
380− device_init_wakeup(&pdev->dev, 1);
380+ device_init_wakeup(&pdev->dev, true);
381381 ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
382382 if (ret)
383383 dev_err(&pdev->dev, "failed to enable irq wake\n");
drivers/rtc/rtc-mxc_v2.c+1−1
@@ -302,7 +302,7 @@ static int mxc_rtc_probe(struct platform_device *pdev) · 301 unmodified lines
302302 if (pdata->irq < 0)
303303 return pdata->irq;
304304
305− device_init_wakeup(&pdev->dev, 1);
305+ device_init_wakeup(&pdev->dev, true);
306306 ret = dev_pm_set_wake_irq(&pdev->dev, pdata->irq);
307307 if (ret)
308308 dev_err(&pdev->dev, "failed to enable irq wake\n");
drivers/rtc/rtc-omap.c+1−1
@@ -920,7 +920,7 @@ static void omap_rtc_remove(struct platform_device *pdev) · 919 unmodified lines
920920 omap_rtc_power_off_rtc = NULL;
921921 }
922922
923− device_init_wakeup(&pdev->dev, 0);
923+ device_init_wakeup(&pdev->dev, false);
924924
925925 if (!IS_ERR(rtc->clk))
926926 clk_disable_unprepare(rtc->clk);
drivers/rtc/rtc-palmas.c+1−1
@@ -287,7 +287,7 @@ static int palmas_rtc_probe(struct platform_device *pdev) · 286 unmodified lines
287287
288288 palmas_rtc->irq = platform_get_irq(pdev, 0);
289289
290− device_init_wakeup(&pdev->dev, 1);
290+ device_init_wakeup(&pdev->dev, true);
291291 palmas_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
292292 &palmas_rtc_ops, THIS_MODULE);
293293 if (IS_ERR(palmas_rtc->rtc)) {
drivers/rtc/rtc-pcf2127.c+82−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/i2c.h>
2121 #include <linux/spi/spi.h>
2222 #include <linux/bcd.h>
23+#include <linux/bitfield.h>
2324 #include <linux/rtc.h>
2425 #include <linux/slab.h>
2526 #include <linux/module.h>
@@ -48,6 +49,7 @@ · 22 unmodified lines
4849 #define PCF2127_BIT_CTRL3_BLF BIT(2)
4950 #define PCF2127_BIT_CTRL3_BF BIT(3)
5051 #define PCF2127_BIT_CTRL3_BTSE BIT(4)
52+#define PCF2127_CTRL3_PM GENMASK(7, 5)
5153 /* Time and date registers */
5254 #define PCF2127_REG_TIME_BASE 0x03
5355 #define PCF2127_BIT_SC_OSF BIT(7)
@@ -331,6 +333,84 @@ static int pcf2127_rtc_set_time(struct device *dev, struct rtc_time *tm) · 277 unmodified lines
331333 return 0;
332334 }
333335
336+static int pcf2127_param_get(struct device *dev, struct rtc_param *param)
337+{
338+ struct pcf2127 *pcf2127 = dev_get_drvdata(dev);
339+ u32 value;
340+ int ret;
341+
342+ switch (param->param) {
343+ case RTC_PARAM_BACKUP_SWITCH_MODE:
344+ ret = regmap_read(pcf2127->regmap, PCF2127_REG_CTRL3, &value);
345+ if (ret < 0)
346+ return ret;
347+
348+ value = FIELD_GET(PCF2127_CTRL3_PM, value);
349+
350+ if (value < 0x3)
351+ param->uvalue = RTC_BSM_LEVEL;
352+ else if (value < 0x6)
353+ param->uvalue = RTC_BSM_DIRECT;
354+ else
355+ param->uvalue = RTC_BSM_DISABLED;
356+
357+ break;
358+
359+ default:
360+ return -EINVAL;
361+ }
362+
363+ return 0;
364+}
365+
366+static int pcf2127_param_set(struct device *dev, struct rtc_param *param)
367+{
368+ struct pcf2127 *pcf2127 = dev_get_drvdata(dev);
369+ u8 mode = 0;
370+ u32 value;
371+ int ret;
372+
373+ switch (param->param) {
374+ case RTC_PARAM_BACKUP_SWITCH_MODE:
375+ ret = regmap_read(pcf2127->regmap, PCF2127_REG_CTRL3, &value);
376+ if (ret < 0)
377+ return ret;
378+
379+ value = FIELD_GET(PCF2127_CTRL3_PM, value);
380+
381+ if (value > 5)
382+ value -= 5;
383+ else if (value > 2)
384+ value -= 3;
385+
386+ switch (param->uvalue) {
387+ case RTC_BSM_LEVEL:
388+ break;
389+ case RTC_BSM_DIRECT:
390+ mode = 3;
391+ break;
392+ case RTC_BSM_DISABLED:
393+ if (value == 0)
394+ value = 1;
395+ mode = 5;
396+ break;
397+ default:
398+ return -EINVAL;
399+ }
400+
401+ return regmap_update_bits(pcf2127->regmap, PCF2127_REG_CTRL3,
402+ PCF2127_CTRL3_PM,
403+ FIELD_PREP(PCF2127_CTRL3_PM, mode + value));
404+
405+ break;
406+
407+ default:
408+ return -EINVAL;
409+ }
410+
411+ return 0;
412+}
413+
334414 static int pcf2127_rtc_ioctl(struct device *dev,
335415 unsigned int cmd, unsigned long arg)
336416 {
@@ -741,6 +821,8 @@ static const struct rtc_class_ops pcf2127_rtc_ops = { · 404 unmodified lines
741821 .read_alarm = pcf2127_rtc_read_alarm,
742822 .set_alarm = pcf2127_rtc_set_alarm,
743823 .alarm_irq_enable = pcf2127_rtc_alarm_irq_enable,
824+ .param_get = pcf2127_param_get,
825+ .param_set = pcf2127_param_set,
744826 };
745827
746828 /* sysfs interface */
drivers/rtc/rtc-pcf85063.c+10−1
@@ -322,7 +322,16 @@ static const struct rtc_class_ops pcf85063_rtc_ops = { · 321 unmodified lines
322322 static int pcf85063_nvmem_read(void *priv, unsigned int offset,
323323 void *val, size_t bytes)
324324 {
325− return regmap_read(priv, PCF85063_REG_RAM, val);
325+ unsigned int tmp;
326+ int ret;
327+
328+ ret = regmap_read(priv, PCF85063_REG_RAM, &tmp);
329+ if (ret < 0)
330+ return ret;
331+
332+ *(u8 *)val = tmp;
333+
334+ return 0;
326335 }
327336
328337 static int pcf85063_nvmem_write(void *priv, unsigned int offset,
drivers/rtc/rtc-pic32.c+1−1
@@ -330,7 +330,7 @@ static int pic32_rtc_probe(struct platform_device *pdev) · 329 unmodified lines
330330
331331 pic32_rtc_enable(pdata, 1);
332332
333− device_init_wakeup(&pdev->dev, 1);
333+ device_init_wakeup(&pdev->dev, true);
334334
335335 pdata->rtc->ops = &pic32_rtcops;
336336 pdata->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
drivers/rtc/rtc-pm8xxx.c+1−1
@@ -503,7 +503,7 @@ static int pm8xxx_rtc_probe(struct platform_device *pdev) · 502 unmodified lines
503503
504504 platform_set_drvdata(pdev, rtc_dd);
505505
506− device_init_wakeup(&pdev->dev, 1);
506+ device_init_wakeup(&pdev->dev, true);
507507
508508 rtc_dd->rtc = devm_rtc_allocate_device(&pdev->dev);
509509 if (IS_ERR(rtc_dd->rtc))
drivers/rtc/rtc-pxa.c+1−1
@@ -360,7 +360,7 @@ static int __init pxa_rtc_probe(struct platform_device *pdev) · 359 unmodified lines
360360 return ret;
361361 }
362362
363− device_init_wakeup(dev, 1);
363+ device_init_wakeup(dev, true);
364364
365365 return 0;
366366 }
drivers/rtc/rtc-rc5t583.c+1−1
@@ -245,7 +245,7 @@ static int rc5t583_rtc_probe(struct platform_device *pdev) · 244 unmodified lines
245245 dev_err(&pdev->dev, "IRQ is not free.\n");
246246 return ret;
247247 }
248− device_init_wakeup(&pdev->dev, 1);
248+ device_init_wakeup(&pdev->dev, true);
249249
250250 ricoh_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
251251 &rc5t583_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-rc5t619.c+1−1
@@ -414,7 +414,7 @@ static int rc5t619_rtc_probe(struct platform_device *pdev) · 413 unmodified lines
414414
415415 } else {
416416 /* enable wake */
417− device_init_wakeup(&pdev->dev, 1);
417+ device_init_wakeup(&pdev->dev, true);
418418 enable_irq_wake(rtc->irq);
419419 }
420420 } else {
drivers/rtc/rtc-renesas-rtca3.c+1−1
@@ -768,7 +768,7 @@ static int rtca3_probe(struct platform_device *pdev) · 767 unmodified lines
768768 if (ret)
769769 return ret;
770770
771− device_init_wakeup(&pdev->dev, 1);
771+ device_init_wakeup(&pdev->dev, true);
772772
773773 priv->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
774774 if (IS_ERR(priv->rtc_dev))
drivers/rtc/rtc-rk808.c+1−1
@@ -418,7 +418,7 @@ static int rk808_rtc_probe(struct platform_device *pdev) · 417 unmodified lines
418418 return ret;
419419 }
420420
421− device_init_wakeup(&pdev->dev, 1);
421+ device_init_wakeup(&pdev->dev, true);
422422
423423 rk808_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
424424 if (IS_ERR(rk808_rtc->rtc))
drivers/rtc/rtc-s3c.c+1−1
@@ -456,7 +456,7 @@ static int s3c_rtc_probe(struct platform_device *pdev) · 455 unmodified lines
456456 dev_dbg(&pdev->dev, "s3c2410_rtc: RTCCON=%02x\n",
457457 readw(info->base + S3C2410_RTCCON));
458458
459− device_init_wakeup(&pdev->dev, 1);
459+ device_init_wakeup(&pdev->dev, true);
460460
461461 info->rtc = devm_rtc_allocate_device(&pdev->dev);
462462 if (IS_ERR(info->rtc)) {
drivers/rtc/rtc-s5m.c+1−1
@@ -729,7 +729,7 @@ static int s5m_rtc_probe(struct platform_device *pdev) · 728 unmodified lines
729729 info->irq, ret);
730730 return ret;
731731 }
732− device_init_wakeup(&pdev->dev, 1);
732+ device_init_wakeup(&pdev->dev, true);
733733 }
734734
735735 return devm_rtc_register_device(info->rtc_dev);
drivers/rtc/rtc-sa1100.c+1−1
@@ -292,7 +292,7 @@ static int sa1100_rtc_probe(struct platform_device *pdev) · 291 unmodified lines
292292 }
293293
294294 platform_set_drvdata(pdev, info);
295− device_init_wakeup(&pdev->dev, 1);
295+ device_init_wakeup(&pdev->dev, true);
296296
297297 return sa1100_rtc_init(pdev, info);
298298 }
drivers/rtc/rtc-sc27xx.c+2−2
@@ -613,14 +613,14 @@ static int sprd_rtc_probe(struct platform_device *pdev) · 612 unmodified lines
613613 return ret;
614614 }
615615
616− device_init_wakeup(&pdev->dev, 1);
616+ device_init_wakeup(&pdev->dev, true);
617617
618618 rtc->rtc->ops = &sprd_rtc_ops;
619619 rtc->rtc->range_min = 0;
620620 rtc->rtc->range_max = 5662310399LL;
621621 ret = devm_rtc_register_device(rtc->rtc);
622622 if (ret) {
623− device_init_wakeup(&pdev->dev, 0);
623+ device_init_wakeup(&pdev->dev, false);
624624 return ret;
625625 }
626626
drivers/rtc/rtc-sh.c+1−1
@@ -611,7 +611,7 @@ static int __init sh_rtc_probe(struct platform_device *pdev) · 610 unmodified lines
611611 if (ret)
612612 goto err_unmap;
613613
614− device_init_wakeup(&pdev->dev, 1);
614+ device_init_wakeup(&pdev->dev, true);
615615 return 0;
616616
617617 err_unmap:
drivers/rtc/rtc-spear.c+2−2
@@ -395,7 +395,7 @@ static int spear_rtc_probe(struct platform_device *pdev) · 394 unmodified lines
395395 goto err_disable_clock;
396396
397397 if (!device_can_wakeup(&pdev->dev))
398− device_init_wakeup(&pdev->dev, 1);
398+ device_init_wakeup(&pdev->dev, true);
399399
400400 return 0;
401401
@@ -411,7 +411,7 @@ static void spear_rtc_remove(struct platform_device *pdev) · 9 unmodified lines
411411
412412 spear_rtc_disable_interrupt(config);
413413 clk_disable_unprepare(config->clk);
414− device_init_wakeup(&pdev->dev, 0);
414+ device_init_wakeup(&pdev->dev, false);
415415 }
416416
417417 #ifdef CONFIG_PM_SLEEP
drivers/rtc/rtc-stm32.c+7−15
@@ -1074,26 +1074,18 @@ static int stm32_rtc_probe(struct platform_device *pdev) · 1073 unmodified lines
10741074 regs = &rtc->data->regs;
10751075
10761076 if (rtc->data->need_dbp) {
1077− rtc->dbp = syscon_regmap_lookup_by_phandle(pdev->dev.of_node,
1078− "st,syscfg");
1077+ unsigned int args[2];
1078+
1079+ rtc->dbp = syscon_regmap_lookup_by_phandle_args(pdev->dev.of_node,
1080+ "st,syscfg",
1081+ 2, args);
10791082 if (IS_ERR(rtc->dbp)) {
10801083 dev_err(&pdev->dev, "no st,syscfg\n");
10811084 return PTR_ERR(rtc->dbp);
10821085 }
10831086
1084− ret = of_property_read_u32_index(pdev->dev.of_node, "st,syscfg",
1085− 1, &rtc->dbp_reg);
1086− if (ret) {
1087− dev_err(&pdev->dev, "can't read DBP register offset\n");
1088− return ret;
1089− }
1090−
1091− ret = of_property_read_u32_index(pdev->dev.of_node, "st,syscfg",
1092− 2, &rtc->dbp_mask);
1093− if (ret) {
1094− dev_err(&pdev->dev, "can't read DBP register mask\n");
1095− return ret;
1096− }
1087+ rtc->dbp_reg = args[0];
1088+ rtc->dbp_mask = args[1];
10971089 }
10981090
10991091 if (!rtc->data->has_pclk) {
drivers/rtc/rtc-sun6i.c+1−1
@@ -826,7 +826,7 @@ static int sun6i_rtc_probe(struct platform_device *pdev) · 825 unmodified lines
826826
827827 clk_prepare_enable(chip->losc);
828828
829− device_init_wakeup(&pdev->dev, 1);
829+ device_init_wakeup(&pdev->dev, true);
830830
831831 chip->rtc = devm_rtc_allocate_device(&pdev->dev);
832832 if (IS_ERR(chip->rtc))
drivers/rtc/rtc-sunplus.c+2−2
@@ -269,7 +269,7 @@ static int sp_rtc_probe(struct platform_device *plat_dev) · 268 unmodified lines
269269 if (ret)
270270 goto free_reset_assert;
271271
272− device_init_wakeup(&plat_dev->dev, 1);
272+ device_init_wakeup(&plat_dev->dev, true);
273273 dev_set_drvdata(&plat_dev->dev, sp_rtc);
274274
275275 sp_rtc->rtc = devm_rtc_allocate_device(&plat_dev->dev);
@@ -307,7 +307,7 @@ static void sp_rtc_remove(struct platform_device *plat_dev) · 31 unmodified lines
307307 {
308308 struct sunplus_rtc *sp_rtc = dev_get_drvdata(&plat_dev->dev);
309309
310− device_init_wakeup(&plat_dev->dev, 0);
310+ device_init_wakeup(&plat_dev->dev, false);
311311 reset_control_assert(sp_rtc->rstc);
312312 clk_disable_unprepare(sp_rtc->rtcclk);
313313 }
drivers/rtc/rtc-tegra.c+1−1
@@ -319,7 +319,7 @@ static int tegra_rtc_probe(struct platform_device *pdev) · 318 unmodified lines
319319 writel(0xffffffff, info->base + TEGRA_RTC_REG_INTR_STATUS);
320320 writel(0, info->base + TEGRA_RTC_REG_INTR_MASK);
321321
322− device_init_wakeup(&pdev->dev, 1);
322+ device_init_wakeup(&pdev->dev, true);
323323
324324 ret = devm_request_irq(&pdev->dev, info->irq, tegra_rtc_irq_handler,
325325 IRQF_TRIGGER_HIGH, dev_name(&pdev->dev),
drivers/rtc/rtc-test.c+1−1
@@ -132,7 +132,7 @@ static int test_probe(struct platform_device *plat_dev) · 131 unmodified lines
132132 break;
133133 default:
134134 rtd->rtc->ops = &test_rtc_ops;
135− device_init_wakeup(&plat_dev->dev, 1);
135+ device_init_wakeup(&plat_dev->dev, true);
136136 }
137137
138138 timer_setup(&rtd->alarm, test_rtc_alarm_handler, 0);
drivers/rtc/rtc-tps6586x.c+1−1
@@ -241,7 +241,7 @@ static int tps6586x_rtc_probe(struct platform_device *pdev) · 240 unmodified lines
241241 return ret;
242242 }
243243
244− device_init_wakeup(&pdev->dev, 1);
244+ device_init_wakeup(&pdev->dev, true);
245245
246246 platform_set_drvdata(pdev, rtc);
247247 rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
drivers/rtc/rtc-tps65910.c+1−1
@@ -418,7 +418,7 @@ static int tps65910_rtc_probe(struct platform_device *pdev) · 417 unmodified lines
418418 tps_rtc->irq = irq;
419419 if (irq != -1) {
420420 if (device_property_present(tps65910->dev, "wakeup-source"))
421− device_init_wakeup(&pdev->dev, 1);
421+ device_init_wakeup(&pdev->dev, true);
422422 else
423423 device_set_wakeup_capable(&pdev->dev, 1);
424424 } else {
drivers/rtc/rtc-tps6594.c+1−1
@@ -37,7 +37,7 @@ · 36 unmodified lines
3737 #define MAX_OFFSET (277774)
3838
3939 // Number of ticks per hour
40−#define TICKS_PER_HOUR (32768 * 3600)
40+#define TICKS_PER_HOUR (32768 * 3600LL)
4141
4242 // Multiplier for ppb conversions
4343 #define PPB_MULT NANO
drivers/rtc/rtc-twl.c+1−1
@@ -572,7 +572,7 @@ static int twl_rtc_probe(struct platform_device *pdev) · 571 unmodified lines
572572 return ret;
573573
574574 platform_set_drvdata(pdev, twl_rtc);
575− device_init_wakeup(&pdev->dev, 1);
575+ device_init_wakeup(&pdev->dev, true);
576576
577577 twl_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
578578 &twl_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-wm831x.c+1−1
@@ -420,7 +420,7 @@ static int wm831x_rtc_probe(struct platform_device *pdev) · 419 unmodified lines
420420 if (ret & WM831X_RTC_ALM_ENA)
421421 wm831x_rtc->alarm_enabled = 1;
422422
423− device_init_wakeup(&pdev->dev, 1);
423+ device_init_wakeup(&pdev->dev, true);
424424
425425 wm831x_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
426426 if (IS_ERR(wm831x_rtc->rtc))
drivers/rtc/rtc-wm8350.c+1−1
@@ -420,7 +420,7 @@ static int wm8350_rtc_probe(struct platform_device *pdev) · 419 unmodified lines
420420 }
421421 }
422422
423− device_init_wakeup(&pdev->dev, 1);
423+ device_init_wakeup(&pdev->dev, true);
424424
425425 wm_rtc->rtc = devm_rtc_device_register(&pdev->dev, "wm8350",
426426 &wm8350_rtc_ops, THIS_MODULE);
drivers/rtc/rtc-xgene.c+2−2
@@ -174,7 +174,7 @@ static int xgene_rtc_probe(struct platform_device *pdev) · 173 unmodified lines
174174 /* Turn on the clock and the crystal */
175175 writel(RTC_CCR_EN, pdata->csr_base + RTC_CCR);
176176
177− ret = device_init_wakeup(&pdev->dev, 1);
177+ ret = device_init_wakeup(&pdev->dev, true);
178178 if (ret) {
179179 clk_disable_unprepare(pdata->clk);
180180 return ret;
@@ -197,7 +197,7 @@ static void xgene_rtc_remove(struct platform_device *pdev) · 16 unmodified lines
197197 struct xgene_rtc_dev *pdata = platform_get_drvdata(pdev);
198198
199199 xgene_rtc_alarm_irq_enable(&pdev->dev, 0);
200− device_init_wakeup(&pdev->dev, 0);
200+ device_init_wakeup(&pdev->dev, false);
201201 clk_disable_unprepare(pdata->clk);
202202 }
203203
drivers/rtc/rtc-zynqmp.c+4−4
@@ -318,8 +318,8 @@ static int xlnx_rtc_probe(struct platform_device *pdev) · 317 unmodified lines
318318 return ret;
319319 }
320320
321− /* Getting the rtc_clk info */
322− xrtcdev->rtc_clk = devm_clk_get_optional(&pdev->dev, "rtc_clk");
321+ /* Getting the rtc info */
322+ xrtcdev->rtc_clk = devm_clk_get_optional(&pdev->dev, "rtc");
323323 if (IS_ERR(xrtcdev->rtc_clk)) {
324324 if (PTR_ERR(xrtcdev->rtc_clk) != -EPROBE_DEFER)
325325 dev_warn(&pdev->dev, "Device clock not found.\n");
@@ -337,7 +337,7 @@ static int xlnx_rtc_probe(struct platform_device *pdev) · 11 unmodified lines
337337
338338 xlnx_init_rtc(xrtcdev);
339339
340− device_init_wakeup(&pdev->dev, 1);
340+ device_init_wakeup(&pdev->dev, true);
341341
342342 return devm_rtc_register_device(xrtcdev->rtc);
343343 }
@@ -345,7 +345,7 @@ static int xlnx_rtc_probe(struct platform_device *pdev) · 1 unmodified line
345345 static void xlnx_rtc_remove(struct platform_device *pdev)
346346 {
347347 xlnx_rtc_alarm_irq_enable(&pdev->dev, 0);
348− device_init_wakeup(&pdev->dev, 0);
348+ device_init_wakeup(&pdev->dev, false);
349349 }
350350
351351 static int __maybe_unused xlnx_rtc_suspend(struct device *dev)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t