Commit Graph
2 Commits
Author SHA1 Message Date
Chris Zhong c412c6034a drivers/rtc/rtc-rk808.c: fix rtc time reading issue
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

[[email protected]: tweak comment per review discussion]
Signed-off-by: Chris Zhong <[email protected]>
Reviewed-by: Doug Anderson <[email protected]>
Cc: Sonny Rao <[email protected]>
Cc: Heiko Stübner <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2015-02-13 21:21:43 -08:00
Chris Zhong 3ca1e326f5 RTC: RK808: add RTC driver for RK808
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.

[[email protected]: make tm_def static]
Signed-off-by: Chris Zhong <[email protected]>
Signed-off-by: Zhang Qing <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Reviewed-by: Doug Anderson <[email protected]>
Tested-by: Doug Anderson <[email protected]>
Cc: Pawel Moll <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Ian Campbell <[email protected]>
Cc: Samuel Ortiz <[email protected]> says:
Cc: Alessandro Zummo <[email protected]>
Cc: Olof Johansson <[email protected]>
Cc: Dmitry Torokhov <[email protected]>
Cc: Javier Martinez Canillas <[email protected]>
Cc: Kever Yang <[email protected]>
Cc: Li Zhong <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2014-10-14 02:18:18 +02:00