summaryrefslogtreecommitdiff
path: root/drivers/rtc
AgeCommit message (Collapse)Author
2012-05-22rtc: tps6591x: Limiting years in the 0 - 99 rangeVenu Byravarasu
As RTC can store year in the 0 - 99 range only, handling it accordingly bug 985890 Change-Id: Idcfb29028f482283ae2658579a3283c7d4f230f1 Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-on: http://git-master/r/102798 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
2012-05-15rtc: tps6591x: Enable alarm interrupt for RTC_WKALM_SET ioctlPreetham Chandru
RTC_WKALM_SET ioctl should do two things: 1. Set alarm value 2. Enable alarm irq In the current implementation for RTC_WKALM_SET ioctl we are only setting the alarm value but not enabling the alarm irq and hence the system is not waking from lp0 state once the set alarm value expiries. For RTC_WKALM_SET ioctl, alarm->enabled will be set to one from userspace. So based on this condition we can differentiate between RTC_WKALM_SET & RTC_ALM_SET and accordingly enable alarm irq. Bug 978205 Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Change-Id: Ia35192e691ca116b13093f52873020f67c5c2f8d Reviewed-on: http://git-master/r/101447 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
2012-03-30rtc: tps80031: Enable RTC interrupt appropriatelyVenu Byravarasu
Observed interrupt not getting enabled properly. hence fixing it. bug 937221 Change-Id: If852c9cd40fc98711fe12a124b533ee8ee99eb3c Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-on: http://git-master/r/83992 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-03-23rtc: tps80031: Fixing POR month comparisonVenu Byravarasu
As month calculation is modified to fix bug 931452 and POR comparison for month is not updated, fixing it. bug 951622 Change-Id: Ifd906b48c51b155809ed88892579e9dd14abd5a0 Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-on: http://git-master/r/89663 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: David Schalig <dschalig@nvidia.com> Tested-by: David Schalig <dschalig@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2012-03-14rtc: max77663: Use alrm->enabled flag to enable rtc alarm irqJinyoung Park
Use alrm->enabled flag to enable rtc alarm irq in rtc_set_alrm function. Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/88048 (cherry picked from commit 41e8686fc049fbdc0e83ecfa3f68da06ff813b99) Change-Id: Ieb3b9863233b9d5bfc06459ef479c47a5e700d3b Reviewed-on: http://git-master/r/89739 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
2012-03-14rtc: max77663: Update read buffer before read RTC IRQ status registerJinyoung Park
To get actual current RTC IRQ status, it have to update read buffer before read RTC IRQ status register. Bug 918156 Bug 924219 Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/88037 (cherry picked from commit 50528b7d136624ef0014deecba18d7bd9b8d8cc8) Change-Id: I5ffcc9b24fec0f3688f641ab9f7cf82a69d77aeb Reviewed-on: http://git-master/r/89738 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
2012-02-29rtc: max8907c: correct month index calculation.Joseph Yoon
max8907c is returning Jan as 1 from rtc register. but kernel is assuming Jan as 0. so correct month index. Change-Id: I9b77b89952442891f53ebd6355352f36a07521cd Signed-off-by: Joseph Yoon <tyoon@nvidia.com> Reviewed-on: http://git-master/r/86561 Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2012-02-09rtc: tps6591x: Fixing month register program errorVenu Byravarasu
The month field of tm structure managed by kernel, expects a value between 0 to 11. However, TPS6591x RTC month register expects the month range to be between 1 to 12. Hence fixing it. Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Change-Id: I054de10dcd58497167c8460fe935325cee3c582f Reviewed-on: http://git-master/r/79930 Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2012-02-09rtc: tps80031: Fixing month register program errorVenu Byravarasu
The month field of tm structure managed by kernel, expects a value between 0 to 11. However, TPS80031 RTC month register expects the month range to be between 1 to 12. Hence fixing it. bug 931452 Change-Id: Ie208c50b316e452e50eb2b607bafe83cb227eaea Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-on: http://git-master/r/79928 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-01-24Merge branch 'linux-3.1.y' into android-tegra-nv-3.1Varun Wadekar
Linux 3.1.10 Change-Id: I465d184c492e8041dd0cd90f2cb70fde17ba7118 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-01-18drivers/rtc/interface.c: fix alarm rollover when day or month is out-of-rangeBen Hutchings
commit e74a8f2edb92cb690b467cea0ab652c509e9f624 upstream. Commit f44f7f96a20a ("RTC: Initialize kernel state from RTC") introduced a potential infinite loop. If an alarm time contains a wildcard month and an invalid day (> 31), or a wildcard year and an invalid month (>= 12), the loop searching for the next matching date will never terminate. Treat the invalid values as wildcards. Fixes <http://bugs.debian.org/646429>, <http://bugs.debian.org/653331> Reported-by: leo weppelman <leoweppelman@googlemail.com> Reported-by: "P. van Gaans" <mailme667@yahoo.co.uk> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-11Revert "rtc: Disable the alarm in the hardware"Linus Torvalds
commit 157e8bf8b4823bfcdefa6c1548002374b61f61df upstream. This reverts commit c0afabd3d553c521e003779c127143ffde55a16f. It causes failures on Toshiba laptops - instead of disabling the alarm, it actually seems to enable it on the affected laptops, resulting in (for example) the laptop powering on automatically five minutes after shutdown. There's a patch for it that appears to work for at least some people, but it's too late to play around with this, so revert for now and try again in the next merge window. See for example http://bugs.debian.org/652869 Reported-and-bisected-by: Andreas Friedrich <afrie@gmx.net> (Toshiba Tecra) Reported-by: Antonio-M. Corbi Bellot <antonio.corbi@ua.es> (Toshiba Portege R500) Reported-by: Marco Santos <marco.santos@waynext.com> (Toshiba Portege Z830) Reported-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr> (Toshiba Portege R830) Cc: Jonathan Nieder <jrnieder@gmail.com> Requested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Change-Id: If63f475a7edbe389ceb01cd430efb2d2a127eb6e Reviewed-on: http://git-master/r/74231 Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com>
2012-01-11rtc: m41t80: Workaround broken alarm functionalityJohn Stultz
commit c3b79770e51ab1fd4201f3b54edf30113b9ce74f upstream. The m41t80 driver can read and set the alarm, but it doesn't seem to have a functional alarm irq. This causes failures when the generic core sees alarm functions, but then cannot use them properly for things like UIE mode. Disabling the alarm functions allows proper error reporting, and possible fallback to emulated modes. Once someone fixes the alarm irq functionality, this can be restored. CC: Matt Turner <mattst88@gmail.com> CC: Nico Macrionitis <acrux@cruxppc.org> CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Reported-by: Matt Turner <mattst88@gmail.com> Reported-by: Nico Macrionitis <acrux@cruxppc.org> Tested-by: Nico Macrionitis <acrux@cruxppc.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Change-Id: Idbb49a2b153a9da2a281e927f14e4a15a676987d Reviewed-on: http://git-master/r/74157 Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com>
2012-01-06Revert "rtc: Disable the alarm in the hardware"Linus Torvalds
commit 157e8bf8b4823bfcdefa6c1548002374b61f61df upstream. This reverts commit c0afabd3d553c521e003779c127143ffde55a16f. It causes failures on Toshiba laptops - instead of disabling the alarm, it actually seems to enable it on the affected laptops, resulting in (for example) the laptop powering on automatically five minutes after shutdown. There's a patch for it that appears to work for at least some people, but it's too late to play around with this, so revert for now and try again in the next merge window. See for example http://bugs.debian.org/652869 Reported-and-bisected-by: Andreas Friedrich <afrie@gmx.net> (Toshiba Tecra) Reported-by: Antonio-M. Corbi Bellot <antonio.corbi@ua.es> (Toshiba Portege R500) Reported-by: Marco Santos <marco.santos@waynext.com> (Toshiba Portege Z830) Reported-by: Christophe Vu-Brugier <cvubrugier@yahoo.fr> (Toshiba Portege R830) Cc: Jonathan Nieder <jrnieder@gmail.com> Requested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-06rtc: m41t80: Workaround broken alarm functionalityJohn Stultz
commit c3b79770e51ab1fd4201f3b54edf30113b9ce74f upstream. The m41t80 driver can read and set the alarm, but it doesn't seem to have a functional alarm irq. This causes failures when the generic core sees alarm functions, but then cannot use them properly for things like UIE mode. Disabling the alarm functions allows proper error reporting, and possible fallback to emulated modes. Once someone fixes the alarm irq functionality, this can be restored. CC: Matt Turner <mattst88@gmail.com> CC: Nico Macrionitis <acrux@cruxppc.org> CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Reported-by: Matt Turner <mattst88@gmail.com> Reported-by: Nico Macrionitis <acrux@cruxppc.org> Tested-by: Nico Macrionitis <acrux@cruxppc.org> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2012-01-05Linux 3.1.7Varun Wadekar
Change-Id: I99507d7cfdcee064f808856dc2ce99d806fd864f
2011-12-30rtc: ricoh583: Fixing month & year calculationsvenu byravarasu
Changes done: 1. As Ricoh RTC month range is between 1 - 12 instead of 0 - 11, fixing it. 2. Filling only two valid BCD digits in the year fields. 3. Enabling YAL alone, with workaround. 4. Code clean up based on check patch warnings. bug 902137 Change-Id: I497ac5d04230e87baa776e84f6eafa8a28ae54ea Signed-off-by: venu byravarasu <vbyravarasu@nvidia.com> Reviewed-on: http://git-master/r/72082 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2011-12-21drivers/rtc/rtc-s3c.c: fix driver clock enable/disable balance issuesJonghwan Choi
commit 2dbcd05f1e9e0932833d16dab1696176fc164b07 upstream. If an error occurs after the clock is enabled, the enable/disable state can become unbalanced. Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-21rtc: tps80031: fix missing curly bracketsDavid Schalig
Bug 914750 Bug 914753 Change-Id: I5aef20ca4925057a5d9d0932c9267a40c732ef4a Signed-off-by: David Schalig <dschalig@nvidia.com> Reviewed-on: http://git-master/r/69720 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com>
2011-12-21rtc: ricoh583: add ricoh583 PMU RTC drivervenu byravarasu
Add Ricoh583 PMU RTC driver along with make files. bug 902137 Change-Id: If9a62ca897e4d41735c7638fff17c7b7570bc3c6 Signed-off-by: venu byravarasu <vbyravarasu@nvidia.com> Reviewed-on: http://git-master/r/70017 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2011-12-14Merge branch 'linux-3.1.5' into android-tegra-nv-3.1Varun Wadekar
Conflicts: arch/arm/Kconfig Change-Id: If8aaaf3efcbbf6c9017b38efb6d76ef933f147fa Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2011-12-09rtc: Fix some bugs that allowed accumulating time drift in suspend/resumeArve Hjønnevåg
commit 6a8943d9ec2567572fca25cf69ad45844d0141a3 upstream. The current code checks if abs(delta_delta.tv_sec) is greater or equal to two before it discards the old delta value, but this can trigger at close to -1 seconds since -1.000000001 seconds is stored as tv_sec -2 and tv_nsec 999999999 in a normalized timespec. rtc_resume had an early return check if the rtc value had not changed since rtc_suspend. This effectivly stops time for the duration of the short sleep. Check if sleep_time is positive after all the adjustments have been applied instead since this allows the old_system adjustment in rtc_suspend to have an effect even for short sleep cycles. Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-09rtc: Disable the alarm in the hardwareRabin Vincent
commit c0afabd3d553c521e003779c127143ffde55a16f upstream. Currently, the RTC code does not disable the alarm in the hardware. This means that after a sequence such as the one below (the files are in the RTC sysfs), the box will boot up after 2 minutes even though we've asked for the alarm to be turned off. # echo $((`cat since_epoch`)+120) > wakealarm # echo 0 > wakealarm # poweroff Fix this by disabling the alarm when there are no timers to run. Cc: John Stultz <john.stultz@linaro.org> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-08rtc: max77663: Disable alarm wakeupJin Park
It should be disabled alarm wakeup to wakeup from sleep by EN1 input signal. Bug 849360 Bug 903301 Reviewed-on: http://git-master/r/66321 (cherry picked from commit 4338d09efe5a58e126d92c794aa641bdfa7f5cd0) Change-Id: If59631bf662f6c4812dcd24cbca65750d5e5b117 Signed-off-by: Jin Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/67382 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2011-11-30Merge branch 'korg-android-tegra-3.1' into after-upstream-androidDan Willemsen
Conflicts: arch/arm/mach-tegra/Kconfig arch/arm/mach-tegra/board-ventana.c drivers/misc/Kconfig drivers/video/tegra/dc/hdmi.c Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
2011-11-30rtc: tps6586x: Fix for proper wakealarmWei Ni
In the driver probe function, call device_init_wakeup() before registering rtc device, so that wakealarm sysfs will be created. BUG=889820 Change-Id: I957fdffb02cd7e43dd96db0794e2e9f8dc7bd3ee Signed-off-by: Wei Ni <wni@nvidia.com> Reviewed-on: http://git-master/r/58937 Reviewed-by: Allen Martin <amartin@nvidia.com> Reviewed-on: http://git-master/r/63244 Rebase-Id: R9e078974bd9e773443b19492b83d25694f4582c2
2011-11-30rtc: max77663: Update driver for alarm interruptMin-wuk Lee
Updated rtc-max77663 driver for alarm interrupt. - Enable alarm for sec, min, hour, mday, month and year except wday, because sometimes wday value is not matched with requested alarm time. - Set alarm to wake-up event from sleep mode. - Add max77663_rtc_irq_mask and max77663_rtc_irq_unmask functions. - Fix incorrected wday calculation. - Clean-up the codes. Bug 849360 Original Author: Jinyoung Park Reviewed-on: http://git-master/r/60655 (cherry picked from commit 80acd66deffa20a391e5324fc9038b7fab42d08d) Change-Id: Ibd637eac7f94ebc920873c652f7776072e2832d1 Reviewed-on: http://git-master/r/62380 Reviewed-on: http://git-master/r/63763 Reviewed-by: Min-wuk Lee <mlee@nvidia.com> Tested-by: Min-wuk Lee <mlee@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: Rfc8fb0c75d7514a4f0aeca69e9478a0d6572fa99
2011-11-30rtc: max77663: Cleanup update_irq_enable operationJin Park
After update rtc core, the update_irq_enable operation was removed and no one calls rtc_class_ops->update_irq_enable() anymore. Cleanup update_irq_enable operation in rtc-max77663 driver. Change-Id: I0a9c6d6e348246f62109d03e92fb72ef2fe45157 Signed-off-by: Jin Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/54685 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Rebase-Id: Rf73a6a28d6a39f8e2cf10a173a8506648ba60af2
2011-11-30rtc: max77663: Added delay for awaiting buffer updateJin Park
Added 14ms delay for awaiting buffer update. So there is no need to check update buffer flag bit on RTC_UPDATE1 register. Bug 849360 Signed-off-by: Jin Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/50987 (cherry picked from commit 1879feec7231ec082e6133e2172566ad4ee43f66) Change-Id: If54c6ea3744140b9886ace26f335b0c0ecb72bb2 Reviewed-on: http://git-master/r/54635 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: R7af025ac026c58ad7aa3d97038c04eb873658eca
2011-11-30rtc: max77663: Add MAX77663 RTC driverJin Park
Add RTC driver for Maxim PMU MAX77663. Bug 849360 Original-Change-Id: Ia7c910a852527f6a7bf5d2622cb1f76fd72222cd Signed-off-by: Jin Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/49584 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Rebase-Id: R716e08b9f98c3be480877009bef0db99ccf8043e
2011-11-30rtc: tps80031: Clearing Alarm interrupt statusvenu byravarasu
Sometimes it is observed that the POR value of RTC interrupt register is having Alarm set. Hence clearing it before enabling RTC interrupt. bug 867362 Original-Change-Id: Id84db407880d4c1f5fb3023218c2b21e82cf515d Reviewed-on: http://git-master/r/49372 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Rebase-Id: Reb9a71a090477a0c7b565f9fa188f25e7679fa15
2011-11-30rtc: tps6591x: Clear interrupt when probing deviceBo Yan
Make sure alarm interrupt is cleared during device probing. bug 867362 Original-Change-Id: Iad33c0e0715de2ec68291a57c2a55d1ad1198565 Reviewed-on: http://git-master/r/49302 Reviewed-by: Bo Yan <byan@nvidia.com> Tested-by: Bo Yan <byan@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Rebase-Id: R5574970052e9a1c1334003e0f03e1d62c7ee5109
2011-11-30rtc: max8907c: fix startup crashPrashant Gaikwad
The rtc_device_register() call has changed semantics so that it will immediately call out to rtc_read_alarm() and since the callbacks require the drvdata to be set, we need to set it before the registration call to valid NULL dereference. Based on 21b398e9670f0bb8f05b7b4cd03e018e8a0b7522 Change-Id: I4960a180ffb63415310bf9fce05de155d0633337 Reviewed-on: http://git-master/r/49460 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: Rb5896ff9928b249d97c263e1647ca451e0380b74
2011-11-30rtc: tps6591x: Registering PMU RTC as a wake sourcevenu byravarasu
Without this registration, "wakealarm" node doesnot get created under the sysfs path /sys/class/rtc/rtc0. This is used for setting RTC alarms using sysfs. bug 846920 Original-Change-Id: I287448354612d526f4b96294fef24f5669949130 Reviewed-on: http://git-master/r/44507 Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Rebase-Id: Rab6c47661fad4fd823fb8bb2c7aa5b8b210f23a7
2011-11-30rtc : tps6586x: move NULL checking to the front.Jubeom Kim
Reviewed-on: http://git-master/r/37866 (cherry picked from commit 4299db4686321fb3017f9118a36610898f172639) Original-Change-Id: Icbfef4dc5604506d30592317c94a7d4fc1bcf16c Reviewed-on: http://git-master/r/39582 Tested-by: Jubeom Kim <jubeomk@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: R7d8f5628cde155fe54d31f37eeacb4b5bb4962d1
2011-11-30rtc: tegra: Use new Tegra platform types.Yudong Tan
This change is needed to support three platforms, silicon, fpga and simulation. Change-Id: I1e132fd744e1fe716c3098b117e38e3c77678b49 Reviewed-on: http://git-master/r/36352 Reviewed-by: Mark Stadler <mastadler@nvidia.com> Tested-by: Yudong Tan <ytan@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Rebase-Id: Rb4c122fc6b87240fc5a14f1addb4d22e121a84a7
2011-11-30rtc: tps80031: Adding driver for TI PMU RTC 80031venu byravarasu
With this change, RTC driver for TI PMU 80031 is being checked in. bug 833336 Original-Change-Id: If4789a5dd49163d2391ab016845ff5807c061f12 Reviewed-on: http://git-master/r/34453 Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Thomas Cherry <tcherry@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Rebase-Id: R98c49f456537e65d02460e738029673e7eea1bc0
2011-11-30rtc: tps6586x: fix error in setting alarm1Ken Chang
Alarm1 expiration time is set based on rtc value. Should not compare the absolute rtc value with the valid range of alarm1 directly, expiration time from now is used instead. Bug 832563 Original-Change-Id: I338e7ee684b5cad6b2fba99b5ac4ec6cff9b75cd Reviewed-on: http://git-master/r/34295 Tested-by: Ken Chang <kenc@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Yu-Fong (Foster) Cho <ycho@nvidia.com> Rebase-Id: Rb4f233478ea418ddf5a7ae9e1d782dbc5c97cbde
2011-11-30rtc: tps6586x: fix alarm1 overflowKen Chang
tps6586 alarm1 has a 24-bit register, however LSB 10 bits [9:0] are used as a counter of ticks per second. Therefore, the valid range is within 0x3FFF seconds (14-bit width). Check the value set to alarm1. Change the value to (current rtc[23:10] minus 1) if the target value is larger than 0x3FFF (4 hours). If no such fix, there might be overflow issues when alarm1 is enabled, and the system might wakes up unexpectedly. This change is to keep the system in suspend state as long as possible if alarm is enabled. Bug 827056 Original-Change-Id: Icb310132e08b56642179d92dfe00a34bfd28982a Reviewed-on: http://git-master/r/32700 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Ken Chang <kenc@nvidia.com> Reviewed-by: Yu-Fong (Foster) Cho <ycho@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: ChihJen Hsu <chhsu@nvidia.com> Rebase-Id: Receaa52de2019ef4a02403312afa1385e5642caf
2011-11-30rtc: tps6591x: enabling backup battery chargingvenu byravarasu
With this change: 1. Enabled backup battery charging 2. Setting RTC default time, if it is not set previously. bug 796507 Original-Change-Id: Idffb99f24718cd8b15f38b6ca8109969ef47be81 Reviewed-on: http://git-master/r/31522 Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Gaurav Sarode <gsarode@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Narendra Damahe <ndamahe@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Rebase-Id: R6a38294f28a7efb288b89b5d8ad39daae73bd5ca
2011-11-30rtc: tps6591x: setting default date & timevenu byravarasu
Following changes are done: 1. Set default date, if platform data is incorrect. 2. Added an offset to adjust the RTC time to show the correct date in the time stamp. Original-Change-Id: I69d9632a3db4a64b61f68bf84098fd00cb95bed7 Reviewed-on: http://git-master/r/27761 Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Original-Change-Id: I875005353c75567821f0497a4ee47dc087d8e322 Rebase-Id: R98eaf3a015ef7614d7ed8c096f51ad69931ea223
2011-11-30rtc: tps6591x: wake up from suspend on alarmvenu byravarasu
Changes required for waking up system, when RTC alarm is triggered. bug 793949 Original-Change-Id: Idcc536a819e977fe35bafeebdffddf57d5388f21 Reviewed-on: http://git-master/r/27359 Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Original-Change-Id: I68bb747cb965d14af9918ad6086ac2e9888f7136 Rebase-Id: Ra2e528aeb4727392e17ee911d673cc49e9d03068
2011-11-30Update copyrightsScott Williams
Original-Change-Id: I2ffeaf6f8dfeb279b40ca6f69f6c9157401a746a Rebase-Id: R07bf43c25a0383391000ff731c2150f6512a2b6d
2011-11-30rtc: enabling RTC if MFD is setvenu byravarasu
Disabling RTC by default and enabling it if MFD is set. Original-Change-Id: I2ad8a652a2f162574efe84395cdaf0b37bd4afa1 Reviewed-on: http://git-master/r/21646 Tested-by: Bitan Biswas <bbiswas@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com> Original-Change-Id: I2d4d316d581c521fbdc2405ae60a06205e51622e Rebase-Id: R4109b18a1daefe7bad6aef988982803fedd5d9ee
2011-11-30rtc: RTC driver for tps6591xvenu byravarasu
With this check in native driver for TPS6591x RTC is added to linux kernel. Original-Change-Id: I267cc11b1451b8e2a4117cdff0b808f9f8fcc42a Reviewed-on: http://git-master/r/20754 Tested-by: Venu Byravarasu <vbyravarasu@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Original-Change-Id: If55c1d1d7ebdedace4f0dea0b19bbda088a6cb1e Rebase-Id: Rdd5b5c4b3c14b247608dffb5ee017051e802e5a1
2011-11-30rtc: fix tps6586x startup crashDan Willemsen
The rtc_device_register() call has changed semantics so that it will immediately call out to rtc_read_alarm() and since the callbacks require the drvdata to be set, we need to set it before the registration call to vaoid NULL dereference. Based on 9cf3b5fa6f7b246784d62a2a7637a871290c9ab9 Rebase-Id: R641c71563fd9b41a92b2d6679c04edf94ed36e25
2011-11-30Merge remote branch 'remotes/git-master/android-tegra-2.6.36' into 0104-mergeJin Qian
Conflicts: arch/arm/configs/tegra_defconfig arch/arm/configs/tegra_whistler_android_defconfig arch/arm/mach-tegra/Kconfig arch/arm/mach-tegra/Makefile arch/arm/mach-tegra/board-ventana.c arch/arm/mach-tegra/board-ventana.h arch/arm/mach-tegra/board-whistler-power.c arch/arm/mach-tegra/board-whistler.c arch/arm/mach-tegra/clock.c arch/arm/mach-tegra/clock.h arch/arm/mach-tegra/common.c arch/arm/mach-tegra/cpu-tegra.c arch/arm/mach-tegra/dma.c arch/arm/mach-tegra/fuse.c arch/arm/mach-tegra/headsmp.S arch/arm/mach-tegra/include/mach/iomap.h arch/arm/mach-tegra/irq.c arch/arm/mach-tegra/spi_tegra_slave.c arch/arm/mach-tegra/tegra2_clocks.c arch/arm/mach-tegra/tegra2_dvfs.c arch/arm/tools/mach-types drivers/crypto/tegra-aes.c drivers/rtc/rtc-tegra.c drivers/video/tegra/host/dev.c drivers/video/tegra/host/nvhost_acm.c drivers/video/tegra/host/nvhost_channel.c drivers/video/tegra/host/nvhost_intr.c sound/soc/tegra/tegra_i2s.c sound/soc/tegra/tegra_pcm.c Original-Change-Id: If13d61cce097ee90892132e775c5ac805a1f91e0 Reviewed-on: http://git-master/r/14922 Tested-by: Jin Qian <jqian@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Tested-by: Scott Williams <scwilliams@nvidia.com> Original-Change-Id: Id331a2ef77522766e5b7f86131c6c981b37ba4c8 Rebase-Id: R50699fd7a447ef849a58da9e207045b5d4da3eb7
2011-11-30Merge remote branch 'git-master/android-tegra-2.6.36' into merge-androidJin Qian
Conflicts: arch/arm/configs/tegra_defconfig arch/arm/mach-tegra/Kconfig arch/arm/mach-tegra/Makefile arch/arm/mach-tegra/board-ventana-power.c arch/arm/mach-tegra/board-ventana-sensors.c arch/arm/mach-tegra/board-ventana.c arch/arm/mach-tegra/clock.c arch/arm/mach-tegra/common.c arch/arm/mach-tegra/cpu-tegra.c arch/arm/mach-tegra/fuse.c arch/arm/mach-tegra/headsmp.S arch/arm/mach-tegra/tegra2_dvfs.c arch/arm/tools/mach-types drivers/rtc/rtc-tegra.c drivers/usb/gadget/fsl_udc_core.c drivers/video/tegra/host/dev.c drivers/video/tegra/host/nvhost_channel.c drivers/video/tegra/host/nvhost_intr.c Original-Change-Id: I1e9b6d0e761cf1e95cf90b78b5932b53fcb9bb5e (cherry picked from commit 2f331e046f7c4cfc6ab54fca3193035b3bf3a14f) Reviewed-on: http://git-master/r/14572 Reviewed-by: Scott Williams <scwilliams@nvidia.com> Tested-by: Scott Williams <scwilliams@nvidia.com> Original-Change-Id: I29db8796b2e27a8d218c332de36f880a7cf4bcb2 Rebase-Id: R0da39c9e0c8fa198550e0abe93658d4d9ce8f86c
2011-11-30[ARM/tegra] Add initial Tegra3 driver supportScott Williams
Bug 764354 Original-Change-Id: I807433ff825bed1fe91ce0cf50a2b3691c64ef0a Reviewed-on: http://git-master/r/12227 Reviewed-by: Scott Williams <scwilliams@nvidia.com> Tested-by: Scott Williams <scwilliams@nvidia.com> Original-Change-Id: I3da91a438f98f2f51618446ce024f3fefd726a19 Rebase-Id: R05d2230fc2dcbdccfcd00161b15f6bb45332c843
2011-11-30rtc : tps6586x: avoid RTC time is getting slowerDaehyoung Ko
To ensure an accurate read of the RTC registers during the required multi-byte read operation, the PMU RTC is designed with the following protection scheme - A circuit detects a write/read and locks the RTC_COUNT4 value by keeping the RTC in a suspended mode - During the suspended mode, a secondary counter is used to keep track of all counts that would have normally incremented the RTC - After the read is complete, the value of the secondary counter is added back to the RTC registers and thereby keeping the RTC accurate - The backup counter allows for a 1ms RTC suspend mode duration when the RTC prescaler is enabled. i2c needs to generate a 2 msgs when reading. - the address setup(write RTC_COUNT4 operation), hence start locking the RTC_COUNT4 - the data transfer (read RTC_COUNT4 operation),release locking it. this may allow the CPU to execute other portions of code in between the two operation. The fix is to start a PMU RTC access by reading the register prior to the RTC_COUNT4 so that access of the RTC PMU registers will be guaranteed to always occur within the 1ms time period. - the address setup(write RTC_COUNT4-1 operation), so there is no locking the RTC_COUNT4 - the data transfer (read RTC_COUNT4 operation), starting locking the RTC_COUNT4 and release locking the RTC_COUNT4 in one operation, so it will be guaranteed within 1ms Bug 811075 Original-Change-Id: Ie07472a329f6a0eed11e6a039cd93307bb5276a0 Reviewed-on: http://git-master/r/27537 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R0279c3dac03756636596c504e623b7159ee474f7