20 Dec, 2015

1 commit

  • In A.D. 1582 Pope Gregory XIII found that the existing Julian calendar
    insufficiently represented reality, and changed the rules about
    calculating leap years to account for this. Similarly, in A.D. 2013
    Rockchip hardware engineers found that the new Gregorian calendar still
    contained flaws, and that the month of November should be counted up to
    31 days instead. Unfortunately it takes a long time for calendar changes
    to gain widespread adoption, and just like more than 300 years went by
    before the last Protestant nation implemented Greg's proposal, we will
    have to wait a while until all religions and operating system kernels
    acknowledge the inherent advantages of the Rockchip system. Until then
    we need to translate dates read from (and written to) Rockchip hardware
    back to the Gregorian format.

    This patch works by defining Jan 1st, 2016 as the arbitrary anchor date
    on which Rockchip and Gregorian calendars are in sync. From that we can
    translate arbitrary later dates back and forth by counting the number
    of November/December transitons since the anchor date to determine the
    offset between the calendars. We choose this method (rather than trying
    to regularly "correct" the date stored in hardware) since it's the only
    way to ensure perfect time-keeping even if the system may be shut down
    for an unknown number of years. The drawback is that other software
    reading the same hardware (e.g. mainboard firmware) must use the same
    translation convention (including the same anchor date) to be able to
    read and write correct timestamps from/to the RTC.

    Signed-off-by: Julius Werner
    Reviewed-by: Douglas Anderson
    Signed-off-by: Alexandre Belloni

    Julius Werner
     

14 Feb, 2015

1 commit

  • 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: Chris Zhong
    Reviewed-by: Doug Anderson
    Cc: Sonny Rao
    Cc: Heiko Stübner
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Zhong
     

14 Oct, 2014

1 commit

  • This is the initial version of the RK808 PMIC. This is a power management
    IC for multimedia products. It provides regulators that are able to
    supply power to processor cores and other components. The chip provides
    other modules including RTC, Clockout.

    Add RTC driver for supporting RTC device present inside RK808 PMIC.

    [akpm@linux-foundation.org: make tm_def static]
    Signed-off-by: Chris Zhong
    Signed-off-by: Zhang Qing
    Tested-by: Heiko Stuebner
    Reviewed-by: Doug Anderson
    Tested-by: Doug Anderson
    Cc: Pawel Moll
    Cc: Mark Rutland
    Cc: Ian Campbell
    Cc: Samuel Ortiz says:
    Cc: Alessandro Zummo
    Cc: Olof Johansson
    Cc: Dmitry Torokhov
    Cc: Javier Martinez Canillas
    Cc: Kever Yang
    Cc: Li Zhong
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Zhong