History log of /linux-master/drivers/rtc/rtc-pcf85063.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>


# 5789837c 17-Jul-2023 Biju Das <biju.das.jz@bp.renesas.com>

rtc: pcf85063: Drop enum pcf85063_type and split pcf85063_cfg[]

Drop enum pcf85063_type and split the array pcf85063_cfg[] as individual
variables, and make lines shorter by referring to e.g. &pcf85063_cfg
instead of &pcf85063_cfg[PCF85063].

Suggested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230717124059.196244-3-biju.das.jz@bp.renesas.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 68c624f8 17-Jul-2023 Biju Das <biju.das.jz@bp.renesas.com>

rtc: pcf85063: Simplify probe()

The pcf85063_ids[].driver_data could store a pointer to the config,
like for DT-based matching, making I2C and DT-based matching
more similar.

After that, we can simplify the probe() by replacing of_device_get_
match_data() and i2c_match_id() by i2c_get_match_data() as we have
similar I2C and DT-based matching table.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230717124059.196244-2-biju.das.jz@bp.renesas.com
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>


# 7e815272 23-Jan-2023 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: use IRQ flags obtained from fwnode

Allow the IRQ type to be passed from the device tree if available as there
may be components changing the trigger type of the interrupt between the
RTC and the IRQ controller.

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


# c2d12e85 11-Dec-2022 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: fix pcf85063_clkout_control

pcf85063_clkout_control reads the wrong register but then update the
correct one.

Reported-by: Janne Terho <janne.terho@ouman.fi>
Fixes: 8c229ab6048b ("rtc: pcf85063: Add pcf85063 clkout control to common clock framework")
Link: https://lore.kernel.org/r/20221211223553.59955-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# a6ceee26 21-Sep-2022 Alexander Stein <alexander.stein@ew.tq-group.com>

rtc: pcf85063: Fix reading alarm

If the alarms are disabled the topmost bit (AEN_*) is set in the alarm
registers. This is also interpreted in BCD number leading to this warning:
rtc rtc0: invalid alarm value: 2022-09-21T80:80:80

Fix this by masking alarm enabling and reserved bits.

Fixes: 05cb3a56ee8c ("rtc: pcf85063: add alarm support")
Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20220921074141.3903104-1-alexander.stein@ew.tq-group.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# aabfe05a 18-Apr-2022 Fabio Estevam <festevam@denx.de>

rtc: pcf85063: Add a compatible entry for pca85073a

The PCA85073A RTC has the same programming model as the PCF85063A.

Add a compatible entry for it.

Tested on a custom i.MX6SX based board.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220419014445.341444-2-festevam@gmail.com


# a9f2d5bb 09-Mar-2022 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: set RTC_FEATURE_ALARM_RES_2S

The PCF85063 doesn't support UIE because setting an alarm to fire every
second confuses the chip and the fastest we can go is an alarm every 2
seconds.

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


# 11316c24 09-Mar-2022 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: switch to RTC_FEATURE_UPDATE_INTERRUPT

Stop using uie_unsupported and clear RTC_FEATURE_UPDATE_INTERRUPT instead.

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


# 1c1b3098 16-Nov-2021 Marc Ferland <ferlandm@amotus.ca>

rtc: pcf85063: add i2c_device_id name matching support

The pcf85063 driver regsitration currently supports the "compatible"
property type of matching (for DT).

This patch adds "matching by name" support to the driver by defining
an i2c_device_id table and setting the id_table parameter in the
i2c_driver struct.

This will, for example, make the driver easier to instantiate on
systems where CONFIG_OF is not enabled (x86 in my case).

Signed-off-by: Marc Ferland <ferlandm@amotus.ca>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20211116164733.17149-1-ferlandm@amotus.ca


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

rtc: pcf85063: silence cppcheck warning

cppcheck warnings: (new ones prefixed by >>)

>> drivers/rtc/rtc-pcf85063.c:292:40: warning: Clarify calculation precedence for '&' and '?'. [clarifyCalculation]
status = status & PCF85063_REG_SC_OS ? RTC_VL_DATA_INVALID : 0;

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20211107225349.110707-1-alexandre.belloni@bootlin.com


# 9f08c9ed 14-Oct-2021 Phil Elwell <phil@raspberrypi.com>

