aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-zynqmp.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-08-13rtc: Remove dev_err() usage after platform_get_irq()Stephen Boyd1-6/+2
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: linux-rtc@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Stephen Boyd <swboyd@chromium.org> Link: https://lore.kernel.org/r/20190730181557.90391-40-swboyd@chromium.org Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-03-18rtc: zynqmp: convert to SPDX identifierAlexandre Belloni1-12/+1
Use SPDX-License-Identifier instead of a verbose license text. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-03-03rtc: zynqmp: let the core handle rangeAlexandre Belloni1-7/+1
Let the core handle the RTC range instead of open coding it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-03-03rtc: zynqmp: fix possible race conditionAlexandre Belloni1-3/+7
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>
2018-05-03rtc: simplify getting .drvdataWolfram Sang1-6/+4
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Michal Simek <michal.simek@xilinx.com> (for zynqmp) Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2018-03-01rtc: stop validating rtc_time after rtc_time64_to_tmAlexandre Belloni1-1/+1
rtc_time64_to_tm never generates an invalid tm. It is not necessary to validate it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2016-05-20rtc: zynqmp: Update seconds time programming logicAnurag Kumar Vulisha1-6/+39
We program RTC time using SET_TIME_WRITE register and read the RTC current time using CURRENT_TIME register. When we set the time by writing into SET_TIME_WRITE Register and immediately try to read the rtc time from CURRENT_TIME register, the previous old value is returned instead of the new loaded time. This is because RTC takes nearly 1 sec to update the new loaded value into the CURRENT_TIME register. This behaviour is expected in our RTC IP. This patch updates the driver to read the current time from SET_TIME_WRITE register instead of CURRENT_TIME when rtc time is requested within an 1sec period after setting the RTC time. Doing so will ensure the correct time is given to the user. Since there is a delay of 1sec in updating the CURRENT_TIME we are loading set time +1sec while programming the SET_TIME_WRITE register, doing this will give correct time without any delay when read from CURRENT_TIME. Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: zynqmp: Write Calibration value before setting timeAnurag Kumar Vulisha1-7/+14
It is suggested to program CALIB_WRITE register with the calibration value before updating the SET_TIME_WRITE register, doing so will clear the Tick Counter and force the next second to be signaled exactly in 1 second. Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: zynqmp: Enable RTC switching to battery power when VCC_PSAUX is N/AAnurag Kumar Vulisha1-0/+8
In order to conserve battery energy, during the PS operation, it is expected that the supply for the battery-powered domain to be switched from the battery (VCC_PSBATT) to (VCC_PSAUX) and automatically be switched back to battery when VCC_PSAUX voltage drops below a limit, doing so prevents the logic within the battery-powered domain from functioning incorrectly. Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2015-09-05rtc: add xilinx zynqmp rtc driverSuneel Garapati1-0/+279
Add support for RTC controller found on Xilinx Zynq Ultrascale+ MPSoC platform. Signed-off-by: Suneel Garapati <suneel.garapati@xilinx.com> Acked-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>