summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-88pm80x.c
Commit message (Collapse)AuthorAgeFilesLines
* rtc: 88pm80x: convert to SPDX identifierAlexandre Belloni2019-04-041-13/+1Star
| | | | | | Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 88pm80x: fix unintended sign extensionColin Ian King2019-02-081-7/+14
| | | | | | | | | | | | | | | Shifting a u8 by 24 will cause the value to be promoted to an integer. If the top bit of the u8 is set then the following conversion to an unsigned long will sign extend the value causing the upper 32 bits to be set in the result. Fix this by casting the u8 value to an unsigned long before the shift. Detected by CoverityScan, CID#714646-714649 ("Unintended sign extension") Fixes: 2985c29c1964 ("rtc: Add rtc support to 88PM80X PMIC") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 88pm80x: convert to rtc_tm_to_time64/rtc_time64_to_tmAlexandre Belloni2018-05-171-8/+8
| | | | | | | Now that the RTC range is properly checked, convert the driver to rtc_tm_to_time64/rtc_time64_to_tm Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 88pm80x: let the core handle the RTC rangeAlexandre Belloni2018-05-171-6/+2Star
| | | | | | | The 88pm80x RTC is storing the time as a 32bit offset from a 32bit counter so it can handle dates from 0 to U32_MAX. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 88pm80x: fix possible race conditionAlexandre Belloni2018-05-171-4/+8
| | | | | | | | | | | 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 before requesting the IRQ. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 88pm80x: remove unused pm80x_rtc_info membersAlexandre Belloni2018-05-171-2/+0Star
| | | | | | | pm80x_rtc_info.calib_work and pm80x_rtc_info.vrtc are never used, remove them. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 88pm80x: stop setting a default timeAlexandre Belloni2018-05-171-22/+0Star
| | | | | | | It doesn't make sense to set the RTC to a default value at probe time. Let the core handle invalid date and time. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 88pm80x: remove artificial limitationAlexandre Belloni2018-03-271-2/+2
| | | | | | | The 88pm80x supports time up to 2106 (it is a 32 bit counter). Also, the year will never be before 1970 as the RTC core forbids that. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: 88pm80x: add device tree supportVaibhav Hiremath2015-09-051-11/+17
| | | | | | | | | Along with DT support, this patch also cleans up the unnecessary code around 'rtc_wakeup' initialization. Signed-off-by: Chao Xie <chao.xie@marvell.com> Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0Star
| | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
* drivers/rtc/rtc-88pm80x.c: use dev_get_platdata()Jingoo Han2013-11-131-4/+4
| | | | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. This is a cosmetic change to make the code simpler and enhance the readability. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* rtc: rtc-88pm80x: remove unnecessary platform_set_drvdata()Jingoo Han2013-07-041-1/+0Star
| | | | | | | | | | | The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata = NULL when no driver is bound"). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drivers/rtc/rtc-88pm80x.c: add CONFIG_PM_SLEEP to suspend/resume functionsJingoo Han2013-04-301-1/+1
| | | | | | | | | | | | | | Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following build warning when CONFIG_PM_SLEEP is not selected. This is because sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when the CONFIG_PM_SLEEP is enabled. drivers/rtc/rtc-88pm80x.c:238:12: warning: 'pm80x_rtc_suspend' defined but not used [-Wunused-function] drivers/rtc/rtc-88pm80x.c:243:12: warning: 'pm80x_rtc_resume' defined but not used [-Wunused-function] Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* rtc: rtc-88pm80x: use devm_rtc_device_register()Jingoo Han2013-04-301-2/+1Star
| | | | | | | | | devm_rtc_device_register() is device managed and makes cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Drivers: rtc: remove __dev* attributes.Greg Kroah-Hartman2013-01-041-3/+3
| | | | | | | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* rtc/rtc-88pm80x: remove unneed devm_kfreeDevendra Naga2012-08-011-2/+0Star
| | | | | | | | | | | | devm_kzalloc() doesn't need a matching devm_kfree(), the freeing mechanism will trigger when driver unloads. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Ashish Jangam <ashish.jangam@kpitcummins.com> Cc: David Dajun Chen <dchen@diasemi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* rtc/rtc-88pm80x: assign ret only when rtc_register_driver failsDevendra Naga2012-08-011-1/+1
| | | | | | | | | | | | | At the probe we are assigning ret to return value of PTR_ERR right after the rtc_register_drive()r, as we would have done it in the if (IS_ERR(ptr)) check, since the function fails and goes inside that case Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Ashish Jangam <ashish.jangam@kpitcummins.com> Cc: David Dajun Chen <dchen@diasemi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* rtc: Add rtc support to 88PM80X PMICQiao Zhou2012-07-091-0/+371
add rtc driver for MARVELL 88PM80X PMIC and enable rtc function. Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Qiao Zhou <zhouqiao@marvell.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>