Skip to content

Commit

Permalink
Merge tag 'rtc-v4.3' 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:
 "Core:
   - use is_visible() to control sysfs attributes
   - switch wakealarm attribute to DEVICE_ATTR_RW
   - make rtc_does_wakealarm() return boolean
   - properly manage lifetime of dev and cdev in rtc device
   - remove unnecessary device_get() in rtc_device_unregister
   - fix double free in rtc_register_device() error path

  New drivers:
   - NXP LPC24xx
   - Xilinx Zynq MP
   - Dialog DA9062

  Subsystem wide cleanups:
   - fix drivers that consider 0 as a valid IRQ in client->irq
   - Drop (un)likely before IS_ERR(_OR_NULL)
   - drop the remaining owner assignment for i2c_driver and
     platform_driver
   - module autoload fixes

  Drivers:
   - 88pm80x: add device tree support
   - abx80x: fix RTC write bit
   - ab8500: Add a sentinel to ab85xx_rtc_ids[]
   - armada38x: Align RTC set time procedure with the official errata
   - as3722: correct month value
   - at91sam9: cleanups
   - at91rm9200: get and use slow clock and cleanups
   - bq32k: remove redundant check
   - cmos: century support, proper fix for the spurious wakeup
   - ds1307: cleanups and wakeup irq support
   - ds1374: Remove unused variable
   - ds1685: Use module_platform_driver
   - ds3232: fix WARNING trace in resume function
   - gemini: fix ptr_ret.cocci warnings
   - mt6397: implement suspend/resume
   - omap: support internal and external clock enabling
   - opal: Enable alarms only when opal supports tpo
   - pcf2127: use OFS flag to detect unreliable date and warn the user
   - pl031: fix typo for author email
   - rx8025: huge cleanup and fixes
   - sa1100/pxa: share common code
   - s5m: fix to update ctrl register
   - s3c: fix clocks and wakeup, cleanup
   - sirfsoc: use regmap
   - nvram_read()/nvram_write() functions for cmos, ds1305, ds1307,
     ds1343, ds1511, ds1553, ds1742, m48t59, rp5c01, stk17ta8, tx4939
   - use rtc_valid_tm() error code when reading date/time instead of 0
     for isl12022, pcf2123, pcf2127"

* tag 'rtc-v4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (90 commits)
  rtc: abx80x: fix RTC write bit
  rtc: ab8500: Add a sentinel to ab85xx_rtc_ids[]
  rtc: ds1374: Remove unused variable
  rtc: Fix module autoload for OF platform drivers
  rtc: Fix module autoload for rtc-{ab8500,max8997,s5m} drivers
  rtc: omap: Add external clock enabling support
  rtc: omap: Add internal clock enabling support
  ARM: dts: AM437x: Add the internal and external clock nodes for rtc
  rtc: s5m: fix to update ctrl register
  rtc: add xilinx zynqmp rtc driver
  devicetree: bindings: rtc: add bindings for xilinx zynqmp rtc
  rtc: as3722: correct month value
  ARM: config: Switch PXA27x platforms to use PXA RTC driver
  ARM: mmp: remove unused RTC register definitions
  ARM: sa1100: remove unused RTC register definitions
  rtc: sa1100/pxa: convert to run-time register mapping
  ARM: pxa: add memory resource to SA1100 RTC device
  rtc: pxa: convert to use shared sa1100 functions
  rtc: sa1100: prepare to share sa1100_rtc_ops
  rtc: ds3232: fix WARNING trace in resume function
  ...
  • Loading branch information
torvalds committed Sep 8, 2015
2 parents 12f03ee + 5f1b2f7 commit c191761
Show file tree
Hide file tree
Showing 82 changed files with 1,756 additions and 933 deletions.
21 changes: 21 additions & 0 deletions Documentation/devicetree/bindings/rtc/nxp,lpc1788-rtc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
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";
};
4 changes: 4 additions & 0 deletions Documentation/devicetree/bindings/rtc/rtc-omap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Required properties:
Optional properties:
- system-power-controller: whether the rtc is controlling the system power
through pmic_power_en
- clocks: Any internal or external clocks feeding in to rtc
- clock-names: Corresponding names of the clocks

Example:

