summaryrefslogtreecommitdiffstats
path: root/drivers/rtc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* rtc: xgene: set rangeAlexandre Belloni2019-04-041-0/+1
| | | | | | CCVR is a 32bit second counter. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: xgene: fix possible race conditionAlexandre Belloni2019-04-041-7/+11
| | | | | | | | | | | The IRQ is requested before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference. Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc struct before requesting the IRQ. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: test: do not use assignment in if conditionAlexandre Belloni2019-04-041-1/+2
| | | | | | | Fix checkpatch error: drivers/rtc/rtc-test.c:155: ERROR: do not use assignment in if condition Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 88pm80x: convert to SPDX identifierAlexandre Belloni2019-04-041-13/+1
| | | | | | Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ab-b5ze-s3: correct checkpatch issuesAlexandre Belloni2019-04-041-18/+16
| | | | | | Correct trivial whitespace and split strings issues. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: core: correct trivial checkpatch warningsAlexandre Belloni2019-04-048-90/+93
| | | | | | | Correct trivial checkpatch warnings, mostly whitespace issues and unbalanced braces. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: x1205: Add DT probing supportLinus Walleij2019-04-041-0/+7
| | | | | | | | | This makes it possible to probe the X1205 RTC from the device tree. This is needed when adding device tree boot support for the IXP4xx-based NSLU2 which has this RTC. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: da9063: convert header to SPDXWolfram Sang2019-04-041-11/+3
| | | | | | | | Covnert the header of the source file to SPDX. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: omap: let the core handle rangeAlexandre Belloni2019-04-041-16/+6
| | | | | | | | Let the core handle the RTC range instead of open coding it. Tested-by: Keerthy <j-keerthy@ti.com> Reviewed-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: mv: add rangeAlexandre Belloni2019-04-041-2/+5
| | | | | | | | This RTC handles time from 2000-01-01 00:00:00 to 2099-12-31 23:59:59 with a weird rollover to 2000-06-23 00:00:00. Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: mv: convert to devm_rtc_allocate_deviceAlexandre Belloni2019-04-041-10/+11
| | | | | | | This allows further improvement of the driver. Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: mv: convert to SPDX identifierAlexandre Belloni2019-04-041-4/+1
| | | | | | | Use SPDX-License-Identifier instead of a verbose license text. Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: convert core to SPDX identifierAlexandre Belloni2019-03-189-45/+16
| | | | | | | Use SPDX-License-Identifier instead of a verbose license text. Also fix the block comment alignment. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ab-b5ze-s3: remove unnecessary checkAlexandre Belloni2019-03-181-10/+8
| | | | | | | The core already checks that the alarm is set in the future. IT is not necessary to do it again in the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ab-b5ze-s3: convert to SPDX identifierAlexandre Belloni2019-03-181-9/+1
| | | | | | Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ab-b5ze-s3: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni2019-03-181-28/+9
| | | | | | | Call the 64bit versions of rtc_time_to_tm as the range is enforced by the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ab-b5ze-s3: remove unnecessary gotosAlexandre Belloni2019-03-181-55/+38
| | | | | | Rework error handling to remove unnecessary gotos. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: ab-b5ze-s3: remove mutexAlexandre Belloni2019-03-181-17/+2
| | | | | | | The rtc_ops are already called with the RTC mutex locked so there is no need to have a separate lock, unless it is used in the irq handler. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: zynqmp: convert to SPDX identifierAlexandre Belloni2019-03-181-12/+1
| | | | | | Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: abx80x: remove useless .removeAlexandre Belloni2019-03-181-6/+0
| | | | | | .remove is empty, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: abx80x: use rtc_add_groupAlexandre Belloni2019-03-181-26/+6
| | | | | | | Use rtc_add_group to add the sysfs group in a race free manner. This has the side effect of moving the files to their proper location. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: abx80x: convert to SPDX identifierAlexandre Belloni2019-03-181-4/+1
| | | | | | Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* Merge tag 'tag-chrome-platform-for-v5.1' of ↵Linus Torvalds2019-03-123-0/+189
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux Pull chrome platform updates from Benson Leung: - SPDX identifier cleanup for platform/chrome - Cleanup series between mfd and chrome/platform, moving cros-ec attributes from mfd/cros_ec_dev to sub-drivers in platform/chrome - Wilco EC driver - Maintainership change to new group repository * tag 'tag-chrome-platform-for-v5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: fix wilco-ec dependencies platform/chrome: wilco_ec: Add RTC driver platform/chrome: wilco_ec: Add support for raw commands in debugfs platform/chrome: Add new driver for Wilco EC platform/chrome: cros_ec: Remove cros_ec dependency in lpc_mec MAINTAINERS: chrome-platform: change the git tree to a chrome-platform group git tree platform/chrome: cros_ec_sysfs: remove pr_fmt() define platform/chrome: cros_ec_lightbar: remove pr_fmt() define platform/chrome: cros_kbd_led_backlight: switch to SPDX identifier platform/chrome: cros_ec_spi: switch to SPDX identifier platform/chrome: cros_ec_proto: switch to SPDX identifier platform/chrome: cros_ec_lpc: switch to SPDX identifier platform/chrome: cros_ec_i2c: switch to SPDX identifier platform/chrome: cros_ec_vbc: switch to SPDX identifier platform/chrome: cros_ec_sysfs: switch to SPDX identifier platform/chrome: cros_ec_lightbar: switch to SPDX identifier platform/chrome: cros_ec_debugfs: switch to SPDX identifier platform/chrome: cromeos_pstore: switch to SPDX identifier
| * platform/chrome: wilco_ec: Add RTC driverNick Crews2019-02-213-0/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This Embedded Controller has an internal RTC that is exposed as a standard RTC class driver with read/write functionality. The driver is added to the drivers/rtc/ so that the maintainer of that directory will be able to comment on this change, as that maintainer is the expert on this system. In addition, the driver code is called indirectly after a corresponding device is registered from core.c, as opposed to core.c registering the driver callbacks directly. To test: > hwclock --show --rtc /dev/rtc1 2007-12-31 16:01:20.460959-08:00 > hwclock --systohc --rtc /dev/rtc1 > hwclock --show --rtc /dev/rtc1 2018-11-29 17:08:00.780793-08:00 > hwclock --show --rtc /dev/rtc1 2007-12-31 16:01:20.460959-08:00 > hwclock --systohc --rtc /dev/rtc1 > hwclock --show --rtc /dev/rtc1 2018-11-29 17:08:00.780793-08:00 Signed-off-by: Duncan Laurie <dlaurie@google.com> Signed-off-by: Nick Crews <ncrews@chromium.org> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> [Fix the sparse warning: symbol 'wilco_ec_rtc_read/write' was not declared] Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
* | rtc: pic32: convert to SPDX identifierAlexandre Belloni2019-03-041-9/+1
| | | | | | | | | | | | Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: pic32: let the core handle rangeAlexandre Belloni2019-03-041-7/+3
| | | | | | | | | | | | Let the core handle the RTC range instead of open coding it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: pic32: convert to devm_rtc_allocate_deviceAlexandre Belloni2019-03-041-6/+8
| | | | | | | | | | | | This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: update my email addressAlexandre Belloni2019-03-042-4/+4
| | | | | | | | | | | | Use my current email address. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: rv8803: convert to SPDX identifierAlexandre Belloni2019-03-041-5/+1
| | | | | | | | | | | | Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: rv8803: let the core handle rangeAlexandre Belloni2019-03-041-3/+2
| | | | | | | | | | | | Let the core handle the RTC range instead of open coding it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: tx4939: convert to SPDX identifierAlexandre Belloni2019-03-041-5/+2
| | | | | | | | | | | | | | | | | | Use SPDX-License-Identifier instead of a verbose license text. The original text refers to the COPYING file in the main directory which is GPL v2 only so also update MODULE_LICENSE() to "GPL v2" instead of "GPL". Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: tx4939: use .set_timeAlexandre Belloni2019-03-031-2/+3
| | | | | | | | | | | | Switch from .set_mmss to .set_time as the former is deprecated. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: tx4939: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni2019-03-031-3/+3
| | | | | | | | | | | | | | Call the 64bit versions of rtc_time_to_tm now that the range is enforced by the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: tx4939: set rangeAlexandre Belloni2019-03-031-0/+1
| | | | | | | | | | | | | | The TX4939 RTC is a 48bit counter that counts two on every clock edge of 32.768 KHz oscillator clock so it counts 32bit seconds. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: tx4939: remove useless testAlexandre Belloni2019-03-031-7/+0
| | | | | | | | | | | | | | The tested condition will never happen as the core always passes a fully set struct tm (using rtc_ktime_to_tm) to the .set_alarm callback. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: zynqmp: let the core handle rangeAlexandre Belloni2019-03-031-7/+1
| | | | | | | | | | | | Let the core handle the RTC range instead of open coding it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: zynqmp: fix possible race conditionAlexandre Belloni2019-03-031-3/+7
| | | | | | | | | | | | | | | | | | | | | | The IRQ is requested before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference. Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc struct before requesting the IRQ. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: imx-sc: use rtc_time64_to_tmAlexandre Belloni2019-03-031-1/+1
| | | | | | | | | | | | | | The imx-sc driver properly sets range_max, use rtc_time64_to_tm() instead of the deprecated rtc_time_to_tm() Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: rx8581: Add support for Epson rx8571 RTCBiju Das2019-03-022-11/+108
| | | | | | | | | | | | | | | | | | | | | | 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>
* | rtc: pcf85063: remove dead codeAlexey Roslyakov2019-03-021-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>
* | rtc: remove rtc_class_ops.read_callbackAlexandre Belloni2019-02-251-5/+0
| | | | | | | | | | | | | | | | Since commit 416f0e8056f7 ("RTC: sa1100: Update the sa1100 RTC driver."), the last user of .read_callback is gone. It has been 8 years and now new user appeared. Simply remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: add AB-RTCMC-32.768kHz-EOZ9 RTC supportArtem Panfilov2019-02-183-0/+476
| | | | | | | | | | | | | | | | This patch adds support for AB-RTCMC-32.768kHz-EOZ9 RTC/Calendar module with I2C interface. Signed-off-by: Artem Panfilov <panfilov.artyom@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: hid-sensor-time: stop selecting IIOAlexandre Belloni2019-02-171-2/+1
| | | | | | | | | | | | | | | | Make RTC_DRV_HID_SENSOR_TIME depend on IIO and HID_SENSOR_HUB to remove possible circular dependencies as this is the only symbol selecting those. Suggested-by: Florian Lohoff <f@zz.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: rv3028: add new driverAlexandre Belloni2019-02-173-0/+742
| | | | | | | | | | | | | | | | | | | | | | Add a driver for the MicroCrystal RV-3028. It is a SMT Real-Time Clock Module that incorporates an integrated CMOS circuit together with an XTAL. It has an i2c interface. The driver handles date/time, alarms, trickle charging, timestamping, frequency offset correction, EEPROM and NVRAM. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: isl1208: Add new style nvmem support to driverTrent Piepho2019-02-171-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the RTC's NVRAM using the standard nvmem support that is part of the Linux RTC framework. This driver already has a sysfs attribute that provides access to the RTC's NVRAM as a single 16-bit value. Some chips have more than two bytes of NVRAM, so this will not work for them. It's also non-standard. This sysfs attribute is left in for backward compatibility, but will only be able to read the first two bytes of NVRAM. The nvmem interface will allow access to all NVRAM, e.g. eight bytes on the isl1218. Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Trent Piepho <tpiepho@impinj.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: isl1208: Support more chip variationsTrent Piepho2019-02-171-22/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add more support in the driver for dealing with differences in is1208 compatible chips. Put the 1208, 1209, 1218, and 1219 in the list and encode information about nvram size, tamper, and timestamp features. This adds support for the isl1209, which has a tamper detect but no timestamp feature. Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Trent Piepho <tpiepho@impinj.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: isl1208: Introduce driver state structTrent Piepho2019-02-171-12/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | This driver has no state of its own, depending entirely on what is in the generic rtc device. Intoduce a state struct. For now it only contains a pointer to the rtc device struct, but future patches will add more data. Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Trent Piepho <tpiepho@impinj.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: meson: remove useless rtc_nvmem_unregister callAlexandre Belloni2019-02-171-4/+1
| | | | | | | | | | | | | | | | rtc_nvmem_unregister() is called on rtc_device release so it is not necessary to call it from the driver. Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: support for the Amlogic Meson RTCMartin Blumenstingl2019-02-113-0/+422
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for the RTC block on the 32-bit Amlogic Meson6, Meson8, Meson8b and Meson8m2 SoCs. The RTC is split in to two parts, which are both managed by this driver: - the AHB front end - and a simple serial connection to the actual registers The RTC_COUNTER register which holds the time is 32-bits wide. There are four 32-bit wide (in total: 16 bytes) "regmem" registers which are exposed using nvmem. On Amlogic's 3.10 kernel this is used to store data which needs to survive a suspend / resume cycle. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> [resurrected Ben's patches after 2 years] Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | rtc: rs5c372: Fix reading from rtc when the oscillator got interrupted.Oliver.Rohe@wago.com2019-02-111-7/+47
| | | | | | | | | | | | | | | | | | When the oscillator of the rtc gets interrupted, e.g. due to an empty battery, reading from the rtc will now return an error and the oscillator bit will be cleared, once the rtc is successfully reset. Signed-off-by: Oliver Rohe <oliver.rohe@wago.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>