summaryrefslogtreecommitdiff
path: root/drivers/rtc
AgeCommit message (Collapse)Author
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
2011-11-30rtc: tps6586x RTC clock fixAndre Sihera
Specified OSC_SRC_SEL flag to force clock signal to be taken from an externally generated source rather than be calculated internally. This should raise the accuracy to within +/-2 seconds/24 hours. Bug 811075 Bug 810537 Original-Change-Id: I7b7c4e4d752fdc03b81239f362a1d6f7aa4d3b92 Reviewed-on: http://git-master/r/27222 Reviewed-by: Andre Sihera <asihera@nvidia.com> Tested-by: Andre Sihera <asihera@nvidia.com> Reviewed-by: David Schalig <dschalig@nvidia.com> Reviewed-by: Scott Peterson <speterson@nvidia.com> Rebase-Id: Re6e093fb517b06f7218e55e2ac7b8d15764d9c57
2011-11-30[TPS658x RTC] Correct reg RTC_CTRL usageDavid Schalig
Correct PRE_BYPASS (clock scaler 32kHz/1kHz select) bitfield. Add platform data to tune RTC XTAL capacitance in board file. Bug 798832, Tested on Ventana/wake via Alarm Clock Original-Change-Id: I82d67610a815866707fc1db934d7d4d7cf93d883 Reviewed-on: http://git-master/r/22402 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Reviewed-by: David Schalig <dschalig@nvidia.com> Reviewed-by: Jonathan Mayo <jmayo@nvidia.com> Rebase-Id: Rf54ae72ccdf2538dcaed60590aa98780a365628b
2011-11-30max8907c rtc: support wake alarmsTom Cherry
This change allows rtc alarms to wake the system. Original-Change-Id: I2a7212fe7cc02b08893fe3a37824b0d39a9f5386 Reviewed-on: http://git-master/r/20101 Tested-by: Thomas Cherry <tcherry@nvidia.com> Reviewed-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: R8cd38d3f738f95f7b4a2d85c0f23f8229ae1e910
2011-11-30rtc: tps6586x: avoid enabling/disabling of same irqVarun Wadekar
alarm_irq_enable can enable/disable irqs and the same irq will be enabled/disabled in set_alarm. Bug 770380 Original-Change-Id: Ibd006e83028cea5cd251d789d258a5549bfa34ce Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/18661 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: R9cec649a63d4553d20806804cc5400b6e6ccb60e
2011-11-30rtc: tps6586x: enable irqs while settings alarmsVarun Wadekar
Bug 770380 Original-Change-Id: I8950a3ef2259b233b1711b266fa7d29270d95bfd Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/18565 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: Ra059906c34e171e4cd28e9e07dc4770dd2624793
2011-11-30max8907c RTC driverTom Cherry
Initial checkin for Maxim max8907c RTC driver Original-Change-Id: I764440cc1b0410e54f480a6e0ce424103052df14 Reviewed-on: http://git-master/r/16615 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com> Rebase-Id: R1ccd0bd1d3e4ae3a353facb4edd9cb2d69bb5c2f
2011-11-30mfd: tps6586x: fix alarm1 supportVarun Wadekar
instead of clearing the irq for alarm enable/disable, the proper bit in RTC_CONFIG has to be set/cleared. tps6586 does not support 1/sec update counter so remove support for update_irq_enable. replace it with alarm_irq_enable. Original-Change-Id: Iee66a6625e810169253a750faf3f12d20d65d7d9 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/17990 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: Rc6bdf71591a07e90f7bb3b7c6b519a76fd9e86ca
2011-11-30Merge branch 'korg-android-3.1' into korg-android+linux-tegra-3.1Dan Willemsen
Conflicts: arch/arm/mm/cache-l2x0.c drivers/misc/Kconfig drivers/misc/Makefile Signed-off-by: Dan Willemsen <dwillemsen@nvidia.com>
2011-11-30rtc: Fix some bugs that allowed accumulating time drift in suspend/resumeArve Hjønnevåg
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. Change-Id: I00b45c0349ec91a4bab9b41a126b377515427898 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2011-11-30rtc alarm: fix bad index when canceling alarms[]JP Abgrall
It was using ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK as an index. Change-Id: I919860cc71254453e382616bce9fd5455802cb3d Signed-off-by: JP Abgrall <jpa@google.com>
2011-11-30rtc: alarm: Update hrtimer if alarm at the head of the queue is reprogrammedArve Hjønnevåg
If an alarm was restarted with a value that moved it away from the head of a queue, the hrtimer would not be updated. This would cause unnecessary wakeups. Change-Id: If379f8dd92b0bdb3173bd8d057adfe0dc1d15259 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2011-11-30rtc: alarm: Don't use save_time_delta.Arve Hjønnevåg
Change-Id: Iaefeca497de02fe36b7f5d79075912f6e349ec53 Signed-off-by: Arve Hjønnevåg <arve@android.com>
2011-11-30rtc: alarm: Add in-kernel alarm interfaceArve Hjønnevåg
Drivers can now create alarms that will use an hrtimer while the system is running and the rtc to wake up from suspend. Signed-off-by: Arve Hjønnevåg <arve@android.com>
2011-11-30rtc: Add android alarm driver.Arve Hjønnevåg
2011-11-30rtc: tps6586x: Fix error in RTC tick calculationsLowell Dennis
In the TPS6586x PMU/PMIC RTC support code, when converting from seconds to ticks using a shift operator, the most significant bits were being lost due to seconds being a 32-bit value and ticks being a 64-bit value. A hard cast was added to avoid this loss. Reviewed-by: Lowell Dennis <ldennis@nvidia.com> Tested-by: Lowell Dennis <ldennis@nvidia.com> Reviewed-by: Jonathan Mayo <jmayo@nvidia.com> Reviewed-by: Peter Zu <pzu@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Signed-off-by: Robert Morell <rmorell@nvidia.com> Signed-off-by: Colin Cross <ccross@android.com>
2011-11-30rtc: tps6586x: add alarm support to tps6586x driverGary King
Signed-off-by: Gary King <gking@nvidia.com>
2011-11-30mfd: tps6586x: add RTC driver for TI TPS6586xGary King
Change-Id: Ie22a19b662fda6365b1c514aaf83c9de12fabbd4 Signed-off-by: Gary King <gking@nvidia.com>
2011-09-14drivers/rtc/rtc-s3c.c: fix no occurrence of alarm interruptDonggeun Kim
The driver does not generate an alarm interrupt even though a time for an alarm is set. This results from disabling rtc_clk after setting the alarm time. To generate an alarm interrupt the driver should maintain its enabled state for rtc_clk the until alarm interrupt occurs. This patch permits generation of an alarm interrupt. [akpm@linux-foundation.org: make s3c_rtc_alarm_clk_lock local to s3c_rtc_alarm_clk_enable()] Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-14drivers/rtc/rtc-imxdi.c needs linux/sched.hAxel Lin
Include linux/sched.h to fix below build error. CC drivers/rtc/rtc-imxdi.o drivers/rtc/rtc-imxdi.c: In function 'di_write_wait': drivers/rtc/rtc-imxdi.c:168: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function) drivers/rtc/rtc-imxdi.c:168: error: (Each undeclared identifier is reported only once drivers/rtc/rtc-imxdi.c:168: error: for each function it appears in.) drivers/rtc/rtc-imxdi.c:168: error: implicit declaration of function 'signal_pending' drivers/rtc/rtc-imxdi.c:168: error: implicit declaration of function 'schedule_timeout' drivers/rtc/rtc-imxdi.c: In function 'dryice_norm_irq': drivers/rtc/rtc-imxdi.c:329: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function) Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Baruch Siach <baruch@tkos.co.il> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-09-07Merge branch 'timers-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tipLinus Torvalds
* 'timers-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip: rtc: twl: Fix registration vs. init order rtc: Initialized rtc_time->tm_isdst rtc: Fix RTC PIE frequency limit rtc: rtc-twl: Remove lockdep related local_irq_enable() rtc: rtc-twl: Switch to using threaded irq rtc: ep93xx: Fix 'rtc' may be used uninitialized warning alarmtimers: Avoid possible denial of service with high freq periodic timers alarmtimers: Memset itimerspec passed into alarm_timer_get alarmtimers: Avoid possible null pointer traversal
2011-08-26rtc: twl: Fix registration vs. init orderTodd Poynor
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. Signed-off-by: Todd Poynor <toddpoynor@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-08-26rtc: Initialized rtc_time->tm_isdstMike Waychison
Even though the Linux kernel does not use the tm_isdst field, it is exposed as part of the ABI. This field can accidentally be left initialized, which is why we currently memset buffers returned to userland in rtc_read_time. There is a case however where the field can return garbage from the stack though when using the RTC_ALM_READ ioctl on the rtc device. This ioctl invokes rtc_read_alarm, which is careful to memset the rtc_wkalrm buffer that is copied to userland, but it then uses a struct copy to assign to alarm->time given the return value from rtc_ktime_to_tm(). rtc_ktime_to_tm() is implemented by calling rtc_time_to_tm using a derivative seconds counds from ktime, but rtc_time_to_tm does not assign a value to ->tm_isdst. This results in garbage from rtc_ktime_to_tm()'s frame ending up being copied out to userland as part of the returned rtc_wkalrm. Fix this by initializing rtc_time->tm_isdst to 0 in rtc_time_to_tm. Signed-off-by: Mike Waychison <mikew@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-08-25drivers/rtc/rtc-s3c.c: allow multiple open / allow no-ioctl-open'ed rtc to ↵MyungJoo Ham
have irq. The previous rtc-s3c had two issues related with its IRQ. 1. Users cannot open rtc multiple times because an open operation calls request_irq on the same IRQ. (e.g., two user processes wants to open and read RTC time from rtc-s3c at the same time) 2. If alarm is set and no one has the rtc opened with filesystem (either the alarm is set by kernel/boot-loader or user set an alarm and closed rtc dev file), the pending bit is not cleared and no further interrupt is invoked. When the alarm is used by the system itself such as a resume from suspend-to-RAM or other Low-power modes/idle, this is a critical issue. This patch mitigates these issues by calling request_irq at probe and free_irq at remove. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Changhwan Youn <chaos.youn@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-25drivers/rtc/rtc-s3c.c: correct debug messagesMyungJoo Ham
RTC-S3C used to print out debug messages incorrectly. This patch corrects incorrect outputs. (undecoded bcd numbers, incorrectly decoded register values) This patch affects the pr-debug messages only. Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Changhwan Youn <chaos.youn@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-17Merge branch 'timers-fixes-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: rtc: Limit RTC PIE frequency rtc: Fix hrtimer deadlock rtc: Handle errors correctly in rtc_irq_set_state() Fixup trivial conflicts in drivers/rtc/interface.c due to slightly trivially versions of the same patch coming in two different ways.
2011-08-10rtc: Fix RTC PIE frequency limitJohn Stultz
Thomas earlier submitted a fix to limit the RTC PIE freq, but picked 5000Hz out of the air. Willy noticed that we should instead use the 8192Hz max from the rtc man documentation. Cc: Willy Tarreau <w@1wt.eu> Cc: stable@kernel.org Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-08-10rtc: rtc-twl: Remove lockdep related local_irq_enable()Sebastian Reichel
Now that the irq is properly threaded (due to it needing i2c access) we should also remove the local_irq_enable() call in twl_rtc_interrupt. Testing this with Pandaboard, the RTC is still working. [Reworked commit message -jstultz] Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-08-10rtc: rtc-twl: Switch to using threaded irqIlkka Koskinen
The driver is accessing to i2c bus in interrupt handler. Therefore, it should use threaded irq. Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com> Acked-by: Balaji T K <balajitk@ti.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-08-10rtc: ep93xx: Fix 'rtc' may be used uninitialized warningAxel Lin
commit 92d921c5d "rtc: ep93xx: Initialize drvdata before registering device" ensures the drvdata is initialized prior to registering the rtc device. But it set the drvdata to an uninitialized pointer. Thus calling platform_get_drvdata in ep93xx_rtc_remove does not get correct address. This patch fixes below warning by adding struct rtc_device *rtc to struct ep93xx_rtc. Then set platform drvdata to ep93xx_rtc instead of rtc. CC drivers/rtc/rtc-ep93xx.o drivers/rtc/rtc-ep93xx.c: In function 'ep93xx_rtc_probe': drivers/rtc/rtc-ep93xx.c:154: warning: 'rtc' may be used uninitialized in this function Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-08-03rtc-omap: fix initialization of control registerDaniel Glöckner
As the comment explains, the intention of the code is to clear the OMAP_RTC_CTRL_MODE_12_24 bit, but instead it only clears the OMAP_RTC_CTRL_SPLIT and OMAP_RTC_CTRL_AUTO_COMP bits, which should be kept. OMAP_RTC_CTRL_DISABLE, OMAP_RTC_CTRL_SET_32_COUNTER, OMAP_RTC_CTRL_TEST, and OMAP_RTC_CTRL_ROUND_30S are also better off being cleared. Signed-off-by: Daniel Glöckner <dg@emlix.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-26rtc: fix hrtimer deadlockThomas Gleixner
Ben reported a lockup related to rtc. The lockup happens due to: CPU0 CPU1 rtc_irq_set_state() __run_hrtimer() spin_lock_irqsave(&rtc->irq_task_lock) rtc_handle_legacy_irq(); spin_lock(&rtc->irq_task_lock); hrtimer_cancel() while (callback_running); So the running callback never finishes as it's blocked on rtc->irq_task_lock. Use hrtimer_try_to_cancel() instead and drop rtc->irq_task_lock while waiting for the callback. Fix this for both rtc_irq_set_state() and rtc_irq_set_freq(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reported-by: Ben Greear <greearb@candelatech.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-26rtc: limit frequencyThomas Gleixner
Due to the hrtimer self rearming mode a user can DoS the machine simply because it's starved by hrtimer events. The RTC hrtimer is self rearming. We really need to limit the frequency to something sensible. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Ben Greear <greearb@candelatech.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-26rtc: handle errors correctly in rtc_irq_set_state()Thomas Gleixner
The code checks the correctness of the parameters, but unconditionally arms/disarms the hrtimer. The result is that a random task might arm/disarm rtc timer and surprise the real owner by either generating events or by stopping them. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: John Stultz <john.stultz@linaro.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Ben Greear <greearb@candelatech.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-26rtc: Limit RTC PIE frequencyThomas Gleixner
The RTC pie hrtimer is self rearming. We really need to limit the frequency to something sensible. Thus limit it to the 8192Hz max value from the rtc man documentation Cc: Willy Tarreau <w@1wt.eu> Cc: stable@kernel.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [jstultz: slightly reworked to use RTC_MAX_FREQ value] Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-07-26rtc: Fix hrtimer deadlockThomas Gleixner
Ben reported a lockup related to rtc. The lockup happens due to: CPU0 CPU1 rtc_irq_set_state() __run_hrtimer() spin_lock_irqsave(&rtc->irq_task_lock) rtc_handle_legacy_irq(); spin_lock(&rtc->irq_task_lock); hrtimer_cancel() while (callback_running); So the running callback never finishes as it's blocked on rtc->irq_task_lock. Use hrtimer_try_to_cancel() instead and drop rtc->irq_task_lock while waiting for the callback. Fix this for both rtc_irq_set_state() and rtc_irq_set_freq(). Cc: stable@kernel.org Reported-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-07-26rtc: Handle errors correctly in rtc_irq_set_state()Thomas Gleixner
In rtc_irq_set_state, the code checks the correctness of the parameters, but then goes on to unconditionally arms/disarms the hrtimer. Thus a random task might arm/disarm rtc timer and surprise the real owner by either generating events or by stopping them. Cc: stable@kernel.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-07-25Merge 'akpm' patch seriesLinus Torvalds
* Merge akpm patch series: (122 commits) drivers/connector/cn_proc.c: remove unused local Documentation/SubmitChecklist: add RCU debug config options reiserfs: use hweight_long() reiserfs: use proper little-endian bitops pnpacpi: register disabled resources drivers/rtc/rtc-tegra.c: properly initialize spinlock drivers/rtc/rtc-twl.c: check return value of twl_rtc_write_u8() in twl_rtc_set_time() drivers/rtc: add support for Qualcomm PMIC8xxx RTC drivers/rtc/rtc-s3c.c: support clock gating drivers/rtc/rtc-mpc5121.c: add support for RTC on MPC5200 init: skip calibration delay if previously done misc/eeprom: add eeprom access driver for digsy_mtc board misc/eeprom: add driver for microwire 93xx46 EEPROMs checkpatch.pl: update $logFunctions checkpatch: make utf-8 test --strict checkpatch.pl: add ability to ignore various messages checkpatch: add a "prefer __aligned" check checkpatch: validate signature styles and To: and Cc: lines checkpatch: add __rcu as a sparse modifier checkpatch: suggest using min_t or max_t ... Did this as a merge because of (trivial) conflicts in - Documentation/feature-removal-schedule.txt - arch/xtensa/include/asm/uaccess.h that were just easier to fix up in the merge than in the patch series.
2011-07-25drivers/rtc/rtc-tegra.c: properly initialize spinlockUwe Kleine-König
Using __SPIN_LOCK_UNLOCKED for a dynamically allocated lock is wrong and breaks the build with PREEMPT_RT_FULL. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: Andrew Chew <achew@nvidia.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25drivers/rtc/rtc-twl.c: check return value of twl_rtc_write_u8() in ↵Jesper Juhl
twl_rtc_set_time() We forget to save the return value of the call to twl_rtc_write_u8(save_control, REG_RTC_CTRL_REG); in 'ret', making the test of 'ret < 0' dead code since 'ret' then couldn't possibly have changed since the last test just a few lines above. It also makes us not detect failures from that specific twl_rtc_write_u8() call. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Rusev <source@mvista.com> Cc: "George G. Davis" <gdavis@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25drivers/rtc: add support for Qualcomm PMIC8xxx RTCAnirudh Ghayal
Add support for PMIC8xxx based RTC. PMIC8xxx is Qualcomm's power management IC that internally houses an RTC module. This driver communicates with the PMIC module over SSBI bus. [akpm@linux-foundation.org: cosmetic tweaks] Acked-by: Wan ZongShun <mcuos.com@gmail.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org> Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25drivers/rtc/rtc-s3c.c: support clock gatingDonggeun Kim
Add support for clock gating. Power consumption can be reduced by setting rtc_clk disabled state except for when RTC related registers are accessed. Signed-off-by: Donggeun Kim <dg77.kim@samsung.com> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: KyungMin Park <kyungmin.park@samsung.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Ben Dooks <ben@fluff.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25drivers/rtc/rtc-mpc5121.c: add support for RTC on MPC5200Dmitry Eremin-Solenikov
MPC5200B contains a limited version of RTC from MPC5121. Add support for the RTC on that CPU. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Anatolij Gustschin <agust@denx.de> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-07-25Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits) fs: Merge split strings treewide: fix potentially dangerous trailing ';' in #defined values/expressions uwb: Fix misspelling of neighbourhood in comment net, netfilter: Remove redundant goto in ebt_ulog_packet trivial: don't touch files that are removed in the staging tree lib/vsprintf: replace link to Draft by final RFC number doc: Kconfig: `to be' -> `be' doc: Kconfig: Typo: square -> squared doc: Konfig: Documentation/power/{pm => apm-acpi}.txt drivers/net: static should be at beginning of declaration drivers/media: static should be at beginning of declaration drivers/i2c: static should be at beginning of declaration XTENSA: static should be at beginning of declaration SH: static should be at beginning of declaration MIPS: static should be at beginning of declaration ARM: static should be at beginning of declaration rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check Update my e-mail address PCIe ASPM: forcedly -> forcibly gma500: push through device driver tree ... Fix up trivial conflicts: - arch/arm/mach-ep93xx/dma-m2p.c (deleted) - drivers/gpio/gpio-ep93xx.c (renamed and context nearby) - drivers/net/r8169.c (just context changes)
2011-07-22Merge branch 'timers-rtc-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'timers-rtc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86: Serialize EFI time accesses on rtc_lock x86: Serialize SMP bootup CMOS accesses on rtc_lock rtc: stmp3xxx: Remove UIE handlers rtc: stmp3xxx: Get rid of mach-specific accessors rtc: stmp3xxx: Initialize drvdata before registering device rtc: stmp3xxx: Port stmp-functions to mxs-equivalents rtc: stmp3xxx: Restore register definitions rtc: vt8500: Use define instead of hardcoded value for status bit
2011-07-22Merge branch 'timers-core-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: time: Fix stupid KERN_WARN compile issue rtc: Avoid accumulating time drift in suspend/resume time: Avoid accumulating time drift in suspend/resume time: Catch invalid timespec sleep values in __timekeeping_inject_sleeptime
2011-07-11Merge branch 'master' into for-nextJiri Kosina
Sync with Linus' tree to be able to apply pending patches that are based on newer code already present upstream.
2011-07-01rtc: stmp3xxx: Remove UIE handlersWolfram Sang
The RTC core handles UIE since 6610e08 (RTC: Rework RTC code to use timerqueue for events), so remove the specific interrupt in this driver. To make it work at all, enable interrupts in set_alarm() if needed. Drop IRQF_DISABLED which is deprecated, while we are here. Finally, add my copyright after all these changes. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-07-01rtc: stmp3xxx: Get rid of mach-specific accessorsWolfram Sang
Replace the accessors with standard readl/writel to remove their platform-dependency. Also, drop __raw_(read|write)l-accessors while we are here. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
2011-07-01rtc: stmp3xxx: Initialize drvdata before registering deviceWolfram Sang
Commit f44f7f96a20 ("RTC: Initialize kernel state from RTC") uncovered an issue in a number of RTC drivers, where the drivers call rtc_device_register before initializing the device or platform drvdata. This frequently results in null pointer dereferences when the rtc_device_register immediately makes use of the rtc device, calling rtc_read_alarm. The solution is to ensure the drvdata is initialized prior to registering the rtc device. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Shawn Guo <shawn.guo@freescale.com> Signed-off-by: John Stultz <john.stultz@linaro.org>