Expand All @@ -26,4 +28,6 @@ rtc@1c23000 {
19>;
interrupt-parent = <&intc>;
system-power-controller;
clocks = <&clk_32k_rtc>, <&clk_32768_ck>;
clock-names = "ext-clk", "int-clk";
};
25 changes: 25 additions & 0 deletions Documentation/devicetree/bindings/rtc/xlnx-rtc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
* Xilinx Zynq Ultrascale+ MPSoC Real Time Clock

RTC controller for the Xilinx Zynq MPSoC Real Time Clock
Separate IRQ lines for seconds and alarm

Required properties:
- compatible: Should be "xlnx,zynqmp-rtc"
- reg: Physical base address of the controller and length
of memory mapped region.
- interrupts: IRQ lines for the RTC.
- interrupt-names: interrupt line names eg. "sec" "alarm"

Optional:
- calibration: calibration value for 1 sec period which will
be programmed directly to calibration register

Example:
rtc: rtc@ffa60000 {
compatible = "xlnx,zynqmp-rtc";
reg = <0x0 0xffa60000 0x100>;
interrupt-parent = <&gic>;
interrupts = <0 26 4>, <0 27 4>;
interrupt-names = "alarm", "sec";
calibration = <0x198233>;
};
2 changes: 2 additions & 0 deletions arch/arm/boot/dts/am4372.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@
interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH
GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
ti,hwmods = "rtc";
clocks = <&clk_32768_ck>;
clock-names = "int-clk";
status = "disabled";
};

Expand Down
13 changes: 13 additions & 0 deletions arch/arm/boot/dts/am437x-gp-evm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@
clock-frequency = <12000000>;
};

/* fixed 32k external oscillator clock */
clk_32k_rtc: clk_32k_rtc {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <32768>;
};

sound0: sound@0 {
compatible = "simple-audio-card";
simple-audio-card,name = "AM437x-GP-EVM";
Expand Down Expand Up @@ -941,3 +948,9 @@
tx-num-evt = <32>;
rx-num-evt = <32>;
};

&rtc {
clocks = <&clk_32k_rtc>, <&clk_32768_ck>;
clock-names = "ext-clk", "int-clk";
status = "okay";
};
9 changes: 9 additions & 0 deletions arch/arm/boot/dts/am437x-idk-evm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@
gpios = <&gpio4 2 GPIO_ACTIVE_LOW>;
};
};

/* fixed 32k external oscillator clock */
clk_32k_rtc: clk_32k_rtc {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <32768>;
};
};

&am43xx_pinmux {
Expand Down Expand Up @@ -394,6 +401,8 @@
};

&rtc {
clocks = <&clk_32k_rtc>, <&clk_32768_ck>;
clock-names = "ext-clk", "int-clk";
status = "okay";
};

Expand Down
9 changes: 9 additions & 0 deletions arch/arm/boot/dts/am437x-sk-evm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
display0 = &lcd0;
};

/* fixed 32k external oscillator clock */
clk_32k_rtc: clk_32k_rtc {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <32768>;
};

backlight {
compatible = "pwm-backlight";
pwms = <&ecap0 0 50000 PWM_POLARITY_INVERTED>;
Expand Down Expand Up @@ -697,6 +704,8 @@
};

&rtc {
clocks = <&clk_32k_rtc>, <&clk_32768_ck>;
clock-names = "ext-clk", "int-clk";
status = "okay";
};

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/cm_x2xx_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_V3020=y
CONFIG_RTC_DRV_SA1100=y
CONFIG_RTC_DRV_PXA=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_INOTIFY=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/em_x270_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_V3020=y
CONFIG_RTC_DRV_SA1100=y
CONFIG_RTC_DRV_PXA=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_INOTIFY=y
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/magician_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ CONFIG_LEDS_TRIGGERS=y
CONFIG_LEDS_TRIGGER_BACKLIGHT=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DEBUG=y
CONFIG_RTC_DRV_SA1100=y
CONFIG_RTC_DRV_PXA=y
CONFIG_EXT2_FS=y
CONFIG_INOTIFY=y
CONFIG_MSDOS_FS=m
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/palmz72_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ CONFIG_MMC=y
CONFIG_MMC_DEBUG=y
CONFIG_MMC_PXA=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_SA1100=y
CONFIG_RTC_DRV_PXA=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
# CONFIG_DNOTIFY is not set
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/pcm027_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CONFIG_MMC=y
CONFIG_MMC_PXA=y
CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_PCF8563=m
CONFIG_RTC_DRV_SA1100=m
CONFIG_RTC_DRV_PXA=m
CONFIG_EXT2_FS=m
CONFIG_EXT3_FS=m
# CONFIG_DNOTIFY is not set
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/configs/trizeps4_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ CONFIG_NEW_LEDS=y
CONFIG_RTC_CLASS=y
# CONFIG_RTC_HCTOSYS is not set
CONFIG_RTC_DRV_PCF8583=m
CONFIG_RTC_DRV_SA1100=y
CONFIG_RTC_DRV_PXA=y
CONFIG_EXT2_FS=y
CONFIG_EXT2_FS_XATTR=y
CONFIG_EXT2_FS_POSIX_ACL=y
Expand Down
23 changes: 0 additions & 23 deletions arch/arm/mach-mmp/include/mach/regs-rtc.h

