aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2019-05-08rtc: pcap: set rangeAlexandre Belloni
While PCAP_RTC_DAY_MASK is set to 0x3ffff, it is very unlikely to be correct as this ends in june 1992, before the product even existed. It is more likely to be a 14-bit day counter. The next product in the family (the mc13xxx) has a 15-bit day counter. The same issue is seen with PCAP_RTC_TOD_MASK which only has 65535 seconds and falls short of the necessary 86400 seconds. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-05-08rtc: digicolor: convert to SPDX identifierAlexandre Belloni
Use SPDX-License-Identifier instead of a verbose license text. Acked-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-05-08rtc: digicolor: use .set_timeAlexandre Belloni
Use .set_time instead of the deprecated .set_mmss. Acked-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-05-08rtc: digicolor: set rangeAlexandre Belloni
While the range of REFERENCE + TIME is actually 33 bits, the counter itself (TIME) is a 32-bits seconds counter. Acked-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-05-08rtc: digicolor: fix possible race conditionAlexandre Belloni
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. Acked-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-30rtc: jz4740: convert to SPDX identifierAlexandre Belloni
Use SPDX-License-Identifier instead of a verbose license text. Tested-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-30rtc: jz4740: rework invalid time detectionAlexandre Belloni
The scratchpad register is used to detect an invalid time when power to the RTC has been lost. Instead of deleting that precious information and set the time to the UNIX epoch, forward it to userspace. Tested-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-30rtc: jz4740: use dev_pm_set_wake_irq() to simplify codeAlexandre Belloni
Use dev_pm_set_wake_irq() to set the RTC as a wakeup source for suspend. This allows to remove the whole dev_pm_ops structure. Tested-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-30rtc: jz4740: use .set_timeAlexandre Belloni
Use .set_time instead of the deprecated .set_mmss. Tested-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-30rtc: jz4740: remove useless checkAlexandre Belloni
rtc_time64_to_tm always returns a valid tm, it is not necessary to validate it. Tested-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-30rtc: jz4740: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni
Call the 64bit versions of rtc_tm time conversion now that the range is enforced by the core. Tested-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-30rtc: jz4740: set rangeAlexandre Belloni
RTC_SEC is a 32-bit seconds counter. Tested-by: Mathieu Malaterre <malat@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: 88pm860x: prevent use-after-free on device removeSven Van Asbroeck
The device's remove() attempts to shut down the delayed_work scheduled on the kernel-global workqueue by calling flush_scheduled_work(). Unfortunately, flush_scheduled_work() does not prevent the delayed_work from re-scheduling itself. The delayed_work might run after the device has been removed, and touch the already de-allocated info structure. This is a potential use-after-free. Fix by calling cancel_delayed_work_sync() during remove(): this ensures that the delayed work is properly cancelled, is no longer running, and is not able to re-schedule itself. This issue was detected with the help of Coccinelle. Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: Use dev_get_drvdata()Kefeng Wang
Using dev_get_drvdata directly. Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: linux-rtc@vger.kernel.org Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: imxdi: convert to SPDX identifierAlexandre Belloni
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: imxdi: remove unnecessary checkAlexandre Belloni
The RTC core already ensures the alarm is set to a time in the future, it is not necessary to check again in the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: imxdi: use .set_timeAlexandre Belloni
Use .set_time instead of the deprecated .set_mmss. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: imxdi: switch to rtc_time64_to_tm/rtc_tm_to_time64Alexandre Belloni
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-29rtc: imxdi: set rangeAlexandre Belloni
The RTC Time Counter MSB Register contains the 32 most significant bits (47:16) of the 47-bit RTC Time Counter. Clocked by a 32.768 KHz clock, this register is effectively a 32-bit seconds counter. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: mxc: use .set_timeAlexandre Belloni
Use .set_time instead of the deprecated .set_mmss64. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: mxc: set rangeAlexandre Belloni
Let the core handle the range, and in particular the imx1 offsetting. This has the benefit of extending the range of the RTC further than 365 days and making .read_time useful again on imx1. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: mxc: fix possible race conditionAlexandre Belloni
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>
2019-04-29rtc: stm32: manage the get_irq probe defer caseFabien Dessenne
Manage the -EPROBE_DEFER error case for the wake IRQ. Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Acked-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: rx6110: declare missing of tableDaniel Gomez
Add missing <of_device_id> table for SPI driver relying on SPI device match since compatible is in a DT binding or in a DTS. Before this patch: modinfo drivers/rtc/rtc-rx6110.ko | grep alias alias: spi:rx6110 After this patch: modinfo drivers/rtc/rtc-rx6110.ko | grep alias alias: spi:rx6110 alias: of:N*T*Cepson,rx6110C* alias: of:N*T*Cepson,rx6110 Reported-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Daniel Gomez <dagmcr@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: wm831x: use .set_timeAlexandre Belloni
Use .set_time instead of the deprecated .set_mmss. Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ds2404: simplify .probe and remove .removeAlexandre Belloni
Use devm_add_action_or_reset to simplify .probe and remove .remove Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ds2404: remove ds2404_chip_opsAlexandre Belloni
There is only one ds2404_chip_ops struct that is implemented, remove the unnecessary indirection. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ds2404: convert to SPDX identifierAlexandre Belloni
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 Belloni
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 Belloni
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 Belloni
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 Belloni
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 Belloni
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 Belloni
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 Belloni
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 Belloni
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 Belloni
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 Belloni
This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-19rtc: ep93xx: stop setting platform_dataAlexandre Belloni
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 Nandor
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 Belloni
Use unsigned int instead of unsigned. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16rtc: mc13xxx: convert to SPDX identifierAlexandre Belloni
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 Belloni
Use .set_time instead of the deprecated .set_mmss64. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-16rtc: mc13xxx: set rangeAlexandre Belloni
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 Bogendoerfer
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 Bogendoerfer
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-12rtc: ds1685: fix crash caused by referencing wrong device structThomas Bogendoerfer
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 Belloni
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 Belloni
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 Belloni
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>