Skip to content

Commit 5916a6f

Browse files
committed
Merge tag 'rtc-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC updates from Alexandre Belloni: "We see a net reduction of the number of lines of code thanks to the removal of a now unused driver and a testing tool that is not used anymore. Apart from this, the max31335 driver gets support for a new part number and pm8xxx gets UEFI support. Core: - setdate is removed as it has better replacements - skip alarms with a second resolution when we know the RTC doesn't support those. Subsystem: - remove unnecessary private struct members - use devm_pm_set_wake_irq were relevant Drivers: - ds1307: stop disabling alarms on probe for DS1337, DS1339, DS1341 and DS3231 - max31335: add max31331 support - pcf50633 is removed as support for the related SoC has been removed - pcf85063: properly handle POR failures" * tag 'rtc-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (50 commits) rtc: remove 'setdate' test program selftest: rtc: skip some tests if the alarm only supports minutes rtc: mt6397: drop unused defines rtc: pcf85063: replace dev_err+return with return dev_err_probe rtc: pcf85063: do a SW reset if POR failed rtc: max31335: Add driver support for max31331 dt-bindings: rtc: max31335: Add max31331 support rtc: cros-ec: Avoid a couple of -Wflex-array-member-not-at-end warnings dt-bindings: rtc: pcf2127: Reference spi-peripheral-props.yaml rtc: rzn1: implement one-second accuracy for alarms rtc: pcf50633: Remove rtc: pm8xxx: implement qcom,no-alarm flag for non-HLOS owned alarm rtc: pm8xxx: mitigate flash wear rtc: pm8xxx: add support for uefi offset dt-bindings: rtc: qcom-pm8xxx: document qcom,no-alarm flag rtc: rv3032: drop WADA rtc: rv3032: fix EERD location rtc: pm8xxx: switch to devm_device_init_wakeup rtc: pm8xxx: fix possible race condition rtc: mpfs: switch to devm_device_init_wakeup ...
2 parents e8b4712 + 424dfcd commit 5916a6f

Some content is hidden

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

43 files changed

+662
-858
lines changed

Documentation/devicetree/bindings/rtc/adi,max31335.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ allOf:
1818

1919
properties:
2020
compatible:
21-
const: adi,max31335
21+
enum:
22+
- adi,max31331
23+
- adi,max31335
2224

2325
reg:
2426
maxItems: 1

Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ title: NXP PCF2127 Real Time Clock
88

99
allOf:
1010
- $ref: rtc.yaml#
11+
- $ref: /schemas/spi/spi-peripheral-props.yaml#
1112

1213
maintainers:
1314
- Alexandre Belloni <alexandre.belloni@bootlin.com>
@@ -34,7 +35,7 @@ required:
3435
- compatible
3536
- reg
3637

37-
additionalProperties: false
38+
unevaluatedProperties: false
3839

3940
examples:
4041
- |

Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ properties:
5050
items:
5151
- const: offset
5252

53+
qcom,no-alarm:
54+
type: boolean
55+
description:
56+
RTC alarm is not owned by the OS
57+
5358
wakeup-source: true
5459

5560
required:

drivers/rtc/Kconfig

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1321,13 +1321,6 @@ config RTC_DRV_SPEAR
13211321
If you say Y here you will get support for the RTC found on
13221322
spear
13231323

1324-
config RTC_DRV_PCF50633
1325-
depends on MFD_PCF50633
1326-
tristate "NXP PCF50633 RTC"
1327-
help
1328-
If you say yes here you get support for the RTC subsystem of the
1329-
NXP PCF50633 used in embedded systems.
1330-
13311324
config RTC_DRV_AB8500
13321325
tristate "ST-Ericsson AB8500 RTC"
13331326
depends on AB8500_CORE

drivers/rtc/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ obj-$(CONFIG_RTC_DRV_PALMAS) += rtc-palmas.o
126126
obj-$(CONFIG_RTC_DRV_PCAP) += rtc-pcap.o
127127
obj-$(CONFIG_RTC_DRV_PCF2123) += rtc-pcf2123.o
128128
obj-$(CONFIG_RTC_DRV_PCF2127) += rtc-pcf2127.o
129-
obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o
130129
obj-$(CONFIG_RTC_DRV_PCF85063) += rtc-pcf85063.o
131130
obj-$(CONFIG_RTC_DRV_PCF8523) += rtc-pcf8523.o
132131
obj-$(CONFIG_RTC_DRV_PCF85363) += rtc-pcf85363.o

drivers/rtc/rtc-ab-eoz9.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -426,29 +426,9 @@ static umode_t abeoz9_is_visible(const void *data,
426426
}
427427
}
428428

429-
static const u32 abeoz9_chip_config[] = {
430-
HWMON_C_REGISTER_TZ,
431-
0
432-
};
433-
434-
static const struct hwmon_channel_info abeoz9_chip = {
435-
.type = hwmon_chip,
436-
.config = abeoz9_chip_config,
437-
};
438-
439-
static const u32 abeoz9_temp_config[] = {
440-
HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN,
441-
0
442-
};
443-
444-
static const struct hwmon_channel_info abeoz9_temp = {
445-
.type = hwmon_temp,
446-
.config = abeoz9_temp_config,
447-
};
448-
449429
static const struct hwmon_channel_info * const abeoz9_info[] = {
450-
&abeoz9_chip,
451-
&abeoz9_temp,
430+
HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
431+
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN),
452432
NULL
453433
};
454434

drivers/rtc/rtc-ab8500.c

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
361361
return -ENODEV;
362362
}
363363

364-
device_init_wakeup(&pdev->dev, true);
364+
devm_device_init_wakeup(&pdev->dev);
365365

