Commit Graph

3141 Commits

Author SHA1 Message Date
Alexandre Belloni
191c0da112 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>
2019-04-04 10:07:11 +02:00
Alexandre Belloni
de311aa8d4 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>
2019-04-04 10:07:11 +02:00
Alexandre Belloni
0f21700ac4 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>
2019-04-04 10:07:11 +02:00
Anson Huang
0c46b07ce4 rtc: snvs: use devm_platform_ioremap_resource() to simplify code
Use the new helper devm_platform_ioremap_resource() which wraps the
platform_get_resource() and devm_ioremap_resource() together, to
simplify the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:11 +02:00
Anson Huang
cf37fa79a7 rtc: mxc: use devm_platform_ioremap_resource() to simplify code
Use the new helper devm_platform_ioremap_resource() which wraps the
platform_get_resource() and devm_ioremap_resource() together, to
simplify the code.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:11 +02:00
Anson Huang
e7afddb2b4 rtc: snvs: use dev_pm_set_wake_irq() to simplify code
With calling dev_pm_set_wake_irq() to set SNVS 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-04 10:07:11 +02:00
Joel Stanley
184a182ed5 rtc: Add ASPEED RTC driver
Read and writes the time to the non-battery backed RTC in the ASPEED BMC
system on chip families.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
9a8f2d12ff rtc: brcmstb-waketimer: switch to rtc_time64_to_tm
Call the 64bit version of rtc_time_to_tm as the range is enforced by the
core.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Pi-Hsun Shih
24db953e94 rtc: mt6397: Don't call irq_dispose_mapping.
The IRQ mapping was changed to not being created in the rtc-mt6397
driver, so the irq_dispose_mapping is no longer needed.
Also the dev_id passed to free_irq should be the same as the last
argument passed to request_threaded_irq.
This prevents a "Trying to free already-free IRQ 274" warning when
unbinding the driver.

Fixes: e695d3a0b3 ("mfd: mt6397: Create irq mappings in mfd core driver")
Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
YueHaibing
fd86b2d4bb rtc: opal: Make opal_tpo_alarm_irq_enable static
Fix sparse warning:

drivers/rtc/rtc-opal.c:227:5:
 warning: symbol 'opal_tpo_alarm_irq_enable' was not declared. Should it be static?

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
e07fa839d9 rtc: wm831x: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
2399244988 rtc: wm831x: 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: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
d315bc1be9 rtc: wm831x: remove unnecessary goto
There is no specific handling in the error path of wm831x_rtc_probe, remove
the unnecessary goto and label.

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
b9a1d801a9 rtc: wm831x: set range
The wm831x has a 32bit second counter.

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
b599db3a9f rtc: da9063: 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: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
5ff404d149 rtc: da9063: set range
The DA9062 and DA9063 have a year register that can go up to 0x3F.

Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
64bef02c92 rtc: sun4v: switch to SPDX identifier
Use SPDX-License-Identifier to be clearer on the license. Choose the v2
only as this is the default Linux license.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
3ec99d6136 rtc: sun4v: set range
The Sun4v Hypervisor Core API Specification states:
Time is described by a single unsigned 64-bit word equivalent to a time_t
for the POSIX time(2) system call. The word contains the time since the
Epoch (00:00:00 UTC, January 1, 1970), measured in seconds.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
65c6f638d6 rtc: sun4v: switch to rtc_time64_to_tm/rtc_tm_to_time64
Call the 64bit versions of rtc_tm time conversion as the hypervisor handles
64bit values.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
58c92990cc rtc: omap: 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-04 10:07:10 +02:00
Alexandre Belloni
28c6852e47 rtc: omap: switch to rtc_time64_to_tm/rtc_tm_to_time64
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>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
72dd89c0bc rtc: ps3: set range
The PS3 has a 64bit second counter from 2000. While this exceeds the 64bit
UNIX timestamp, there is not doubt that non of them will still be working
by then.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:10 +02:00
Alexandre Belloni
0b5e47bbaa rtc: ps3: convert to devm_rtc_allocate_device
This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
e85b930bc6 rtc: ps3: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
70c805c23f rtc: ps3: switch to rtc_time64_to_tm/rtc_tm_to_time64
Call the 64bit versions of rtc_tm time conversion as the PS3 handles 64bit
values.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
be8bf986c0 rtc: at91sam9: correct trivial checkpatch warnings
Correct trivial checkpatch warnings, mostly whitespace issues and
unbalanced braces.

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
bc40072d71 rtc: at91sam9: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
8af760a3ec rtc: at91sam9: switch to rtc_time64_to_tm/rtc_tm_to_time64
Call the 64bit versions of rtc_tm time conversion as the range is enforced
by the core.

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
255c43ca01 rtc: at91sam9: set range
The AT91 RTT is a 32bit second counter that is saved in a 32bit global
purpose register.

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
6c7293e729 rtc: at91sam9: convert to devm_rtc_allocate_device
This allows further improvement of the driver.

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
1a76a77c88 rtc: at91sam9: drop platform_data support
ARCH_AT91 is DT only for a while, drop platform data support.

Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
beee05dfbe rtc: sh: set range
The SH RTC is a BCD RTC with some version having 4 digits for the year.

