Commit Graph

824818 Commits

Author SHA1 Message Date
Alexandre Belloni 53523216ba rtc: ds2404: switch to rtc_time64_to_tm
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-19 22:37:16 +02:00
Alexandre Belloni 13bfa94225 rtc: ds2404: set range
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-19 22:37:16 +02:00
Alexandre Belloni d71c771532 rtc: ep93xx: fix checkpatch issues
Fix sysfs attribute declaration as suggested by checkpatch.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19 22:37:16 +02:00
Alexandre Belloni 4fdf4d237f rtc: ep93xx: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19 22:37:16 +02:00
Alexandre Belloni ef9440a2e3 rtc: ep93xx: use .set_time
Use .set_time instead of the deprecated .set_mmss.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19 22:37:16 +02:00
Alexandre Belloni 886a77e73e rtc: ep93xx: switch to rtc_time64_to_tm
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-19 22:37:16 +02:00
Alexandre Belloni 2d4fc6df77 rtc: ep93xx: set range
The ep93xx RTC is a 32-bit seconds counter.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19 22:37:16 +02:00
Alexandre Belloni 09cd030b54 rtc: ep93xx: use rtc_add_group
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-19 22:37:16 +02:00
Alexandre Belloni bac68b30d5 rtc: ep93xx: convert to devm_rtc_allocate_device
This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19 22:37:16 +02:00
Alexandre Belloni b809d192eb rtc: ep93xx: stop setting platform_data
Since commit 28dc5f8038 ("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-19 22:37:16 +02:00
Han Nandor 9eec31f310 rtc: ds3232: get SRAM access using NVMEM Framework
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-19 22:36:55 +02:00
Alexandre Belloni 9fc0fd5077 rtc: mc13xxx: fix style issue
Use unsigned int instead of unsigned.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16 18:06:54 +02:00
Alexandre Belloni edd6d79ece rtc: mc13xxx: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16 18:06:53 +02:00
Alexandre Belloni eee86deafe rtc: mc13xxx: use .set_time
Use .set_time instead of the deprecated .set_mmss64.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16 18:06:51 +02:00
Alexandre Belloni e4ae7023e1 rtc: mc13xxx: set range
All supported PMICs have a 15 bits days counter and hours, minutes, seconds

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16 18:06:49 +02:00
Thomas Bogendoerfer 3b6bddda2f rtc: ds1685: use threaded interrupt
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: aaaf5fbf56 ("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-16 18:03:48 +02:00
Thomas Bogendoerfer e330c3d547 rtc: ds1685: remove dead code
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-16 18:03:46 +02:00
Thomas Bogendoerfer 692802d26b rtc: ds1685: fix crash caused by referencing wrong device struct
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: cfb74916e2 ("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-12 12:23:20 +02:00
Alexandre Belloni 7342e2a73a rtc: lpc32xx: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12 12:23:20 +02:00
Alexandre Belloni 34b21c9ee8 rtc: lpc32xx: use .set_time
Use .set_time instead of the deprecated .set_mmss.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12 12:23:20 +02:00
Alexandre Belloni f04dd349a3 rtc: lpc32xx: switch to rtc_time64_to_tm/rtc_tm_to_time64
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-12 12:23:20 +02:00
Alexandre Belloni ba4a84f5ab rtc: lpc32xx: simplify IRQ setup
Move the optional IRQ setup to a single location.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12 12:23:20 +02:00
Alexandre Belloni 3a13426908 rtc: lpc32xx: set range
The LPC32xx RTC is a 32bit second counter.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12 12:23:20 +02:00
Alexandre Belloni 6bbad585fd rtc: lpc32xx: convert to devm_rtc_allocate_device
This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-12 12:23:20 +02:00
Anson Huang fbc5ee9a69 rtc: mxc_v2: use dev_pm_set_wake_irq() to simplify code
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-11 23:18:33 +02:00
Anson Huang bc0e731fc2 rtc: mxc: use dev_pm_set_wake_irq() to simplify code
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-11 23:18:32 +02:00
Andy Shevchenko 862cac15d2 rtc: rx8025: Fix a parameter to %ptR in rx8025_read_alarm()
The commit 1921cab117 ("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-11 23:18:30 +02:00
YueHaibing 153a9177c1 rtc: sirfsoc: Make sysrtc_regmap_config static
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-11 23:18:27 +02:00
Alexandre Belloni ac2ae48efa rtc: ab3100: convert to SPDX identifier
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-11 16:42:55 +02:00
Alexandre Belloni 0dca027bb8 rtc: ab3100: use .set_time
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-11 16:42:55 +02:00
Alexandre Belloni 386b5941a0 rtc: ab3100: set range
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-11 16:42:55 +02:00
Alexandre Belloni 56573ca7ee rtc: pcf85363: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11 16:42:55 +02:00
Alexandre Belloni b21a841c4c rtc: pcf85363: remove useless forward declaration
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-11 16:42:55 +02:00
Alexandre Belloni 176a5ee32c rtc: pcf85363: remove bogus i2c functionality check
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-11 16:42:55 +02:00
Alexandre Belloni c0ec8319cc rtc: pcf85363: set range
This is a standard BCD RTC that will fail in 2100.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11 16:42:55 +02:00
Alexandre Belloni 8f7b1d718a rtc: pcf85363: remove unused struct pcf85363 member
pcf85363->dev is unused, remove it.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11 16:42:55 +02:00
Alexandre Belloni 838d2d9165 rtc: stmp3xxx: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11 16:42:55 +02:00
Alexandre Belloni 622eb9b487 rtc: stmp3xxx: use .set_time
Use .set_time instead of the deprecated .set_mmss.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-11 16:42:55 +02:00
Alexandre Belloni a659a08180 rtc: stmp3xxx: switch to rtc_time64_to_tm/rtc_tm_to_time64
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-11 16:42:54 +02:00
Alexandre Belloni 0d823abd7c rtc: stmp3xxx: set range
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-11 16:42:51 +02:00
Alexandre Belloni b6838275be rtc: tegra: convert to SPDX identifier
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-08 15:05:26 +02:00
Alexandre Belloni 34ea0ac3e2 rtc: tegra: switch to rtc_time64_to_tm/rtc_tm_to_time64
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-08 15:05:23 +02:00
Alexandre Belloni e108980246 rtc: tegra: set range
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-08 15:05:19 +02:00
Alexandre Belloni 7d624621b7 rtc: coh901331: convert to SPDX identifier
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-08 14:40:12 +02:00
Alexandre Belloni febad79460 rtc: coh901331: use .set_time
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-08 14:40:09 +02:00
Alexandre Belloni 9cf2f9b5ad rtc: coh901331: switch to rtc_time64_to_tm/rtc_tm_to_time64
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>
2019-04-08 14:40:05 +02:00
Alexandre Belloni 06cfd668ec rtc: coh901331: set range
The COH 901 331 is a 32bit seconds counter.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08 14:39:59 +02:00
Alexandre Belloni e3a7691321 rtc: ds1672: switch debug message to %ptR
Use %ptR to simplify debug message.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08 14:35:46 +02:00
Alexandre Belloni 69468320a9 rtc: ds1672: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08 14:35:40 +02:00
Alexandre Belloni 219219d9b8 rtc: ds1672: use .set_time
Use .set_time instead of the deprecated .set_mmss.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-08 14:35:38 +02:00