History log of /linux-master/drivers/rtc/rtc-rx8025.c
Revision Date Author Comments
# 31b0cecb 05-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

rtc: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

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


# e59b3c73 06-Nov-2022 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

rtc: Include <linux/kstrtox.h> when appropriate

The kstrto<something>() functions have been moved from kernel.h to
kstrtox.h.

So, include the latter directly in the appropriate files.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/786421fd0435a32206288904a1f879436a717529.1667721637.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 8ffb7733 21-Oct-2022 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

rtc: rx8025: Convert to .probe_new()

.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in .probe().

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


# 71af9156 06-Jul-2022 Mathew McBride <matt@traverse.com.au>

rtc: rx8025: fix 12/24 hour mode detection on RX-8035

The 12/24hr flag in the RX-8035 can be found in the hour register,
instead of the CTRL1 on the RX-8025. This was overlooked when
support for the RX-8035 was added, and was causing read errors when
the hour register 'overflowed'.

To deal with the relevant register not always being visible in
the relevant functions, determine the 12/24 mode at startup and
store it in the driver state.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Fixes: f120e2e33ac8 ("rtc: rx8025: implement RX-8035 support")
Cc: stable@vger.kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220706074236.24011-1-matt@traverse.com.au


# bce7a01a 04-May-2022 Minghao Chi <chi.minghao@zte.com.cn>

rtc: simplify the return expression of rx8025_set_offset()

Simplify the return expression.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Reviewed-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220505022314.59822-1-chi.minghao@zte.com.cn


# b476266f 07-Nov-2021 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: use .set_offset/.read_offset

The driver has its own sysfs file to adjust the clock. Fortunately, it is
already in pbb, however, the sign it expects is the opposite of what the
RTC core does (which actually aligns with the RTC).

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


# 3d35840d 07-Nov-2021 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: use rtc_add_group

Remove open coded sysfs registration by using rtc_add_group.

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


# 5be3933f 07-Nov-2021 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: clear RTC_FEATURE_ALARM when alarm are not supported

Clear RTC_FEATURE_ALARM to signal alarms are not supported to the core
instead of checking client->irq.

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


# 1709d7ee 07-Nov-2021 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: set range

Set the RTC range, it is a classic BCD RTC, with 00 being a leap
year. Let the core handle range checking.

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


# 8670558f 07-Nov-2021 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: let the core handle the alarm resolution

Tell the RTC core UIE are not supported because the resolution of the alarm
is a minute.

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


# 5e7f635a 07-Nov-2021 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: switch to devm_rtc_allocate_device

Switch to devm_rtc_allocate_device/devm_rtc_register_device, this allows
for further improvement of the driver.

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


# f120e2e3 08-Jul-2021 Mathew McBride <matt@traverse.com.au>

rtc: rx8025: implement RX-8035 support

The RX-8035 is a newer RTC from EPSON that is very
similar to the RX-8025.

The key difference is in the oscillation stop (XSTP)
bit which is inverted on the RX-8035.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210709044518.28769-2-matt@traverse.com.au


# 31247546 19-Jan-2021 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: use rtc_lock/rtc_unlock

Avoid accessing directly rtc->ops_lock and use the RTC core helpers.

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


# 47a3c048 18-Dec-2019 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

rtc: rx8025: Remove struct i2c_client from struct rx8025_data

struct i2c_client can be referenced from the device structure, so this
doesn't need to have it in struct rx8025_data.
Remove struct i2c_client from struct rx8025_data.

CC: Alessandro Zummo <a.zummo@towertech.it>
CC: Alexandre Belloni <alexandre.belloni@bootlin.com>
CC: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Link: https://lore.kernel.org/r/20191218081624.3307752-1-iwamatsu@nigauri.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

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

Based on 2 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 version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

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

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


# 110036b4 07-Jun-2019 Wolfram Sang <wsa+renesas@sang-engineering.com>

rtc: rx8025: simplify getting the adapter of a client

We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 862cac15 10-Apr-2019 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

rtc: rx8025: Fix a parameter to %ptR in rx8025_read_alarm()

The commit 1921cab11723 ("rtc: rx8025: Switch to use %ptR") converted
the driver to use new %p extension, but actually used wrong type of
the parameter in one case.

Fix a parameter to %ptR in rx8025_read_alarm().

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 1921cab1 04-Dec-2018 Andy Shevchenko <andriy.shevchenko@linux.intel.com>

rtc: rx8025: Switch to use %ptR

Use %ptR instead of open coded variant to print content of
struct rtc_time in human readable format.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 22652ba7 19-Feb-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: stop validating rtc_time in .read_time

The RTC core is always calling rtc_valid_tm after the read_time callback.
It is not necessary to call it just before returning from the callback.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.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>


# 56d86a7e 28-Jun-2016 Uwe Kleine-König <uwe@kleine-koenig.org>

rtc: simplify implementations of read_alarm

