projects/linux·commit c1917615

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

c1917615 · Linus Torvalds <[email protected]> · 2015-09-08 15:46:31 -07:00

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
  ...
Commit
c19176154b464c861e49355eff636aa6896735b5
Parents
12f03ee6 · 5f1b2f77

Merge commit. Changes below are compared with the first parent: 12f03ee6.

Changes

82 files changed · +1756 −933

FileStatusAddDelContent
Documentation/devicetree/bindings/rtc/nxp,lpc1788-rtc.txtadded+21−0View file
Documentation/devicetree/bindings/rtc/rtc-omap.txtmodified+4−0View file
Documentation/devicetree/bindings/rtc/xlnx-rtc.txtadded+25−0View file
arch/arm/boot/dts/am4372.dtsimodified+2−0View file
arch/arm/boot/dts/am437x-gp-evm.dtsmodified+13−0View file
arch/arm/boot/dts/am437x-idk-evm.dtsmodified+9−0View file
arch/arm/boot/dts/am437x-sk-evm.dtsmodified+9−0View file
arch/arm/configs/cm_x2xx_defconfigmodified+1−1View file
arch/arm/configs/em_x270_defconfigmodified+1−1View file
arch/arm/configs/magician_defconfigmodified+1−1View file
arch/arm/configs/palmz72_defconfigmodified+1−1View file
arch/arm/configs/pcm027_defconfigmodified+1−1View file
arch/arm/configs/trizeps4_defconfigmodified+1−1View file
arch/arm/mach-mmp/include/mach/regs-rtc.hdeleted+0−23View before deletion
arch/arm/mach-pxa/devices.cmodified+2−16View file
arch/arm/mach-pxa/pxa27x.cmodified+0−1View file
arch/arm/mach-pxa/pxa3xx.cmodified+0−1View file
arch/arm/mach-sa1100/include/mach/SA-1100.hmodified+0−34View file
drivers/rtc/Kconfigmodified+29−8View file
drivers/rtc/Makefilemodified+2−0View file
drivers/rtc/class.cmodified+14−19View file
drivers/rtc/interface.cmodified+1−1View file
drivers/rtc/rtc-88pm80x.cmodified+17−11View file
drivers/rtc/rtc-ab-b5ze-s3.cmodified+1−1View file
drivers/rtc/rtc-ab8500.cmodified+2−0View file
drivers/rtc/rtc-abx80x.cmodified+1−1View file
drivers/rtc/rtc-armada38x.cmodified+13−20View file
drivers/rtc/rtc-as3722.cmodified+2−2View file
drivers/rtc/rtc-at91rm9200.cmodified+32−11View file
drivers/rtc/rtc-at91sam9.cmodified+26−19View file
drivers/rtc/rtc-bfin.cmodified+1−1View file
drivers/rtc/rtc-bq32k.cmodified+1−2View file
drivers/rtc/rtc-cmos.cmodified+59−66View file
drivers/rtc/rtc-coh901331.cmodified+1−0View file
drivers/rtc/rtc-core.hmodified+3−16View file
drivers/rtc/rtc-da9063.cmodified+280−112View file
drivers/rtc/rtc-dev.cmodified+1−0View file
drivers/rtc/rtc-ds1305.cmodified+0−18View file
drivers/rtc/rtc-ds1307.cmodified+56−64View file
drivers/rtc/rtc-ds1343.cmodified+0−12View file
drivers/rtc/rtc-ds1374.cmodified+2−5View file
drivers/rtc/rtc-ds1511.cmodified+5−37View file
drivers/rtc/rtc-ds1553.cmodified+2−2View file
drivers/rtc/rtc-ds1685.cmodified+1−21View file
drivers/rtc/rtc-ds1742.cmodified+2−2View file
drivers/rtc/rtc-ds3232.cmodified+5−3View file
drivers/rtc/rtc-fm3130.cmodified+0−1View file
drivers/rtc/rtc-gemini.cmodified+1−4View file
drivers/rtc/rtc-hym8563.cmodified+0−1View file
drivers/rtc/rtc-isl12022.cmodified+2−6View file
drivers/rtc/rtc-isl12057.cmodified+1−1View file
drivers/rtc/rtc-lpc24xx.cadded+310−0View file
drivers/rtc/rtc-m48t59.cmodified+10−8View file
drivers/rtc/rtc-max8997.cmodified+1−0View file
drivers/rtc/rtc-moxart.cmodified+1−0View file
drivers/rtc/rtc-mpc5121.cmodified+1−0View file
drivers/rtc/rtc-mt6397.cmodified+27−0View file
drivers/rtc/rtc-mv.cmodified+1−0View file
drivers/rtc/rtc-omap.cmodified+33−0View file
drivers/rtc/rtc-opal.cmodified+5−5View file
drivers/rtc/rtc-pcf2123.cmodified+1−7View file
drivers/rtc/rtc-pcf2127.cmodified+24−11View file
drivers/rtc/rtc-pcf85063.cmodified+0−1View file
drivers/rtc/rtc-pcf8523.cmodified+0−1View file
drivers/rtc/rtc-pcf8563.cmodified+0−1View file
drivers/rtc/rtc-pcf8583.cmodified+0−1View file
drivers/rtc/rtc-pl031.cmodified+1−1View file
drivers/rtc/rtc-pxa.cmodified+28−27View file
drivers/rtc/rtc-rp5c01.cmodified+2−2View file
drivers/rtc/rtc-rx8025.cmodified+105−172View file
drivers/rtc/rtc-rx8581.cmodified+0−1View file
drivers/rtc/rtc-s3c.cmodified+21−7View file
drivers/rtc/rtc-s5m.cmodified+11−0View file
drivers/rtc/rtc-sa1100.cmodified+84−55View file
drivers/rtc/rtc-sa1100.hadded+23−0View file
drivers/rtc/rtc-sirfsoc.cmodified+64−43View file
drivers/rtc/rtc-stk17ta8.cmodified+2−2View file
drivers/rtc/rtc-sysfs.cmodified+36−36View file
drivers/rtc/rtc-tx4939.cmodified+2−4View file
drivers/rtc/rtc-vt8500.cmodified+1−0View file
drivers/rtc/rtc-zynqmp.cadded+279−0View file
include/asm-generic/rtc.hmodified+29−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/devicetree/bindings/rtc/nxp,lpc1788-rtc.txt

