History log of /linux-master/drivers/rtc/rtc-twl.c
Revision Date Author Comments
# 8805bace 27-Aug-2023 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: twl: remove unnecessary messages

The RTC core already prints a message when the RTC is registered and when
registering fails, it is not necessary to have more in the driver.

Link: https://lore.kernel.org/r/20230827221643.544259-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 7130856f 28-May-2022 Ladislav Michl <ladis@linux-mips.org>

rtc: twl: add NVRAM support

Export SRAM using nvmem.

Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/ZDf7qZTiml0ijD2g@lenoch
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# fff118c9 04-Mar-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

rtc: twl: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is (mostly) ignored
and this typically results in resource leaks. To improve here there is a
quest to make the remove callback return void. In the first step of this
quest all drivers are converted to .remove_new() which already returns
void.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230304133028.2135435-38-u.kleine-koenig@pengutronix.de
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# a2054256 14-Aug-2017 Wolfram Sang <wsa@kernel.org>

mfd: twl: Move header file out of I2C realm

include/linux/i2c is not for client devices. Move the header file to a
more appropriate location.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Acked-by: Thierry Reding <thierry.reding@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 1c02cbfe 23-Nov-2016 Nicolae Rosia <Nicolae_Rosia@mentor.com>

rtc: twl: make driver DT only

Since there are no platform based users and all users
of this code are TI OMAP-based which is DT only, it makes
sense to remove unused code.

Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# e3e7f95b 23-Nov-2016 Nicolae Rosia <Nicolae_Rosia@mentor.com>

rtc: twl: kill static variables

The current code uses static variables which prevent
the use of multiple rtc twl instances.
We also make it clear that this driver supports only
TWL4030 and TWL6030 classes.

Signed-off-by: Nicolae Rosia <Nicolae_Rosia@mentor.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 34c7b3ac 31-Aug-2016 Julia Lawall <julia.lawall@lip6.fr>

rtc: constify rtc_class_ops structures

Check for rtc_class_ops structures that are only passed to
devm_rtc_device_register, rtc_device_register,
platform_device_register_data, all of which declare the corresponding
parameter as const. Declare rtc_class_ops structures that have these
properties as const.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct rtc_class_ops i@p = { ... };

@ok@
identifier r.i;
expression e1,e2,e3,e4;
position p;
@@
(
devm_rtc_device_register(e1,e2,&i@p,e3)
|
rtc_device_register(e1,e2,&i@p,e3)
|
platform_device_register_data(e1,e2,e3,&i@p,e4)
)

@bad@
position p != {r.p,ok.p};
identifier r.i;
@@
i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
struct rtc_class_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Baruch Siach <baruch@tkos.co.il>
Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# a737e835 16-Apr-2015 Joe Perches <joe@perches.com>

rtc: use more standard kernel logging styles

Neaten the logging a bit by adding #define pr_fmt

Miscellanea:

o Remove __FILE__/__func__ uses
o Coalesce formats adding missing spaces
o Align arguments
o (rtc-cmos) Integrated 2 consecutive messages

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Joshua Kinard <kumba@gentoo.org>
Cc: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 0929ae37 20-Oct-2014 Wolfram Sang <wsa@kernel.org>

rtc: drop owner assignment from platform_drivers

A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>


# f53eeb85 23-Jan-2014 Jingoo Han <jg1.han@samsung.com>

drivers/rtc/rtc-twl.c: use devm_*() functions

Use devm_*() functions to make cleanup paths simpler, and remove
unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Cc: Yoichi Yuasa <yuasa@linux-mips.org>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# b99b94b5 31-Jul-2013 Grygorii Strashko <grygorii.strashko@ti.com>

drivers/rtc/rtc-twl.c: fix: rtcX/wakealarm attribute isn't created

The device_init_wakeup() should be called before rtc_device_register().
Otherwise, sysfs "sys/class/rtc/rtcX/wakealarm" attribute will not be seen
from User space.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 5ee67484 03-Jul-2013 Peter Ujfalusi <peter.ujfalusi@ti.com>

drivers/rtc/rtc-twl.c: cleanup with module_platform_driver() conversion

Use module_platform_driver() to register the platform driver.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# d3869ff6 03-Jul-2013 Peter Ujfalusi <peter.ujfalusi@ti.com>

drivers/rtc/rtc-twl.c: fix rtc_reg_map initialization

Initialize the rtc_reg_map in platform_driver's probe function instead at
module_init time. This way we can make sure that the twl-core has been
already probed and initialized (twl_priv->twl_id is valid) since the
platform device for the RTC driver will be created by the twl-core after
it finished its init.

