1. 14 2月, 2015 9 次提交
    • A
      rtc: add support for Abracon AB-RTCMC-32.768kHz-B5ZE-S3 I2C RTC chip · 0b2f6228
      Arnaud Ebalard 提交于
      This patch adds support for Abracon AB-RTCMC-32.768kHz-B5ZE-S3
      RTC/Calendar module w/ I2C interface.
      
      This support includes RTC time reading and setting, Alarm (1 minute
      accuracy) reading and setting, and battery low detection.  The device also
      supports frequency adjustment and two timers but those features are
      currently not implemented in this driver.  Due to alarm accuracy
      limitation (and current lack of timer support in the driver), UIE mode is
      not supported.
      Signed-off-by: NArnaud Ebalard <arno@natisbad.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Peter Huewe <peter.huewe@infineon.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Thierry Reding <treding@nvidia.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Rob Herring <robherring2@gmail.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Rob Landley <rob@landley.net>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Cc: Kumar Gala <galak@codeaurora.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0b2f6228
    • C
      drivers/rtc/rtc-rk808.c: fix rtc time reading issue · c412c603
      Chris Zhong 提交于
      After we set the GET_TIME bit, the rtc time can't be read immediately.  We
      should wait up to 31.25 us, about one cycle of 32khz.  Otherwise reading
      RTC time will return a old time.  If we clear the GET_TIME bit after
      setting, the time of i2c transfer is certainly more than 31.25us.
      
      Doug said:
      
      : I think we are safe.  At 400kHz (the max speed of this part) each bit can
      : be transferred no faster than 2.5us.  In order to do a valid i2c
      : transaction we need to _at least_ write the address of the device and the
      : data onto the bus, which is 16 bits.  16 * 2.5us = 40us.  That's above the
      : 31.25us
      
      [akpm@linux-foundation.org: tweak comment per review discussion]
      Signed-off-by: NChris Zhong <zyw@rock-chips.com>
      Reviewed-by: NDoug Anderson <dianders@chromium.org>
      Cc: Sonny Rao <sonnyrao@chromium.org>
      Cc: Heiko Stübner <heiko@sntech.de>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c412c603
    • K
      drivers/rtc/rtc-isl12057.c: constify struct regmap_config · 1ef2816f
      Krzysztof Kozlowski 提交于
      The regmap_config struct may be const because it is not modified by the
      driver and regmap_init() accepts pointer to const.
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1ef2816f
    • K
      drivers/rtc/rtc-at91sam9.c: constify struct regmap_config · bddd8ddd
      Krzysztof Kozlowski 提交于
      The regmap_config struct may be const because it is not modified by the
      driver and regmap_init() accepts pointer to const.
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      bddd8ddd
    • J
      drivers/rtc/rtc-imxdi.c: add more known register bits · 46edeffa
      Juergen Borleis 提交于
      Intended for monitoring and controlling the security features.  These bits
      are required to bring this unit back to live after a security violation
      event was detected.  The code to bring it back to live will follow after a
      vendor clearance.
      Signed-off-by: NJuergen Borleis <jbe@pengutronix.de>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      46edeffa
    • J
      drivers/rtc/rtc-imxdi.c: trivial clean up code · 6df17a65
      Juergen Borleis 提交于
      Signed-off-by: NJuergen Borleis <jbe@pengutronix.de>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6df17a65
    • A
      rtc: rtc-isl12057: add isil,irq2-can-wakeup-machine property for in-tree users · 298ff012
      Arnaud Ebalard 提交于
      Current in-tree users of ISL12057 RTC chip (NETGEAR ReadyNAS 102, 104 and
      2120) do not have the IRQ#2 pin of the chip (associated w/ the Alarm1
      mechanism) connected to their SoC, but to a PMIC (TPS65251 FWIW).  This
      specific hardware configuration allows the NAS to wake up when the alarms
      rings.
      
      Recently introduced alarm support for ISL12057 relies on the provision of
      an "interrupts" property in system .dts file, which previous three users
      will never get.  For that reason, alarm support on those devices is not
      function.  To support this use case, this patch adds a new DT property for
      ISL12057 (isil,irq2-can-wakeup-machine) to indicate that the chip is
      capable of waking up the device using its IRQ#2 pin (even though it does
      not have its IRQ#2 pin connected directly to the SoC).
      
      This specific configuration was tested on a ReadyNAS 102 by setting an
      alarm, powering off the device and see it reboot as expected when the
      alarm rang w/:
      
        # echo `date '+%s' -d '+ 1 minutes'` > /sys/class/rtc/rtc0/wakealarm
        # shutdown -h now
      
      As a side note, the ISL12057 remains in the list of trivial devices,
      because the property is not per se required by the device to work but can
      help handle system w/ specific requirements.  In exchange, the new feature
      is described in details in a specific documentation file.
      Signed-off-by: NArnaud Ebalard <arno@natisbad.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Peter Huewe <peter.huewe@infineon.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Thierry Reding <treding@nvidia.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Darshana Padmadas <darshanapadmadas@gmail.com>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Pawel Moll <pawel.moll@arm.com>
      Cc: Stephen Warren <swarren@wwwdotorg.org>
      Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Rob Landley <rob@landley.net>
      Cc: Jason Cooper <jason@lakedaemon.net>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
      Cc: Kumar Gala <galak@codeaurora.org>
      Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      298ff012
    • A
      drivers/rtc/rtc-isl12057.c: add alarm support to Intersil ISL12057 RTC driver · fd71493d
      Arnaud Ebalard 提交于
      This patch adds alarm support to Intersil ISL12057 driver.  This allows to
      configure the chip to generate an interrupt when the alarm matches current
      time value.  Alarm can be programmed up to one month in the future and is
      accurate to the second.
      
      The patch was developed to support two different configurations: systems
      w/ and w/o RTC chip IRQ line connected to the main CPU.
      
      The latter is the one found on current 3 kernel users of the chip for
      which support was initially developed (Netgear ReadyNAS 102, 104 and 2120
      NAS).  On those devices, the IRQ#2 pin of the chip is not connected to the
      SoC but to a PMIC.  This allows setting an alarm, powering off the device
      and have it wake up when the alarm rings.  To support that configuration
      the driver does the following:
      
       1. it has alarm_irq_enable() function returns -ENOTTY when no IRQ
          is passed to the driver.
       2. it marks the device as a wakeup source in all cases (whether an
          IRQ is passed to the driver or not) to have 'wakealarm' sysfs
          entry created.
       3. it marks the device has not supporting UIE mode when no IRQ is
          passed to the driver (see the commmit message of c9f5c7e7)
      
      This specific configuration was tested on a ReadyNAS 102 by setting an
      alarm, powering off the device and see it reboot as expected when the
      alarm rang.
      
      The former configuration was tested on a Netgear ReadyNAS 102 after some
      soldering of the IRQ#2 pin of the RTC chip to a MPP line of the SoC (the
      one used usually handles the reset button).  The test was performed using
      a modified .dts file reflecting this change (see below) and rtc-test.c
      program available in Documentation/rtc.txt.  This test program ran as
      expected, which validates alarm supports, including interrupt support.
      
      As a side note, the ISL12057 remains in the list of trivial devices, i.e.
      no specific DT binding being added by this patch: i2c core automatically
      handles extraction of IRQ line info from .dts file.  For instance, if one
      wants to reference the interrupt line for the alarm in its .dts file,
      adding interrupt and interrupt-parent properties works as expected:
      
                isl12057: isl12057@68 {
                        compatible =3D "isil,isl12057";
                        interrupt-parent =3D <&gpio0>;
                        interrupts =3D <6 IRQ_TYPE_EDGE_FALLING>;
                        reg =3D <0x68>;
                };
      
      FWIW, if someone is looking for a way to test alarm support on a system on
      which the chip IRQ line has the ability to boot the system (e.g.  ReadyNAS
      102, 104, etc):
      
          # echo 0 > /sys/class/rtc/rtc0/wakealarm
          # echo `date '+%s' -d '+ 1 minutes'` > /sys/class/rtc/rtc0/wakealarm
          # shutdown -h now
      
      With the commands above, after a minute, the system comes back to life.
      Signed-off-by: NArnaud Ebalard <arno@natisbad.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Peter Huewe <peter.huewe@infineon.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: Thierry Reding <treding@nvidia.com>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Uwe Kleine-König <uwe@kleine-koenig.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fd71493d
    • J
      drivers/rtc/rtc-pcf2123.c: add support for devicetree · 3fc70077
      Joshua Clayton 提交于
      Add compatible string "nxp,rtc-pcf2123"
      Document the binding
      Signed-off-by: NJoshua Clayton <stillcompiling@gmail.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Alessandro Zummo <a.zummo@towertech.it>
      Cc: Grant Likely <grant.likely@linaro.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3fc70077
  2. 27 1月, 2015 1 次提交
  3. 24 1月, 2015 5 次提交
  4. 20 1月, 2015 1 次提交
    • A
      efi: rtc-efi: Mark UIE as unsupported · 822a0279
      Ard Biesheuvel 提交于
      Tools like hwclock attempt to enable the RTC update interrupt (UIE) to
      maximize the accuracy of the reported time value. The EFI rtc does not
      have interrupt capability so this is a pointless exercise to begin with,
      but the generic RTC framework ends up issuing a SetWakeupTime() Runtime
      Services call before drawing that conclusion on its own.
      
      Instead, we can mark UIE as unsupported at driver probe time. The net
      result is the same, but without the spurious SetWakeupTime() call.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NMatt Fleming <matt.fleming@intel.com>
      822a0279
  5. 14 12月, 2014 1 次提交
  6. 11 12月, 2014 23 次提交