- 08 Nov, 2019 13 commits
-
-
Ilya Ledvich authored
The RTC month value is 1-indexed, but the kernel assumes it is 0-indexed. This may result in the RTC not rolling over correctly. Signed-off-by: Ilya Ledvich <ilya@compulab.co.il> Reviewed-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Link: https://lore.kernel.org/r/20191101095422.14787-1-ilya@compulab.co.ilSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Chuhong Yuan authored
This driver forgets to disable and unprepare clock when remove. Add a call to clk_disable_unprepare to fix it. Fixes: c4f07ece ("rtc: brcmstb-waketimer: Add Broadcom STB wake-timer") Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20191105160043.20018-1-hslester96@gmail.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Let the rtc core check the date/time against the RTC range. Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20191016201414.30934-2-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
The RTC core now has error messages in case of registration failure, there is no need to have other messages in the drivers. Reviewed-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20191016201414.30934-1-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
dpm_sysfs_remove() and device_pm_remove() are already called by device_del() on device removal so there is no need to call device_init_wakeup(dev, false) from the driver and it allows to remove the .remove callback. Link: https://lore.kernel.org/r/20191021155806.3625-3-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
dpm_sysfs_remove() and device_pm_remove() are already called by device_del() on device removal so there is no need to call device_init_wakeup(dev, false) from the driver and it allows to remove the .remove callback. Link: https://lore.kernel.org/r/20191021155806.3625-4-alexandre.belloni@bootlin.comReviewed-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
dpm_sysfs_remove() and device_pm_remove() are already called by device_del() on device removal so there is no need to call device_init_wakeup(dev, false) from the driver and it allows to remove the .remove callback. Link: https://lore.kernel.org/r/20191021155806.3625-2-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
dpm_sysfs_remove() and device_pm_remove() are already called by device_del() on device removal so there is no need to call device_init_wakeup(dev, false) from the driver and it allows to remove the .remove callback. Link: https://lore.kernel.org/r/20191021155806.3625-1-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Never enable update interrupts when the time set on the rtc is invalid. In that case, also avoid enabling the emulation because it will fail for the same reason. Link: https://lore.kernel.org/r/20191021155631.3342-2-alexandre.belloni@bootlin.com Link: https://lore.kernel.org/r/CA+ASDXMarBG5C1Kz42B9i_iVZ1=i6GgH9Yja2cdmSueKD_As_g@mail.gmail.comReported-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reported-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
When setting the time in the future with the uie timer enabled, rtc_timer_do_work will loop for a while because the expiration of the uie timer was way before the current RTC time and a new timer will be enqueued until the current rtc time is reached. If the uie timer is enabled, disable it before setting the time and enable it after expiring current timers (which may actually be an alarm). This is the safest thing to do to ensure the uie timer is still synchronized with the RTC, especially in the UIE emulation case. Reported-by: syzbot+08116743f8ad6f9a6de7@syzkaller.appspotmail.com Fixes: 6610e089 ("RTC: Rework RTC code to use timerqueue for events") Link: https://lore.kernel.org/r/20191020231320.8191-1-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Directly call ktime_get_real_seconds instead of converting the result to a struct rtc_time and then back to a time64_t. Link: https://lore.kernel.org/r/20191016201223.30568-4-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Call the 64bit versions of rtc_tm time conversion to avoid the y2038 issue. Link: https://lore.kernel.org/r/20191016201223.30568-3-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
The driver drops the nanoseconds part of the timespec64, there is no need to call ktime_get_real_ts64. Link: https://lore.kernel.org/r/20191016201223.30568-2-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 21 Oct, 2019 1 commit
-
-
Martin Hundebøll authored
Linux should handle when the pcf2127 watchdog feature is enabled by the bootloader. This is done by checking the watchdog timer value during init, and set the WDOG_HW_RUNNING flag if the value differs from zero. Signed-off-by: Martin Hundebøll <martin@geanix.com> Acked-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20191021080838.2789-1-martin@geanix.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 19 Oct, 2019 18 commits
-
-
Parthiban Nallathambi authored
rv3028 provides clkout (enabled by default). Add clkout to clock framework source and control from device tree for variable frequency with enable and disable functionality. Signed-off-by: Parthiban Nallathambi <pn@denx.de> Link: https://lore.kernel.org/r/20191018100425.1687979-1-pn@denx.deSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
It is not necessary to call device_init_wakeup(dev, false) in .remove as device_del will take care of that. It is also not necessary to devm_free_irq. Finally, dev_pm_clear_wake_irq can be called unconditionally. Link: https://lore.kernel.org/r/20191019204941.6203-9-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Rework the interrupt handling to avoid caching the values as the core is already doing that. The core also always ensures the rtc_time passed for the alarm is fully populated. The only trick is in read_alarm where status needs to be read before the alarm registers to ensure the potential irq is not cleared. Link: https://lore.kernel.org/r/20191019204941.6203-8-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Use rtc_lock and rtc_unlock to lock the rtc from the interrupt handler. This removes the need for a driver specific lock. Link: https://lore.kernel.org/r/20191019204941.6203-7-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Check whether regmap_read fails before continuing in the sysfs .show callbacks. Link: https://lore.kernel.org/r/20191019204941.6203-6-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Use regmap_update_bits to update DS1343_CONTROL_REG in a race free manner when setting the glitch filter. Link: https://lore.kernel.org/r/20191019204941.6203-5-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
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. Link: https://lore.kernel.org/r/20191019204941.6203-4-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
To avoid possible race condition, use regmap_bulk_write to write all the date/time registers at once instead of sequentially. Link: https://lore.kernel.org/r/20191019204941.6203-3-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
RTC_SET_CHARGE doesn't exist, the ioctl code is never used. Link: https://lore.kernel.org/r/20191019204941.6203-2-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
This is a standard BCD rtc with a useless century bit (no leap year correction after 2099). Link: https://lore.kernel.org/r/20191019204941.6203-1-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Introduce rtc_lock and rtc_unlock to shorten the code when locking and unlocking ops_lock from drivers. Link: https://lore.kernel.org/r/20191019205034.6382-1-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Let the rtc core check the date/time against the RTC range. Link: https://lore.kernel.org/r/20191016201626.31309-5-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
This allows further improvement of the driver. Link: https://lore.kernel.org/r/20191016201626.31309-4-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
The RTC core now has error messages in case of registration failure, there is no need to have other messages in the drivers. Link: https://lore.kernel.org/r/20191016201626.31309-3-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
err_return doesn't do anything special, simply return instead of goto. Link: https://lore.kernel.org/r/20191016201626.31309-2-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Some RTCs handle date up to 2199. Link: https://lore.kernel.org/r/20191016201626.31309-1-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
This is a standard BCD RTC that will fail in 2100. Link: https://lore.kernel.org/r/20191016200848.30246-2-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
This allows further improvement of the driver and removes the need to forward declare s35390a_driver. Link: https://lore.kernel.org/r/20191016200848.30246-1-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 16 Oct, 2019 2 commits
-
-
Alexandre Belloni authored
The correct location for this option is under platform driver, not i2c drivers. Link: https://lore.kernel.org/r/20191014155840.22554-1-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Thomas Bogendoerfer authored
SGI Octane (IP30) doesn't have RTC register directly mapped into CPU address space, but accesses RTC registers with an address and data register. This is now supported by additional access functions, which are selected by a new field in platform data. Removed plat_read/plat_write since there is no user and their usage could introduce lifetime issue, when functions are placed in different modules. Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Acked-by: Joshua Kinard <kumba@gentoo.org> Reviewed-by: Joshua Kinard <kumba@gentoo.org> Link: https://lore.kernel.org/r/20191014214621.25257-1-tbogendoerfer@suse.deSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 14 Oct, 2019 4 commits
-
-
Thomas Bogendoerfer authored
Simplify ioremapping of registers by using devm_platform_ioremap_resource. Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Acked-by: Joshua Kinard <kumba@gentoo.org> Link: https://lore.kernel.org/r/20191011150546.9186-2-tbogendoerfer@suse.deSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Thomas Bogendoerfer authored
A few of the fields in struct ds1685_priv aren't needed at all, so we can remove it. Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de> Acked-by: Joshua Kinard <kumba@gentoo.org> Link: https://lore.kernel.org/r/20191011150546.9186-1-tbogendoerfer@suse.deSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Srinivas Goud authored
This patch fixes the warnings reported by static code analysis. Updated calibval variable type to unsigned type from signed. Signed-off-by: Srinivas Goud <srinivas.goud@xilinx.com> Signed-off-by: Michal Simek <michal.simek@xilinx.com> Link: https://lore.kernel.org/r/20765c4c27aa92c75426b82fd2815ebef6471492.1570544738.git.michal.simek@xilinx.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Nick Crews authored
If the RTC HW returns an invalid time, the rtc_year_days() call would crash. This patch adds error logging in this situation, and removes the tm_yday and tm_wday calculations. These fields should not be relied upon by userspace according to man rtc, and thus we don't need to calculate them. Signed-off-by: Nick Crews <ncrews@chromium.org> Reviewed-by: Daniel Campello <campello@chromium.org> Link: https://lore.kernel.org/r/20191004142608.170159-1-ncrews@chromium.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 07 Oct, 2019 2 commits
-
-
Alexandre Belloni authored
The DS1347 can handle years from 0 to 9999, add century register support. Link: https://lore.kernel.org/r/20191007134724.15505-10-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Use regmap_update_bits instead of open coding. Also add proper error handling. Link: https://lore.kernel.org/r/20191007134724.15505-9-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-