This file was deleted.

18 changes: 2 additions & 16 deletions arch/arm/mach-pxa/devices.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,25 +440,11 @@ struct platform_device pxa_device_rtc = {
.resource = pxa_rtc_resources,
};

static struct resource sa1100_rtc_resources[] = {
{
.start = IRQ_RTC1Hz,
.end = IRQ_RTC1Hz,
.name = "rtc 1Hz",
.flags = IORESOURCE_IRQ,
}, {
.start = IRQ_RTCAlrm,
.end = IRQ_RTCAlrm,
.name = "rtc alarm",
.flags = IORESOURCE_IRQ,
},
};

struct platform_device sa1100_device_rtc = {
.name = "sa1100-rtc",
.id = -1,
.num_resources = ARRAY_SIZE(sa1100_rtc_resources),
.resource = sa1100_rtc_resources,
.num_resources = ARRAY_SIZE(pxa_rtc_resources),
.resource = pxa_rtc_resources,
};

static struct resource pxa_ac97_resources[] = {
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-pxa/pxa27x.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ static struct platform_device *devices[] __initdata = {
&pxa_device_asoc_ssp2,
&pxa_device_asoc_ssp3,
&pxa_device_asoc_platform,
&sa1100_device_rtc,
&pxa_device_rtc,
&pxa27x_device_ssp1,
&pxa27x_device_ssp2,
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-pxa/pxa3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ static struct platform_device *devices[] __initdata = {
&pxa_device_asoc_ssp3,
&pxa_device_asoc_ssp4,
&pxa_device_asoc_platform,
&sa1100_device_rtc,
&pxa_device_rtc,
&pxa3xx_device_ssp1,
&pxa3xx_device_ssp2,
Expand Down
34 changes: 0 additions & 34 deletions arch/arm/mach-sa1100/include/mach/SA-1100.h
Original file line number Diff line number Diff line change
Expand Up @@ -857,40 +857,6 @@
#define OIER_E3 OIER_E (3) /* match interrupt Enable 3 */


/*
* Real-Time Clock (RTC) control registers
*
* Registers
* RTAR Real-Time Clock (RTC) Alarm Register (read/write).
* RCNR Real-Time Clock (RTC) CouNt Register (read/write).
* RTTR Real-Time Clock (RTC) Trim Register (read/write).
* RTSR Real-Time Clock (RTC) Status Register (read/write).
*
* Clocks
* frtx, Trtx Frequency, period of the real-time clock crystal
* (32.768 kHz nominal).
* frtc, Trtc Frequency, period of the real-time clock counter
* (1 Hz nominal).
*/

#define RTAR __REG(0x90010000) /* RTC Alarm Reg. */
#define RCNR __REG(0x90010004) /* RTC CouNt Reg. */
#define RTTR __REG(0x90010008) /* RTC Trim Reg. */
#define RTSR __REG(0x90010010) /* RTC Status Reg. */

#define RTTR_C Fld (16, 0) /* clock divider Count - 1 */
#define RTTR_D Fld (10, 16) /* trim Delete count */
/* frtc = (1023*(C + 1) - D)*frtx/ */
/* (1023*(C + 1)^2) */
/* Trtc = (1023*(C + 1)^2)*Trtx/ */
/* (1023*(C + 1) - D) */

#define RTSR_AL 0x00000001 /* ALarm detected */
#define RTSR_HZ 0x00000002 /* 1 Hz clock detected */
#define RTSR_ALE 0x00000004 /* ALarm interrupt Enable */
#define RTSR_HZE 0x00000008 /* 1 Hz clock interrupt Enable */


/*
* Power Manager (PM) control registers
*
Expand Down
37 changes: 29 additions & 8 deletions drivers/rtc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -945,11 +945,11 @@ config RTC_DRV_DA9055
will be called rtc-da9055

config RTC_DRV_DA9063
tristate "Dialog Semiconductor DA9063 RTC"
depends on MFD_DA9063
tristate "Dialog Semiconductor DA9063/DA9062 RTC"
depends on MFD_DA9063 || MFD_DA9062
help
If you say yes here you will get support for the RTC subsystem
of the Dialog Semiconductor DA9063.
for the Dialog Semiconductor PMIC chips DA9063 and DA9062.

This driver can also be built as a module. If so, the module
will be called "rtc-da9063".
Expand Down Expand Up @@ -1116,6 +1116,13 @@ config RTC_DRV_OPAL
This driver can also be built as a module. If so, the module
will be called rtc-opal.

config RTC_DRV_ZYNQMP
tristate "Xilinx Zynq Ultrascale+ MPSoC RTC"
depends on OF
help
If you say yes here you get support for the RTC controller found on
Xilinx Zynq Ultrascale+ MPSoC.

comment "on-CPU RTC drivers"

config RTC_DRV_DAVINCI
Expand Down Expand Up @@ -1306,11 +1313,13 @@ config RTC_DRV_GENERIC
just say Y.

config RTC_DRV_PXA
tristate "PXA27x/PXA3xx"
depends on ARCH_PXA
help
If you say Y here you will get access to the real time clock
built into your PXA27x or PXA3xx CPU.
tristate "PXA27x/PXA3xx"
depends on ARCH_PXA
select RTC_DRV_SA1100
help
If you say Y here you will get access to the real time clock
built into your PXA27x or PXA3xx CPU. This RTC is actually 2 RTCs
consisting of an SA1100 compatible RTC and the extended PXA RTC.

This RTC driver uses PXA RTC registers available since pxa27x
series (RDxR, RYxR) instead of legacy RCNR, RTAR.
Expand Down Expand Up @@ -1456,6 +1465,18 @@ config RTC_DRV_JZ4740
This driver can also be buillt as a module. If so, the module
will be called rtc-jz4740.

config RTC_DRV_LPC24XX
tristate "NXP RTC for LPC178x/18xx/408x/43xx"
depends on ARCH_LPC18XX || COMPILE_TEST
depends on OF && HAS_IOMEM
help
This enables support for the NXP RTC found which can be found on
NXP LPC178x/18xx/408x/43xx devices.

If you have one of the devices above enable this driver to use
the hardware RTC. This driver can also be buillt as a module. If
so, the module will be called rtc-lpc24xx.

config RTC_DRV_LPC32XX
depends on ARCH_LPC32XX
tristate "NXP LPC32XX RTC"
Expand Down
2 changes: 2 additions & 0 deletions drivers/rtc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ obj-$(CONFIG_RTC_DRV_ISL12057) += rtc-isl12057.o
obj-$(CONFIG_RTC_DRV_ISL1208) += rtc-isl1208.o
obj-$(CONFIG_RTC_DRV_JZ4740) += rtc-jz4740.o
obj-$(CONFIG_RTC_DRV_LP8788) += rtc-lp8788.o
obj-$(CONFIG_RTC_DRV_LPC24XX) += rtc-lpc24xx.o
obj-$(CONFIG_RTC_DRV_LPC32XX) += rtc-lpc32xx.o
obj-$(CONFIG_RTC_DRV_LOONGSON1) += rtc-ls1x.o
obj-$(CONFIG_RTC_DRV_M41T80) += rtc-m41t80.o
Expand Down Expand Up @@ -158,3 +159,4 @@ obj-$(CONFIG_RTC_DRV_WM831X) += rtc-wm831x.o
obj-$(CONFIG_RTC_DRV_WM8350) += rtc-wm8350.o
obj-$(CONFIG_RTC_DRV_X1205) += rtc-x1205.o
obj-$(CONFIG_RTC_DRV_XGENE) += rtc-xgene.o
obj-$(CONFIG_RTC_DRV_ZYNQMP) += rtc-zynqmp.o
Loading

0 comments on commit c191761

Please sign in to comment.