summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2019-04-30rtc: jz4740: use dev_pm_set_wake_irq() to simplify codeAlexandre Belloni1-30/+7
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 Belloni1-3/+3
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 Belloni1-1/+1
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 Belloni1-5/+3
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 Belloni1-2/+10
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 Asbroeck1-1/+1
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 Wang6-38/+21
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 Belloni1-11/+1
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 Belloni1-9/+1
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 Belloni1-3/+3
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 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-29rtc: imxdi: set rangeAlexandre Belloni1-5/+10
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 Belloni1-2/+4
Use .set_time instead of the deprecated .set_mmss64. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-04-29rtc: mxc: set rangeAlexandre Belloni1-13/+17
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 Belloni1-7/+9
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 Dessenne1-3/+6
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 Gomez1-0/+9
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 Belloni1-3/+5
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 Belloni1-18/+7
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 Belloni1-19/+3
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 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-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-12rtc: 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-12rtc: 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-12rtc: 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-12rtc: 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>