View file
diff --git a/Documentation/devicetree/bindings/rtc/nxp,lpc1788-rtc.txt b/Documentation/devicetree/bindings/rtc/nxp,lpc1788-rtc.txt
new file mode 100644
index 0000000..3c97bd1
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/nxp,lpc1788-rtc.txt
@@ -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";
+};

Documentation/devicetree/bindings/rtc/rtc-omap.txt

View file
diff --git a/Documentation/devicetree/bindings/rtc/rtc-omap.txt b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
index 43a8366..bf7d11a 100644
--- a/Documentation/devicetree/bindings/rtc/rtc-omap.txt
+++ b/Documentation/devicetree/bindings/rtc/rtc-omap.txt
@@ -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:
@@ -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";
};

Documentation/devicetree/bindings/rtc/xlnx-rtc.txt

View file
diff --git a/Documentation/devicetree/bindings/rtc/xlnx-rtc.txt b/Documentation/devicetree/bindings/rtc/xlnx-rtc.txt
new file mode 100644
index 0000000..0df6f01
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/xlnx-rtc.txt
@@ -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>;
+};

arch/arm/boot/dts/am4372.dtsi

View file
diff --git a/arch/arm/boot/dts/am4372.dtsi b/arch/arm/boot/dts/am4372.dtsi
index 564900b..0447c04 100644
--- a/arch/arm/boot/dts/am4372.dtsi
+++ b/arch/arm/boot/dts/am4372.dtsi
@@ -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";
};

arch/arm/boot/dts/am437x-gp-evm.dts

View file
diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts
index 215775d..22038f2 100644
--- a/arch/arm/boot/dts/am437x-gp-evm.dts
+++ b/arch/arm/boot/dts/am437x-gp-evm.dts
@@ -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";
@@ -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";
+};

