summaryrefslogtreecommitdiff
path: root/drivers/rtc
AgeCommit message (Collapse)Author
2013-02-15rtc: palmas: Clear all interrupt of RTC during initLaxman Dewangan
There is a false wakeup from Palma RTC in suspend state of system. Following changes are done to fix this issue: - Clear all intrruprs of RTC during initialization, - make RTC interrupt as early resume and - do not enable the interrupt in suspend, as the interrupt get enabled when user sets the alarm. Add debug prints on rtc callbacks for tracing the activity happen with RTC hardware to catch any false setting/alarm/wakeup. bug 1227717 Change-Id: I18a5a0a845dcf036d6ffea8a350f5d32fef83e5d Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/200736 Reviewed-by: Automatic_Commit_Validation_User
2012-11-22rtc: palmas: add battery backup charging supportLaxman Dewangan
Add platform data for RTC to select the battery backup charging or not. Change-Id: Ie4010a9c58c89237619017297733320ca646960c Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/164937 Reviewed-by: Automatic_Commit_Validation_User
2012-10-31rtc: tps65910: Added rtc time init supportSumit Sharma
Added support for initializing rtc time Fixed IRQ numbers in header file Changed module name fro rtc-tps65910 to tps65910-rtc Bug 1055083 Change-Id: I067a52ef21e58eb03331d25417062f53e45b082d Signed-off-by: Sumit Sharma <sumsharma@nvidia.com> Reviewed-on: http://git-master/r/144765 GVS: Gerrit_Virtual_Submit Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2012-10-10rtc: fix crash in rtc driver during suspendMallikarjun Kasoju
palmas rtc pointer is not assigned as child to palmas which is causing kernel panic during suspend. Reviewed-on: http://git-master/r/133000 (cherry picked from commit 94d02a6e4ffb1b7b616caa9e54310714ac6ec127) Change-Id: I648913ff89d1b478f11638a9a3c7982491869683 Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com> Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/143049 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
2012-09-14rtc: tps65910: add RTC driver for TPS65910 PMIC RTCVenu Byravarasu
TPS65910 PMIC is a MFD with RTC as one of the device. Adding RTC driver for supporting RTC device present inside TPS65910 PMIC. Only support for RTC alarm is implemented as part of this patch. Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> (cherry picked from commit 7df2d82cd4b0b350d4e507eb502b31b568029172) Change-Id: Ibc977599db45a7f8d4930c8182a18f31ba535a68 Reviewed-on: http://git-master/r/132543 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit
2012-09-13rtc: max77663: Set Alarm wday to its reset valueDaniel Fu
The wday is configured only when disabled alarm. When enable alarm, set it to its default reset value 0x01, and not enable it, to prevent an error happened when re-read the alarm value into the virtualized generic layer at boot up in reading alarm setting of RTC. Bug 1034871 Change-Id: I8bfa997653edaaa286cf768c1827b5ab986f52cc Signed-off-by: Daniel Fu <danifu@nvidia.com> Reviewed-on: http://git-master/r/129398 (cherry picked from commit 1a61c310b66245a73e021d786eea45c31cd9f6e9) Signed-off-by: Kerwin Wan <kerwinw@nvidia.com> Change-Id: Ifa78078c6387689d12fe1aade8a9c531fef4f771 Reviewed-on: http://git-master/r/131130 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
2012-09-13rtc: tps80031: fix alarm wakeupAmit Kamath
Call device_init_wakeup before registration. This enables RTC as an alarm timer. Hence changing sequence of calls. RTC interrupt enabled when alarm is set. Bug 1044940 Change-Id: I47724c5951a1b334186315517a0ea60011fdfa05 Signed-off-by: Amit Kamath <akamath@nvidia.com> Reviewed-on: http://git-master/r/131089 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-09-11drivers: rtc: tegra: Remove rtc register resetPrashant Malani
RTC registers are accessed before tegra_rtc_probe(). As such, resetting them here would lead to inconsistent state, and possible problems with time subtraction. Bug 1010972 Change-Id: I342a88411b5fcde86078537c313d857e3cd9a4f2 Signed-off-by: Prashant Malani <pmalani@nvidia.com> Reviewed-on: http://git-master/r/131263 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bo Yan <byan@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
2012-09-11rtc: max77663: fix alarm reading bugDaniel Fu
When reading alarm of RTC-max77663, it didn't set alrm->enabled correctly, if irq is masked, means disable alarm, alrm->enabled should be set to 0, else it should be 1. Change-Id: Id0b1ffd9a816643712f33624d7d52cbe7b66b3c3 Signed-off-by: Daniel Fu <danifu@nvidia.com> Reviewed-on: http://git-master/r/129593 (cherry picked from commit e81b06d36a924dcdf8bb0456e7a50d1634d0365f) Signed-off-by: Kerwin Wan <kerwinw@nvidia.com> Change-Id: I21eb95bd6c051963db22e9b4494c6b59c79ae17c Reviewed-on: http://git-master/r/131124 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-08-23Merge commit 'v3.4.9' into android-t114-3.4Varun Wadekar
Linux v3.4.9 Conflicts: arch/arm/kernel/smp.c arch/arm/vfp/entry.S Change-Id: I731e815ed35ba9280374a5a3e5a6a8b6b805d695 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-08-15rtc: wm831x: Feed the write counter into device_add_randomness()Mark Brown
commit 9dccf55f4cb011a7552a8a2749a580662f5ed8ed upstream. The tamper evident features of the RTC include the "write counter" which is a pseudo-random number regenerated whenever we set the RTC. Since this value is unpredictable it should provide some useful seeding to the random number generator. Only do this on boot since the goal is to seed the pool rather than add useful entropy. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-14rtc: RTC driver for palmasMallikarjun Kasoju
Add RTC driver for palmas Bug 978821 Change-Id: I6cdc1f491f97db0edc1c57d2429de565e407d799 Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com> Reviewed-on: http://git-master/r/122126 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
2012-08-09rtc-max77663: add wakeup property in RTC device.haydend
Android use ioctl ANDROID_ALARM_SET_RTC on /dev/alarm to change time, alarm device driver will call RTC interface to set the change into RTC register. On K3.4 alarm related code has changed a little bit, in alarmtimer.c alarmtimer_rtc_add_device used as rtc class add_device callback, in this function will check if devices can wakeup system or not, if (!device_may_wakeup(rtc->dev.parent)) return -1; If check is failed, the alarm device will not bind to a RTC device this will cause our time change not set into RTC register, the change will lose after system reboot. Because K3.1 don't has such check, so we need use device_init_wakeup to add wakeup property on rtc-max77663 in K3.4 to solve the issue. bug 1026999 Change-Id: If542407d5ee1fcce0718ba4107315a1c4020f653 Signed-off-by: Hayden Du <haydend@nvidia.com> Reviewed-on: http://git-master/r/121243 Reviewed-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-08-08rtc: tps80031: register as mfd sub deviceLaxman Dewangan
register RTC driver of TPS80031 as mfd sub driver in place of adding it as a sub devices. This is inline with the mfd driver policy. Change-Id: I2f9c13478a1e85c9670dd7bc576ec761f2e24733 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/121133 Reviewed-by: Automatic_Commit_Validation_User
2012-08-06rtc/tegra: treat compilation warning as errorschowdary
- Add compilation flag to treat warning as error bug 949219 Change-Id: Ic52b13519b817ab3861bd56692ec6b6da60edc48 Signed-off-by: schowdary <schowdary@nvidia.com>
2012-07-30rtc: tps6591x: Prevent wrong date settingPreetham Chandru
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>
2012-07-18Merge commit 'v3.4.5' into android-t114-3.4-rebasedVarun Wadekar
Linux v3.4.5 Conflicts: drivers/base/power/main.c Change-Id: I782e650a89665caea8aed9e5598234888dc11088 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-07-16drivers/rtc/rtc-mxc.c: fix irq enabled interrupts warningBenoît Thébaudeau
commit b59f6d1febd6cbe9fae4589bf72da0ed32bc69e0 upstream. Fixes WARNING: at irq/handle.c:146 handle_irq_event_percpu+0x19c/0x1b8() irq 25 handler mxc_rtc_interrupt+0x0/0xac enabled interrupts Modules linked in: (unwind_backtrace+0x0/0xf0) from (warn_slowpath_common+0x4c/0x64) (warn_slowpath_common+0x4c/0x64) from (warn_slowpath_fmt+0x30/0x40) (warn_slowpath_fmt+0x30/0x40) from (handle_irq_event_percpu+0x19c/0x1b8) (handle_irq_event_percpu+0x19c/0x1b8) from (handle_irq_event+0x28/0x38) (handle_irq_event+0x28/0x38) from (handle_level_irq+0x80/0xc4) (handle_level_irq+0x80/0xc4) from (generic_handle_irq+0x24/0x38) (generic_handle_irq+0x24/0x38) from (handle_IRQ+0x30/0x84) (handle_IRQ+0x30/0x84) from (avic_handle_irq+0x2c/0x4c) (avic_handle_irq+0x2c/0x4c) from (__irq_svc+0x40/0x60) Exception stack(0xc050bf60 to 0xc050bfa8) bf60: 00000001 00000000 003c4208 c0018e20 c050a000 c050a000 c054a4c8 c050a000 bf80: c05157a8 4117b363 80503bb4 00000000 01000000 c050bfa8 c0018e2c c000e808 bfa0: 60000013 ffffffff (__irq_svc+0x40/0x60) from (default_idle+0x1c/0x30) (default_idle+0x1c/0x30) from (cpu_idle+0x68/0xa8) (cpu_idle+0x68/0xa8) from (start_kernel+0x22c/0x26c) Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Sascha Hauer <kernel@pengutronix.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> 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>
2012-07-16drivers/rtc/rtc-ab8500.c: use IRQF_ONESHOT when requesting a threaded IRQLee Jones
commit 3cfd16a551dc0c188160e1765168a04baf2d3198 upstream. This driver's IRQ registration is failing because the kernel now forces IRQs to be ONESHOT if no IRQ handler is passed. Signed-off-by: Lee Jones <lee.jones@linaro.org> 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-16drivers/rtc/rtc-spear.c: fix use-after-free in spear_rtc_remove()Devendra Naga
commit 2a643893e50fde71d7ba84b5592ec61b467b9ab6 upstream. `config' is freed and is then used in the rtc_device_unregister() call, causing a kernel panic. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Reviewed-by: Viresh Kumar <viresh.linux@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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-12rtc: max77663: avoid powering on system by RTC alarm.Jinyoung Park
Clean RTC alarm and don't set new alarm during shutdown process. After powering off, we do not want Maxim PMIC automaticly boots caused by RTC alarm. Bug 985193 Signed-off-by: Haley Teng <hteng@nvidia.com> Reviewed-on: http://git-master/r/104773 (cherry picked from commit 0bd7f3163f73ba3cf87dadd6bc6fa35a538ac153) Change-Id: I7209407503b9f51dfb5b8f59d05c6fa8f04c6069 Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/110858 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-06-07rtc: tps80031: add msecure supportTom Cherry
Bug 986402 Change-Id: Id12540e31f8d7d9a04d764ed012310a685eafb8d Signed-off-by: Tom Cherry <tcherry@nvidia.com> Reviewed-on: http://git-master/r/104269 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Conflicts: drivers/rtc/rtc-tps80031.c
2012-06-04Merge commit 'v3.4' into android-tegra-nv-3.4Varun Wadekar
2012-05-30rtc: 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-25rtc: rtc-tps6586x: enable irq before enabling alarmsVarun Wadekar
Specifically enable the rtc irq before enabling alarms. Change-Id: Ieffa18905ca110f5679835c9b7b1483efd1943c5 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-05-17drivers/rtc/rtc-pl031.c: configure correct wday for 2000-01-01Rajkumar Kasirajan
The reset date of the ST Micro version of PL031 is 2000-01-01. The correct weekday for 2000-01-01 is saturday, but pl031 is initialized to sunday. This may lead to alarm malfunction, so configure the correct wday if RTC_DR indicates reset. Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: Mattias Wallin <mattias.wallin@stericsson.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>
2012-05-17rtc: 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-05-14rtc: Fix possible null pointer dereference in rtc-mpc5121.cJohn Stultz
Mark Loard pointed out: "For example, this beauty from rtc-mpc5121.c in the same update: ... rtc->rtc = rtc_device_register("mpc5200-rtc", &op->dev, &mpc5200_rtc_ops, THIS_MODULE); ... rtc->rtc->uie_unsupported = 1; // <<<< Ooops NULL pointer >>>> if (IS_ERR(rtc->rtc)) { // <<<< this needs to be earlier >>>> err = PTR_ERR(rtc->rtc); goto out_free_irq; } ..." This patch moves setting the uie_unsupported flag to after we validate the rtc->rtc pointer to resolve this. Reported by: Mark Lord <kernel@teksavvy.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Link: http://lkml.kernel.org/r/1335300215-21427-1-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2012-05-04Merge branch 'timers-urgent-for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull timer fix from Thomas Gleixner. * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: rtc: Fix possible null pointer dereference in rtc-mpc5121.c
2012-04-30drivers/rtc/rtc-ds1307.c: fix BUG shown with lock debugging enabledAnatolij Gustschin
Add struct bin_attribute initialization to fix the following bug: rtc-ds1307 3-0068: rtc core: registered ds1307 as rtc0 BUG: key cfb14fcc not in .data! ------------[ cut here ]------------ WARNING: at kernel/lockdep.c:2986 sysfs_add_file_mode+0x84/0xdc() Modules linked in: [<c0018d94>] (unwind_backtrace+0x0/0xf8) from [<c0031f7c>] (warn_slowpath_common+0x4c/0x64) [<c0031f7c>] (warn_slowpath_common+0x4c/0x64) from [<c0031fb0>] (warn_slowpath_null+0x1c/0x24) [<c0031fb0>] (warn_slowpath_null+0x1c/0x24) from [<c012f7ac>] (sysfs_add_file_mode+0x84/0xdc) [<c012f7ac>] (sysfs_add_file_mode+0x84/0xdc) from [<c04b11e4>] (ds1307_probe+0x5e4/0x6ac) [<c04b11e4>] (ds1307_probe+0x5e4/0x6ac) from [<c036e600>] (i2c_device_probe+0xdc/0x108) [<c036e600>] (i2c_device_probe+0xdc/0x108) from [<c02cdf84>] (driver_probe_device+0x90/0x210) [<c02cdf84>] (driver_probe_device+0x90/0x210) from [<c02ce198>] (__driver_attach+0x94/0x98) [<c02ce198>] (__driver_attach+0x94/0x98) from [<c02cc824>] (bus_for_each_dev+0x50/0x7c) [<c02cc824>] (bus_for_each_dev+0x50/0x7c) from [<c02cd780>] (bus_add_driver+0x184/0x244) [<c02cd780>] (bus_add_driver+0x184/0x244) from [<c02ce43c>] (driver_register+0x78/0x12c) [<c02ce43c>] (driver_register+0x78/0x12c) from [<c03701ac>] (i2c_register_driver+0x2c/0xb4) [<c03701ac>] (i2c_register_driver+0x2c/0xb4) from [<c0008798>] (do_one_initcall+0x34/0x178) [<c0008798>] (do_one_initcall+0x34/0x178) from [<c0691860>] (kernel_init+0xdc/0x194) [<c0691860>] (kernel_init+0xdc/0x194) from [<c0013cf0>] (kernel_thread_exit+0x0/0x8) Since commit 6992f5334995af4 ("sysfs: Use one lockdep class per sysfs attribute") this initialization is required. Reported-by: Stefano Babic <sbabic@denx.de> Tested-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Stefano Babic <sbabic@denx.de> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-26rtc: Fix possible null pointer dereference in rtc-mpc5121.cJohn Stultz
Mark Loard pointed out: "For example, this beauty from rtc-mpc5121.c in the same update: ... rtc->rtc = rtc_device_register("mpc5200-rtc", &op->dev, &mpc5200_rtc_ops, THIS_MODULE); ... rtc->rtc->uie_unsupported = 1; // <<<< Ooops NULL pointer >>>> if (IS_ERR(rtc->rtc)) { // <<<< this needs to be earlier >>>> err = PTR_ERR(rtc->rtc); goto out_free_irq; } ..." This patch moves setting the uie_unsupported flag to after we validate the rtc->rtc pointer to resolve this. Reported by: Mark Lord <kernel@teksavvy.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Link: http://lkml.kernel.org/r/1335300215-21427-1-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2012-04-25drivers/rtc/rtc-ds1307.c: fix BUG shown with lock debugging enabledAnatolij Gustschin
Add struct bin_attribute initialization to fix the following bug: rtc-ds1307 3-0068: rtc core: registered ds1307 as rtc0 BUG: key cfb14fcc not in .data! ------------[ cut here ]------------ WARNING: at kernel/lockdep.c:2986 sysfs_add_file_mode+0x84/0xdc() Modules linked in: [<c0018d94>] (unwind_backtrace+0x0/0xf8) from [<c0031f7c>] (warn_slowpath_common+0x4c/0x64) [<c0031f7c>] (warn_slowpath_common+0x4c/0x64) from [<c0031fb0>] (warn_slowpath_null+0x1c/0x24) [<c0031fb0>] (warn_slowpath_null+0x1c/0x24) from [<c012f7ac>] (sysfs_add_file_mode+0x84/0xdc) [<c012f7ac>] (sysfs_add_file_mode+0x84/0xdc) from [<c04b11e4>] (ds1307_probe+0x5e4/0x6ac) [<c04b11e4>] (ds1307_probe+0x5e4/0x6ac) from [<c036e600>] (i2c_device_probe+0xdc/0x108) [<c036e600>] (i2c_device_probe+0xdc/0x108) from [<c02cdf84>] (driver_probe_device+0x90/0x210) [<c02cdf84>] (driver_probe_device+0x90/0x210) from [<c02ce198>] (__driver_attach+0x94/0x98) [<c02ce198>] (__driver_attach+0x94/0x98) from [<c02cc824>] (bus_for_each_dev+0x50/0x7c) [<c02cc824>] (bus_for_each_dev+0x50/0x7c) from [<c02cd780>] (bus_add_driver+0x184/0x244) [<c02cd780>] (bus_add_driver+0x184/0x244) from [<c02ce43c>] (driver_register+0x78/0x12c) [<c02ce43c>] (driver_register+0x78/0x12c) from [<c03701ac>] (i2c_register_driver+0x2c/0xb4) [<c03701ac>] (i2c_register_driver+0x2c/0xb4) from [<c0008798>] (do_one_initcall+0x34/0x178) [<c0008798>] (do_one_initcall+0x34/0x178) from [<c0691860>] (kernel_init+0xdc/0x194) [<c0691860>] (kernel_init+0xdc/0x194) from [<c0013cf0>] (kernel_thread_exit+0x0/0x8) Since commit 6992f5334995af4 ("sysfs: Use one lockdep class per sysfs attribute") this initialization is required. Reported-by: Stefano Babic <sbabic@denx.de> Tested-by: Stefano Babic <sbabic@denx.de> Signed-off-by: Anatolij Gustschin <agust@denx.de> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Stefano Babic <sbabic@denx.de> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-18drivers/rtc/rtc-pl031.c: enable clock on all ST variantsLinus Walleij
The ST variants of the PL031 all require bit 26 in the control register to be set before they work properly. Discovered this when testing on the Nomadik board where it would suprisingly just stand still. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Cc: Alessandro Rubini <rubini@unipv.it> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-18drivers/rtc/rtc-twl.c: use static register while reading timeKonstantin Shlyakhovoy
RTC stores time and date in several registers. Due to the fact that these registers can't be read instantaneously, there is a chance that reading from counting registers gives an error of one minute, one hour, one day, etc. To address this issue, the RTC has hardware support to copy the RTC counting registers to static shadowed registers. The current implementation does not use this feature, and in a stress test, we can reproduce this error at a rate of around two times per 300000 readings. Fix the implementation to ensure that the right snapshot of time is captured. Signed-off-by: Konstantin Shlyakhovoy <x0155534@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Benoit Cousson <b-cousson@ti.com> Cc: linux-omap <linux-omap@vger.kernel.org> Acked-by: Mykola Oleksiienko <x0174904@ti.com> Acked-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-18drivers/rtc/rtc-s3c.c: add placeholder for driver private dataTushar Behera
Driver data field is a pointer, hence assigning that to an integer results in compilation warnings. Fixes following compilation warnings: drivers/rtc/rtc-s3c.c: In function `s3c_rtc_get_driver_data': drivers/rtc/rtc-s3c.c:452:3: warning: return makes integer from pointer without a cast [enabled by default] drivers/rtc/rtc-s3c.c: At top level: drivers/rtc/rtc-s3c.c:674:3: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/rtc/rtc-s3c.c:674:3: warning: (near initialization for `s3c_rtc_dt_match[1].data') [enabled by default] drivers/rtc/rtc-s3c.c:677:3: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/rtc/rtc-s3c.c:677:3: warning: (near initialization for `s3c_rtc_dt_match[2].data') [enabled by default] drivers/rtc/rtc-s3c.c:680:3: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/rtc/rtc-s3c.c:680:3: warning: (near initialization for `s3c_rtc_dt_match[3].data') [enabled by default] Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Cc: Heiko Stuebner <heiko@sntech.de> 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>
2012-04-18drivers/rtc/rtc-s3c.c: fix compilation errorTushar Behera
Fix this error: drivers/rtc/rtc-s3c.c: At top level: drivers/rtc/rtc-s3c.c:671:3: error: request for member `data' in something not a structure or union drivers/rtc/rtc-s3c.c:674:3: error: request for member `data' in something not a structure or union drivers/rtc/rtc-s3c.c:677:3: error: request for member `data' in something not a structure or union drivers/rtc/rtc-s3c.c:680:3: error: request for member `data' in something not a structure or union Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Cc: Heiko Stuebner <heiko@sntech.de> 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>
2012-04-18drivers/rtc/rtc-efi.c: fix section mismatch warningJan Beulich
efi_rtc_init() uses platform_driver_probe(), so there's no need to also set efi_rtc_driver's probe member (as it won't be used anyway). This fixes a modpost section mismatch warning (as efi_rtc_probe() validly is __init). Signed-off-by: Jan Beulich <jbeulich@suse.com> Cc: Matthew Garrett <mjg@redhat.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>
2012-04-18drivers/rtc/rtc-r9701.c: reset registers if invalid values are detectedAndreas Dumberger
hwclock refuses to set date/time if RTC registers contain invalid values. Check the date/time register values at probe time and initialize them to make hwclock happy. Signed-off-by: Andreas Dumberger <andreas.dumberger@tqs.de> Signed-off-by: Anatolij Gustschin <agust@denx.de> 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>
2012-04-18drivers/rtc/rtc-88pm860x.c: fix rtc irq enable callbackJett.Zhou
According to 88pm860x spec, rtc alarm irq enable control is bit3 for RTC_ALARM_EN, so fix it. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Cc: Axel Lin <axel.lin@gmail.com> Cc: Haojian Zhuang <haojian.zhuang@marvell.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>
2012-04-12drivers/rtc/rtc-pl031.c: enable clock on all ST variantsLinus Walleij
The ST variants of the PL031 all require bit 26 in the control register to be set before they work properly. Discovered this when testing on the Nomadik board where it would suprisingly just stand still. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Cc: Alessandro Rubini <rubini@unipv.it> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-12drivers/rtc/rtc-twl.c: use static register while reading timeKonstantin Shlyakhovoy
RTC stores time and date in several registers. Due to the fact that these registers can't be read instantaneously, there is a chance that reading from counting registers gives an error of one minute, one hour, one day, etc. To address this issue, the RTC has hardware support to copy the RTC counting registers to static shadowed registers. The current implementation does not use this feature, and in a stress test, we can reproduce this error at a rate of around two times per 300000 readings. Fix the implementation to ensure that the right snapshot of time is captured. Signed-off-by: Konstantin Shlyakhovoy <x0155534@ti.com> Signed-off-by: Nishanth Menon <nm@ti.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Benoit Cousson <b-cousson@ti.com> Cc: linux-omap <linux-omap@vger.kernel.org> Acked-by: Mykola Oleksiienko <x0174904@ti.com> Acked-by: Oleksandr Dmytryshyn <oleksandr.dmytryshyn@ti.com> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-12drivers/rtc/rtc-s3c.c: add placeholder for driver private dataTushar Behera
Driver data field is a pointer, hence assigning that to an integer results in compilation warnings. Fixes following compilation warnings: drivers/rtc/rtc-s3c.c: In function `s3c_rtc_get_driver_data': drivers/rtc/rtc-s3c.c:452:3: warning: return makes integer from pointer without a cast [enabled by default] drivers/rtc/rtc-s3c.c: At top level: drivers/rtc/rtc-s3c.c:674:3: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/rtc/rtc-s3c.c:674:3: warning: (near initialization for `s3c_rtc_dt_match[1].data') [enabled by default] drivers/rtc/rtc-s3c.c:677:3: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/rtc/rtc-s3c.c:677:3: warning: (near initialization for `s3c_rtc_dt_match[2].data') [enabled by default] drivers/rtc/rtc-s3c.c:680:3: warning: initialization makes pointer from integer without a cast [enabled by default] drivers/rtc/rtc-s3c.c:680:3: warning: (near initialization for `s3c_rtc_dt_match[3].data') [enabled by default] Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Cc: Heiko Stuebner <heiko@sntech.de> 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>
2012-04-12drivers/rtc/rtc-s3c.c: fix compilation errorTushar Behera
Fix this error: drivers/rtc/rtc-s3c.c: At top level: drivers/rtc/rtc-s3c.c:671:3: error: request for member `data' in something not a structure or union drivers/rtc/rtc-s3c.c:674:3: error: request for member `data' in something not a structure or union drivers/rtc/rtc-s3c.c:677:3: error: request for member `data' in something not a structure or union drivers/rtc/rtc-s3c.c:680:3: error: request for member `data' in something not a structure or union Signed-off-by: Tushar Behera <tushar.behera@linaro.org> Cc: Heiko Stuebner <heiko@sntech.de> 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>
2012-04-12drivers/rtc/rtc-efi.c: fix section mismatch warningJan Beulich
efi_rtc_init() uses platform_driver_probe(), so there's no need to also set efi_rtc_driver's probe member (as it won't be used anyway). This fixes a modpost section mismatch warning (as efi_rtc_probe() validly is __init). Signed-off-by: Jan Beulich <jbeulich@suse.com> Cc: Matthew Garrett <mjg@redhat.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>
2012-04-12drivers/rtc/rtc-r9701.c: reset registers if invalid values are detectedAndreas Dumberger
hwclock refuses to set date/time if RTC registers contain invalid values. Check the date/time register values at probe time and initialize them to make hwclock happy. Signed-off-by: Andreas Dumberger <andreas.dumberger@tqs.de> Signed-off-by: Anatolij Gustschin <agust@denx.de> 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>
2012-04-11rtc: 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-04-11rtc: 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-04-07Merge branch '3.4-rc1' into android-tegra-nv-3.3-rebasedVarun Wadekar
Change-Id: Ib3b69ffc5ac3e07c9cc44cc49e9142088eec477e Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-04-05Merge branch 'akpm' (Andrew's patch-bomb)Linus Torvalds
Merge batch of fixes from Andrew Morton: "The simple_open() cleanup was held back while I wanted for laggards to merge things. I still need to send a few checkpoint/restore patches. I've been wobbly about merging them because I'm wobbly about the overall prospects for success of the project. But after speaking with Pavel at the LSF conference, it sounds like they're further toward completion than I feared - apparently davem is at the "has stopped complaining" stage regarding the net changes. So I need to go back and re-review those patchs and their (lengthy) discussion." * emailed from Andrew Morton <akpm@linux-foundation.org>: (16 patches) memcg swap: use mem_cgroup_uncharge_swap fix backlight: add driver for DA9052/53 PMIC v1 C6X: use set_current_blocked() and block_sigmask() MAINTAINERS: add entry for sparse checker MAINTAINERS: fix REMOTEPROC F: typo alpha: use set_current_blocked() and block_sigmask() simple_open: automatically convert to simple_open() scripts/coccinelle/api/simple_open.cocci: semantic patch for simple_open() libfs: add simple_open() hugetlbfs: remove unregister_filesystem() when initializing module drivers/rtc/rtc-88pm860x.c: fix rtc irq enable callback fs/xattr.c:setxattr(): improve handling of allocation failures fs/xattr.c:listxattr(): fall back to vmalloc() if kmalloc() failed fs/xattr.c: suppress page allocation failure warnings from sys_listxattr() sysrq: use SEND_SIG_FORCED instead of force_sig() proc: fix mount -t proc -o AAA
2012-04-05drivers/rtc/rtc-88pm860x.c: fix rtc irq enable callbackJett.Zhou
According to 88pm860x spec, rtc alarm irq enable control is bit3 for RTC_ALARM_EN, so fix it. Signed-off-by: Jett.Zhou <jtzhou@marvell.com> Cc: Axel Lin <axel.lin@gmail.com> Cc: Haojian Zhuang <haojian.zhuang@marvell.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>