aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-04-19rtc: ds2404: convert to SPDX identifierAlexandre Belloni1-8/+2
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ds2404: use .set_timeAlexandre Belloni1-3/+3
Use .set_time instead of the deprecated .set_mmss. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ds2404: switch to rtc_time64_to_tmAlexandre Belloni1-1/+1
Call the 64bit version of rtc_time_to_tm now that the range is enforced by the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ds2404: set rangeAlexandre Belloni1-5/+9
The real-time clock is a 5-byte binary counter. It is incremented 256 times per second. The least significant byte is a count of fractional seconds. The upper four bytes are a count of seconds. The realtime clock can accumulate 136 years of seconds before rolling over. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ep93xx: fix checkpatch issuesAlexandre Belloni1-9/+9
Fix sysfs attribute declaration as suggested by checkpatch. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ep93xx: convert to SPDX identifierAlexandre Belloni1-4/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ep93xx: use .set_timeAlexandre Belloni1-2/+3
Use .set_time instead of the deprecated .set_mmss. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ep93xx: switch to rtc_time64_to_tmAlexandre Belloni1-1/+1
Call the 64bit version of rtc_time_to_tm now that the range is enforced by the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ep93xx: set rangeAlexandre Belloni1-0/+1
The ep93xx RTC is a 32-bit seconds counter. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ep93xx: use rtc_add_groupAlexandre Belloni1-16/+4
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>
2019-04-19rtc: ep93xx: convert to devm_rtc_allocate_deviceAlexandre Belloni1-2/+7
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ep93xx: stop setting platform_dataAlexandre Belloni1-15/+3
Since commit 28dc5f803899 ("drivers/rtc/rtc-ep93xx.c: use dev_get_platdata()"), platform_data is not used directly, it is not necessary to set it anymore. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ds3232: get SRAM access using NVMEM FrameworkHan Nandor1-2/+38
DS3232 RTC has 236 bytes of persistent memory. Add RTC SRAM read and write access using the NVMEM Framework. Signed-off-by: Han Nandor <nandor.han@vaisala.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16rtc: mc13xxx: fix style issueAlexandre Belloni1-1/+1
Use unsigned int instead of unsigned. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16rtc: mc13xxx: convert to SPDX identifierAlexandre Belloni1-4/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16rtc: mc13xxx: use .set_timeAlexandre Belloni1-3/+3
Use .set_time instead of the deprecated .set_mmss64. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16rtc: mc13xxx: set rangeAlexandre Belloni1-2/+10
All supported PMICs have a 15 bits days counter and hours, minutes, seconds Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16rtc: ds1685: use threaded interruptThomas Bogendoerfer1-116/+104
Handling of extended interrupts (kickstart, wake-up, ram-clear) was moved off to a work queue, but the interrupts aren't acknowledged in the interrupt handler. This leads to a deadlock, if driver is used with interrupts. To fix this we use a threaded interrupt, get rid of the work queue and do locking with just the rtc mutex lock. Fixes: aaaf5fbf56f1 ("rtc: add driver for DS1685 family of real time clocks") Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16rtc: ds1685: remove dead codeThomas Bogendoerfer1-36/+0
ds1685_rtc_begin_ctrl_access/ds1685_rtc_end_ctrl_access aren't used, so get rid of it. Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-15platform/chrome: wilco_ec: Standardize mailbox interfaceNick Crews1-24/+39
The current API for the wilco EC mailbox interface is bad. It assumes that most messages sent to the EC follow a similar structure, with a command byte in MBOX[0], followed by a junk byte, followed by actual data. This doesn't happen in several cases, such as setting the RTC time, using the raw debugfs interface, and reading or writing properties such as the Peak Shift policy (this last to be submitted soon). Similarly for the response message from the EC, the current interface assumes that the first byte of data is always 0, and the second byte is unused. However, in both setting and getting the RTC time, in the debugfs interface, and for reading and writing properties, this isn't true. The current way to resolve this is to use WILCO_EC_FLAG_RAW* flags to specify when and when not to skip these initial bytes in the sent and received message. They are confusing and used so much that they are normal, and not exceptions. In addition, the first byte of response in the debugfs interface is still always skipped, which is weird, since this raw interface should be giving the entire result. Additionally, sent messages assume the first byte is a command, and so struct wilco_ec_message contains the "command" field. In setting or getting properties however, the first byte is not a command, and so this field has to be filled with a byte that isn't actually a command. This is again inconsistent. wilco_ec_message contains a result field as well, copied from wilco_ec_response->result. The message result field should be removed: if the message fails, the cause is already logged, and the callers are alerted. They will never care about the actual state of the result flag. These flags and different cases make the wilco_ec_transfer() function, used in wilco_ec_mailbox(), really gross, dealing with a bunch of different cases. It's difficult to figure out what it is doing. Finally, making these assumptions about the structure of a message make it so that the messages do not correspond well with the specification for the EC's mailbox interface. For instance, this interface specification may say that MBOX[9] in the received message contains some information, but the calling code needs to remember that the first byte of response is always skipped, and because it didn't set the RESPONSE_RAW flag, the next byte is also skipped, so this information is actually contained within wilco_ec_message->response_data[7]. This makes it difficult to maintain this code in the future. To fix these problems this patch standardizes the mailbox interface by: - Removing the WILCO_EC_FLAG_RAW* flags - Removing the command and reserved_raw bytes from wilco_ec_request - Removing the mbox0 byte from wilco_ec_response - Simplifying wilco_ec_transfer() because of these changes - Gives the callers of wilco_ec_mailbox() the responsibility of exactly and consistently defining the structure of the mailbox request and response - Removing command and result from wilco_ec_message. This results in the reduction of total code, and makes it much more maintainable and understandable. Signed-off-by: Nick Crews <ncrews@chromium.org> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
2019-04-12rtc: ds1685: fix crash caused by referencing wrong device structThomas Bogendoerfer1-3/+3
sysfs entries added by rtc_add_group are called with the rtc device as argument and not the underlying device. Fixed by using the dev->parent Fixes: cfb74916e2ec ("rtc: ds1685: use rtc_add_group") Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12rtc: lpc32xx: convert to SPDX identifierAlexandre Belloni1-9/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12rtc: lpc32xx: use .set_timeAlexandre Belloni1-2/+3
Use .set_time instead of the deprecated .set_mmss. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12rtc: lpc32xx: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-8/+3
Call the 64bit versions of rtc_tm time conversion now that the range is enforced by the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12rtc: lpc32xx: simplify IRQ setupAlexandre Belloni1-10/+5
Move the optional IRQ setup to a single location. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12rtc: lpc32xx: set rangeAlexandre Belloni1-0/+1
The LPC32xx RTC is a 32bit second counter. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12rtc: lpc32xx: convert to devm_rtc_allocate_deviceAlexandre Belloni1-9/+10
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: mxc_v2: use dev_pm_set_wake_irq() to simplify codeAnson Huang1-25/+4
With calling dev_pm_set_wake_irq() to set MXC_V2 RTC as wakeup source for suspend, generic wake irq mechanism will automatically enable it as wakeup source when suspend, then the suspend/resume callback which are ONLY for enabling/disabling irq wake can be removed, it simplifies the code. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: mxc: use dev_pm_set_wake_irq() to simplify codeAnson Huang1-26/+6
With calling dev_pm_set_wake_irq() to set MXC RTC as wakeup source for suspend, generic wake irq mechanism will automatically enable it as wakeup source when suspend, then the suspend/resume callback which are ONLY for enabling/disabling irq wake can be removed, it simplifies the code. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: rx8025: Fix a parameter to %ptR in rx8025_read_alarm()Andy Shevchenko1-1/+1
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>
2019-04-11rtc: sirfsoc: Make sysrtc_regmap_config staticYueHaibing1-1/+1
Fix sparse warning: drivers/rtc/rtc-sirfsoc.c:282:28: warning: symbol 'sysrtc_regmap_config' was not declared. Should it be static? Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: ab3100: convert to SPDX identifierAlexandre Belloni1-1/+1
Use SPDX-License-Identifier instead of the custom license line. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: ab3100: use .set_timeAlexandre Belloni1-3/+3
Use .set_time instead of the deprecated .set_mmss64. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: ab3100: set rangeAlexandre Belloni1-7/+9
The ab3100 has a 48bit counter running at 65536 Hz (despite one of the comment). The max value is then (2^48 - 1)/2^16 == 2^32 - 1. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: pcf85363: 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-11rtc: pcf85363: remove useless forward declarationAlexandre Belloni1-2/+0
It is not necessary to forward declare pcf85363_driver as it is not used before being declared. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: pcf85363: remove bogus i2c functionality checkAlexandre Belloni1-3/+0
regmap is abstracting the i2c functionalities the best it can, there is no need to check. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: pcf85363: set rangeAlexandre Belloni1-0/+2
This is a standard BCD RTC that will fail in 2100. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: pcf85363: remove unused struct pcf85363 memberAlexandre Belloni1-4/+2
pcf85363->dev is unused, remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: stmp3xxx: convert to SPDX identifierAlexandre Belloni1-9/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: stmp3xxx: use .set_timeAlexandre Belloni1-3/+3
Use .set_time instead of the deprecated .set_mmss. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: stmp3xxx: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-5/+3
Call the 64bit versions of rtc_tm time conversion now that the range is enforced by the core. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11rtc: stmp3xxx: set rangeAlexandre Belloni1-2/+8
From the datasheet: "HW_RTC_SECONDS provides access to the 32-bit real-time seconds counter." Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08rtc: OMAP: Add support for rtc-only modeKeerthy1-9/+42
Prepare rtc driver for rtc-only with DDR in self-refresh mode. omap_rtc_power_off now should cater to two features: 1) RTC plus DDR in self-refresh is power a saving mode where in the entire system including the different voltage rails from PMIC are shutdown except the ones feeding on to RTC and DDR. DDR is kept in self-refresh hence the contents are preserved. RTC ALARM2 is connected to PMIC_EN line once we the ALARM2 is triggered we enter the mode with DDR in self-refresh and RTC Ticking. After a predetermined time an RTC ALARM1 triggers waking up the system[1]. The control goes to bootloader. The bootloader then checks RTC scratchpad registers to confirm it was an rtc_only wakeup and follows a different path, configure bare minimal clocks for ddr and then jumps to the resume address in another RTC scratchpad registers and transfers the control to Kernel. Kernel then restores the saved context. omap_rtc_power_off_program does the ALARM2 programming part. [1] http://www.ti.com/lit/ug/spruhl7h/spruhl7h.pdf Page 2884 2) Power-off: This is usual poweroff mode. omap_rtc_power_off calls the above omap_rtc_power_off_program function and in addition to that programs the OMAP_RTC_PMIC_REG for any external wake ups for PMIC like the pushbutton and shuts off the PMIC. Hence the split in omap_rtc_power_off. Signed-off-by: Keerthy <j-keerthy@ti.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> [tony@atomide.com: folded in a fix for compile warning] Signed-off-by: Tony Lindgren <tony@atomide.com>
2019-04-08rtc: tegra: convert to SPDX identifierAlexandre Belloni1-14/+1
Use SPDX-License-Identifier instead of a verbose license text. Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08rtc: tegra: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-4/+4
Call the 64bit versions of rtc_tm time conversion now that the range is enforced by the core. Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08rtc: tegra: set rangeAlexandre Belloni1-10/+14
The Tegra 20 RTC is a 32bit seconds counter (with an unused millisecond counter). Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08rtc: coh901331: convert to SPDX identifierAlexandre Belloni1-1/+1
Use SPDX-License-Identifier instead of the custom license line. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08rtc: coh901331: use .set_timeAlexandre Belloni1-3/+3
Use .set_time instead of the deprecated .set_mmss. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08rtc: coh901331: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni1-7/+7
Call the 64bit versions of rtc_tm time conversion now that the range is enforced by the core. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>