Skip to content

Commit

Permalink
Merge tag 'rtc-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/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
  ...
  • Loading branch information
Linus Torvalds committed Apr 3, 2025
2 parents e8b4712 + 424dfcd commit 5916a6f
Show file tree
Hide file tree
Showing 43 changed files with 662 additions and 858 deletions.
4 changes: 3 additions & 1 deletion Documentation/devicetree/bindings/rtc/adi,max31335.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ allOf:

properties:
compatible:
const: adi,max31335
enum:
- adi,max31331
- adi,max31335

reg:
maxItems: 1
Expand Down
3 changes: 2 additions & 1 deletion Documentation/devicetree/bindings/rtc/nxp,pcf2127.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ title: NXP PCF2127 Real Time Clock

allOf:
- $ref: rtc.yaml#
- $ref: /schemas/spi/spi-peripheral-props.yaml#

maintainers:
- Alexandre Belloni <alexandre.belloni@bootlin.com>
Expand All @@ -34,7 +35,7 @@ required:
- compatible
- reg

additionalProperties: false
unevaluatedProperties: false

examples:
- |
Expand Down
5 changes: 5 additions & 0 deletions Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ properties:
items:
- const: offset

qcom,no-alarm:
type: boolean
description:
RTC alarm is not owned by the OS

wakeup-source: true

required:
Expand Down
7 changes: 0 additions & 7 deletions drivers/rtc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1321,13 +1321,6 @@ config RTC_DRV_SPEAR
If you say Y here you will get support for the RTC found on
spear

config RTC_DRV_PCF50633
depends on MFD_PCF50633
tristate "NXP PCF50633 RTC"
help
If you say yes here you get support for the RTC subsystem of the
NXP PCF50633 used in embedded systems.

config RTC_DRV_AB8500
tristate "ST-Ericsson AB8500 RTC"
depends on AB8500_CORE
Expand Down
1 change: 0 additions & 1 deletion drivers/rtc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ obj-$(CONFIG_RTC_DRV_PALMAS) += rtc-palmas.o
obj-$(CONFIG_RTC_DRV_PCAP) += rtc-pcap.o
obj-$(CONFIG_RTC_DRV_PCF2123) += rtc-pcf2123.o
obj-$(CONFIG_RTC_DRV_PCF2127) += rtc-pcf2127.o
obj-$(CONFIG_RTC_DRV_PCF50633) += rtc-pcf50633.o
obj-$(CONFIG_RTC_DRV_PCF85063) += rtc-pcf85063.o
obj-$(CONFIG_RTC_DRV_PCF8523) += rtc-pcf8523.o
obj-$(CONFIG_RTC_DRV_PCF85363) += rtc-pcf85363.o
Expand Down
24 changes: 2 additions & 22 deletions drivers/rtc/rtc-ab-eoz9.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,29 +426,9 @@ static umode_t abeoz9_is_visible(const void *data,
}
}

static const u32 abeoz9_chip_config[] = {
HWMON_C_REGISTER_TZ,
0
};

static const struct hwmon_channel_info abeoz9_chip = {
.type = hwmon_chip,
.config = abeoz9_chip_config,
};

static const u32 abeoz9_temp_config[] = {
HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN,
0
};

static const struct hwmon_channel_info abeoz9_temp = {
.type = hwmon_temp,
.config = abeoz9_temp_config,
};

static const struct hwmon_channel_info * const abeoz9_info[] = {
&abeoz9_chip,
&abeoz9_temp,
HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MIN),
NULL
};

Expand Down
11 changes: 2 additions & 9 deletions drivers/rtc/rtc-ab8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
return -ENODEV;
}

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

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

dev_pm_set_wake_irq(&pdev->dev, irq);
devm_pm_set_wake_irq(&pdev->dev, irq);
platform_set_drvdata(pdev, rtc);

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

static void ab8500_rtc_remove(struct platform_device *pdev)
{
dev_pm_clear_wake_irq(&pdev->dev);
device_init_wakeup(&pdev->dev, false);
}

static struct platform_driver ab8500_rtc_driver = {
.driver = {
.name = "ab8500-rtc",
},
.probe = ab8500_rtc_probe,
.remove = ab8500_rtc_remove,
.id_table = ab85xx_rtc_ids,
};

Expand Down
16 changes: 8 additions & 8 deletions drivers/rtc/rtc-aspeed.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <linux/io.h>