Reported-by: Christoph Fritz <chf.fritz@googlemail.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Tested-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# ae845894 03-Jul-2013 Kevin Hilman <khilman@linaro.org>

drivers/rtc/rtc-twl.c: ensure IRQ is wakeup enabled

Currently, the RTC IRQ is never wakeup-enabled so is not capable of
bringing the system out of suspend.

On OMAP platforms, we have gotten by without this because the TWL RTC is
on an I2C-connected chip which is capable of waking up the OMAP via the IO
ring when the OMAP is in low-power states.

However, if the OMAP suspends without hitting the low-power states (and
the IO ring is not enabled), RTC wakeups will not work because the IRQ is
not wakeup enabled.

To fix, ensure the RTC IRQ is wakeup enabled whenever the RTC alarm is
set.

Signed-off-by: Kevin Hilman <khilman@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# ca5f4389 03-Jul-2013 Jingoo Han <jg1.han@samsung.com>

rtc: rtc-twl: 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>


# 24b8256a 12-Jun-2013 Tony Lindgren <tony@atomide.com>

drivers/rtc/rtc-twl.c: fix missing device_init_wakeup() when booted with device tree

When booted in legacy mode device_init_wakeup() gets called by
drivers/mfd/twl-core.c when the children are initialized. However, when
booted using device tree, the children are created with
of_platform_populate() instead add_children().

This means that the RTC driver will not have device_init_wakeup() set,
and we need to call it from the driver probe like RTC drivers typically
do.

Without this we cannot test PM wake-up events on omaps for cases where
there may not be any physical wake-up event.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Reported-by: Kevin Hilman <khilman@linaro.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# b9d8c460 29-Apr-2013 Jingoo Han <jg1.han@samsung.com>

rtc: rtc-twl: convert twl4030rtc_driver to dev_pm_ops

Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.

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>


# c8a6046e 21-Feb-2013 Sachin Kamat <sachin.kamat@linaro.org>

drivers/rtc: use of_match_ptr() macro

This eliminates having an #ifdef returning NULL for the case when OF is
disabled. Maintains consistency in cases where OF is always selected.

Signed-off-by: Sachin Kamat <sachin.kamat@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>


# 5a167f45 21-Dec-2012 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Drivers: rtc: remove __dev* attributes.

CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 14591d88 13-Nov-2012 Peter Ujfalusi <peter.ujfalusi@ti.com>

mfd/rtc/gpio: twl: No need to allocate bigger buffer for write

Since the twl-core has been converted to use regmap it is no longer needed
to allocate bigger buffer for data when writing to twl.

CC: Grant Likely <grant.likely@secretlab.ca>
CC: Alessandro Zummo <a.zummo@towertech.it>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 8dcebaa9 17-Sep-2012 Kevin Hilman <khilman@ti.com>

drivers/rtc/rtc-twl.c: ensure all interrupts are disabled during probe

On some platforms, bootloaders are known to do some interesting RTC
programming. Without going into the obscurities as to why this may be
the case, suffice it to say the the driver should not make any
assumptions about the state of the RTC when the driver loads. In
particular, the driver probe should be sure that all interrupts are
disabled until otherwise programmed.

This was discovered when finding bursty I2C traffic every second on
Overo platforms. This I2C overhead was keeping the SoC from hitting
deep power states. The cause was found to be the RTC firing every
second on the I2C-connected TWL PMIC.

Special thanks to Felipe Balbi for suggesting to look for a rogue driver
as the source of the I2C traffic rather than the I2C driver itself.

Special thanks to Steve Sakoman for helping track down the source of the
continuous RTC interrups on the Overo boards.

Signed-off-by: Kevin Hilman <khilman@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
Tested-by: Steve Sakoman <steve@sakoman.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Tested-by: Shubhrajyoti Datta <omaplinuxkernel@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 6b91bf1a 11-Jul-2012 Kevin Hilman <khilman@ti.com>

drivers/rtc/rtc-twl.c: fix threaded IRQ to use IRQF_ONESHOT

