aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
Commit message (Collapse)AuthorAgeFilesLines
...
| | * rtc: mpfs: Use devm_pm_set_wake_irqPeng Fan2025-03-031-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up. Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: ab8500: Use resource managed API to simplify codePeng Fan2025-03-031-9/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the error handling code and 'driver.remove()' hook. Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: pm8xxx: Use devm_pm_set_wake_irqPeng Fan2025-03-031-11/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up. Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: ds1343: Use devm_pm_set_wake_irqPeng Fan2025-03-031-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use devm_pm_set_wake_irq, then the 'driver.remove()' could be cleaned up. Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: nxp-bbnsm: Use resource managed API to simplify codePeng Fan2025-03-031-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the error handling code and 'driver.remove()' hook. Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: stm32: Use resource managed API to simplify codePeng Fan2025-03-031-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use devm_pm_set_wake_irq and devm_device_init_wakeup to cleanup the error handling code and 'driver.remove()' hook. Reviewed-by: Antonio Borneo <[email protected]> Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: pl030: Constify amba_id tableKrzysztof Kozlowski2025-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 'struct amba_id' table is not modified so can be changed to const for more safety. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: fsl-ftm-alarm: Mark acpi_id table as maybe unusedKrzysztof Kozlowski2025-02-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For !ACPI builds, the acpi_device_id table will not be referenced because of ACPI_PTR: rtc-fsl-ftm-alarm.c:312:36: error: unused variable 'ftm_imx_acpi_ids' [-Werror,-Wunused-const-variable] Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * | rtc: class: Switch to use hrtimer_setup()Nam Cao2025-02-181-2/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hrtimer_setup() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init() and the open coded initialization of hrtimer::function with the new setup mechanism. Patch was created by using Coccinelle. Signed-off-by: Nam Cao <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Zack Rusin <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/all/22f3f087ddbab1708583033c07c3b7fb17810110.1738746904.git.namcao@linutronix.de
* | Merge remote-tracking UNTIL 24. Mar 2025saturneric2025-03-3058-92/+173
|\|
| * Merge tag 'rtc-6.14' of ↵Linus Torvalds2025-01-3158-92/+173
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Not much this cycle, there are multiple small fixes. Core: - use boolean values with device_init_wakeup() Drivers: - pcf2127: add BSM support - pcf85063: fix possible out of bounds write" * tag 'rtc-6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: pcf2127: add BSM support rtc: Remove hpet_rtc_dropped_irq() dt-bindings: rtc: mxc: Document fsl,imx31-rtc rtc: stm32: Use syscon_regmap_lookup_by_phandle_args rtc: zynqmp: Fix optional clock name property rtc: loongson: clear TOY_MATCH0_REG in loongson_rtc_isr() rtc: pcf85063: fix potential OOB write in PCF85063 NVMEM read rtc: tps6594: Fix integer overflow on 32bit systems rtc: use boolean values with device_init_wakeup() rtc: RTC_DRV_SPEAR should not default to y when compile-testing
| | * rtc: pcf2127: add BSM supportAlexandre Belloni2025-01-281-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pcf2127 encodes BSM, BLD and power fail detection in the same set of bits so it is necessary to do some calculation when changing BSM to keep the rest of the configuration as-is. However, when BSM is disabled, there is no configuration with BLD enabled so this will be lost when coming back to a mode with BSM enabled. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: Remove hpet_rtc_dropped_irq()Dr. David Alan Gilbert2025-01-131-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hpet_rtc_dropped_irq() has been unused since commit f52ef24be21a ("rtc/alpha: remove legacy rtc driver") Remove it in rtc, and x86 hpet code. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Acked-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: stm32: Use syscon_regmap_lookup_by_phandle_argsKrzysztof Kozlowski2025-01-131-15/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use syscon_regmap_lookup_by_phandle_args() which is a wrapper over syscon_regmap_lookup_by_phandle() combined with getting the syscon argument. Except simpler code this annotates within one line that given phandle has arguments, so grepping for code would be easier. There is also no real benefit in printing errors on missing syscon argument, because this is done just too late: runtime check on static/build-time data. Dtschema and Devicetree bindings offer the static/build-time check for this already. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: zynqmp: Fix optional clock name propertyMichal Simek2025-01-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clock description in DT binding introduced by commit f69060c14431 ("dt-bindings: rtc: zynqmp: Add clock information") is talking about "rtc" clock name but driver is checking "rtc_clk" name instead. Because clock is optional property likely in was never handled properly by the driver. Fixes: 07dcc6f9c762 ("rtc: zynqmp: Add calibration set and get support") Signed-off-by: Michal Simek <[email protected]> Cc: [email protected] Reviewed-by: Peter Korsgaard <[email protected]> Link: https://lore.kernel.org/r/cd5f0c9d01ec1f5a240e37a7e0d85b8dacb3a869.1732723280.git.michal.simek@amd.com Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: loongson: clear TOY_MATCH0_REG in loongson_rtc_isr()Ming Wang2025-01-121-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The TOY_MATCH0_REG should be cleared to 0 in the RTC interrupt handler, otherwise the interrupt cannot be cleared, which will cause the loongson_rtc_isr() to be triggered multiple times. The previous code cleared TOY_MATCH0_REG in the loongson_rtc_handler(), which is an ACPI interrupt. This did not prevent loongson_rtc_isr() from being triggered multiple times. This commit moves the clearing of TOY_MATCH0_REG to the loongson_rtc_isr() to ensure that the interrupt is properly cleared. Fixes: 1b733a9ebc3d ("rtc: Add rtc driver for the Loongson family chips") Signed-off-by: Ming Wang <[email protected]> Reviewed-by: Huacai Chen <[email protected]> Reviewed-by: Keguang Zhang <[email protected]> # on LS1B Tested-by: Keguang Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: pcf85063: fix potential OOB write in PCF85063 NVMEM readOleksij Rempel2025-01-121-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The nvmem interface supports variable buffer sizes, while the regmap interface operates with fixed-size storage. If an nvmem client uses a buffer size less than 4 bytes, regmap_read will write out of bounds as it expects the buffer to point at an unsigned int. Fix this by using an intermediary unsigned int to hold the value. Fixes: fadfd092ee91 ("rtc: pcf85063: add nvram support") Signed-off-by: Oleksij Rempel <[email protected]> Signed-off-by: Ahmad Fatoum <[email protected]> Link: https://lore.kernel.org/r/20241218-rtc-pcf85063-stack-corruption-v1-1-12fd0ee0f046@pengutronix.de Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: tps6594: Fix integer overflow on 32bit systemsDan Carpenter2025-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is this multiply in tps6594_rtc_set_offset() tmp = offset * TICKS_PER_HOUR; The "tmp" variable is an s64 but "offset" is a long in the (-277774)-277774 range. On 32bit systems a long can hold numbers up to approximately two billion. The number of TICKS_PER_HOUR is really large, (32768 * 3600) or roughly a hundred million. When you start multiplying by a hundred million it doesn't take long to overflow the two billion mark. Probably the safest way to fix this is to change the type of TICKS_PER_HOUR to long long because it's such a large number. Fixes: 9f67c1e63976 ("rtc: tps6594: Add driver for TPS6594 RTC") Signed-off-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: use boolean values with device_init_wakeup()Wolfram Sang2025-01-0953-62/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | device_init_wakeup() second argument is a bool type. Use proper boolean values when calling it to match the type and to produce unambiguous code which is easier to understand. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Charles Keepax <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| | * rtc: RTC_DRV_SPEAR should not default to y when compile-testingGeert Uytterhoeven2025-01-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merely enabling compile-testing should not enable additional functionality. Signed-off-by: Geert Uytterhoeven <[email protected]> Acked-by: Viresh Kumar <[email protected]> Link: https://lore.kernel.org/r/7b8eefe3b0150101ba01c3ea55e45aa3134059ba.1733243007.git.geert+renesas@glider.be Signed-off-by: Alexandre Belloni <[email protected]>
* | | fix: drivers patch make raspberry pi 5 work properlysaturneric2025-01-127-7/+344
|/ /
* / module: Convert symbol namespace to string literalPeter Zijlstra2024-12-021-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up the existing export namespace code along the same lines of commit 33def8498fdd ("treewide: Convert macro and uses of __section(foo) to __section("foo")") and for the same reason, it is not desired for the namespace argument to be a macro expansion itself. Scripted using git grep -l -e MODULE_IMPORT_NS -e EXPORT_SYMBOL_NS | while read file; do awk -i inplace ' /^#define EXPORT_SYMBOL_NS/ { gsub(/__stringify\(ns\)/, "ns"); print; next; } /^#define MODULE_IMPORT_NS/ { gsub(/__stringify\(ns\)/, "ns"); print; next; } /MODULE_IMPORT_NS/ { $0 = gensub(/MODULE_IMPORT_NS\(([^)]*)\)/, "MODULE_IMPORT_NS(\"\\1\")", "g"); } /EXPORT_SYMBOL_NS/ { if ($0 ~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+),/) { if ($0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/ && $0 !~ /(EXPORT_SYMBOL_NS[^(]*)\(\)/ && $0 !~ /^my/) { getline line; gsub(/[[:space:]]*\\$/, ""); gsub(/[[:space:]]/, "", line); $0 = $0 " " line; } $0 = gensub(/(EXPORT_SYMBOL_NS[^(]*)\(([^,]+), ([^)]+)\)/, "\\1(\\2, \"\\3\")", "g"); } } { print }' $file; done Requested-by: Masahiro Yamada <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://mail.google.com/mail/u/2/#inbox/FMfcgzQXKWgMmjdFwwdsfgxzKpVHWPlc Acked-by: Greg KH <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* Merge tag 'rtc-6.13' of ↵Linus Torvalds2024-11-3063-329/+1980
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "New drivers: - Amlogic A4 and A5 RTC - Marvell 88PM886 PMIC RTC - Renesas RTCA-3 for Renesas RZ/G3S Driver updates: - ab-eoz9: fix temperature and alarm support - cmos: improve locking behaviour - isl12022: add alarm support - m48t59: improve epoch handling - mt6359: add range - rzn1: fix BCD conversions and simplify driver" * tag 'rtc-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (38 commits) rtc: ab-eoz9: don't fail temperature reads on undervoltage notification rtc: rzn1: reduce register access rtc: rzn1: drop superfluous wday calculation m68k: mvme147, mvme16x: Adopt rtc-m48t59 platform driver rtc: brcmstb-waketimer: don't include 'pm_wakeup.h' directly rtc: m48t59: Use platform_data struct for year offset value rtc: ab-eoz9: fix abeoz9_rtc_read_alarm rtc: rv3028: fix RV3028_TS_COUNT type rtc: rzn1: update Michel's email rtc: rzn1: fix BCD to rtc_time conversion errors rtc: amlogic-a4: fix compile error rtc: amlogic-a4: drop error messages MAINTAINERS: Add an entry for Amlogic RTC driver rtc: support for the Amlogic on-chip RTC dt-bindings: rtc: Add Amlogic A4 and A5 RTC rtc: add driver for Marvell 88PM886 PMIC RTC rtc: check if __rtc_read_time was successful in rtc_timer_do_work() rtc: pcf8563: Switch to regmap rtc: pcf8563: Sort headers alphabetically rtc: abx80x: Fix WDT bit position of the status register ...
| * rtc: ab-eoz9: don't fail temperature reads on undervoltage notificationMaxime Chevallier2024-11-251-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The undervoltage flags reported by the RTC are useful to know if the time and date are reliable after a reboot. Although the threshold VLOW1 indicates that the thermometer has been shutdown and time compensation is off, it doesn't mean that the temperature readout is currently impossible. As the system is running, the RTC voltage is now fully established and we can read the temperature. Fixes: 67075b63cce2 ("rtc: add AB-RTCMC-32.768kHz-EOZ9 RTC support") Signed-off-by: Maxime Chevallier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: rzn1: reduce register accessWolfram Sang2024-11-251-42/+33
| | | | | | | | | | | | | | | | | | | | | | | | This RTC has special 32bit registers which return multiple of the same 8bit registers at once. Use these to minimize register access. Also, do the to/from BCD conversions right away, so 'tm' always contains values as described in time.h. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: rzn1: drop superfluous wday calculationWolfram Sang2024-11-251-15/+0
| | | | | | | | | | | | | | | | | | | | The week register simply counts from 0 to 6 where the numbers do not even represent a specific weekday. So we can adopt 'tm_wday' numbering of the RTC core without converting it. Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: brcmstb-waketimer: don't include 'pm_wakeup.h' directlyWolfram Sang2024-11-181-1/+0
| | | | | | | | | | | | | | | | | | | | The header clearly states that it does not want to be included directly, only via 'device.h'. 'platform_device.h' works equally well. Remove the direct inclusion. Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: m48t59: Use platform_data struct for year offset valueFinn Thain2024-11-181-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Instead of hard-coded values and ifdefs, store the year offset in the platform_data struct. Tested-by: Daniel Palmer <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Finn Thain <[email protected]> Tested-by: Andreas Larsson <[email protected]> Acked-by: Andreas Larsson <[email protected]> Link: https://lore.kernel.org/r/665c3526184a8d0c4a6373297d8e7d9a12591d8b.1731450735.git.fthain@linux-m68k.org Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ab-eoz9: fix abeoz9_rtc_read_alarmAlexandre Belloni2024-11-181-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | abeoz9_rtc_read_alarm assumes we always read the alarm in 12-hour mode while abeoz9_rtc_set_alarm will always set it in 24-hour mode. We could support 12-hour mode in both functions but it seems very unlikely that the RTC would be set to 12-hour mode now as the driver has been setting it to 24-hour mode for a while now. The setting is undefined at power-up and unchanged by subsequent resets which doesn't help us. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: rv3028: fix RV3028_TS_COUNT typeAlexandre Belloni2024-11-181-2/+4
| | | | | | | | | | | | | | | | | | Read RV3028_TS_COUNT in an unsigned int so static checkers stop reporting a mismatch between the format specifier and the type. Reported-by: Zhu Jun <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: rzn1: update Michel's emailWolfram Sang2024-11-181-2/+2
| | | | | | | | | | | | | | | | The Renesas address bounces, use the alternative one. Signed-off-by: Wolfram Sang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: rzn1: fix BCD to rtc_time conversion errorsWolfram Sang2024-11-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | tm_mon describes months from 0 to 11, but the register contains BCD from 1 to 12. tm_year contains years since 1900, but the BCD contains 20XX. Apply the offsets when converting these numbers. Fixes: deeb4b5393e1 ("rtc: rzn1: Add new RTC driver") Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: amlogic-a4: fix compile errorXianwei Zhao2024-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When compile rtc-a4, build error as following: ERROR: modpost: drivers/rtc/rtc-amlogic-a4: struct of_device_id is not terminated with a NULL entry! This commit is to fix it. Fixes: c89ac9182ee2 ("rtc: support for the Amlogic on-chip RTC") Reported-by: Stephen Rothwell <[email protected]> Signed-off-by: Xianwei Zhao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: amlogic-a4: drop error messagesAlexandre Belloni2024-11-121-15/+5
| | | | | | | | | | | | | | | | | | Drop error message because there is a high probability they will never be seen and the final user action is clear, the time has to be set again. Reviewed-by: Neil Armstrong <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: support for the Amlogic on-chip RTCYiting Deng2024-11-123-0/+487
| | | | | | | | | | | | | | | | | | | | | | | | | | This is the third amlogic driver. The RTC hardware of A4 SoC is different from the previous one. This RTC hardware includes a timing function and an alarm function. But the existing has only timing function, alarm function is using the system clock to implement a virtual alarm. Add the RTC driver to support it. Signed-off-by: Yiting Deng <[email protected]> Signed-off-by: Xianwei Zhao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: add driver for Marvell 88PM886 PMIC RTCKarel Balej2024-11-113-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | RTC lives on the chip's base register page. Add the relevant register definitions and implement a basic set/read time functionality. Tested with the samsung,coreprimevelte smartphone which contains this PMIC and whose vendor kernel tree has also served as the sole reference for this. Signed-off-by: Karel Balej <[email protected]> Acked-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: check if __rtc_read_time was successful in rtc_timer_do_work()Yongliang Gao2024-11-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the __rtc_read_time call fails,, the struct rtc_time tm; may contain uninitialized data, or an illegal date/time read from the RTC hardware. When calling rtc_tm_to_ktime later, the result may be a very large value (possibly KTIME_MAX). If there are periodic timers in rtc->timerqueue, they will continually expire, may causing kernel softlockup. Fixes: 6610e0893b8b ("RTC: Rework RTC code to use timerqueue for events") Signed-off-by: Yongliang Gao <[email protected]> Acked-by: Jingqun Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: pcf8563: Switch to regmapNobuhiro Iwamatsu2024-11-112-123/+82
| | | | | | | | | | | | | | | | Switch the i2c_transfer methods to regmap APIs. Signed-off-by: Nobuhiro Iwamatsu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: pcf8563: Sort headers alphabeticallyNobuhiro Iwamatsu2024-11-111-4/+4
| | | | | | | | | | | | | | | | Sort headers in alphabetical order. Signed-off-by: Nobuhiro Iwamatsu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: abx80x: Fix WDT bit position of the status registerNobuhiro Iwamatsu2024-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The WDT bit in the status register is 5, not 6. This fixes from 6 to 5. Link: https://abracon.com/Support/AppsManuals/Precisiontiming/AB08XX-Application-Manual.pdf Link: https://www.microcrystal.com/fileadmin/Media/Products/RTC/App.Manual/RV-1805-C3_App-Manual.pdf Fixes: 749e36d0a0d7 ("rtc: abx80x: add basic watchdog support") Cc: Jeremy Gebben <[email protected]> Signed-off-by: Nobuhiro Iwamatsu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: mt6359: Use RTC_TC_DOW hardware register for wdayAngeloGioacchino Del Regno2024-11-111-10/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of calculating the number of full days since Sunday with (days + 4) % 7, read (and write) that to the RTC Day-of-week Time Counter register (RTC_TC_DOW). Some transformation (addition and subtraction for set/get) is still done, as this register's range is [1..7], while the tm_wday in struct tm's range is [0..6]. Please note that this was added only to set_time() and read_time() callbacks because set_alarm() and read_alarm() are setting a bit in RTC_AL_MASK to ignore DOW for RTC HW alarms for unknown reasons. Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: mt6359: Add RTC hardware range and add support for start-yearAngeloGioacchino Del Regno2024-11-111-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the RTC hardware range parameters to enable the possibility of using the `start-year` devicetree property which, if present, will set the start_secs parameter by overriding the defaults that this driver is setting; To keep compatibility with (hence have the same date/time reading as) the old behavior, set: - range_min to 1900-01-01 00:00:00 - range_max to 2027-12-31 23:59:59 (HW year max range is 0-127) - start_secs defaulting to 1968-01-02 00:00:00 Please note that the oddness of starting from January 2nd is not a hardware quirk and it's done only to get the same date/time reading as an RTC which time was set before this commit. Also remove the RTC_MIN_YEAR_OFFSET addition and subtraction in callbacks set_time() and read_time() respectively, as now this is already done by the API. Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Macpaul Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: bbnsm: add remove hookPeng Fan2024-11-111-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Without remove hook to clear wake irq, there will be kernel dump when doing module test. "bbnsm_rtc 44440000.bbnsm:rtc: wake irq already initialized" Add remove hook to clear wake irq and set wakeup to false. Fixes: eb7b85853c38 ("rtc: bbnsm: Add the bbnsm rtc support") Signed-off-by: Peng Fan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: isl12022: Replace uint8_t types with u8Esben Haabendal2024-11-101-2/+2
| | | | | | | | | | | | | | | | | | Keep coding style consistent, by using kernel integer types instead of standard types. Signed-off-by: Esben Haabendal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: isl12022: Add alarm supportEsben Haabendal2024-11-101-7/+227
| | | | | | | | | | | | | | | | | | | | | | | | The ISL12022 RTC has a combined INT/fOUT pin, which can be used for alarm interrupt when frequency output is not enabled. The device-tree bindings should ensure that interrupt and clock output is not enabled at the same time. Signed-off-by: Esben Haabendal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: isl12022: Prepare for extending rtc device drvdataEsben Haabendal2024-11-101-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | Add a struct to hold the regmap pointer, so more information can be added. This is morally a revert of commit f525b210e9d4 ("rtc: isl12022: Get rid of unneeded private struct isl12022"). Acked-by: Rasmus Villemoes <[email protected]> Signed-off-by: Esben Haabendal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: rtc-mc146818-lib: Use is_leap_year instead of calculate leap yearsNobuhiro Iwamatsu2024-11-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | The is_leap_year() for determining leap year is provided in rtc lib. This uses is_leap_year() instead of its own leap year determination routine. Signed-off-by: Nobuhiro Iwamatsu <[email protected]> Acked-by: Maciej W. Rozycki <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: st-lpc: Use IRQF_NO_AUTOEN flag in request_irq()Jinjie Ruan2024-11-101-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If request_irq() fails in st_rtc_probe(), there is no need to enable the irq, and if it succeeds, disable_irq() after request_irq() still has a time gap in which interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will disable IRQ auto-enable when request IRQ. Fixes: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Jinjie Ruan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: Makefile: Replace spaces with tab.Tóth János2024-11-101-1/+1
| | | | | | | | | | | | | | | | Fix a style error. Signed-off-by: Tóth János <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: Switch back to struct platform_driver::remove()Uwe Kleine-König2024-11-1047-47/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After commit 0edb555a65d1 ("platform: Make platform_driver::remove() return void") .remove() is (again) the right callback to implement for platform drivers. Convert all platform drivers below drivers/rtc to use .remove(), with the eventual goal to drop struct platform_driver::remove_new(). As .remove() and .remove_new() have the same prototypes, conversion is done by just changing the structure member name in the driver initializer. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>