The range for the RTCs with only 2 digits for the year was unfortunately
shifted to handle 1999 to 2098.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
1097998d27 rtc: sh: fix possible race condition
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.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
9852023d20 rtc: sh: stop resetting time to epoch
There is no point in resetting the time to epoch as this means that
userspace will never get the valuable information that time is actually
invalid.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
[Anders Roxell <anders.roxell@linaro.org>: remove unused variable r]
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
c1576497b2 rtc: dm355evm: 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-04 10:07:09 +02:00
Alexandre Belloni
c5655adc02 rtc: dm355evm: switch to rtc_time64_to_tm/rtc_tm_to_time64
Call the 64bit versions of rtc_tm time conversion as the range is enforced
by the core.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
4bc85a3873 rtc: dm355evm: set range
The MSP430 has a 32bit second counter.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
c50fd69a4f rtc: dm355evm: convert to devm_rtc_allocate_device
This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
2be7f1b5d0 rtc: goldfish: 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-04 10:07:09 +02:00
Alexandre Belloni
b509306d1f rtc: goldfish: switch to rtc_time64_to_tm/rtc_tm_to_time64
This RTC handles dates after 2106 (up to July 2554), call the 64bit
versions of rtc_tm time conversion.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:09 +02:00
Alexandre Belloni
6a6ec8c15d rtc: goldfish: allow building on more than MIPS
Goldfish can be ARM or x86, allow building the driver for more than just
MIPS.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:08 +02:00
Alexandre Belloni
bd01386e2c rtc: goldfish: sort headers
Sort headers alphabetically.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:08 +02:00
Alexandre Belloni
5e2954fd8e rtc: goldfish: add range
This RTC has a 64bit nanosecond counter.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:08 +02:00
Alexandre Belloni
409b84e3eb rtc: goldfish: convert to devm_rtc_allocate_device
This allows further improvement of the driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:08 +02:00
Alexandre Belloni
58f889150a rtc: xgene: use .set_time
Use .set_time instead of the deprecated .set_mmss.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:08 +02:00
Alexandre Belloni
43f327fa48 rtc: xgene: switch to rtc_time64_to_tm/rtc_tm_to_time64
Call the 64bit versions of rtc_tm time conversion as the range is enforced
by the core.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:08 +02:00
Alexandre Belloni
9a842a7ebb rtc: xgene: stop caching alarm_time
There is no point in caching alarm_time for .read_alarm because
.read_alarm is only called at boo time and thus alarm_time is always 0.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:08 +02:00
Alexandre Belloni
db7853414b rtc: xgene: correct checkpatch issues
Correct trivial whitespace issues. Also sort the headers.

Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-04 10:07:08 +02:00
Alexandre Belloni
3a205b9dc8 rtc: xgene: 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-04 10:07:08 +02:00
Alexandre Belloni
490595abfd rtc: xgene: set range
CCVR is a 32bit second counter.

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