arch/arm/boot/dts/am437x-idk-evm.dts

View file
diff --git a/arch/arm/boot/dts/am437x-idk-evm.dts b/arch/arm/boot/dts/am437x-idk-evm.dts
index 3783442..af25801 100644
--- a/arch/arm/boot/dts/am437x-idk-evm.dts
+++ b/arch/arm/boot/dts/am437x-idk-evm.dts
@@ -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 {
@@ -394,6 +401,8 @@
};
&rtc {
+ clocks = <&clk_32k_rtc>, <&clk_32768_ck>;
+ clock-names = "ext-clk", "int-clk";
status = "okay";
};

arch/arm/boot/dts/am437x-sk-evm.dts

View file
diff --git a/arch/arm/boot/dts/am437x-sk-evm.dts b/arch/arm/boot/dts/am437x-sk-evm.dts
index 22af448..7da7c2d 100644
--- a/arch/arm/boot/dts/am437x-sk-evm.dts
+++ b/arch/arm/boot/dts/am437x-sk-evm.dts
@@ -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>;
@@ -697,6 +704,8 @@
};
&rtc {
+ clocks = <&clk_32k_rtc>, <&clk_32768_ck>;
+ clock-names = "ext-clk", "int-clk";
status = "okay";
};

arch/arm/configs/cm_x2xx_defconfig

View file
diff --git a/arch/arm/configs/cm_x2xx_defconfig b/arch/arm/configs/cm_x2xx_defconfig
index dc01c04..3b32d5f 100644
--- a/arch/arm/configs/cm_x2xx_defconfig
+++ b/arch/arm/configs/cm_x2xx_defconfig
@@ -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

arch/arm/configs/em_x270_defconfig

View file
diff --git a/arch/arm/configs/em_x270_defconfig b/arch/arm/configs/em_x270_defconfig
index 4560c9c..8e10df7 100644
--- a/arch/arm/configs/em_x270_defconfig
+++ b/arch/arm/configs/em_x270_defconfig
@@ -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

arch/arm/configs/magician_defconfig

View file
diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig
index 557dd29..a5b4920 100644
--- a/arch/arm/configs/magician_defconfig
+++ b/arch/arm/configs/magician_defconfig
@@ -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

arch/arm/configs/palmz72_defconfig

View file
diff --git a/arch/arm/configs/palmz72_defconfig b/arch/arm/configs/palmz72_defconfig
index 4baa83c..83c135e 100644
--- a/arch/arm/configs/palmz72_defconfig
+++ b/arch/arm/configs/palmz72_defconfig
@@ -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

arch/arm/configs/pcm027_defconfig

View file
diff --git a/arch/arm/configs/pcm027_defconfig b/arch/arm/configs/pcm027_defconfig
index 0a847d0..b5624e3 100644
--- a/arch/arm/configs/pcm027_defconfig
+++ b/arch/arm/configs/pcm027_defconfig
@@ -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

arch/arm/configs/trizeps4_defconfig

View file
diff --git a/arch/arm/configs/trizeps4_defconfig b/arch/arm/configs/trizeps4_defconfig
index 932ee4e..4bc8700 100644
--- a/arch/arm/configs/trizeps4_defconfig
+++ b/arch/arm/configs/trizeps4_defconfig
@@ -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

arch/arm/mach-mmp/include/mach/regs-rtc.h

