Commit 54f71b03 authored by Linus Torvalds's avatar Linus Torvalds

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

Pull RTC updates from Alexandre Belloni:
 "There is one new driver and then most of the changes are the device
  tree bindings conversions to yaml.

  New driver:
   - Epson RX8111

  Drivers:
   - Many Device Tree bindings conversions to dtschema
   - pcf8563: wakeup-source support"

* tag 'rtc-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
  pcf8563: add wakeup-source support
  rtc: rx8111: handle VLOW flag
  rtc: rx8111: demote warnings to debug level
  rtc: rx6110: Constify struct regmap_config
  dt-bindings: rtc: convert trivial devices into dtschema
  dt-bindings: rtc: stmp3xxx-rtc: convert to dtschema
  dt-bindings: rtc: pxa-rtc: convert to dtschema
  rtc: Add driver for Epson RX8111
  dt-bindings: rtc: Add Epson RX8111
  rtc: mcp795: drop unneeded MODULE_ALIAS
  rtc: nuvoton: Modify part number value
  rtc: test: Split rtc unit test into slow and normal speed test
  dt-bindings: rtc: nxp,lpc1788-rtc: convert to dtschema
  dt-bindings: rtc: digicolor-rtc: move to trivial-rtc
  dt-bindings: rtc: alphascale,asm9260-rtc: convert to dtschema
  dt-bindings: rtc: armada-380-rtc: convert to dtschema
  rtc: cros-ec: provide ID table for avoiding fallback match
