rtc: tps6591x: Prevent wrong date setting
authorPreetham Chandru <pchandru@nvidia.com>
Fri, 20 Jul 2012 05:31:26 +0000 (10:31 +0530)
committerVarun Wadekar <vwadekar@nvidia.com>
Mon, 30 Jul 2012 10:55:58 +0000 (15:55 +0530)
commit9b667813cf7593fd783cf52e33244c497ca3a354
tree747f6129a88ce0370e266dc913215ad561bd5032
parentfb4075179a6d663cf185d3bbfaa6e9a7638cc922
rtc: tps6591x: Prevent wrong date setting

This CL handles the following:

1. Prevents setting of wrong date in tps6591x_rtc_set_time().

For example the following case was not handled in rtc driver:
if hwclock command wanted to set 31/Dec/1999 then our RTC driver was
setting the date to 31/Dec/2099 and later on when hwclock read the
date back it was getting a invalid date.
Also, the hwclock command can only handle date upto the year 2038.

2. Sets STOP_RTC bit to one when the driver is initialized

Bug 1012914
Bug 1017647
Signed-off-by: Preetham Chandru R <pchandru@nvidia.com>
Change-Id: If8abfebe3ee6da05498deb38d7247ab265729c0c
Reviewed-on: http://git-master/r/117298
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-by: Kiran Adduri <kadduri@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/rtc/rtc-tps6591x.c