struct aspeed_rtc {
struct rtc_device *rtc_dev;
void __iomem *base;
};

Expand Down Expand Up @@ -85,6 +84,7 @@ static const struct rtc_class_ops aspeed_rtc_ops = {
static int aspeed_rtc_probe(struct platform_device *pdev)
{
struct aspeed_rtc *rtc;
struct rtc_device *rtc_dev;

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

rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc->rtc_dev))
return PTR_ERR(rtc->rtc_dev);
rtc_dev = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc_dev))
return PTR_ERR(rtc_dev);

platform_set_drvdata(pdev, rtc);

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

return devm_rtc_register_device(rtc->rtc_dev);
return devm_rtc_register_device(rtc_dev);
}

static const struct of_device_id aspeed_rtc_match[] = {
Expand Down
30 changes: 12 additions & 18 deletions drivers/rtc/rtc-cros-ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,34 @@ struct cros_ec_rtc {
static int cros_ec_rtc_get(struct cros_ec_device *cros_ec, u32 command,
u32 *response)
{
DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
sizeof(struct ec_response_rtc));
int ret;
struct {
struct cros_ec_command msg;
struct ec_response_rtc data;
} __packed msg;

memset(&msg, 0, sizeof(msg));
msg.msg.command = command;
msg.msg.insize = sizeof(msg.data);
msg->command = command;
msg->insize = sizeof(struct ec_response_rtc);

ret = cros_ec_cmd_xfer_status(cros_ec, &msg.msg);
ret = cros_ec_cmd_xfer_status(cros_ec, msg);
if (ret < 0)
return ret;

*response = msg.data.time;
*response = ((struct ec_response_rtc *)msg->data)->time;

return 0;
}

static int cros_ec_rtc_set(struct cros_ec_device *cros_ec, u32 command,
u32 param)
{
DEFINE_RAW_FLEX(struct cros_ec_command, msg, data,
sizeof(struct ec_response_rtc));
int ret;
struct {
struct cros_ec_command msg;
struct ec_response_rtc data;
} __packed msg;

memset(&msg, 0, sizeof(msg));
msg.msg.command = command;
msg.msg.outsize = sizeof(msg.data);
msg.data.time = param;
msg->command = command;
msg->outsize = sizeof(struct ec_response_rtc);
((struct ec_response_rtc *)msg->data)->time = param;

ret = cros_ec_cmd_xfer_status(cros_ec, &msg.msg);
ret = cros_ec_cmd_xfer_status(cros_ec, msg);
if (ret < 0)
return ret;
return 0;
Expand Down
4 changes: 1 addition & 3 deletions drivers/rtc/rtc-ds1307.c
Original file line number Diff line number Diff line change
Expand Up @@ -1807,10 +1807,8 @@ static int ds1307_probe(struct i2c_client *client)
* For some variants, be sure alarms can trigger when we're
* running on Vbackup (BBSQI/BBSQW)
*/
if (want_irq || ds1307_can_wakeup_device) {
if (want_irq || ds1307_can_wakeup_device)
regs[0] |= DS1337_BIT_INTCN | chip->bbsqi_bit;
regs[0] &= ~(DS1337_BIT_A2IE | DS1337_BIT_A1IE);
}

regmap_write(ds1307->regmap, DS1337_REG_CONTROL,
regs[0]);
Expand Down
8 changes: 1 addition & 7 deletions drivers/rtc/rtc-ds1343.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,18 +427,13 @@ static int ds1343_probe(struct spi_device *spi)
"unable to request irq for rtc ds1343\n");
} else {
device_init_wakeup(&spi->dev, true);
dev_pm_set_wake_irq(&spi->dev, spi->irq);
devm_pm_set_wake_irq(&spi->dev, spi->irq);
}
}

return 0;
}

static void ds1343_remove(struct spi_device *spi)
{
dev_pm_clear_wake_irq(&spi->dev);
}

#ifdef CONFIG_PM_SLEEP

static int ds1343_suspend(struct device *dev)
Expand Down Expand Up @@ -471,7 +466,6 @@ static struct spi_driver ds1343_driver = {
.pm = &ds1343_pm,
},
.probe = ds1343_probe,
.remove = ds1343_remove,
.id_table = ds1343_id,
};

