aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-twl.c
Commit message (Collapse)AuthorAgeFilesLines
* twl-rtc: mask alarm interrupts at shutdown.Anand Gadiyar2014-10-011-0/+5
| | | | | | | | | Mask alarm interrupts when the system is shutdown so that we don't get powered up unnecessarily. Change-Id: I732577f1d62a28e880c193a3d7d7d6bcdaf863d2 Signed-off-by: Anand Gadiyar <gadiyar@ti.com> Signed-off-by: Semen Protsenko <semen.protsenko@ti.com>
* RTC: twl6030: correct usage of static register while reading RTCKonstantin Shlyakhovoy2014-10-011-5/+38
| | | | | | | | | | | | | | RTC stores time and date in several registers. Due to the fact that these registers can't be read momentary there is a chance that reading from counting registers gives an error of one minute, one hour, one day, etc. To address the issue the RTC has hardware that can copy the counting registers to static shadowed registers. However, while re-using driver code for twl6030, the feature wasn't correctly implemented. So wrong time was read one - two times per 300000 readings. This patch corrects usage of RTC registers for twl6030. Change-Id: Iab1a9afd381e2a3de3b6b381ebf9bb8b798a6e18 Signed-off-by: Konstantin Shlyakhovoy <x0155534@ti.com>
* Merge branch 'android-3.0' into android-omap-3.0Todd Poynor2013-01-161-0/+5
|\ | | | | | | | | | | | | Fixup incompatible code in opp.c: omap_init_opp_table() Change-Id: Iac7d60b814a539285d00e0a3dbb6e3f0060cb683 Signed-off-by: Todd Poynor <toddpoynor@google.com>
| * drivers/rtc/rtc-twl.c: ensure all interrupts are disabled during probeKevin Hilman2012-10-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 8dcebaa9a0ae8a0487f4342f3d56d2cb1c980860 upstream. On some platforms, bootloaders are known to do some interesting RTC programming. Without going into the obscurities as to why this may be the case, suffice it to say the the driver should not make any assumptions about the state of the RTC when the driver loads. In particular, the driver probe should be sure that all interrupts are disabled until otherwise programmed. This was discovered when finding bursty I2C traffic every second on Overo platforms. This I2C overhead was keeping the SoC from hitting deep power states. The cause was found to be the RTC firing every second on the I2C-connected TWL PMIC. Special thanks to Felipe Balbi for suggesting to look for a rogue driver as the source of the I2C traffic rather than the I2C driver itself. Special thanks to Steve Sakoman for helping track down the source of the continuous RTC interrups on the Overo boards. Signed-off-by: Kevin Hilman <khilman@ti.com> Cc: Felipe Balbi <balbi@ti.com> Tested-by: Steve Sakoman <steve@sakoman.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Tested-by: Shubhrajyoti Datta <omaplinuxkernel@gmail.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@linuxfoundation.org>
* | rtc: twl: Fix registration vs. init orderTodd Poynor2011-07-261-31/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only register as an RTC device after the hardware has been successfully initialized. The RTC class driver will call back to this driver to read a pending alarm, and other drivers watching for new devices on the RTC class may read the RTC time upon registration. Such access might occur while the RTC is stopped, prior to clearing pending alarms, etc. The new ordering also avoids leaving the platform device drvdata set to an unregistered struct rtc_device * on probe errors. Change-Id: I9b52fa142a797872390ca45e618d1bbd3196ab70 Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | rtc: twl: Use threaded IRQ, remove IRQ enable in interrupt handlerTodd Poynor2011-07-261-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IRQs disabled on entry to twl_rtc_interrupt is not a consequence of LOCKDEP; both twl6030 and twl4030 explicitly disable IRQs before calling the module IRQ handlers. The ISR should not be enabling IRQs; use a threaded IRQ handler instead. Also fixes warnings: WARNING: at kernel/irq/handle.c:130 handle_irq_event_percpu+nnn irq nnn handler twl_rtc_interrupt+nnn enabled interrupts Change-Id: I5eea3f2545645eda2b9d0599e52fd23cb1416106 Signed-off-by: Todd Poynor <toddpoynor@google.com>
* | rtc: twl: Enable RTC IRQ for wakeupTodd Poynor2011-07-251-0/+3
|/ | | | | Change-Id: I6316d70f8e34c048edbc7f3773cd6a5de15eece0 Signed-off-by: Todd Poynor <toddpoynor@google.com>
* RTC: Cleanup rtc_class_ops->update_irq_enable()John Stultz2011-03-091-13/+0
| | | | | | | | | | | | | | | Now that the generic code handles UIE mode irqs via periodic alarm interrupts, no one calls the rtc_class_ops->update_irq_enable() method anymore. This patch removes the driver hooks and implementations of update_irq_enable if no one else is calling it. CC: Thomas Gleixner <tglx@linutronix.de> CC: Alessandro Zummo <a.zummo@towertech.it> CC: Marcelo Roberto Jimenez <mroberto@cpti.cetuc.puc-rio.br> CC: rtc-linux@googlegroups.com Signed-off-by: John Stultz <john.stultz@linaro.org>
* rtc-twl: Storage class should be before const qualifierTobias Klauser2010-03-061-2/+2
| | | | | | | | | | | | The C99 specification states in section 6.11.5: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-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>
* rtc: Add twl6030 RTC supportBalaji T K2009-12-141-41/+111
| | | | | | | | | | | | This patch adds support for RTC in phoenix TWL6030. Register offset addresses have changed in TWL6030 rtc-twl.c will hence forth support all twl RTC (4030, 5030, 6030 ..) Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Reviewed-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Rename twl4030_ routines in rtc-twl.cBalaji T K2009-12-131-68/+68
| | | | | | | | | | | This patch renames all twl4030_ functions to twl_ so that RTC driver can be shared between Triton and Phoenix. Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Nayak Rajendra <rnayak@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Rename all twl4030_i2c*Balaji T K2009-12-131-7/+7
| | | | | | | | | | | | This patch renames function names like twl4030_i2c_write_u8, twl4030_i2c_read_u8 to twl_i2c_write_u8, twl_i2c_read_u8 and also common variable in twl-core.c Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* mfd: Rename twl4030* driver files to enable re-useSantosh Shilimkar2009-12-131-0/+540
The upcoming TWL6030 is companion chip for OMAP4 like the current TWL4030 for OMAP3. The common modules like RTC, Regulator creates opportunity to re-use the most of the code from twl4030. This patch renames few common drivers twl4030* files to twl* to enable the code re-use. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>