History log of /drivers/rtc/rtc-mc13xxx.c
Revision Date Author Comments
5ab9a52a3af613b74a7cda033c1623c7913c50d9 03-Apr-2014 Alexander Shiyan <shc_work@mail.ru> drivers/rtc/rtc-mc13xxx.c: fix potential race condition

RTC drivers must not return an error after device registration. This
patch makes RTC registration as the last action.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
6a2b342228b98432a585c83d59ed6aa0620be7c4 03-Apr-2014 Alexander Shiyan <shc_work@mail.ru> rtc: mc13xxx: make rtc_read_time() more readable

Remove unnecessary locks when reading the time and make the read
operation until the values of day matched between reading the seconds,
it will make the mc13xxx_rtc_read_time() procedure more readable.
Additionally, patch introduced a "seconds in a day" definition.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12de362108d5ec24cce1bbe520570dc8fdccca9c 03-Apr-2014 Alexander Shiyan <shc_work@mail.ru> rtc: mc13xxx: change RTC validation scheme

Datasheet says: "When the VSRTC voltage drops to the range of 0.9 - 0.8V,
the RTCPORB reset signal is generated and the contents of the RTC will
be reset. <skip>. To inform the processor that the contents of the RTC
are no longer valid due to the reset, a timer reset interrupt function
is implemented with the RTCRSTI bit." This patch makes the RTC valid by
default until RTCRST interrupt occurs.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fb1bd9a22da3d0f2436ffa95fdc0382b89659288 03-Apr-2014 Alexander Shiyan <shc_work@mail.ru> rtc: mc13xxx: fix 1Hz interrupt

1Hz interrupt is never unmasked, so no interrupts appears. This patch
fix this issue.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2fb004a9b00e34908e59a1c1c5770910690a7588 03-Apr-2014 Alexander Shiyan <shc_work@mail.ru> rtc: mc13xxx: simplify alarm_irq_enable()

This patch removes excess layer for alarm_irq_enable() function.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
589e501439f9866b4bc415743b0ae0bb9a461c69 03-Apr-2014 Alexander Shiyan <shc_work@mail.ru> rtc: mc13xxx: request IRQs after RTC registration

Interrupts can appear after request_irq and interrupt handlers can use
the RTC device, but currently we register RTC after IRQs. This patch
changes this order and simplify error path a bit.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
77bf2ea8de78ce7dd842409a847b888e720f62d8 03-Apr-2014 Alexander Shiyan <shc_work@mail.ru> rtc: mc13xxx: remove __exit_p()

Since we no longer allow building without hotplug, the
mc13xxx_rtc_remove() function is always present and we should not use
__exit_p() to refer to it.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <kernel@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
d8f447877b1cd40267a66c6d9fcd11464c859346 04-Jul-2013 Jingoo Han <jg1.han@samsung.com> rtc: rtc-mc13xxx: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or
on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata
= NULL when no driver is bound"). Thus, it is not needed to manually
clear the device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
a379fd2458d78d3286c8103aa479839b073c89fe 30-Apr-2013 Jingoo Han <jg1.han@samsung.com> rtc: rtc-mc13xxx: use devm_*() functions

Use devm_*() functions to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
09fb7ad15aa62116f96e0f7b62c7723e636786f1 30-Apr-2013 Jingoo Han <jg1.han@samsung.com> rtc: rtc-mc13xxx: use module_platform_driver_probe()

Use module_platform_driver_probe() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
19a1ac505d5f3545ebc5b0a195d65cef4da94bb5 30-Jul-2012 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> rtc/mc13xxx: add support for the rtc in the mc34708 pmic

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.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>
0f636fc16f80fe64261ce39440e49a259ff2b0da 30-Jul-2012 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> rtc/mc13xxx: use MODULE_DEVICE_TABLE instead of MODULE_ALIAS

This allows automatic driver loading for all supported device types.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.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>
a46481d7af1e6c59c03f3ddac400d9054f804952 11-Jan-2012 Axel Lin <axel.lin@gmail.com> drivers/rtc/rtc-mc13xxx.c: make mc13xxx_rtc_idtable static

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
db5cf8d1ac4ac3fa06d89345154ce20068aeb097 02-Nov-2011 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> drivers/rtc/rtc-mc13xxx.c: move probe and remove callbacks to .init.text and .exit.text

