History log of /linux-master/drivers/rtc/rtc-rx8581.c
Revision Date Author Comments
# 48144c28 24-Jul-2023 Rob Herring <robh@kernel.org>

rtc: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230724205456.767430-1-robh@kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


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


# 3f4a3322 10-Jun-2022 Stephen Kitt <steve@sk2.org>

rtc: use simple i2c probe

All these drivers have an i2c probe function which doesn't use the
"struct i2c_device_id *id" parameter, so they can trivially be
converted to the "probe_new" style of probe with a single argument.

This change was done using the following Coccinelle script, and fixed
up for whitespace changes:

@ rule1 @
identifier fn;
identifier client, id;
@@

- static int fn(struct i2c_client *client, const struct i2c_device_id *id)
+ static int fn(struct i2c_client *client)
{
...when != id
}

@ rule2 depends on rule1 @
identifier rule1.fn;
identifier driver;
@@

struct i2c_driver driver = {
- .probe
+ .probe_new
=
(
fn
|
- &fn
+ fn
)
,
};

Signed-off-by: Stephen Kitt <steve@sk2.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220610162346.4134094-1-steve@sk2.org


# 19408467 01-Feb-2021 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8581: quiet maybe-unused variable warning

When CONFIG_OF is disabled then the matching table is not referenced.

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


# fdcfd854 09-Nov-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

rtc: rework rtc_register_device() resource management

rtc_register_device() is a managed interface but it doesn't use devres
by itself - instead it marks an rtc_device as "registered" and the devres
callback for devm_rtc_allocate_device() takes care of resource release.

This doesn't correspond with the design behind devres where managed
structures should not be aware of being managed. The correct solution
here is to register a separate devres callback for unregistering the
device.

While at it: rename rtc_register_device() to devm_rtc_register_device()
and add it to the list of managed interfaces in devres.rst. This way we
can avoid any potential confusion of driver developers who may expect
there to exist a corresponding unregister function.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201109163409.24301-8-brgl@bgdev.pl


# 3a905c2d 09-Nov-2020 Bartosz Golaszewski <bgolaszewski@baylibre.com>

rtc: add devm_ prefix to rtc_nvmem_register()

rtc_nvmem_register() is a managed interface. It doesn't require any
release function to be called at driver detach. To avoid confusing
driver authors, let's rename it to devm_rtc_nvmem_register() and add it
to the list of managed interfaces in Documentation/.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20201109163409.24301-6-brgl@bgdev.pl


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


# 51f896ff 21-Feb-2019 Biju Das <biju.das@bp.renesas.com>

rtc: rx8581: Add support for Epson rx8571 RTC

Add support for Epson rx8571 real-time clock. rx8571 rtc is compatible
with rx8581,except that rx8571 has additional 16 bytes of RAM.

16 bytes of nvmem is supported and exposed in sysfs (# is the instance
number,starting with 0): /sys/bus/nvmem/devices/rx8571-#/nvmem

Signed-off-by: Biju Das <biju.das@bp.renesas.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 94389b28 17-May-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8581: switch to regmap

Switch to regmap to simplify handling block read/write.

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


# 6e6111f6 17-May-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8581: error out when time invalid

Return an error when the date is unreliable because the battery is low.

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


# ed87c6d8 17-May-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8581: remove useless declaration

The rx8581_driver forward declaration is useless, remove it.

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


# 2d2b300b 17-May-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8581: remove useless indirection

rx8581_get_datetime and rx8581_set_datetime are only used after casting dev
to an i2c_client. Remove that useless indirection.

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


# c6e3c297 17-May-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8581: let the core handle rtc range

Let the core handle offsetting and windowing the RTC range.

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


# 86c54ef6 17-May-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8581: add RTC range

The rx8581 can support dates from 01/01/2000 to 31/12/2099.

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


# b8157168 17-May-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8581: switch to rtc_register_device

This allows for future improvement of the driver.

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


# 24f421b7 20-Feb-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: rx8581: remove useless message

It is not necessary to print a message when the time is invalid as
userspace will already get an error (and an optional dev_dbg message).

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


# ffbecfbd 03-Mar-2017 Javier Martinez Canillas <javier@osg.samsung.com>

rtc: rx8581: Add OF device ID table

The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:<device>.

But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# fa569113 31-Mar-2016 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: remove useless DRV_VERSION

Many drivers are defining a DRV_VERSION. This is often only used for
MODULE_VERSION and sometimes to print an info message at probe time. This
is kind of pointless as they are all versionned with the kernel anyway.
Also the core will print a message when a new rtc is found.

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>


# d643a49a 23-Jan-2014 Andreas Werner <andreas.werner@men.de>

drivers/rtc/rtc-rx8581.c: add SMBus-only adapters support

Add support for SMBus-only adapters (e.g. i2c-piix4). The driver has
implemented only support for I2C adapters which implement the
I2C_FUNC_SMBUS_I2C_BLOCK functionality before.

With this patch it is possible to load and use the RTC driver with I2C and
SMBUS adapters like the rtc-ds1307 does.

Tested on AMD G Series Platform (i2c-piix4 adapter driver).

Signed-off-by: Andreas Werner <andreas.werner@men.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 75319092 03-Jul-2013 Sachin Kamat <sachin.kamat@linaro.org>

drivers/rtc/rtc-rx8581.c: remove empty function

After the switch to devm_* functions and the removal of
rtc_device_unregister(), the 'remove' function does not do anything.
Delete it.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


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

rtc: rtc-rx8581: use devm_rtc_device_register()

devm_rtc_device_register() is device managed and makes 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>


# 2884fce1 27-Jul-2010 Rudolf Marek <rudolf.marek@sysgo.com>

drivers/rtc/rtc-rx8581.c: fix setdatetime

Fix the logic while writing new date/time to the chip. The driver
incorrectly wrote back register values to different registers and even
with wrong mask. The patch adds clearing of the VLF register, which
should be cleared if all date/time values are set.

Signed-off-by: Rudolf Marek <rudolf.marek@sysgo.com>
Acked-by: Wan ZongShun <mcuos.com@gmail.com>
Cc: Martyn Welch <martyn.welch@gefanuc.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>


# 9756c4da 14-Apr-2010 Martyn Welch <martyn.welch@ge.com>

rtc: e-mail corrections following split of GE Fanuc joint venture

This patch corrects author and copyright notices following the split-up of
the GE Fanuc joint venture.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# a7fa9851 12-Nov-2008 Martyn Welch <martyn.welch@gefanuc.com>

rtc: basic implementation of Epson RX-8581 I2C Real Time Clock

Provide the basic "get" and "set" functionality for the Epson RX-8581 I2C
RTC. It currently does not support the RTC's Alarm or Fixed-cycle timer.

[akpm@linux-foundation.org: need log2.h for ilog2(), remove unneeded initialisation]
Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>