summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
Commit message (Collapse)AuthorAgeFilesLines
...
| * rtc: stk17ta8: fix possible race conditionAlexandre Belloni2018-03-011-2/+2
| | | | | | | | | | | | | | The probe function is not allowed to fail after registering the RTC. Call rtc_register_device() at the end. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: stk17ta8: switch to rtc_register_deviceAlexandre Belloni2018-03-011-2/+7
| | | | | | | | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: stk17ta8: make alarms usefulAlexandre Belloni2018-03-011-4/+1
| | | | | | | | | | | | | | | | Currently, the IRQs are disabled when the rtc driver is removed (e.g. when shutting down the platform). This means that the RTC will be unable to wakeup the platform. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: rp5c01: use generic nvmemAlexandre Belloni2018-03-011-41/+24
| | | | | | | | | | | | | | Instead of adding a binary sysfs attribute from the driver, use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: rp5c01: fix possible race conditionAlexandre Belloni2018-03-011-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The probe function is not allowed to fail after registering the RTC because the following may happen: CPU0: CPU1: sys_load_module() do_init_module() do_one_initcall() cmos_do_probe() rtc_device_register() __register_chrdev() cdev->owner = struct module* open("/dev/rtc0") rtc_device_unregister() module_put() free_module() module_free(mod->module_core) /* struct module *module is now freed */ chrdev_open() spin_lock(cdev_lock) cdev_get() try_module_get() module_is_live() /* dereferences already freed struct module* */ Switch to devm_rtc_allocate_device/rtc_register_device to register the rtc as late as possible. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1742: use generic nvmemAlexandre Belloni2018-03-011-41/+26
| | | | | | | | | | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1742: switch to rtc_register_deviceAlexandre Belloni2018-03-011-2/+8
| | | | | | | | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: cmos: use generic nvmemAlexandre Belloni2018-03-011-43/+30
| | | | | | | | | | | | | | | | Instead of adding a binary sysfs attribute from the driver, use the core to register an nvmem device. This allows to use the in-kernel interface to access the nvram. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: cmos: fix possible race conditionAlexandre Belloni2018-03-011-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The probe function is not allowed to fail after registering the RTC because the following may happen: CPU0: CPU1: sys_load_module() do_init_module() do_one_initcall() cmos_do_probe() rtc_device_register() __register_chrdev() cdev->owner = struct module* open("/dev/rtc0") rtc_device_unregister() module_put() free_module() module_free(mod->module_core) /* struct module *module is now freed */ chrdev_open() spin_lock(cdev_lock) cdev_get() try_module_get() module_is_live() /* dereferences already freed struct module* */ Switch to devm_rtc_allocate_device/rtc_register_device to register the rtc as late as possible. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1553: make alarms usefulAlexandre Belloni2018-03-011-10/+0
| | | | | | | | | | | | | | | | Currently, the IRQs are disabled when the rtc driver is removed (e.g. when shutting down the platform). This means that the RTC will be unable to wakeup the platform. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1553: use generic nvmemAlexandre Belloni2018-03-011-31/+24
| | | | | | | | | | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1553: switch to rtc_register_deviceAlexandre Belloni2018-03-011-2/+7
| | | | | | | | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: sirfsoc: remove useless sirfsoc_rtc_ioctlAlexandre Belloni2018-03-011-18/+0
| | | | | | | | | | | | sirfsoc_rtc_ioctl() doesn't implement any actual ioctl, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: m48t59: use generic nvmemAlexandre Belloni2018-03-011-32/+24
| | | | | | | | | | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: m48t59: switch to rtc_register_deviceAlexandre Belloni2018-03-011-2/+7
| | | | | | | | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1343: use generic nvmemAlexandre Belloni2018-03-011-46/+20
| | | | | | | | | | | | | | | | Instead of adding a binary sysfs attribute from the driver (which suffers from a race condition as the attribute appears after the device), use the core to register an nvmem device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1343: remove undocumented and useless sysfs filesAlexandre Belloni2018-03-011-95/+1
| | | | | | | | | | | | | | A documented ABI already exists to get information about the alarm. It is the only one that is used. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1343: switch to rtc_register_deviceAlexandre Belloni2018-03-011-5/+8
| | | | | | | | | | | | This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1343: simplify regmap initializationAlexandre Belloni2018-03-011-6/+2
| | | | | | | | | | | | Avoid using memset as gcc can properly initialize structures. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: remove nvmem_configAlexandre Belloni2018-03-011-2/+0
| | | | | | | | | | | | | | | | | | | | Because nvmem_config is only used and copied at nvmem registration, remove it from struct rtc_device. All the rtc drivers using nvmem are now calling rtc_nvmem_register directly. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: rv8803: fix possible race conditionAlexandre Belloni2018-03-011-8/+8
| | | | | | | | | | | | | | The probe function is not allowed to fail after registering the RTC. Call rtc_register_device() at the end. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: rv8803: put struct nvmem_config on the stackAlexandre Belloni2018-03-011-10/+10
| | | | | | | | | | | | Avoid allocating memory for struct nvmem_config. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: rv8803: call rtc_nvmem_register()Alexandre Belloni2018-03-011-1/+2
| | | | | | | | | | | | | | Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: pcf85363: put struct nvmem_config on the stackAlexandre Belloni2018-03-011-9/+10
| | | | | | | | | | | | Avoid allocating memory for struct nvmem_config. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: pcf85363: call rtc_nvmem_register()Alexandre Belloni2018-03-011-2/+6
| | | | | | | | | | | | | | Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: omap: call rtc_nvmem_register()Alexandre Belloni2018-03-011-1/+2
| | | | | | | | | | | | | | Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: m48t86: put m48t86_nvmem_cfg on the stackAlexandre Belloni2018-03-011-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | Move m48t86_nvmem_cfg to the stack of m48t86_rtc_probe. This results in a very small code size reduction and make it safer on systems with two similar RTCs: text data bss dec hex filename 1733 164 0 1897 769 drivers/rtc/rtc-m48t86.o.before 1793 100 0 1893 765 drivers/rtc/rtc-m48t86.o.after Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: m48t86: call rtc_nvmem_register()Alexandre Belloni2018-03-011-1/+2
| | | | | | | | | | | | | | Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1511: put ds1511_nvmem_cfg on the stackAlexandre Belloni2018-03-011-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | Move ds1511_nvmem_cfg to the stack of ds1511_rtc_probe. This results in a very small code size reduction and make it safer on systems with two similar RTCs: text data bss dec hex filename 2128 164 4 2296 8f8 drivers/rtc/rtc-ds1511.o.before 2175 100 4 2279 8e7 drivers/rtc/rtc-ds1511.o.after Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1511: call rtc_nvmem_register()Alexandre Belloni2018-03-011-1/+2
| | | | | | | | | | | | | | Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1307: put struct nvmem_config on the stackAlexandre Belloni2018-03-011-9/+10
| | | | | | | | | | | | | | Avoid allocating memory for struct nvmem_config as it is only necessary at the nvmem registration. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1307: call rtc_nvmem_register()Alexandre Belloni2018-03-011-6/+6
| | | | | | | | | | | | | | Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1305: put ds1305_nvmem_cfg on the stackAlexandre Belloni2018-03-011-9/+8
| | | | | | | | | | | | This makes to code safer on system using two similar RTCs. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1305: call rtc_nvmem_register()Alexandre Belloni2018-03-011-2/+2
| | | | | | | | | | | | | | Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: export rtc_nvmem_register() to driversAlexandre Belloni2018-03-012-15/+1
| | | | | | | | | | | | | | Export rtc_nvmem_register() so it can be called from drivers instead of only the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: nvmem: allow registering the nvmem device before the rtcAlexandre Belloni2018-03-012-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch the parent of the nvmem device to the parent of the rtc device so it can be registered before the RTC. This is a small change in the ABI as the nvmem moves out of the /sys/class/rtc/rtcX folder to be under the parent device folder (that is where the previous nvram files where registered). However, it is still available under its correct location, /sys/bus/nvmem/devices which is the one that should be used by userspace applications. The other benefit is that the nvmem device can stay registered even if the rtc registration fails. Or it is possible to not register the rtc if the nvmem registration failed. Finally, it makes a lot of sense for devices that actually have different i2c or spi addresses for the RTC and the EEPROM. That is basically how it would end up when using MFD or even completely separate devices. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: nvmem: disallow registering nvmem more than onceAlexandre Belloni2018-02-141-0/+3
| | | | | | | | | | | | | | Make rtc_nvmem_register return -EBUSY when an nvmem is already registered for that RTC. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: nvmem: return error valuesAlexandre Belloni2018-02-142-8/+13
| | | | | | | | | | | | | | In case of error, make rtc_nvmem_register() able to return an error value to its caller. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: nvmem: pass nvmem_config to rtc_nvmem_register()Alexandre Belloni2018-02-143-11/+14
| | | | | | | | | | | | | | To be able to remove nvmem_config from struct rtc_device, pass it as a parameter to rtc_nvmem_register. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1302: remove redundant initializations of pointer bpColin Ian King2018-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pointe bp is being initialized and this value is never read, it is being updated to the same value later just before it is going to be used. Remove the initialization as it is never read and keep the setting of bp closer to the use of bp. Cleans up clang warnings: drivers/rtc/rtc-ds1302.c:115:7: warning: Value stored to 'bp' during its initialization is never read drivers/rtc/rtc-ds1302.c:46:7: warning: Value stored to 'bp' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: goldfish: Add missing MODULE_LICENSEJames Hogan2018-02-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following warning in MIPS allmodconfig by adding a MODULE_LICENSE() at the end of rtc-goldfish.c, based on the file header comment which says GNU General Public License version 2: WARNING: modpost: missing MODULE_LICENSE() in drivers/rtc/rtc-goldfish.o Fixes: f22d9cdcb5eb ("rtc: goldfish: Add RTC driver for Android emulator") Signed-off-by: James Hogan <jhogan@kernel.org> Cc: Miodrag Dinic <miodrag.dinic@mips.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: linux-rtc@vger.kernel.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: Fix overflow when converting time64_t to rtc_timeBaolin Wang2018-02-131-4/+2
| | | | | | | | | | | | | | | | | | | | | | If we convert one large time values to rtc_time, in the original formula 'days * 86400' can be overflowed in 'unsigned int' type to make the formula get one incorrect remain seconds value. Thus we can use div_s64_rem() function to avoid this situation. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: Add tracepoints for RTC systemBaolin Wang2018-02-131-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It will be more helpful to add some tracepoints to track RTC actions when debugging RTC driver. Below sample is that we set/read the RTC time, then set 2 alarms, so we can see the trace logs: set/read RTC time: kworker/0:1-67 [000] 21.814245: rtc_set_time: UTC (1510301580) (0) kworker/0:1-67 [000] 21.814312: rtc_read_time: UTC (1510301580) (0) set the first alarm timer: kworker/0:1-67 [000] 21.829238: rtc_timer_enqueue: RTC timer:(ffffffc15eb49bc8) expires:1510301700000000000 period:0 kworker/0:1-67 [000] 22.018279: rtc_set_alarm: UTC (1510301700) (0) set the second alarm timer: kworker/0:1-67 [000] 22.230284: rtc_timer_enqueue: RTC timer:(ffffff80088e6430) expires:1510301820000000000 period:0 the first alarm timer was expired: kworker/0:1-67 [000] 145.155584: rtc_timer_dequeue: RTC timer:(ffffffc15eb49bc8) expires:1510301700000000000 period:0 kworker/0:1-67 [000] 145.155593: rtc_timer_fired: RTC timer:(ffffffc15eb49bc8) expires:1510301700000000000 period:0 kworker/0:1-67 [000] 145.172504: rtc_set_alarm: UTC (1510301820) (0) the second alarm timer was expired: kworker/0:1-67 [000] 269.102353: rtc_timer_dequeue: RTC timer:(ffffff80088e6430) expires:1510301820000000000 period:0 kworker/0:1-67 [000] 269.102360: rtc_timer_fired: RTC timer:(ffffff80088e6430) expires:1510301820000000000 period:0 disable alarm irq: kworker/0:1-67 [000] 269.102469: rtc_alarm_irq_enable: disable RTC alarm IRQ (0) Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | Merge branch 'for-linus' of ↵Linus Torvalds2018-04-051-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: kfifo: fix inaccurate comment tools/thermal: tmon: fix for segfault net: Spelling s/stucture/structure/ edd: don't spam log if no EDD information is present Documentation: Fix early-microcode.txt references after file rename tracing: Block comments should align the * on each line treewide: Fix typos in printk GenWQE: Fix a typo in two comments treewide: Align function definition open/close braces
| * | treewide: Align function definition open/close bracesJoe Perches2018-03-261-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some functions definitions have either the initial open brace and/or the closing brace outside of column 1. Move those braces to column 1. This allows various function analyzers like gnu complexity to work properly for these modified functions. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Paul Moore <paul@paul-moore.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Takashi Iwai <tiwai@suse.de> Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Nicolin Chen <nicoleotsuka@gmail.com> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | rtc: remove bfin driverArnd Bergmann2018-03-263-459/+0
| | | | | | | | | | | | | | | | | | The blackfin architecture is getting removed, so this one is now obsolete. Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Acked-by: Aaron Wu <aaron.wu@analog.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* | rtc: remove tile driverArnd Bergmann2018-03-263-154/+0
| | | | | | | | | | | | | | | | The tile architecture is getting removed, so this driver is no longer needed. Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* | treewide: simplify Kconfig dependencies for removed archsArnd Bergmann2018-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | A lot of Kconfig symbols have architecture specific dependencies. In those cases that depend on architectures we have already removed, they can be omitted. Acked-by: Kalle Valo <kvalo@codeaurora.org> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* | mn10300: Remove the architectureDavid Howells2018-03-092-2/+2
|/ | | | | | | | | | Remove the MN10300 arch as the hardware is defunct. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David Howells <dhowells@redhat.com> cc: Masahiro Yamada <yamada.masahiro@socionext.com> cc: linux-am33-list@redhat.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds2018-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
OpenPOWER on IntegriCloud