The driver is added using platform_driver_probe(), so the callbacks can be
discarded more aggessively.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.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>
156229b352b999cafb86a21b50912975e39b7f44 06-May-2011 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> rtc: mc13xxx: Don't call rtc_device_register while holding lock

Since commit f44f7f9 (RTC: Initialize kernel state from RTC)
rtc_device_register reads the programmed alarm. As reading the alarm
needs to take the mc13xxx lock, release it before calling
rtc_device_register.

This fixes a deadlock during boot:

INFO: task swapper:1 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
swapper D c02b175c 0 1 0 0x00000000
[<c02b175c>] (schedule+0x304/0x4f4) from [<c02b25a8>] (__mutex_lock_slowpath+0x7c/0x110)
[<c02b25a8>] (__mutex_lock_slowpath+0x7c/0x110) from [<c020b4cc>] (mc13xxx_rtc_read_time+0x1c/0x118)
[<c020b4cc>] (mc13xxx_rtc_read_time+0x1c/0x118) from [<c0208f04>] (__rtc_read_time+0x58/0x5c)
[<c0208f04>] (__rtc_read_time+0x58/0x5c) from [<c0209508>] (rtc_read_time+0x30/0x48)
[<c0209508>] (rtc_read_time+0x30/0x48) from [<c0209dd4>] (__rtc_read_alarm+0x1c/0x290)
[<c0209dd4>] (__rtc_read_alarm+0x1c/0x290) from [<c0208d58>] (rtc_device_register+0x150/0x27c)
[<c0208d58>] (rtc_device_register+0x150/0x27c) from [<c02b0b74>] (mc13xxx_rtc_probe+0x128/0x17c)
[<c02b0b74>] (mc13xxx_rtc_probe+0x128/0x17c) from [<c01d5280>] (platform_drv_probe+0x1c/0x24)
[<c01d5280>] (platform_drv_probe+0x1c/0x24) from [<c01d3e58>] (driver_probe_device+0x80/0x1a8)
[<c01d3e58>] (driver_probe_device+0x80/0x1a8) from [<c01d400c>] (__driver_attach+0x8c/0x90)
[<c01d400c>] (__driver_attach+0x8c/0x90) from [<c01d3654>] (bus_for_each_dev+0x60/0x8c)
[<c01d3654>] (bus_for_each_dev+0x60/0x8c) from [<c01d2f6c>] (bus_add_driver+0x180/0x248)
[<c01d2f6c>] (bus_add_driver+0x180/0x248) from [<c01d4664>] (driver_register+0x70/0x15c)
[<c01d4664>] (driver_register+0x70/0x15c) from [<c01d5700>] (platform_driver_probe+0x18/0x98)
[<c01d5700>] (platform_driver_probe+0x18/0x98) from [<c00273a8>] (do_one_initcall+0x2c/0x168)
[<c00273a8>] (do_one_initcall+0x2c/0x168) from [<c00083ac>] (kernel_init+0xa0/0x150)
[<c00083ac>] (kernel_init+0xa0/0x150) from [<c0033ff8>] (kernel_thread_exit+0x0/0x8)

Reported-by: Vagrant Cascadian <vagrant@debian.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Closes: http://bugs.debian.org/625804
[Tweaked commit log -jstultz]
Signed-off-by: John Stultz <john.stultz@linaro.org>
c344180c9e77145a9e7eab0050169c68afae04b2 15-Apr-2011 Axel Lin <axel.lin@gmail.com> drivers/rtc/rtc-mc13xxx.c: fix unterminated platform_device_id table

The platform_device_id table is supposed to be zero-terminated.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
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>
51ba60c5bb3b0f71bee26404ddc22d8e4109e88a 03-Feb-2011 John Stultz <john.stultz@linaro.org> RTC: Cleanup rtc_class_ops->update_irq_enable()

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>
1c97872b80691f6bd3e46ec431a0d59dc75cb8da 28-Oct-2010 Uwe Kleine-König <u.kleine-koenig@pengutronix.de> rtc: Add support for the rtc found in the MC13892 PMIC

The mfd driver for MC13783 recently got support for MC13892 and was
renamed accordingly from mc13783-core to mc13xxx-core. Do the same for
rtc-mc13783.

The only relevant change is to use platform id's to tell the platform bus
that this driver is responsible for mc13892-rtc devices, too.

Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>