rtc: pcf85063: Always clear EXT_TEST from set_time

Power-on reset after the insertion of a battery does not always complete
successfully, leading to corrupted register content. The EXT_TEST bit
will stop the clock from running, but currently the driver will never
recover.

Safely handle the erroneous state by clearing EXT_TEST as part of the
usual set_time method.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20211015111208.1757110-1-phil@raspberrypi.com


# 4c8a7b80 13-Oct-2021 Alexander Stein <alexander.stein@ew.tq-group.com>

rtc: pcf85063: add support for fixed clock

TQ-Systems' TQMa8Mx module (SoM) uses a pcf85063 as RTC. The default output
is 32768Hz. This is to provide the i.MX8M CKIL clock. Once the RTC driver
is probed, the clock is disabled and all i.MX8M functionality depending on
the 32 KHz clock will halt. In our case the whole system halts and a power
cycle is required.

Referencing the pcf85063 directly results in a deadlock. The kernel
will see, that i.MX8M system clock needs the RTC clock and do probe
deferral. But the i.MX8M I2C module never becomes usable without the
i.MX8M CKIL clock and thus the RTC's clock will not be probed. So
from the kernel's perspective this is a chicken-and-egg problem.

Technically everything is fine by not touching anything, since
the RTC clock correctly enables the clock on reset (i.e. on
battery backup power loss).

A workaround for this issue is describing the square wave pin
as fixed-clock, which is registered early and basically how
this pin is used on the i.MX8M.