parents 4286e1fc 4c9a91b9
* Alphascale asm9260 SoC Real Time Clock
Required properties:
- compatible: Should be "alphascale,asm9260-rtc"
- reg: Physical base address of the controller and length
of memory mapped region.
- interrupts: IRQ line for the RTC.
- clocks: Reference to the clock entry.
- clock-names: should contain:
* "ahb" for the SoC RTC clock
Example:
rtc0: rtc@800a0000 {
compatible = "alphascale,asm9260-rtc";
reg = <0x800a0000 0x100>;
clocks = <&acc CLKID_AHB_RTC>;
clock-names = "ahb";
interrupts = <2>;
};
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/alphascale,asm9260-rtc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Alphascale asm9260 SoC Real Time Clock
maintainers:
- Javier Carrasco <javier.carrasco.cruz@gmail.com>
allOf:
- $ref: rtc.yaml#
properties:
compatible:
const: alphascale,asm9260-rtc
reg:
maxItems: 1
clocks:
maxItems: 1
clock-names:
const: ahb
interrupts:
maxItems: 1
required:
- compatible
- reg
- clocks
- clock-names
- interrupts
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/alphascale,asm9260.h>
rtc@800a0000 {
compatible = "alphascale,asm9260-rtc";
reg = <0x800a0000 0x100>;
clocks = <&acc CLKID_AHB_RTC>;
clock-names = "ahb";
interrupts = <2>;
};
* Real Time Clock of the Armada 38x/7K/8K SoCs
RTC controller for the Armada 38x, 7K and 8K SoCs
Required properties:
- compatible : Should be one of the following:
"marvell,armada-380-rtc" for Armada 38x SoC
"marvell,armada-8k-rtc" for Aramda 7K/8K SoCs
- reg: a list of base address and size pairs, one for each entry in
reg-names
- reg names: should contain:
* "rtc" for the RTC registers
* "rtc-soc" for the SoC related registers and among them the one
related to the interrupt.
- interrupts: IRQ line for the RTC.
Example:
rtc@a3800 {
compatible = "marvell,armada-380-rtc";
reg = <0xa3800 0x20>, <0x184a0 0x0c>;
reg-names = "rtc", "rtc-soc";
interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
};
Conexant Digicolor Real Time Clock controller
This binding currently supports the CX92755 SoC.
Required properties:
- compatible: should be "cnxt,cx92755-rtc"
- reg: physical base address of the controller and length of memory mapped
region.
- interrupts: rtc alarm interrupt
Example:
rtc@f0000c30 {
compatible = "cnxt,cx92755-rtc";
reg = <0xf0000c30 0x18>;
interrupts = <25>;
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/fsl,stmp3xxx-rtc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: STMP3xxx/i.MX28 Time Clock Controller
maintainers:
- Javier Carrasco <javier.carrasco.cruz@gmail.com>
allOf:
- $ref: rtc.yaml#
properties:
compatible:
oneOf:
- items:
- enum:
- fsl,imx28-rtc
- fsl,imx23-rtc
- const: fsl,stmp3xxx-rtc
- const: fsl,stmp3xxx-rtc
reg:
maxItems: 1
interrupts:
maxItems: 1
stmp,crystal-freq:
description:
Override crystal frequency as determined from fuse bits.
Use <0> for "no crystal".
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 32000, 32768]
required:
- compatible
- reg
- interrupts
unevaluatedProperties: false
examples:
- |
rtc@80056000 {
compatible = "fsl,imx28-rtc", "fsl,stmp3xxx-rtc";
reg = <0x80056000 2000>;
interrupts = <29>;
};
Android Goldfish RTC
Android Goldfish RTC device used by Android emulator.
Required properties:
- compatible : should contain "google,goldfish-rtc"
- reg : <registers mapping>
- interrupts : <interrupt mapping>
Example:
goldfish_timer@9020000 {
compatible = "google,goldfish-rtc";
reg = <0x9020000 0x1000>;
interrupts = <0x3>;
};
* NXP LPC32xx SoC Real Time Clock controller
Required properties:
- compatible: must be "nxp,lpc3220-rtc"
- reg: physical base address of the controller and length of memory mapped
region.
- interrupts: The RTC interrupt
Example:
rtc@40024000 {
compatible = "nxp,lpc3220-rtc";
reg = <0x40024000 0x1000>;
interrupts = <52 0>;
};
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/marvell,armada-380-rtc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: RTC controller for the Armada 38x, 7K and 8K SoCs
maintainers:
- Javier Carrasco <javier.carrasco.cruz@gmail.com>
allOf:
- $ref: rtc.yaml#
properties:
compatible:
enum:
- marvell,armada-380-rtc
- marvell,armada-8k-rtc
reg:
items:
- description: RTC base address size
- description: Base address and size of SoC related registers
reg-names:
items:
- const: rtc
- const: rtc-soc
interrupts:
maxItems: 1
required:
- compatible
- reg
- reg-names
- interrupts
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
rtc@a3800 {
compatible = "marvell,armada-380-rtc";
reg = <0xa3800 0x20>, <0x184a0 0x0c>;
reg-names = "rtc", "rtc-soc";
interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
};
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/marvell,pxa-rtc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: PXA Real Time Clock
maintainers:
- Javier Carrasco <javier.carrasco.cruz@gmail.com>
allOf:
- $ref: rtc.yaml#
properties:
compatible:
const: marvell,pxa-rtc
reg:
maxItems: 1
interrupts:
items:
- description: 1 Hz
- description: Alarm
required:
- compatible
- reg
- interrupts
unevaluatedProperties: false
examples:
- |
rtc@40900000 {
compatible = "marvell,pxa-rtc";
reg = <0x40900000 0x3c>;
interrupts = <30>, <31>;
};
* Maxim (Dallas) DS1742/DS1743 Real Time Clock
Required properties:
- compatible: Should contain "maxim,ds1742".
- reg: Physical base address of the RTC and length of memory
mapped region.
Example:
rtc: rtc@10000000 {
compatible = "maxim,ds1742";
reg = <0x10000000 0x800>;
};
NXP LPC1788 real-time clock
The LPC1788 RTC provides calendar and clock functionality
together with periodic tick and alarm interrupt support.
Required properties:
- compatible : must contain "nxp,lpc1788-rtc"
- reg : Specifies base physical address and size of the registers.
- interrupts : A single interrupt specifier.
- clocks : Must contain clock specifiers for rtc and register clock
- clock-names : Must contain "rtc" and "reg"
See ../clocks/clock-bindings.txt for details.
Example:
rtc: rtc@40046000 {
compatible = "nxp,lpc1788-rtc";
reg = <0x40046000 0x1000>;
interrupts = <47>;
clocks = <&creg_clk 0>, <&ccu1 CLK_CPU_BUS>;
clock-names = "rtc", "reg";
};
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/rtc/nxp,lpc1788-rtc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: NXP LPC1788 real-time clock
description:
The LPC1788 RTC provides calendar and clock functionality
together with periodic tick and alarm interrupt support.
maintainers:
- Javier Carrasco <javier.carrasco.cruz@gmail.com>
allOf:
- $ref: rtc.yaml#
properties:
compatible:
const: nxp,lpc1788-rtc
reg:
maxItems: 1
clocks:
items:
- description: RTC clock
- description: Register clock
clock-names:
items:
- const: rtc
- const: reg
interrupts:
maxItems: 1
required:
- compatible
- reg
- clocks
- clock-names
- interrupts
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/lpc18xx-ccu.h>
rtc@40046000 {
compatible = "nxp,lpc1788-rtc";
reg = <0x40046000 0x1000>;
clocks = <&creg_clk 0>, <&ccu1 CLK_CPU_BUS>;
clock-names = "rtc", "reg";
interrupts = <47>;
};
* Mvebu Real Time Clock
RTC controller for the Kirkwood, the Dove, the Armada 370 and the
Armada XP SoCs
Required properties:
- compatible : Should be "marvell,orion-rtc"
- reg: physical base address of the controller and length of memory mapped
region.
- interrupts: IRQ line for the RTC.
Example:
rtc@10300 {
compatible = "marvell,orion-rtc";
reg = <0xd0010300 0x20>;
interrupts = <50>;
};
* PXA RTC
PXA specific RTC driver.
Required properties:
- compatible : Should be "marvell,pxa-rtc"
Examples:
rtc@40900000 {
compatible = "marvell,pxa-rtc";
reg = <0x40900000 0x3c>;
interrupts = <30 31>;
};
ASPEED BMC RTC
==============
Required properties:
- compatible: should be one of the following
* aspeed,ast2400-rtc for the ast2400
* aspeed,ast2500-rtc for the ast2500
* aspeed,ast2600-rtc for the ast2600
- reg: physical base address of the controller and length of memory mapped
region
- interrupts: The interrupt number
Example:
rtc@1e781000 {
compatible = "aspeed,ast2400-rtc";
reg = <0x1e781000 0x18>;
interrupts = <22>;
status = "disabled";
};
* SPEAr RTC
Required properties:
- compatible : "st,spear600-rtc"
- reg : Address range of the rtc registers
- interrupt: Should contain the rtc interrupt number
Example:
rtc@fc000000 {
compatible = "st,spear600-rtc";
reg = <0xfc000000 0x1000>;
interrupt-parent = <&vic1>;
interrupts = <12>;
};
* STMP3xxx/i.MX28 Time Clock controller
Required properties:
- compatible: should be one of the following.
* "fsl,stmp3xxx-rtc"
- reg: physical base address of the controller and length of memory mapped
region.
- interrupts: rtc alarm interrupt
Optional properties:
- stmp,crystal-freq: override crystal frequency as determined from fuse bits.
Only <32000> and <32768> are possible for the hardware. Use <0> for
"no crystal".
Example:
rtc@80056000 {
compatible = "fsl,imx28-rtc", "fsl,stmp3xxx-rtc";
reg = <0x80056000 2000>;
interrupts = <29>;
};
......@@ -24,6 +24,14 @@ properties:
- abracon,abb5zes3
# AB-RTCMC-32.768kHz-EOZ9: Real Time Clock/Calendar Module with I2C Interface
- abracon,abeoz9
# ASPEED BMC ast2400 Real-time Clock
- aspeed,ast2400-rtc
# ASPEED BMC ast2500 Real-time Clock
- aspeed,ast2500-rtc
# ASPEED BMC ast2600 Real-time Clock
- aspeed,ast2600-rtc
# Conexant Digicolor Real Time Clock Controller
- cnxt,cx92755-rtc
# I2C, 32-Bit Binary Counter Watchdog RTC with Trickle Charger and Reset Input/Output
- dallas,ds1374
# Dallas DS1672 Real-time Clock
......@@ -38,19 +46,28 @@ properties:
- epson,rx8025
- epson,rx8035
# I2C-BUS INTERFACE REAL TIME CLOCK MODULE with Battery Backed RAM
- epson,rx8111
- epson,rx8571
# I2C-BUS INTERFACE REAL TIME CLOCK MODULE
- epson,rx8581
# Android Goldfish Real-time Clock
- google,goldfish-rtc
# Intersil ISL1208 Low Power RTC with Battery Backed SRAM
- isil,isl1208
# Intersil ISL1218 Low Power RTC with Battery Backed SRAM
- isil,isl1218
# Mvebu Real-time Clock
- marvell,orion-rtc
# Maxim DS1742/DS1743 Real-time Clock
- maxim,ds1742
# SPI-BUS INTERFACE REAL TIME CLOCK MODULE
- maxim,mcp795
# Real Time Clock Module with I2C-Bus
- microcrystal,rv3029
# Real Time Clock
- microcrystal,rv8523
# NXP LPC32xx SoC Real-time Clock
- nxp,lpc3220-rtc
# Real-time Clock Module
- pericom,pt7c4338
# I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
......@@ -67,6 +84,10 @@ properties:
- ricoh,rv5c387a
# 2-wire CMOS real-time clock
- sii,s35390a
# ST SPEAr Real-time Clock
- st,spear600-rtc
# VIA/Wondermedia VT8500 Real-time Clock
- via,vt8500-rtc
# I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
- whwave,sd3078
# Xircom X1205 I2C RTC
......
VIA/Wondermedia VT8500 Realtime Clock Controller
-----------------------------------------------------
Required properties:
- compatible : "via,vt8500-rtc"
- reg : Should contain 1 register ranges(address and length)
- interrupts : alarm interrupt
Example:
rtc@d8100000 {
compatible = "via,vt8500-rtc";
reg = <0xd8100000 0x10000>;
interrupts = <48>;
};
......@@ -1500,7 +1500,6 @@ F: drivers/irqchip/irq-goldfish-pic.c
ANDROID GOLDFISH RTC DRIVER
M: Jiaxun Yang <jiaxun.yang@flygoat.com>
S: Supported
F: Documentation/devicetree/bindings/rtc/google,goldfish-rtc.txt
F: drivers/rtc/rtc-goldfish.c
AOA (Apple Onboard Audio) ALSA DRIVER
......
......@@ -664,6 +664,16 @@ config RTC_DRV_RX8010
This driver can also be built as a module. If so, the module
will be called rtc-rx8010.
config RTC_DRV_RX8111
tristate "Epson RX8111"
select REGMAP_I2C
depends on I2C
help
If you say yes here you will get support for the Epson RX8111 RTC.
This driver can also be built as a module. If so, the module will be
called rtc-rx8111.
config RTC_DRV_RX8581
tristate "Epson RX-8571/RX-8581"
select REGMAP_I2C
......
......@@ -154,6 +154,7 @@ obj-$(CONFIG_RTC_DRV_RX4581) += rtc-rx4581.o
obj-$(CONFIG_RTC_DRV_RX6110) += rtc-rx6110.o
obj-$(CONFIG_RTC_DRV_RX8010) += rtc-rx8010.o
obj-$(CONFIG_RTC_DRV_RX8025) += rtc-rx8025.o
obj-$(CONFIG_RTC_DRV_RX8111) += rtc-rx8111.o
obj-$(CONFIG_RTC_DRV_RX8581) += rtc-rx8581.o
obj-$(CONFIG_RTC_DRV_RZN1) += rtc-rzn1.o
obj-$(CONFIG_RTC_DRV_S35390A) += rtc-s35390a.o
......
......@@ -27,17 +27,17 @@ static void advance_date(int *year, int *month, int *mday, int *yday)
}
/*
* Checks every day in a 160000 years interval starting on 1970-01-01
* Check every day in specified number of years interval starting on 1970-01-01
* against the expected result.
*/
static void rtc_time64_to_tm_test_date_range(struct kunit *test)
static void rtc_time64_to_tm_test_date_range(struct kunit *test, int years)
{
/*
* 160000 years = (160000 / 400) * 400 years
* = (160000 / 400) * 146097 days
* = (160000 / 400) * 146097 * 86400 seconds
* years = (years / 400) * 400 years
* = (years / 400) * 146097 days
* = (years / 400) * 146097 * 86400 seconds
*/
time64_t total_secs = ((time64_t) 160000) / 400 * 146097 * 86400;
time64_t total_secs = ((time64_t)years) / 400 * 146097 * 86400;
int year = 1970;
int month = 1;
......@@ -66,8 +66,27 @@ static void rtc_time64_to_tm_test_date_range(struct kunit *test)
}
}
/*
* Checks every day in a 160000 years interval starting on 1970-01-01
* against the expected result.
*/
static void rtc_time64_to_tm_test_date_range_160000(struct kunit *test)
{
rtc_time64_to_tm_test_date_range(test, 160000);
}
/*
* Checks every day in a 1000 years interval starting on 1970-01-01
* against the expected result.
*/
static void rtc_time64_to_tm_test_date_range_1000(struct kunit *test)
{
rtc_time64_to_tm_test_date_range(test, 1000);
}
static struct kunit_case rtc_lib_test_cases[] = {
KUNIT_CASE(rtc_time64_to_tm_test_date_range),
KUNIT_CASE(rtc_time64_to_tm_test_date_range_1000),
KUNIT_CASE_SLOW(rtc_time64_to_tm_test_date_range_160000),
{}
};
......
......@@ -5,6 +5,7 @@
// Author: Stephen Barber <smbarber@chromium.org>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
......@@ -392,6 +393,12 @@ static void cros_ec_rtc_remove(struct platform_device *pdev)
dev_err(dev, "failed to unregister notifier\n");
}
static const struct platform_device_id cros_ec_rtc_id[] = {
{ DRV_NAME, 0 },
{}
};
MODULE_DEVICE_TABLE(platform, cros_ec_rtc_id);
static struct platform_driver cros_ec_rtc_driver = {
.probe = cros_ec_rtc_probe,
.remove_new = cros_ec_rtc_remove,
......@@ -399,6 +406,7 @@ static struct platform_driver cros_ec_rtc_driver = {
.name = DRV_NAME,
.pm = &cros_ec_rtc_pm_ops,
},
.id_table = cros_ec_rtc_id,
};
module_platform_driver(cros_ec_rtc_driver);
......@@ -406,4 +414,3 @@ module_platform_driver(cros_ec_rtc_driver);
MODULE_DESCRIPTION("RTC driver for Chrome OS ECs");
MODULE_AUTHOR("Stephen Barber <smbarber@chromium.org>");
MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:" DRV_NAME);
......@@ -450,4 +450,3 @@ module_spi_driver(mcp795_driver);
MODULE_DESCRIPTION("MCP795 RTC SPI Driver");
MODULE_AUTHOR("Josef Gajdusek <atx@atx.name>");
MODULE_LICENSE("GPL");
MODULE_ALIAS("spi:mcp795");
......@@ -517,12 +517,15 @@ static int nct3018y_probe(struct i2c_client *client)
if (nct3018y->part_num < 0) {
dev_dbg(&client->dev, "Failed to read NCT3018Y_REG_PART.\n");
return nct3018y->part_num;
} else if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y) {
flags = NCT3018Y_BIT_HF;
err = i2c_smbus_write_byte_data(client, NCT3018Y_REG_CTRL, flags);
if (err < 0) {
dev_dbg(&client->dev, "Unable to write NCT3018Y_REG_CTRL.\n");
return err;
} else {
nct3018y->part_num &= 0x03; /* Part number is corresponding to bit 0 and 1 */
if (nct3018y->part_num == NCT3018Y_REG_PART_NCT3018Y) {
flags = NCT3018Y_BIT_HF;
err = i2c_smbus_write_byte_data(client, NCT3018Y_REG_CTRL, flags);
if (err < 0) {
dev_dbg(&client->dev, "Unable to write NCT3018Y_REG_CTRL.\n");
return err;
}
}
}
......
......@@ -527,7 +527,6 @@ static int pcf8563_probe(struct i2c_client *client)
i2c_set_clientdata(client, pcf8563);
pcf8563->client = client;
device_set_wakeup_capable(&client->dev, 1);
/* Set timer to lowest frequency to save power (ref Haoyu datasheet) */
buf = PCF8563_TMRC_1_60;
......@@ -553,6 +552,7 @@ static int pcf8563_probe(struct i2c_client *client)
/* the pcf8563 alarm only supports a minute accuracy */
set_bit(RTC_FEATURE_ALARM_RES_MINUTE, pcf8563->rtc->features);
clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, pcf8563->rtc->features);
clear_bit(RTC_FEATURE_ALARM, pcf8563->rtc->features);
pcf8563->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
pcf8563->rtc->range_max = RTC_TIMESTAMP_END_2099;
pcf8563->rtc->set_start_time = true;
......@@ -573,7 +573,12 @@ static int pcf8563_probe(struct i2c_client *client)
return err;
}
} else {
clear_bit(RTC_FEATURE_ALARM, pcf8563->rtc->features);
client->irq = 0;
}
if (client->irq > 0 || device_property_read_bool(&client->dev, "wakeup-source")) {
device_init_wakeup(&client->dev, true);
set_bit(RTC_FEATURE_ALARM, pcf8563->rtc->features);
}
err = devm_rtc_register_device(pcf8563->rtc);
......
......@@ -330,7 +330,7 @@ static int rx6110_probe(struct rx6110_data *rx6110, struct device *dev)
}
#if IS_ENABLED(CONFIG_SPI_MASTER)
static struct regmap_config regmap_spi_config = {
static const struct regmap_config regmap_spi_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = RX6110_REG_IRQ,
......@@ -410,7 +410,7 @@ static void rx6110_spi_unregister(void)
#endif /* CONFIG_SPI_MASTER */
#if IS_ENABLED(CONFIG_I2C)
static struct regmap_config regmap_i2c_config = {
static const struct regmap_config regmap_i2c_config = {
.reg_bits = 8,
.val_bits = 8,
.max_register = RX6110_REG_IRQ,
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment