]> Git Repo - linux.git/commitdiff
Merge tag 'rtc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
authorLinus Torvalds <[email protected]>
Tue, 1 Jan 2019 21:24:31 +0000 (13:24 -0800)
committerLinus Torvalds <[email protected]>
Tue, 1 Jan 2019 21:24:31 +0000 (13:24 -0800)
Pull RTC updates from Alexandre Belloni:
 "Subsystem:
   - new %ptR printk format
   - rename core files
   - allow registration of multiple nvmem devices

  New driver:
   - i.MX system controller RTC

  Driver updates:
   - abx80x: handle voltage ioctls, correct binding doc
   - m41t80: correct month in alarm reads
   - pcf85363: add pcf85263 support
   - pcf8523: properly handle battery low flag
   - s3c: limit alarm to one year in the future as ALMYEAR is broken
   - sun6i: rework clock output binding"

* tag 'rtc-4.21' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (54 commits)
  rtc: rename core files
  rtc: nvmem: fix possible use after free
  rtc: add i.MX system controller RTC support
  dt-bindings: fsl: scu: add rtc binding
  rtc: pcf2123: Add Microcrystal rv2123
  rtc: class: reimplement devm_rtc_device_register
  rtc: enforce rtc_timer_init private_data type
  rtc: abx80x: Implement RTC_VL_READ,CLR ioctls
  rtc: pcf85363: Add support for NXP pcf85263 rtc
  dt-bindings: rtc: pcf85363: Document pcf85263 real-time clock
  rtc: pcf8523: don't return invalid date when battery is low
  dt-bindings: rtc: use a generic node name for ds1307
  PM: Switch to use %ptR
  m68k/mac: Switch to use %ptR
  Input: hp_sdc_rtc - Switch to use %ptR
  rtc: tegra: Switch to use %ptR
  rtc: s5m: Switch to use %ptR
  rtc: s3c: Switch to use %ptR
  rtc: rx8025: Switch to use %ptR
  rtc: rx6110: Switch to use %ptR
  ...

1  2 
Documentation/devicetree/bindings/arm/freescale/fsl,scu.txt
drivers/char/rtc.c
drivers/rtc/hctosys.c

index 0af618b6a44806adf103094cb771c7b0824644f9,0860346fc9ebfde11007c1ca6e7803a5aaaa3067..27784b6edfeddfada4cd156615fbd0911cfa7823
@@@ -58,11 -58,19 +58,11 @@@ This binding for the SCU power domain p
  domain binding[2].
  
  Required properties:
 -- compatible:         Should be "fsl,scu-pd".
 -- #address-cells:     Should be 1.
 -- #size-cells:                Should be 0.
 -
 -Required properties for power domain sub nodes:
 -- #power-domain-cells:        Must be 0.
 -
 -Optional Properties:
 -- reg:                        Resource ID of this power domain.
 -                      No exist means uncontrollable by user.
 +- compatible:         Should be "fsl,imx8qxp-scu-pd".
 +- #power-domain-cells:        Must be 1. Contains the Resource ID used by
 +                      SCU commands.
                        See detailed Resource ID list from:
 -                      include/dt-bindings/power/imx-rsrc.h
 -- power-domains:      phandle pointing to the parent power domain.
 +                      include/dt-bindings/firmware/imx/rsrc.h
  
  Clock bindings based on SCU Message Protocol
  ------------------------------------------------------------
@@@ -88,16 -96,13 +88,16 @@@ Pinctrl bindings based on SCU Message P
  This binding uses the i.MX common pinctrl binding[3].
  
  Required properties:
 -- compatible:         Should be "fsl,imx8qxp-iomuxc".
 +- compatible:         Should be one of:
 +                      "fsl,imx8qm-iomuxc",
 +                      "fsl,imx8qxp-iomuxc".
  
  Required properties for Pinctrl sub nodes:
  - fsl,pins:           Each entry consists of 3 integers which represents
                        the mux and config setting for one pin. The first 2
                        integers <pin_id mux_mode> are specified using a
                        PIN_FUNC_ID macro, which can be found in
 +                      <dt-bindings/pinctrl/pads-imx8qm.h>,
                        <dt-bindings/pinctrl/pads-imx8qxp.h>.
                        The last integer CONFIG is the pad setting value like
                        pull-up on this pin.
  [2] Documentation/devicetree/bindings/power/power_domain.txt
  [3] Documentation/devicetree/bindings/pinctrl/fsl,imx-pinctrl.txt
  
+ RTC bindings based on SCU Message Protocol
+ ------------------------------------------------------------
+ Required properties:
+ - compatible: should be "fsl,imx8qxp-sc-rtc";
  Example (imx8qxp):
  -------------
  lsio_mu1: mailbox@5d1c0000 {
@@@ -147,10 -158,27 +153,14 @@@ firmware 
                        ...
                };
  
 -              imx8qx-pm {
 -                      compatible = "fsl,scu-pd";
 -                      #address-cells = <1>;
 -                      #size-cells = <0>;
 -
 -                      pd_dma: dma-power-domain {
 -                              #power-domain-cells = <0>;
 -
 -                              pd_dma_lpuart0: dma-lpuart0@57 {
 -                                      reg = <SC_R_UART_0>;
 -                                      #power-domain-cells = <0>;
 -                                      power-domains = <&pd_dma>;
 -                              };
 -                              ...
 -                      };
 -                      ...
 +              pd: imx8qx-pd {
 +                      compatible = "fsl,imx8qxp-scu-pd";
 +                      #power-domain-cells = <1>;
                };
+               rtc: rtc {
+                       compatible = "fsl,imx8qxp-sc-rtc";
+               };
        };
  };
  
@@@ -161,5 -189,5 +171,5 @@@ serial@5a060000 
        clocks = <&clk IMX8QXP_UART0_CLK>,
                 <&clk IMX8QXP_UART0_IPG_CLK>;
        clock-names = "per", "ipg";
 -      power-domains = <&pd_dma_lpuart0>;
 +      power-domains = <&pd IMX_SC_R_UART_0>;
  };
diff --combined drivers/char/rtc.c
index 62b7c721c73230207c5f6c8d06e3c16fecb5489e,0cde96822a875827a7643e8c88296625ee52daa2..c862d0b6b118adc468278a075e405cd93e1e04f1
@@@ -866,8 -866,8 +866,8 @@@ static int __init rtc_init(void
  #ifdef CONFIG_SPARC32
        for_each_node_by_name(ebus_dp, "ebus") {
                struct device_node *dp;
 -              for (dp = ebus_dp; dp; dp = dp->sibling) {
 -                      if (!strcmp(dp->name, "rtc")) {
 +              for_each_child_of_node(ebus_dp, dp) {
 +                      if (of_node_name_eq(dp, "rtc")) {
                                op = of_find_device_by_node(dp);
                                if (op) {
                                        rtc_port = op->resource[0].start;
@@@ -1125,11 -1125,10 +1125,10 @@@ static int rtc_proc_show(struct seq_fil
         * time or for Universal Standard Time (GMT). Probably local though.
         */
        seq_printf(seq,
-                  "rtc_time\t: %02d:%02d:%02d\n"
-                  "rtc_date\t: %04d-%02d-%02d\n"
+                  "rtc_time\t: %ptRt\n"
+                  "rtc_date\t: %ptRd\n"
                   "rtc_epoch\t: %04lu\n",
-                  tm.tm_hour, tm.tm_min, tm.tm_sec,
-                  tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, epoch);
+                  &tm, &tm, epoch);
  
        get_rtc_alm_time(&tm);
  
diff --combined drivers/rtc/hctosys.c
index b9ec4a16db1f6b6fd113c5661a28aa0e9153eeaa,23efbe6949a3674881b713564a18bf8fcb284f71..ff2092a0d38ca2e9529853931cec457a510b4dfe
@@@ -50,20 -50,14 +50,16 @@@ static int __init rtc_hctosys(void
        tv64.tv_sec = rtc_tm_to_time64(&tm);
  
  #if BITS_PER_LONG == 32
 -      if (tv64.tv_sec > INT_MAX)
 +      if (tv64.tv_sec > INT_MAX) {
 +              err = -ERANGE;
                goto err_read;
 +      }
  #endif
  
        err = do_settimeofday64(&tv64);
  
-       dev_info(rtc->dev.parent,
-               "setting system clock to "
-               "%d-%02d-%02d %02d:%02d:%02d UTC (%lld)\n",
-               tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
-               tm.tm_hour, tm.tm_min, tm.tm_sec,
-               (long long) tv64.tv_sec);
+       dev_info(rtc->dev.parent, "setting system clock to %ptR UTC (%lld)\n",
+                &tm, (long long)tv64.tv_sec);
  
  err_read:
        rtc_class_close(rtc);
This page took 0.090985 seconds and 4 git commands to generate.