Since commit d68778b80dd7 ("rtc: initialize output parameter for read
alarm to "uninitialized"") there is no need to explicitly set
unsupported members to -1. So drop the respective assignments from
drivers.

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# ef5f4a9e 15-Feb-2016 Akinobu Mita <akinobu.mita@gmail.com>

rtc: rx8025: unsupport UIE mode

The alarm for rx8025 only has a minute accuracy, so unsupport UIE mode.

pcf8563 and hym8563 also have a minute accuracy and unsupport it.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 302c5608 15-Feb-2016 Akinobu Mita <akinobu.mita@gmail.com>

rtc: rx8025: round up to nearest minute for a minute accuracy alarm

The alarm for rx8025 only has a minute accuracy, so round up to nearest
minute when setting alarm. Without doing this, rtctest blocks one day
after setting alarm to 5 seconds later.

pcf8563 and hym8563 also have similar handling.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 9dbe3852 15-Feb-2016 Akinobu Mita <akinobu.mita@gmail.com>

rtc: rx8025: protect ctrl1 register update by rtc->ops_lock

The ctrl1 register is accessed by alarm operations. But it is updated
in threaded interrupt handler without acquiring rtc->ops_lock.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 0a966c07 15-Feb-2016 Akinobu Mita <akinobu.mita@gmail.com>

rtc: rx8025: fix irq handler registration

When IRQ line for this chips is connected, devm_request_threaded_irq()
refuses to register irq handler with the following message.

genirq: Threaded irq requested with handler=NULL and !ONESHOT for irq

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# d00cd819 28-Jan-2016 Leslie Lau <laulinxk@gmail.com>

drivers/rtc: broken link fix

In drivers/rtc/rtc-rx8025.c is a broken link that is supposed to
lead to a form allowing users to subscribe to the lm-sensors mailing list.

The link <http://lists.lm-sensors.org/mailman/listinfo/lmsensors> leads
to a page with a 404 error. I believe the link should be replaced
with <lm-sensors@lm-sensors.org>.

Signed-off-by: Leslie Lau <laulinxk@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# aaa3cee5 21-Jan-2016 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: remove rv8803 id

The rv8803 has its own driver that should be used. Remove its id from
the rx8025 driver.

Fixes: b1f9d790b59dc04f8813a49a92ddd8651770ffee
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# b1f9d790 26-Sep-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: remove unnecessary braces

braces {} are not necessary for single statement blocks

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# efbbb4fd 04-Aug-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: check time validity when necessary

Check time validity when reading time as this is when we need to know.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 5c66e1e0 04-Aug-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: fix RX8025_BIT_CTRL2_CTFG initialization

RX8025_BIT_CTRL2_CTFG was set to 0 only when it was already 0.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 4b33d36b 04-Aug-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: remove useless initialization

irq_freq is already initialized to 1 in rtc_device_register()

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 8c4a4467 04-Aug-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: reset validity when setting time

Wait for the user to set the time to reset the validity bits. Until then,
the time may be invalid.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# a27c7bf6 04-Aug-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: fix rx8025_init_client()

rx8025_init_client is modifying ctrl[0] and writing it to RX8025_REG_CTRL2
but ctrl[0] is actually RX8025_REG_CTRL1.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 8a06513d 03-Aug-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: continue without alarm when irq request fails

Instead of bailing out, disable alarms and continue when
devm_request_threaded_irq() fails. This allows to still provide some
functionality.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# fd9061fb 03-Aug-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: cleanup accessors

Remove useless error messages, at that point, the user already knows
something went wrong but will not be able to do anything about it anyway.
It is also highly unlikely that some registers are readable/writable
but not some other ones.

Also, transform rx8025_read_reg to be more resemblant to
i2c_smbus_read_byte_data()

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 6f0a8cfe 26-Jul-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: don't reset the time

Stop setting the time to epoch when it is invalid. The proper way to handle
that is to return an error when it is invalid instead of returning an
incorrect value.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 2e10e74d 25-Jul-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: fix transfer mode

The datasheet specifies that transfer mode must be 0 for write and either
0x4 (simplified read) or 0 (standard read). 0x8 is not specified, use
standard mode.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 32672c55 24-Jul-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: only handle dates between 2000 and 2099

The hardware is only capable of handling dates between 2000 and 2099,
enforce that.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 2ddd1869 25-Jul-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: use BIT()

Use BIT() instead of hand coding.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# dbcce7cf 24-Jul-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: remove useless probe error message

It is useless to print a message when probe fails as the user is already
aware that it failed.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# f0b63a1d 24-Jul-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: switch to managed irq allocation

Use devm_request_threaded_irq() so it is not necessary to call free_irq()
explicitly.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# b6a57c95 24-Jul-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: Convert to threaded IRQ

The driver currently emulates the concept of threaded IRQ using a
workqueue, switch to threaded IRQ instead.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 15d3bdc2 24-Jul-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8025: remove useless headers and reorder them

Remove the useless includes and order the remaining ones alphabetically.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# f2284f9c 24-Jul-2015 Henri Roosen <henriroosen@gmail.com>

rtc: rx8025: remove obsolete local_irq_disable() and local_irq_enable() for rtc_update_irq()

Since commit e6229bec25be ("rtc: make rtc_update_irq callable with irqs
enabled") rtc_update_irq() is callable with irqs enabled.

Signed-off-by: Henri Roosen <henriroosen@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# b2884543 10-Jul-2015 Krzysztof Kozlowski <krzk@kernel.org>

rtc: Drop owner assignment from i2c_driver

i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 147a9855 03-Apr-2014 Jingoo Han <jg1.han@samsung.com>

rtc: rtc-rx8025: remove unnecessary OOM messages

The site-specific OOM messages are unnecessary, because they duplicate
the MM subsystem generic OOM message.

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>


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

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


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


# 0abc9201 23-Mar-2012 Axel Lin <axel.lin@gmail.com>

rtc: convert rtc i2c drivers to module_i2c_driver

Factor out some boilerplate code for i2c driver registration into
module_i2c_driver.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Piotr Ziecik <kosmo@semihalf.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Scott Wood <scottwood@freescale.com>
Cc: Srikanth Srinivasan <srikanth.srinivasan@freescale.com>
Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Sergey Lapin <slapin@ossfans.org>
Cc: Roman Fietze <roman.fietze@telemotive.de>
Cc: Herbert Valerio Riedel <hvr@gnu.org>
Cc: Alexander Bigga <ab@mycable.de>
Cc: Dale Farnsworth <dale@farnsworth.org>
Cc: Gregory Hermant <gregory.hermant@calao-systems.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Martyn Welch <martyn.welch@ge.com>
Cc: Byron Bradley <byron.bbradley@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 80d4bb51 03-Feb-2011 John Stultz <john.stultz@linaro.org>

RTC: Cleanup rtc_class_ops->irq_set_state

With PIE mode interrupts now emulated in generic code via an hrtimer,
no one calls rtc_class_ops->irq_set_state(), so this patch removes it
along with driver implementations.

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>


# 9db8995b 24-Dec-2010 Tejun Heo <tj@kernel.org>

rtc: don't use flush_scheduled_work()

flush_scheduled_work() is deprecated and scheduled to be removed. On
removal, directly cancel the work, and flush the uie_task in
rtc-dev.c::clear_uie().

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: rtc-linux@googlegroups.com


# b770ffd4 19-Jul-2010 Thomas Weber <weber@corscience.de>

comment typo fixes: charater => character

Fix typo in comments. Replace charater with character.
Characteristics too.

Signed-off-by: Thomas Weber <weber@corscience.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# fbae3fb1 03-Jun-2010 Wolfram Sang <wsa@kernel.org>

i2c: Remove all i2c_set_clientdata(client, NULL) in drivers

I2C drivers can use the clientdata-pointer to point to private data. As I2C
devices are not really unregistered, but merely detached from their driver, it
used to be the drivers obligation to clear this pointer during remove() or a
failed probe(). As a couple of drivers forgot to do this, it was agreed that it
was cleaner if the i2c-core does this clearance when appropriate, as there is
no guarantee for the lifetime of the clientdata-pointer after remove() anyhow.
This feature was added to the core with commit
e4a7b9b04de15f6b63da5ccdd373ffa3057a3681 to fix the faulty drivers.

As there is no need anymore to clear the clientdata-pointer, remove all current
occurrences in the drivers to simplify the code and prevent confusion.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Richard Purdie <rpurdie@linux.intel.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Jean Delvare <khali@linux-fr.org>


# 5a0e3ad6 24-Mar-2010 Tejun Heo <tj@kernel.org>

include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>


# 3c2b9075 17-Jun-2009 Wolfgang Grandegger <wg@grandegger.com>

rtc: add stand-alone driver for RX8025 chip

Add support for the Epson RX-8025SA/NB RTC chips. It includes support for
alarms, periodic interrupts (1 Hz) and clock precision adjustment.

For clock precision adjustment, the SYSFS file "clock_adjust_ppb" gets
created in "/sys/class/rtc/rtcX/device". It permits to set and get the
clock adjustment in ppb (parts per billion), e.g.:

# echo -183000 > /sys/class/rtc/rtc0/device/clock_adjust_ppb
# cat /sys/class/rtc/rtc0/device/clock_adjust_ppb
-183000

This allows to compensate temperature dependent clock drifts. According
to the RX8025 SA/NB application manual the frequency and temperature
characteristics can be approximated using the following equation:

df = a * (ut - t)**2

df: Frequency deviation in any temperature
a : Coefficient = (-35 +-5) * 10**-9
ut: Ultimate temperature in degree = +25 +-5 degree
t : Any temperature in degree

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
Signed-off-by: Dmitry Rakhchev <rda@emcraft.com>
Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>