This addresses the exact same issue as in commit f765e349c3e1 ("rtc:
m41t80: add support for fixed clock").

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
[Fixed return value 0 -> NULL]
Link: https://lore.kernel.org/r/20211013074954.997445-1-alexander.stein@ew.tq-group.com


# 98c25b80 24-Jun-2021 Fabio Estevam <festevam@gmail.com>

rtc: pcf85063: Update the PCF85063A datasheet revision

After updating the datasheet URL, the PCF85063A datasheet revision
has changed.

Adjust it accordingly.

Reported-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210624120953.2313378-1-festevam@gmail.com


# 663bff17 03-Jun-2021 Fabio Estevam <festevam@gmail.com>

rtc: pcf85063: Fix the datasheet URL

The current datasheet URL is no longer valid.

Replace with a valid one.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210603143447.2223353-2-festevam@gmail.com


# 03531606 10-Mar-2021 Francois Gervais <fgervais@distech-controls.com>

rtc: pcf85063: fallback to parent of_node

The rtc device node is always NULL.

Since v5.12-rc1-dontuse/3c9ea42802a1fbf7ef29660ff8c6e526c58114f6 this
will lead to a NULL pointer dereference.

To fix this use the parent node which is the i2c client node as set by
devm_rtc_allocate_device().

Using the i2c client node seems to be what other similar drivers do
e.g. rtc-pcf8563.c.

Signed-off-by: Francois Gervais <fgervais@distech-controls.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210310211026.27299-1-fgervais@distech-controls.com


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

rtc: pcf85063: quiet maybe-unused variable warnings

pcf85063a_config and rv8263_config are only referenced by
pcf85063_of_match, move them in the #ifdef CONFIG_OF section.

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


# d4eaffe2 10-Jan-2021 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: remove pcf85063_rtc_ops_alarm

Move the alarm callbacks in pcf85063_rtc_ops and use RTC_FEATURE_ALARM to
signal to the core whether alarms are available instead of having a
supplementary struct rtc_class_ops without alarm callbacks.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20210110231752.1418816-9-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


# df561f66 23-Aug-2020 Gustavo A. R. Silva <gustavoars@kernel.org>

treewide: Use fallthrough pseudo-keyword

Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>


# 3567d3d1 06-Jul-2020 Alexander A. Klimov <grandmaster@al2klimov.de>

rtc: Replace HTTP links with HTTPS ones

Rationale:
Reduces attack surface on kernel devs opening the links for MITM
as HTTPS traffic is much harder to manipulate.

Deterministic algorithm:
For each file:
If not .svg:
For each line:
If doesn't contain `\bxmlns\b`:
For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
If both the HTTP and HTTPS versions
return 200 OK and serve the same content:
Replace HTTP with HTTPS.

Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200706062727.18481-1-grandmaster@al2klimov.de


# 8c229ab6 23-Jan-2020 Michael McCormick <michael.mccormick@enatel.net>

rtc: pcf85063: Add pcf85063 clkout control to common clock framework

The PCF85063 has a configurable clock output signal. Add support for it
using in the CCF.

Signed-off-by: Michael McCormick <michael.mccormick@enatel.net>
Link: https://lore.kernel.org/r/20200124015239.24662-1-michael.mccormick@enatel.net
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# f86dc5bd 14-Dec-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: return meaningful value for RTC_VL_READ

PCF85063_REG_SC_OS means the voltage dropped too low and data has been
lost.

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


# 0295c27f 14-Dec-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: remove RTC_VL_CLR handling

Remove RTC_VL_CLR handling because it is a disservice to userspace as it
removes the important information that the RTC data is invalid. This may
lead userspace to set an invalid system time later on.

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


# 27ff836d 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: add RTC_VL_READ/RTC_VL_CLR support

Allow reading the oscillator status bit. Also allow clearing it even if
that makes little sense and can't be done in a race free way.

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


# 85370d3d 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: add offset correction support

The PCF850363 has an offset correction with two modes:

With mode 0, the correction is triggered once every two hours and then
correction pulses are applied once per minute until the programmed
correction values have been implemented. This gives a step of 4.34 ppm.

With mode 1, the correction is triggered once every four minutes and then
correction pulses are applied once per second up to a maximum of 60 pulses.
When correction values greater than 60 pulses are used, additional
correction pulses are made in the 59 th second. This gives a step of 4.069
ppm.

Use the correction closest to the requested value.

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


# fadfd092 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: add nvram support

The pcf85063 has one byte of nvram.

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


# 5b3a3ade 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: add Micro Crystal RV8263 support

The Micro Crystal RV8263 has the same IC as the pcf85063 but has an on
board crystal. This means that the CAP_SEL bit has to be cleared so the
correct capacitance is selected for the crystal.

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


# 05cb3a56 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: add alarm support

Add support for the alarms. The match on the weekday is not used as it it
not necessarily properly set.

The tested RTC shows a behaviour where setting an alarm on the second right
after an alarm that fired is not working, probably because of the circuit
that ensures an alarm only fires once. This is why uie_unsupported is set.

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


# 0e2e8777 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: differentiate pcf85063a and pcf85063tp

As stated in a comment pcf85063a and pcf85063tp don't have the same number
of registers. Especially, pcf85063tp doesn't have alarm support.

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


# e89b60d0 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: switch to regmap

Switch to regmap to simplify register accesses and remove the need for
pcf85063_stop_clock/pcf85063_start_clock.

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


# 802a779a 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: set range

This is a standard BCD RTC that will fail in 2100.

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


# 3555a342 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: convert to devm_rtc_allocate_device

This allows further improvement of the driver.

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


# 191c0da1 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: remove bogus i2c functionality check

Only smbus reads and write are done in the driver, plain i2c functionality
is not required.

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


# de311aa8 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: convert to SPDX identifier

Use SPDX-License-Identifier instead of a verbose license text.

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


# 0f21700a 01-Apr-2019 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: switch to probe_new

struct i2c_device_id argument of probe() is not used, so use probe_new()
instead.

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


# 069e28e5 19-Feb-2019 Alexey Roslyakov <alexey.roslyakov@gmail.com>

rtc: pcf85063: remove dead code

Some of defines are not in use since
7b5768486a910532885f01b9d2dad4818c8b3be1. Remove it to make the code
easier to read and understand.

Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# bbb43838 19-Jan-2019 Sam Ravnborg <sam@ravnborg.org>

rtc: pcf85063: set xtal load capacitance from DT

Add support for specifying the xtal load capacitance in the DT node.
The pcf85063 supports xtal load capacitance of 7pF or 12.5pF.
If the rtc has the wrong configuration the time will
drift several hours/week.

The driver use the default value 7pF.

The DT may specify either 7000fF or 12500fF.
(The DT uses femto Farad to avoid decimal numbers).
Other values are warned and the driver uses the default value.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Urs Fässler <urs.fassler@bbv.ch>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# ec9cf1b7 15-Jul-2018 Alvin Šipraga <alvin@airtame.com>

rtc: pcf85063: preserve control register value between stop and start

Fix a bug that caused the Control_1 register to get zeroed whenever the
RTC time is set. The problem occurred between stopping and starting the
RTC clock, wherein the return value of a successful I2C write function
would get written to the register.

Also update variables of the start and stop functions to be more
consistent with the rest of the driver.

Signed-off-by: Alvin Šipraga <alvin@airtame.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 051abf55 21-Feb-2018 Michael McCormick <michael.mccormick@enatel.net>

rtc: pcf85063: fix clearing bits in pcf85063_start_clock

Bit clear operation was missing ~

Signed-off-by: Michael McCormick <michael.mccormick@enatel.net>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>


# 965271df 21-Feb-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: remove useless indirection

pcf85063_get_datetime and pcf85063_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>


# 0a6b8886 21-Feb-2018 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: 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 before returning from the callback.

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


# c18b4c52 17-Oct-2016 Mirza Krak <mirza.krak@hostmobility.com>

rtc: pcf85063: do not register a RTC device if chip is not present

Add a sanity check to see if chip is present. If we can not communicate
with the chip there is no point in registering a RTC device.

Signed-off-by: Mirza Krak <mirza.krak@hostmobility.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 0d981f81 12-Jul-2016 Chris DeBruin <cdeb5783@gmail.com>

rtc: pcf85063: Add support for the PCF85063A device

The current rtc-pcf85063 driver only supports the PCF85063TP device.
Using the existing driver on a PCF85063A will result in the time being
set correctly into the RTC, but the RTC is held in the stopped state.
Therefore, the time will no longer advance and no error is indicated.

The PCF85063A device has a bigger memory map than the PCF85063TP.
The existing driver make use of an address rollover condition,
but the rollover point is different in the two devices.

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


# c421ce72 18-Jul-2016 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: fix year range

The year range is not validated properly

As the driver has been mainlined in 2014, it is not an issue to stop
handling dates between 1970 and 2000 with the benefit of handling dates up
to 2100.

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


# 2da424af 02-Mar-2016 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: remove struct pcf85063

No members of struct pcf85063 are used anymore, remove the whole structure.

Reviewed-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# a2892bf4 02-Mar-2016 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: remove useless DRV_VERSION

Since the driver is mainlined there is no use for a separate version
number.

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


# ba270bbb 23-Feb-2016 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: remove useless century handling

pcf85063_get_datetime() tries to handle a century bit but that bit is not
documented and the final value is never used anywhere else in the kernel.

Reviewed-by: Juergen Borleis <jbe@pengutronix.de>
Tested-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 31d4d33e 09-Feb-2016 Juergen Borleis <jbe@pengutronix.de>

rtc: pcf85063: fix time/date setting

When setting a new time/date the RTC's clock must be stopped first, in
order to write the time/date registers in an atomic manner.
So, this change stops the clock first and then writes the time/date
registers and the clock control register (to re-enable the clock) in one
turn.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 6cc4c8b1 09-Feb-2016 Juergen Borleis <jbe@pengutronix.de>

rtc: pcf85063: fix time/date reading

Check if the RTC signals an invalid time/date (due to a battery power loss
for example). In this case ignore the time/date until it is really set again.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 7b576848 09-Feb-2016 Juergen Borleis <jbe@pengutronix.de>

rtc: pcf85063: simplify code to read the current time

By using i2c_smbus_read_i2c_block_data() the code is now much simpler.

While at it: when reading the RTC's seconds register, all time/date registers
are frozen until the RTC's year register is read. So it is important to read
all time/date registers in one turn to not lose a second event. Make it more
clear why the read must happen in this way.

Signed-off-by: Juergen Borleis <jbe@pengutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>


# 5413eaba 29-Sep-2015 Alexandre Belloni <alexandre.belloni@bootlin.com>

rtc: pcf85063: return an error when date is invalid

Return an error when the date is invalid as the policy should be
implemented there.

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>


# 796b7abb 08-Aug-2014 Søren Andersen <san@rosetechnology.dk>

rtc: add pcf85063 support

Add support for the pcf85063 rtc chip.

[akpm@linux-foundation.org: fix comment typo, tweak conding style]
Signed-off-by: Soeren Andersen <san@rosetechnology.dk>
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>