Skip to content

Commit 2a9f04b

Browse files
committed
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
2 parents a4b5e48 + 9727452 commit 2a9f04b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+180
-102
lines changed

Diff for: Documentation/devicetree/bindings/rtc/rtc-mxc.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ maintainers:
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

Diff for: arch/x86/include/asm/hpet.h

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ extern int hpet_set_rtc_irq_bit(unsigned long bit_mask);
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);

Diff for: arch/x86/kernel/hpet.c

-6
Original file line numberDiff line numberDiff line change
@@ -1382,12 +1382,6 @@ int hpet_set_periodic_freq(unsigned long freq)
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;

Diff for: drivers/rtc/Kconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ config RTC_DRV_SC27XX
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

Diff for: drivers/rtc/rtc-88pm80x.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static int pm80x_rtc_probe(struct platform_device *pdev)
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:

Diff for: drivers/rtc/rtc-88pm860x.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ static int pm860x_rtc_probe(struct platform_device *pdev)
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
}

Diff for: drivers/rtc/rtc-amlogic-a4.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static int aml_rtc_probe(struct platform_device *pdev)
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)
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)
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 = {

Diff for: drivers/rtc/rtc-armada38x.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev)
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

Diff for: drivers/rtc/rtc-as3722.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static int as3722_rtc_probe(struct platform_device *pdev)
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);

Diff for: drivers/rtc/rtc-at91rm9200.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static int __init at91_rtc_probe(struct platform_device *pdev)
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;

Diff for: drivers/rtc/rtc-at91sam9.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ static int at91_rtc_probe(struct platform_device *pdev)
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

Diff for: drivers/rtc/rtc-cadence.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ static void cdns_rtc_remove(struct platform_device *pdev)
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);

Diff for: drivers/rtc/rtc-cmos.c

+1-6
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,6 @@ static inline int hpet_set_periodic_freq(unsigned long freq)
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)
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,

Diff for: drivers/rtc/rtc-cpcap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static int cpcap_rtc_probe(struct platform_device *pdev)
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 */

Diff for: drivers/rtc/rtc-cros-ec.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ static int cros_ec_rtc_probe(struct platform_device *pdev)
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;

Diff for: drivers/rtc/rtc-da9055.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static int da9055_rtc_probe(struct platform_device *pdev)
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);

Diff for: drivers/rtc/rtc-ds3232.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static int ds3232_probe(struct device *dev, struct regmap *regmap, int irq,
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

Diff for: drivers/rtc/rtc-isl1208.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ static int isl1208_setup_irq(struct i2c_client *client, int irq)
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,

Diff for: drivers/rtc/rtc-jz4740.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ static int jz4740_rtc_probe(struct platform_device *pdev)
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)

Diff for: drivers/rtc/rtc-loongson.c

+10-7
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ static irqreturn_t loongson_rtc_isr(int irq, void *id)
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)
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)
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)
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

Diff for: drivers/rtc/rtc-lp8788.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static int lp8788_rtc_probe(struct platform_device *pdev)
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);

Diff for: drivers/rtc/rtc-lpc32xx.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static int lpc32xx_rtc_probe(struct platform_device *pdev)
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

Diff for: drivers/rtc/rtc-max77686.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ static int max77686_rtc_probe(struct platform_device *pdev)
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);

Diff for: drivers/rtc/rtc-max8925.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static int max8925_rtc_probe(struct platform_device *pdev)
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);

Diff for: drivers/rtc/rtc-max8997.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ static int max8997_rtc_probe(struct platform_device *pdev)
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);

Diff for: drivers/rtc/rtc-meson-vrtc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int meson_vrtc_probe(struct platform_device *pdev)
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

Diff for: drivers/rtc/rtc-mpc5121.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int mpc5121_rtc_probe(struct platform_device *op)
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

Diff for: drivers/rtc/rtc-mt6397.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ static int mtk_rtc_probe(struct platform_device *pdev)
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;

Diff for: drivers/rtc/rtc-mv.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
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)
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);

Diff for: drivers/rtc/rtc-mxc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
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");

Diff for: drivers/rtc/rtc-mxc_v2.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
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");

Diff for: drivers/rtc/rtc-omap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ static void omap_rtc_remove(struct platform_device *pdev)
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);

Diff for: drivers/rtc/rtc-palmas.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static int palmas_rtc_probe(struct platform_device *pdev)
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)) {

0 commit comments

Comments
 (0)