Expand Down
14 changes: 7 additions & 7 deletions drivers/rtc/rtc-ds2404.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ struct ds2404 {
struct gpio_desc *rst_gpiod;
struct gpio_desc *clk_gpiod;
struct gpio_desc *dq_gpiod;
struct rtc_device *rtc;
};

static int ds2404_gpio_map(struct ds2404 *chip, struct platform_device *pdev)
Expand Down Expand Up @@ -182,6 +181,7 @@ static const struct rtc_class_ops ds2404_rtc_ops = {
static int rtc_probe(struct platform_device *pdev)
{
struct ds2404 *chip;
struct rtc_device *rtc;
int retval = -EBUSY;

chip = devm_kzalloc(&pdev->dev, sizeof(struct ds2404), GFP_KERNEL);
Expand All @@ -190,20 +190,20 @@ static int rtc_probe(struct platform_device *pdev)

chip->dev = &pdev->dev;

chip->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(chip->rtc))
return PTR_ERR(chip->rtc);
rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc))
return PTR_ERR(rtc);

retval = ds2404_gpio_map(chip, pdev);
if (retval)
return retval;

platform_set_drvdata(pdev, chip);

chip->rtc->ops = &ds2404_rtc_ops;
chip->rtc->range_max = U32_MAX;
rtc->ops = &ds2404_rtc_ops;
rtc->range_max = U32_MAX;

retval = devm_rtc_register_device(chip->rtc);
retval = devm_rtc_register_device(rtc);
if (retval)
return retval;

Expand Down
24 changes: 2 additions & 22 deletions drivers/rtc/rtc-ds3232.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,29 +339,9 @@ static int ds3232_hwmon_read(struct device *dev,
return err;
}

static u32 ds3232_hwmon_chip_config[] = {
HWMON_C_REGISTER_TZ,
0
};

static const struct hwmon_channel_info ds3232_hwmon_chip = {
.type = hwmon_chip,
.config = ds3232_hwmon_chip_config,
};

static u32 ds3232_hwmon_temp_config[] = {
HWMON_T_INPUT,
0
};

static const struct hwmon_channel_info ds3232_hwmon_temp = {
.type = hwmon_temp,
.config = ds3232_hwmon_temp_config,
};

static const struct hwmon_channel_info * const ds3232_hwmon_info[] = {
&ds3232_hwmon_chip,
&ds3232_hwmon_temp,
HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ),
HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT),
NULL
};

Expand Down
16 changes: 8 additions & 8 deletions drivers/rtc/rtc-ep93xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

struct ep93xx_rtc {
void __iomem *mmio_base;
struct rtc_device *rtc;
};

static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload,
Expand Down Expand Up @@ -123,6 +122,7 @@ static const struct attribute_group ep93xx_rtc_sysfs_files = {
static int ep93xx_rtc_probe(struct platform_device *pdev)
{
struct ep93xx_rtc *ep93xx_rtc;
struct rtc_device *rtc;
int err;

ep93xx_rtc = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_rtc), GFP_KERNEL);
Expand All @@ -135,18 +135,18 @@ static int ep93xx_rtc_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, ep93xx_rtc);

ep93xx_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(ep93xx_rtc->rtc))
return PTR_ERR(ep93xx_rtc->rtc);
rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc))
return PTR_ERR(rtc);

ep93xx_rtc->rtc->ops = &ep93xx_rtc_ops;
ep93xx_rtc->rtc->range_max = U32_MAX;
rtc->ops = &ep93xx_rtc_ops;
rtc->range_max = U32_MAX;

err = rtc_add_group(ep93xx_rtc->rtc, &ep93xx_rtc_sysfs_files);
err = rtc_add_group(rtc, &ep93xx_rtc_sysfs_files);
if (err)
return err;

return devm_rtc_register_device(ep93xx_rtc->rtc);
return devm_rtc_register_device(rtc);
}

static const struct of_device_id ep93xx_rtc_of_ids[] = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-fsl-ftm-alarm.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static const struct of_device_id ftm_rtc_match[] = {
};
MODULE_DEVICE_TABLE(of, ftm_rtc_match);

static const struct acpi_device_id ftm_imx_acpi_ids[] = {
static const struct acpi_device_id ftm_imx_acpi_ids[] __maybe_unused = {
{"NXP0014",},
{ }
};
Expand Down
Loading

0 comments on commit 5916a6f

Please sign in to comment.