366366
rtc = devm_rtc_allocate_device(&pdev->dev);
367367
if (IS_ERR(rtc))
@@ -375,7 +375,7 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
375375
if (err < 0)
376376
return err;
377377

378-
dev_pm_set_wake_irq(&pdev->dev, irq);
378+
devm_pm_set_wake_irq(&pdev->dev, irq);
379379
platform_set_drvdata(pdev, rtc);
380380

381381
set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->features);
@@ -392,18 +392,11 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
392392
return devm_rtc_register_device(rtc);
393393
}
394394

395-
static void ab8500_rtc_remove(struct platform_device *pdev)
396-
{
397-
dev_pm_clear_wake_irq(&pdev->dev);
398-
device_init_wakeup(&pdev->dev, false);
399-
}
400-
401395
static struct platform_driver ab8500_rtc_driver = {
402396
.driver = {
403397
.name = "ab8500-rtc",
404398
},
405399
.probe = ab8500_rtc_probe,
406-
.remove = ab8500_rtc_remove,
407400
.id_table = ab85xx_rtc_ids,
408401
};
409402

drivers/rtc/rtc-aspeed.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <linux/io.h>
99

1010
struct aspeed_rtc {
11-
struct rtc_device *rtc_dev;
1211
void __iomem *base;
1312
};
1413

@@ -85,6 +84,7 @@ static const struct rtc_class_ops aspeed_rtc_ops = {
8584
static int aspeed_rtc_probe(struct platform_device *pdev)
8685
{
8786
struct aspeed_rtc *rtc;
87+
struct rtc_device *rtc_dev;
8888

8989
rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL);
9090
if (!rtc)
@@ -94,17 +94,17 @@ static int aspeed_rtc_probe(struct platform_device *pdev)
9494
if (IS_ERR(rtc->base))
9595
return PTR_ERR(rtc->base);
9696

97-
rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
98-
if (IS_ERR(rtc->rtc_dev))
99-
return PTR_ERR(rtc->rtc_dev);
97+
rtc_dev = devm_rtc_allocate_device(&pdev->dev);
98+
if (IS_ERR(rtc_dev))
99+
return PTR_ERR(rtc_dev);
100100

101101
platform_set_drvdata(pdev, rtc);
102102

103-
rtc->rtc_dev->ops = &aspeed_rtc_ops;
104-
rtc->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_1900;
105-
rtc->rtc_dev->range_max = 38814989399LL; /* 3199-12-31 23:59:59 */
103+
rtc_dev->ops = &aspeed_rtc_ops;
104+
rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_1900;
105+
rtc_dev->range_max = 38814989399LL; /* 3199-12-31 23:59:59 */
106106

107-
return devm_rtc_register_device(rtc->rtc_dev);
107+
return devm_rtc_register_device(rtc_dev);
108108
}
109109

110110
static const struct of_device_id aspeed_rtc_match[] = {

drivers/rtc/rtc-cros-ec.c

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,40 +35,34 @@ struct cros_ec_rtc {
3535
static int cros_ec_rtc_get(struct cros_ec_device *cros_ec, u32 command,
3636
u32 *response)
3737
{
38+
DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
39+
sizeof(struct ec_response_rtc));
3840
int ret;
39-
struct {
40-
struct cros_ec_command msg;
41-
struct ec_response_rtc data;
42-
} __packed msg;
4341

44-
memset(&msg, 0, sizeof(msg));
45-
msg.msg.command = command;
46-
msg.msg.insize = sizeof(msg.data);
42+
msg->command = command;
43+
msg->insize = sizeof(struct ec_response_rtc);
4744

48-
ret = cros_ec_cmd_xfer_status(cros_ec, &msg.msg);
45+
ret = cros_ec_cmd_xfer_status(cros_ec, msg);
4946
if (ret < 0)
5047
return ret;
5148

52-
*response = msg.data.time;
49+
*response = ((struct ec_response_rtc *)msg->data)->time;
5350

5451
return 0;
5552
}
5653

5754
static int cros_ec_rtc_set(struct cros_ec_device *cros_ec, u32 command,
5855
u32 param)
5956
{
57+
DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
58+
sizeof(struct ec_response_rtc));
6059
int ret;
61-
struct {
62-
struct cros_ec_command msg;
63-
struct ec_response_rtc data;
64-
} __packed msg;
6560

66-
memset(&msg, 0, sizeof(msg));
67-
msg.msg.command = command;
68-
msg.msg.outsize = sizeof(msg.data);
69-
msg.data.time = param;
61+
msg->command = command;
62+
msg->outsize = sizeof(struct ec_response_rtc);
63+
((struct ec_response_rtc *)msg->data)->time = param;
7064

71-
ret = cros_ec_cmd_xfer_status(cros_ec, &msg.msg);
65+
ret = cros_ec_cmd_xfer_status(cros_ec, msg);
7266
if (ret < 0)
7367
return ret;
7468
return 0;

drivers/rtc/rtc-ds1307.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,10 +1807,8 @@ static int ds1307_probe(struct i2c_client *client)
18071807
* For some variants, be sure alarms can trigger when we're
18081808
* running on Vbackup (BBSQI/BBSQW)
18091809
*/
1810-
if (want_irq || ds1307_can_wakeup_device) {
1810+
if (want_irq || ds1307_can_wakeup_device)
18111811
regs[0] |= DS1337_BIT_INTCN | chip->bbsqi_bit;
1812-
regs[0] &= ~(DS1337_BIT_A2IE | DS1337_BIT_A1IE);
1813-
}
18141812

18151813
regmap_write(ds1307->regmap, DS1337_REG_CONTROL,
18161814
regs[0]);

0 commit comments

Comments
 (0)