View before deletion
diff --git a/arch/arm/mach-mmp/include/mach/regs-rtc.h b/arch/arm/mach-mmp/include/mach/regs-rtc.h
deleted file mode 100644
index 5bff886..0000000
--- a/arch/arm/mach-mmp/include/mach/regs-rtc.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __ASM_MACH_REGS_RTC_H
-#define __ASM_MACH_REGS_RTC_H
-
-#include <mach/addr-map.h>
-
-#define RTC_VIRT_BASE (APB_VIRT_BASE + 0x10000)
-#define RTC_REG(x) (*((volatile u32 __iomem *)(RTC_VIRT_BASE + (x))))
-
-/*
- * Real Time Clock
- */
-
-#define RCNR RTC_REG(0x00) /* RTC Count Register */
-#define RTAR RTC_REG(0x04) /* RTC Alarm Register */
-#define RTSR RTC_REG(0x08) /* RTC Status Register */
-#define RTTR RTC_REG(0x0C) /* RTC Timer Trim Register */
-
-#define RTSR_HZE (1 << 3) /* HZ interrupt enable */
-#define RTSR_ALE (1 << 2) /* RTC alarm interrupt enable */
-#define RTSR_HZ (1 << 1) /* HZ rising-edge detected */
-#define RTSR_AL (1 << 0) /* RTC alarm detected */
-
-#endif /* __ASM_MACH_REGS_RTC_H */

arch/arm/mach-pxa/devices.c

View file
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index e6ce669..c624732 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -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[] = {

arch/arm/mach-pxa/pxa27x.c

View file
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index e6aae9e..221260d 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -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,

arch/arm/mach-pxa/pxa3xx.c

View file
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 1656384..ce0f8d6 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -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,

arch/arm/mach-sa1100/include/mach/SA-1100.h

View file
diff --git a/arch/arm/mach-sa1100/include/mach/SA-1100.h b/arch/arm/mach-sa1100/include/mach/SA-1100.h
index 0ac6cc0..7972617 100644
--- a/arch/arm/mach-sa1100/include/mach/SA-1100.h
+++ b/arch/arm/mach-sa1100/include/mach/SA-1100.h
@@ -858,40 +858,6 @@
/*
- * 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
*
* Registers

drivers/rtc/Kconfig

View file
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 533bfa3..9d42906 100644
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -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".
@@ -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
@@ -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.
@@ -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"

drivers/rtc/Makefile

View file
diff --git a/drivers/rtc/Makefile b/drivers/rtc/Makefile
index 1b09a62..e491eb5 100644
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@ -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
@@ -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

drivers/rtc/class.c

View file
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c
index ea2a315..de86578 100644
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -202,6 +202,7 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
rtc->max_user_freq = 64;
rtc->dev.parent = dev;
rtc->dev.class = rtc_class;
+ rtc->dev.groups = rtc_get_dev_attribute_groups();
rtc->dev.release = rtc_device_release;
mutex_init(&rtc->ops_lock);
@@ -234,12 +235,12 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
err = device_register(&rtc->dev);
if (err) {
+ /* This will free both memory and the ID */
put_device(&rtc->dev);
- goto exit_kfree;
+ goto exit;
}
rtc_dev_add_device(rtc);
- rtc_sysfs_add_device(rtc);
rtc_proc_add_device(rtc);
dev_info(dev, "rtc core: registered %s as %s\n",
@@ -247,9 +248,6 @@ struct rtc_device *rtc_device_register(const char *name, struct device *dev,
return rtc;
-exit_kfree:
- kfree(rtc);
-
exit_ida:
ida_simple_remove(&rtc_ida, id);
@@ -268,19 +266,17 @@ EXPORT_SYMBOL_GPL(rtc_device_register);
*/
void rtc_device_unregister(struct rtc_device *rtc)
{
- if (get_device(&rtc->dev) != NULL) {
- mutex_lock(&rtc->ops_lock);
- /* remove innards of this RTC, then disable it, before
- * letting any rtc_class_open() users access it again
- */
- rtc_sysfs_del_device(rtc);
- rtc_dev_del_device(rtc);
- rtc_proc_del_device(rtc);
- device_unregister(&rtc->dev);
- rtc->ops = NULL;
- mutex_unlock(&rtc->ops_lock);
- put_device(&rtc->dev);
- }
+ mutex_lock(&rtc->ops_lock);
+ /*
+ * Remove innards of this RTC, then disable it, before
+ * letting any rtc_class_open() users access it again
+ */
+ rtc_dev_del_device(rtc);
+ rtc_proc_del_device(rtc);
+ device_del(&rtc->dev);
+ rtc->ops = NULL;
+ mutex_unlock(&rtc->ops_lock);
+ put_device(&rtc->dev);
}
EXPORT_SYMBOL_GPL(rtc_device_unregister);
@@ -363,7 +359,6 @@ static int __init rtc_init(void)
}
rtc_class->pm = RTC_CLASS_DEV_PM_OPS;
rtc_dev_init();
- rtc_sysfs_init(rtc_class);
return 0;
}

