25 Mar, 2016

4 commits

  • Pull more RTC updates from Alexandre Belloni:
    "A second pull request for v4.6 with a few fixesi before -rc1. The new
    features for abx80x actually make the RTC behave correctly.

    Drivers:
    - abx80x: handle both XT and RC oscillators, XT failure bit and
    autocalibration
    - m41t80: avoid out of range year values
    - rv8803: workaround an i2c HW issue"

    * tag 'rtc-4.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
    rtc: abx80x: handle the oscillator failure bit
    rtc: abx80x: handle autocalibration
    rtc: rv8803: workaround i2c HW issue
    rtc: mcp795: add devicetree support
    rtc: asm9260: remove incorrect __init/__exit annotations
    rtc: m41t80: avoid out of range year values
    rtc: s3c: Don't print an error on probe deferral
    rtc: rv3029: stop mentioning rv3029c2

    Linus Torvalds
     
  • Handle the Oscillator Failure ('OF') bit from Oscillator Status register
    (0x1D). This bit is cleared on set_time function and is read each time the
    date/time is read, but only in case of XT Oscillator selection.
    In RC mode, this bit is always set.

    Signed-off-by: Mylène Josserand
    Signed-off-by: Alexandre Belloni

    Mylène Josserand
     
  • The autocalibration is separated in two bits to set in Oscillator
    Control register (0x1c) :
    - OSEL bit to select the oscillator type (XT or RC).
    - ACAL bit to select the autocalibration type.

    These functionnalities are exported in sysfs entries : "oscillator"
    and "autocalibration". Respectively, the values are "xtal" for XT
    oscillator and "rc" for RC oscillator and 0 to disable the
    autocalibration cycle, 512 for a 512 seconds autocalibration cycle
    and 1024 for a cycle of 1024 seconds.

    Examples :
    Set to XT Oscillator
    echo xtal > /sys/class/rtc/rtc0/device/oscillator
    Activate an autocalibration every 512 seconds
    echo 512 > /sys/class/rtc/rtc0/device/autocalibration

    Signed-off-by: Mylène Josserand
    Signed-off-by: Alexandre Belloni

    Mylène Josserand
     
  • The rv8803 has a 60µs window where it will not answer on the i2c bus.
    It also means there will be no ack for the communication. Make sure
    communication is tried multiple times when this happens (the i2c subsystem
    mandates -ENXIO is that case but the number of retries is host specific).
    The critical parts are the probe function and the alarm callback so make
    sure we handle the failure there.

    Cc: stable@vger.kernel.org # v4.4
    Signed-off-by: Alexandre Belloni

    Alexandre Belloni
     

22 Mar, 2016

1 commit


19 Mar, 2016

3 commits

  • The probe and remove callbacks of the platform driver are marked __init
    and __exit, respectively. However, this is not a correct way to annotate
    them, as it will result in those sections to be discarded at link time
    or after boot, while we can actually call them again based on manual
    unbinding, or deferred probing.

    Kbuild warns about the problem:

    WARNING: drivers/rtc/rtc-asm9260.o(.data+0x0): Section mismatch in reference from the variable asm9260_rtc_driver to the function .init.text:asm9260_rtc_probe()

    This removes the annotations, so we no longer branch into missing
    code and avoid the warning.

    Signed-off-by: Arnd Bergmann
    Fixes: 125e550fd257 ("rtc: add Alphascale asm9260 driver")
    Signed-off-by: Alexandre Belloni

    Arnd Bergmann
     
  • Avoid saving an out of range year value to the RTC. Reading that value
    from the RTC again returns a totally wrong time value. For Example

    $ timedatectl set-ntp no
    $ timedatectl set-time "1990-01-01 12:12:00"
    # Reboot
    rtc-m41t80 0-0068: setting system clock to 2090-01-01 12:12:35 UTC (3786955955)

    Signed-off-by: Stefan Christ
    Signed-off-by: Alexandre Belloni

    Stefan Christ
     
  • The clock and source clock looked up by the driver may not be available
    just because the clock controller driver was not probed yet so printing
    an error in this case is not correct and only adds confusion to users.

    However, knowing that a driver's probe was deferred may be useful so it
    can be printed as a debug information.

    Signed-off-by: Javier Martinez Canillas
    Signed-off-by: Alexandre Belloni

    Javier Martinez Canillas
     

18 Mar, 2016

1 commit


15 Mar, 2016

31 commits