aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-pcf85063.c
AgeCommit message (Collapse)AuthorFilesLines
2023-07-27rtc: Explicitly include correct DT includesRob Herring1-1/+1
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>
2023-07-27rtc: pcf85063: Drop enum pcf85063_type and split pcf85063_cfg[]Biju Das1-45/+38
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>
2023-07-27rtc: pcf85063: Simplify probe()Biju Das1-18/+8
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>
2023-06-06rtc: Switch i2c drivers back to use .probe()Uwe Kleine-König1-1/+1
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>
2023-02-01rtc: pcf85063: use IRQ flags obtained from fwnodeAlexandre Belloni1-1/+6
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>
2022-12-11rtc: pcf85063: fix pcf85063_clkout_controlAlexandre Belloni1-1/+1
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>
2022-11-16rtc: pcf85063: Fix reading alarmAlexander Stein1-4/+4
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>
2022-05-18rtc: pcf85063: Add a compatible entry for pca85073aFabio Estevam1-0/+2
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
2022-03-23rtc: pcf85063: set RTC_FEATURE_ALARM_RES_2SAlexandre Belloni1-0/+1
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
2022-03-23rtc: pcf85063: switch to RTC_FEATURE_UPDATE_INTERRUPTAlexandre Belloni1-1/+1
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
2021-12-01rtc: pcf85063: add i2c_device_id name matching supportMarc Ferland1-31/+66
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
2021-11-10rtc: pcf85063: silence cppcheck warningAlexandre Belloni1-1/+1
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
2021-10-15rtc: pcf85063: Always clear EXT_TEST from set_timePhil Elwell1-0/+2
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
2021-10-15rtc: pcf85063: add support for fixed clockAlexander Stein1-0/+12
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
2021-07-10rtc: pcf85063: Update the PCF85063A datasheet revisionFabio Estevam1-1/+1
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
2021-06-20rtc: pcf85063: Fix the datasheet URLFabio Estevam1-2/+2
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
2021-04-16rtc: pcf85063: fallback to parent of_nodeFrancois Gervais1-4/+3
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
2021-02-06rtc: pcf85063: quiet maybe-unused variable warningsAlexandre Belloni1-19/+19
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
2021-01-16rtc: pcf85063: remove pcf85063_rtc_ops_alarmAlexandre Belloni1-9/+2
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
2020-11-19rtc: rework rtc_register_device() resource managementBartosz Golaszewski1-1/+1
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
2020-11-19rtc: add devm_ prefix to rtc_nvmem_register()Bartosz Golaszewski1-1/+1
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
2020-08-23treewide: Use fallthrough pseudo-keywordGustavo A. R. Silva1-1/+1
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>
2020-07-16rtc: Replace HTTP links with HTTPS onesAlexander A. Klimov1-2/+2
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
2020-03-26rtc: pcf85063: Add pcf85063 clkout control to common clock frameworkMichael McCormick1-0/+157
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>
2019-12-18rtc: pcf85063: return meaningful value for RTC_VL_READAlexandre Belloni1-8/+2
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>
2019-12-18rtc: pcf85063: remove RTC_VL_CLR handlingAlexandre Belloni1-6/+0
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>
2019-04-04rtc: pcf85063: add RTC_VL_READ/RTC_VL_CLR supportAlexandre Belloni1-0/+35
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>
2019-04-04rtc: pcf85063: add offset correction supportAlexandre Belloni1-1/+57
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>
2019-04-04rtc: pcf85063: add nvram supportAlexandre Belloni1-0/+24
The pcf85063 has one byte of nvram. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04rtc: pcf85063: add Micro Crystal RV8263 supportAlexandre Belloni1-4/+28
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>
2019-04-04rtc: pcf85063: add alarm supportAlexandre Belloni1-0/+121
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>
2019-04-04rtc: pcf85063: differentiate pcf85063a and pcf85063tpAlexandre Belloni1-6/+27
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>
2019-04-04rtc: pcf85063: switch to regmapAlexandre Belloni1-93/+61
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>
2019-04-04rtc: pcf85063: set rangeAlexandre Belloni1-3/+2
This is a standard BCD RTC that will fail in 2100. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04rtc: pcf85063: convert to devm_rtc_allocate_deviceAlexandre Belloni1-6/+6
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04rtc: pcf85063: remove bogus i2c functionality checkAlexandre Belloni1-3/+0
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>
2019-04-04rtc: pcf85063: convert to SPDX identifierAlexandre Belloni1-6/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04rtc: pcf85063: switch to probe_newAlexandre Belloni1-10/+2
struct i2c_device_id argument of probe() is not used, so use probe_new() instead. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-03-02rtc: pcf85063: remove dead codeAlexey Roslyakov1-7/+0
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>
2019-01-22rtc: pcf85063: set xtal load capacitance from DTSam Ravnborg1-0/+39
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>
2018-07-28rtc: pcf85063: preserve control register value between stop and startAlvin Šipraga1-10/+11
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>
2018-03-17rtc: pcf85063: fix clearing bits in pcf85063_start_clockMichael McCormick1-1/+1
Bit clear operation was missing ~ Signed-off-by: Michael McCormick <michael.mccormick@enatel.net> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-03-17rtc: pcf85063: remove useless indirectionAlexandre Belloni1-12/+4
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>
2018-03-17rtc: pcf85063: stop validating rtc_time in .read_timeAlexandre Belloni1-1/+1
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>
2016-11-04rtc: pcf85063: do not register a RTC device if chip is not presentMirza Krak1-0/+7
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>
2016-07-19rtc: pcf85063: Add support for the PCF85063A deviceChris DeBruin1-9/+38
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>
2016-07-19rtc: pcf85063: fix year rangeAlexandre Belloni1-7/+5
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>
2016-03-14rtc: pcf85063: remove struct pcf85063Alexandre Belloni1-17/+5
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>
2016-03-14rtc: pcf85063: remove useless DRV_VERSIONAlexandre Belloni1-5/+0
Since the driver is mainlined there is no use for a separate version number. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: pcf85063: remove useless century handlingAlexandre Belloni1-7/+0
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>
2016-03-14rtc: pcf85063: fix time/date settingJuergen Borleis1-23/+55
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>
2016-03-14rtc: pcf85063: fix time/date readingJuergen Borleis1-0/+7
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>
2016-03-14rtc: pcf85063: simplify code to read the current timeJuergen Borleis1-26/+21
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>
2015-11-08rtc: pcf85063: return an error when date is invalidAlexandre Belloni1-7/+1
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>
2015-09-05rtc: Drop owner assignment from i2c_driverKrzysztof Kozlowski1-1/+0
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>
2014-08-08rtc: add pcf85063 supportSøren Andersen1-0/+204
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>