- 09 Feb, 2023 12 commits
-
-
Johan Hovold authored
Rename the driver-data struct device pointer by dropping the "rtc" prefix which is both redundant and misleading (as this is a pointer to the platform device and not the rtc class device). Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: David Collins <quic_collinsd@quicinc.com> Link: https://lore.kernel.org/r/20230202155448.6715-10-johan+linaro@kernel.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Johan Hovold authored
Clean up the time and alarm callback debugging by using a consistent and succinct human-readable (i.e. non-raw) format. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: David Collins <quic_collinsd@quicinc.com> Link: https://lore.kernel.org/r/20230202155448.6715-9-johan+linaro@kernel.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Johan Hovold authored
Use the unaligned le32 helpers instead of open coding when accessing the time and alarm registers. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: David Collins <quic_collinsd@quicinc.com> Link: https://lore.kernel.org/r/20230202155448.6715-8-johan+linaro@kernel.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Johan Hovold authored
Drop the original register defines which have been unused since commit c8d523a4 ("drivers/rtc/rtc-pm8xxx.c: rework to support pm8941 rtc"). Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: David Collins <quic_collinsd@quicinc.com> Link: https://lore.kernel.org/r/20230202155448.6715-7-johan+linaro@kernel.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Johan Hovold authored
In the unlikely event that disabling the alarm and clearing the status ever fails, return IRQ_NONE instead of IRQ_HANDLED. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20230202155448.6715-6-johan+linaro@kernel.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Johan Hovold authored
Since commit c8d523a4 ("drivers/rtc/rtc-pm8xxx.c: rework to support pm8941 rtc") which removed the shadow control register there is no need for a driver lock. Specifically, the rtc ops are serialised by rtc core and the interrupt handler only unconditionally disables the alarm using the alarm_ctrl register. Note that since only the alarm enable bit of alarm_ctrl is used after enabling the RTC at probe, the locking was not needed when doing open coded read-modify-write cycles either. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: David Collins <quic_collinsd@quicinc.com> Link: https://lore.kernel.org/r/20230202155448.6715-5-johan+linaro@kernel.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Johan Hovold authored
Switch to using regmap_update_bits() instead of open coding read-modify-write accesses. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: David Collins <quic_collinsd@quicinc.com> Link: https://lore.kernel.org/r/20230202155448.6715-4-johan+linaro@kernel.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Johan Hovold authored
Drop the unnecessary error messages after every spmi regmap access, which are not expected to fail. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20230202155448.6715-3-johan+linaro@kernel.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Johan Hovold authored
Make sure to disable the alarm before updating the four alarm time registers to avoid spurious alarms during the update. Note that the disable needs to be done outside of the ctrl_reg_lock section to prevent a racing alarm interrupt from disabling the newly set alarm when the lock is released. Fixes: 9a9a54ad ("drivers/rtc: add support for Qualcomm PMIC8xxx RTC") Cc: stable@vger.kernel.org # 3.1 Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: David Collins <quic_collinsd@quicinc.com> Link: https://lore.kernel.org/r/20230202155448.6715-2-johan+linaro@kernel.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Heiner Kallweit authored
Convert Amlogic Meson vrtc controller binding to yaml. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/d820d54b-d082-589a-621f-2795d885696a@gmail.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Sascha Hauer authored
RTC core never calls rv8803_set_alarm with an invalid alarm time, so if an invalid alarm time > 0 is set, external factors must have corrupted the RTC's alarm time and possibly other registers. Play it safe by marking the date/time invalid, so all registers are reinitialized on a ->set_time. This may cause existing setups to lose time if they so far set only date/time, but ignored that the alarm registers had an invalid date value, e.g.: rtc rtc0: invalid alarm value: 2020-3-27 7:82:0 These systems will have their ->get_time return -EINVAL till ->set_time initializes the alarm value (and sets a new time). Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20221123095527.2771434-3-s.hauer@pengutronix.deSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Ahmad Fatoum authored
bcd2bin(0x0A) happily returns 10, despite this being an invalid BCD value. RTC drivers converting possibly corrupted BCD timestamps might want to validate their input before calling bcd2bin(). Provide a macro to do so. Unlike bcd2bin and bin2bcd, out-of-line versions are not implemented. Should the macro experience enough use, this can be retrofitted. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.kernel.org/r/20221123095527.2771434-2-s.hauer@pengutronix.deSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 01 Feb, 2023 13 commits
-
-
Uwe Kleine-König authored
rtc-max8907 is a platform driver that doesn't use any symbol provided in <linux/i2c.h>. So drop the include. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221219081440.1399791-1-u.kleine-koenig@pengutronix.deSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-1-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-12-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-11-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-10-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-9-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-8-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-7-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-6-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-5-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-4-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-3-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Alexandre Belloni authored
Allow the IRQ type to be passed from the device tree if available as there may be components changing the trigger type of the interrupt between the RTC and the IRQ controller. Link: https://lore.kernel.org/r/20230123200217.1236011-2-alexandre.belloni@bootlin.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 25 Jan, 2023 3 commits
-
-
Hugo Villeneuve authored
pca/pcf2129 devices can also have the 'reset-source' property, so remove them from the trivial RTC devices list. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Reviewed-by: Bruno Thomsen <bruno.thomsen@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20221220152237.1125178-1-hugo@hugovil.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Doug Berger authored
The wake interrupt only fires when the system is in a suspend state. Fortunately we have another interrupt that fires in a non-suspend state at the L2 controller UPG_AUX_AON. Add support for this interrupt line so we can use the alarm in a non-wake context. Signed-off-by: Doug Berger <opendmb@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20230124201430.2502371-3-opendmb@gmail.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Doug Berger authored
A second interrupt can optionally be specified for this device to be used for generating RTC alarm interrupts. Signed-off-by: Doug Berger <opendmb@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20230124201430.2502371-2-opendmb@gmail.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 23 Jan, 2023 7 commits
-
-
Samuel Holland authored
On all variants of the hardware, the internal oscillator is one possible parent for the AR100 clock. It needs to be exported so we can model that relationship correctly in the devicetree. Fixes: c56afc18 ("rtc: sun6i: Expose internal oscillator through device tree") Signed-off-by: Samuel Holland <samuel@sholland.org> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://lore.kernel.org/r/20221229215319.14145-1-samuel@sholland.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Wadim Egorov authored
Move RV3028 RTC bindings from trivial-rtc.yaml into microcrystal,rv3032.yaml. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230111163404.3526248-2-w.egorov@phytec.deSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
WANG Xuerui authored
Document the binding for the LS2X RTC block found on the Loongson-2K SoC and the LS7A bridge, originally appearing on the Loongson-2H. Signed-off-by: WANG Xuerui <git@xen0n.name> Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn> Acked-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/0288efeb4209e4a49af07de6399045aaa00a970c.1673227292.git.zhoubinbin@loongson.cnSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Doug Berger authored
In preparation for adding a second interrupt to service RTC interrupts, the existing interrupt is renamed from the generic 'irq' to 'wake_irq' to more clearly convey its role. It is also converted to an unsigned int. Finally, the driver message that outputs the IRQ number when registered is removed since devm_rtc_register_device() already provides a report of registration and the interrupts can be found in /proc/interrupts. Signed-off-by: Doug Berger <opendmb@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20230120190147.718976-5-opendmb@gmail.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Doug Berger authored
Since the WKTMR hardware block cannot be disabled it is necessary for the driver to accommodate for associated timing hazards. This commit targets the following possibilities: A possible race between clearing a wktmr event and the alarm expiring is made one-sided by setting the alarm to its maximum value before clearing the event. Programming alarm values close to the current time may not trigger events if the counter advances while the alarm is being programmed. After programming an alarm, a check is made to ensure that it is either in the future or an expiration event is pending. Signed-off-by: Doug Berger <opendmb@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20230120190147.718976-4-opendmb@gmail.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Doug Berger authored
These changes are not intended to affect functionality, but simplify the source code. They are performed here to simplify review and reduce confusion with other changes in this set. Since set_alarm includes the alarm_irq_enable functionality call it directly from that function for simplicity (even though it does nothing at the moment). The order of the declarations is changed to prevent the need for a prototype. The function device_init_wakeup() is used to replace the functions device_set_wakeup_capable() and device_wakeup_enable() since it is equivalent. Signed-off-by: Doug Berger <opendmb@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20230120190147.718976-3-opendmb@gmail.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Doug Berger authored
This commit defines bit 0 as the bit of interest within the BRCMSTB_WKTMR_EVENT register to make the implementation more readable. Signed-off-by: Doug Berger <opendmb@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20230120190147.718976-2-opendmb@gmail.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 09 Jan, 2023 2 commits
-
-
Uwe Kleine-König authored
.probe_new() doesn't get the i2c_device_id * parameter, so determine that explicitly in the probe function. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20221118224540.619276-561-uwe@kleine-koenig.orgSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
Shanker Donthineni authored
The current implementation of rtc-efi is expecting all the 4 time services GET{SET}_TIME{WAKEUP} must be supported by UEFI firmware. As per the EFI_RT_PROPERTIES_TABLE, the platform specific implementations can choose to enable selective time services based on the RTC device capabilities. This patch does the following changes to provide GET/SET RTC services on platforms that do not support the WAKEUP feature. 1) Relax time services cap check when creating a platform device. 2) Clear RTC_FEATURE_ALARM bit in the absence of WAKEUP services. 3) Conditional alarm entries in '/proc/driver/rtc'. Cc: <stable@vger.kernel.org> # v6.0+ Signed-off-by: Shanker Donthineni <sdonthineni@nvidia.com> Link: https://lore.kernel.org/r/20230102230630.192911-1-sdonthineni@nvidia.comSigned-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-
- 25 Dec, 2022 2 commits
-
-
Linus Torvalds authored
-
Steven Rostedt (Google) authored
Due to several bugs caused by timers being re-armed after they are shutdown and just before they are freed, a new state of timers was added called "shutdown". After a timer is set to this state, then it can no longer be re-armed. The following script was run to find all the trivial locations where del_timer() or del_timer_sync() is called in the same function that the object holding the timer is freed. It also ignores any locations where the timer->function is modified between the del_timer*() and the free(), as that is not considered a "trivial" case. This was created by using a coccinelle script and the following commands: $ cat timer.cocci @@ expression ptr, slab; identifier timer, rfield; @@ ( - del_timer(&ptr->timer); + timer_shutdown(&ptr->timer); | - del_timer_sync(&ptr->timer); + timer_shutdown_sync(&ptr->timer); ) ... when strict when != ptr->timer ( kfree_rcu(ptr, rfield); | kmem_cache_free(slab, ptr); | kfree(ptr); ) $ spatch timer.cocci . > /tmp/t.patch $ patch -p1 < /tmp/t.patch Link: https://lore.kernel.org/lkml/20221123201306.823305113@linutronix.de/Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org> Acked-by: Pavel Machek <pavel@ucw.cz> [ LED ] Acked-by: Kalle Valo <kvalo@kernel.org> [ wireless ] Acked-by: Paolo Abeni <pabeni@redhat.com> [ networking ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-
- 23 Dec, 2022 1 commit
-
-
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spiLinus Torvalds authored
Pull spi fix from Mark Brown: "One driver specific change here which handles the case where a SPI device for some reason tries to change the bus speed during a message on fsl_spi hardware, this should be very unusual" * tag 'spi-fix-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: fsl_spi: Don't change speed while chipselect is active
-