Requesting a threaded interrupt without a primary handler and without
IRQF_ONESHOT is dangerous, and after commit 1c6c6952 ("genirq: Reject
bogus threaded irq requests"), these requests are rejected. This causes
->probe() to fail, and the RTC driver not to be availble.

To fix, add IRQF_ONESHOT to the IRQ flags.

Tested on OMAP3730/OveroSTORM and OMAP4430/Panda board using rtcwake to
wake from system suspend multiple times.

Signed-off-by: Kevin Hilman <khilman@ti.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# f3ec434c 12-Apr-2012 Konstantin Shlyakhovoy <x0155534@ti.com>

drivers/rtc/rtc-twl.c: use static register while reading time

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>


# 2778ebcc 23-Mar-2012 Venu Byravarasu <vbyravarasu@nvidia.com>

drivers/rtc/rtc-twl.c: return correct RTC event from ISR

Following changes are made as part of this change:

1. As TWL RTC supports periodic interrupt, the correct event should be
RTC_PF instead of RTC_UF.

2. No need to initialize variable "events" to 0 & then OR it with the
event values. Hence fixing it.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.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>


# 94a339d0 23-Mar-2012 Venu Byravarasu <vbyravarasu@nvidia.com>

drivers/rtc/rtc-twl.c: simplify RTC interrupt clearing

For clearing RTC interrupt, programming ALARM bit only is sufficient, as
all other bits are any way not affected by writing 0 to them.

Hence removed unwanted OR operation.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.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>


# f7439bcb 23-Mar-2012 Venu Byravarasu <vbyravarasu@nvidia.com>

drivers/rtc/rtc-twl.c: enable RTC irrespective of its prior state

As part of probe, before enabling RTC, RTC_CTRL register is read to check
if it is already running. If RTC is used by kernel alone, then this read
is not required. Even if RTC was enabled already by boot loader, setting
STOP_RTC bit again should not harm. Hence removed unwanted read
operation.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.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>


# ce9f6506 23-Mar-2012 Venu Byravarasu <vbyravarasu@nvidia.com>

drivers/rtc/rtc-twl.c: optimize IRQ bit access

As the TWL RTC driver has a cached copy of enabled RTC interrupt bits in
variable rtc_irq_bits, that can be checked before really setting or
masking any of the interrupt bits.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.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>


# 948170f8 10-Jan-2012 Benoit Cousson <b-cousson@ti.com>

drivers/rtc/rtc-twl.c: add DT support for RTC inside twl4030/twl6030

Add the DT support for the TI rtc-twl present in the twl4030 and twl6030
devices.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
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>


# 7e72c686 10-Aug-2011 Todd Poynor <toddpoynor@google.com>

rtc: twl: Fix registration vs. init order

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>


# 34d623d1 31-May-2011 Sebastian Reichel <sre@kernel.org>

rtc: rtc-twl: Remove lockdep related local_irq_enable()

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>


# dec35d19 16-Mar-2011 Ilkka Koskinen <ilkka.koskinen@nokia.com>

rtc: rtc-twl: Switch to using threaded irq

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>


# 8f6b0dd3 25-Jul-2011 Jesper Juhl <jj@chaosbits.net>

drivers/rtc/rtc-twl.c: check return value of twl_rtc_write_u8() in 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>


# 51ba60c5 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>


# 2e84067b 05-Mar-2010 Tobias Klauser <tklauser@distanz.ch>

rtc-twl: Storage class should be before const qualifier

The C99 specification states in section 6.11.5:

The placement of a storage-class specifier other than at the beginning of
the declaration specifiers in a declaration is an obsolescent feature.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# a6b49ffd 13-Dec-2009 Balaji T K <balajitk@ti.com>

rtc: Add twl6030 RTC support

This patch adds support for RTC in phoenix TWL6030.
Register offset addresses have changed in TWL6030
rtc-twl.c will hence forth support all twl RTC (4030, 5030, 6030 ..)

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# ef3b7d0d 13-Dec-2009 Balaji T K <balajitk@ti.com>

mfd: Rename twl4030_ routines in rtc-twl.c

This patch renames all twl4030_ functions to twl_ so that RTC driver can be
shared between Triton and Phoenix.

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Nayak Rajendra <rnayak@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# fc7b92fc 13-Dec-2009 Balaji T K <balajitk@ti.com>

mfd: Rename all twl4030_i2c*

This patch renames function names like twl4030_i2c_write_u8,
twl4030_i2c_read_u8 to twl_i2c_write_u8, twl_i2c_read_u8
and also common variable in twl-core.c

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# b07682b6 13-Dec-2009 Santosh Shilimkar <santosh.shilimkar@ti.com>

mfd: Rename twl4030* driver files to enable re-use

The upcoming TWL6030 is companion chip for OMAP4 like the current TWL4030
for OMAP3. The common modules like RTC, Regulator creates opportunity
to re-use the most of the code from twl4030.

This patch renames few common drivers twl4030* files to twl* to enable
the code re-use.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>