drivers/rtc/interface.c

View file
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c
index 11b6390..5836751 100644
--- a/drivers/rtc/interface.c
+++ b/drivers/rtc/interface.c
@@ -564,7 +564,7 @@ enum hrtimer_restart rtc_pie_update_irq(struct hrtimer *timer)
void rtc_update_irq(struct rtc_device *rtc,
unsigned long num, unsigned long events)
{
- if (unlikely(IS_ERR_OR_NULL(rtc)))
+ if (IS_ERR_OR_NULL(rtc))
return;
pm_stay_awake(rtc->dev.parent);

drivers/rtc/rtc-88pm80x.c

View file
diff --git a/drivers/rtc/rtc-88pm80x.c b/drivers/rtc/rtc-88pm80x.c
index 7df0579..466bf7f 100644
--- a/drivers/rtc/rtc-88pm80x.c
+++ b/drivers/rtc/rtc-88pm80x.c
@@ -251,17 +251,26 @@ static SIMPLE_DEV_PM_OPS(pm80x_rtc_pm_ops, pm80x_rtc_suspend, pm80x_rtc_resume);
static int pm80x_rtc_probe(struct platform_device *pdev)
{
struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent);
- struct pm80x_platform_data *pm80x_pdata =
- dev_get_platdata(pdev->dev.parent);
- struct pm80x_rtc_pdata *pdata = NULL;
+ struct pm80x_rtc_pdata *pdata = dev_get_platdata(&pdev->dev);
struct pm80x_rtc_info *info;
+ struct device_node *node = pdev->dev.of_node;
struct rtc_time tm;
unsigned long ticks = 0;
int ret;
- pdata = dev_get_platdata(&pdev->dev);
- if (pdata == NULL)
- dev_warn(&pdev->dev, "No platform data!\n");
+ if (!pdata && !node) {
+ dev_err(&pdev->dev,
+ "pm80x-rtc requires platform data or of_node\n");
+ return -EINVAL;
+ }
+
+ if (!pdata) {
+ pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+ if (!pdata) {
+ dev_err(&pdev->dev, "failed to allocate memory\n");
+ return -ENOMEM;
+ }
+ }
info =
devm_kzalloc(&pdev->dev, sizeof(struct pm80x_rtc_info), GFP_KERNEL);
@@ -327,11 +336,8 @@ static int pm80x_rtc_probe(struct platform_device *pdev)
regmap_update_bits(info->map, PM800_RTC_CONTROL, PM800_RTC1_USE_XO,
PM800_RTC1_USE_XO);
- if (pm80x_pdata) {

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ab-b5ze-s3.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ab8500.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-abx80x.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-armada38x.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-as3722.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-at91rm9200.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-at91sam9.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-bfin.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-bq32k.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-cmos.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-coh901331.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-core.h

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-da9063.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-dev.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ds1305.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ds1307.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ds1343.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ds1374.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ds1511.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ds1553.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ds1685.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ds1742.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-ds3232.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-fm3130.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-gemini.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-hym8563.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-isl12022.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-isl12057.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-lpc24xx.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-m48t59.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-max8997.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-moxart.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-mpc5121.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-mt6397.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-mv.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-omap.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-opal.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-pcf2123.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-pcf2127.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-pcf85063.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-pcf8523.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-pcf8563.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-pcf8583.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-pl031.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-pxa.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-rp5c01.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-rx8025.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-rx8581.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-s3c.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-s5m.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-sa1100.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-sa1100.h

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-sirfsoc.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-stk17ta8.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-sysfs.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-tx4939.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-vt8500.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-zynqmp.c

View file

This diff is incomplete. Download the complete patch.

include/asm-generic/rtc.h

View file

This diff is incomplete. Download the complete patch.