aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
Commit message (Collapse)AuthorAgeFilesLines
...
| * rtc: s35390a: Drop vendorless compatible string from match tableRob Herring (Arm)2024-09-111-1/+0
| | | | | | | | | | | | | | | | | | | | There's no need to list "s35390a" in the DT match table. The I2C core will strip any vendor prefix and match against the i2c_device_id table which has an "s35390a" entry. Signed-off-by: Rob Herring (Arm) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: twl: convert comma to semicolonChen Ni2024-09-111-2/+2
| | | | | | | | | | | | | | | | | | Replace a comma between expression statements by a semicolon. Fixes: 7130856f5605 ("rtc: twl: add NVRAM support") Signed-off-by: Chen Ni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: stm32: add alarm A out featureValentin Caron2024-08-141-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | STM32 RTC can pulse some SOC pins when an RTC alarm expires. This patch adds this functionality for alarm A. The pulse can out on three pins RTC_OUT1, RTC_OUT2, RTC_OUT2_RMP (PC13, PB2, PI8 on stm32mp15) (PC13, PB2, PI1 on stm32mp13) (PC13, PF4/PF6, PI8 on stm32mp25). This patch only adds the functionality for devices which are using st,stm32mp1-rtc and st,stm32mp25-rtc compatible. Add "alarm-a" in pinmux functions. Signed-off-by: Valentin Caron <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: stm32: add Low Speed Clock Output (LSCO) supportValentin Caron2024-08-142-0/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RTC is able to output on a pin the "LSE" internal clock. STM32 RTC is now registered as a clock provider. It provides rtc_lsco clock, that means RTC_LSCO is output on either RTC_OUT1 or RTC_OUT2_RMP, depending on pinmux DT property. The clock is marked as CLK_IGNORE_UNUSED and CLK_IS_CRITICAL because RTC_LSCO can be early required by devices needed it to init. Add LSCO in pinmux functions. Add "stm32_rtc_clean_outs" to disable LSCO. As RTC is part of "backup" power domain, it is not reset during shutdown or reboot. So force LSCO disable at probe. Co-developed-by: Amelie Delaunay <[email protected]> Signed-off-by: Amelie Delaunay <[email protected]> Signed-off-by: Valentin Caron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: stm32: add pinctrl and pinmux interfacesValentin Caron2024-08-142-0/+125
| | | | | | | | | | | | | | | | | | | | | | STM32 RTC is capable to handle 3 specific pins of the soc. "out1, out2 and out2_rmp". To handle this, we use pinctrl framework. There is a single pin per group. Signed-off-by: Valentin Caron <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* | rtc: support i.MX95 BBM RTCPeng Fan2024-08-283-0/+174
|/ | | | | | | | | | | | | | The BBM module provides RTC feature. To i.MX95, this module is managed by System Manager and exported System Control Management Interface(SCMI). Linux could use i.MX SCMI BBM Extension protocol to use RTC feature. This driver is to use SCMI interface to get/set RTC. Reviewed-by: Cristian Marussi <[email protected]> Signed-off-by: Peng Fan <[email protected]> Message-Id: <[email protected]> Acked-by: Alexandre Belloni <[email protected]> Signed-off-by: Sudeep Holla <[email protected]>
* rtc: stm32: add new st,stm32mp25-rtc compatible and check RIF configurationValentin Caron2024-07-101-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | Introduce new st,stm32mp25-rtc compatible. It is based on st,stm32mp1-rtc. Difference is that stm32mp25 soc implements a triple protection on RTC registers: - Secure bit based protection - Privileged context based protection - Compartment ID filtering based protection This driver will now check theses configurations before probing to avoid exceptions and fake reads on register. At this time, driver needs only to check two resources: INIT and ALARM_A. Other resources are not used. Resource isolation framework (RIF) is a comprehensive set of hardware blocks designed to enforce and manage isolation of STM32 hardware resources, like memory and peripherals. Link: https://www.st.com/resource/en/reference_manual/rm0457-stm32mp25xx-advanced-armbased-3264bit-mpus-stmicroelectronics.pdf#page=4081 Signed-off-by: Valentin Caron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: Drop explicit initialization of struct i2c_device_id::driver_data to 0Uwe Kleine-König2024-07-0623-27/+27
| | | | | | | | | | | | | | | | These drivers don't use the driver_data member of struct i2c_device_id, so don't explicitly initialize this member. This prepares putting driver_data in an anonymous union which requires either no initialization or named designators. But it's also a nice cleanup on its own. While add it, also remove a comma after the sentinel entry in rtc-hym8563. Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: interface: Add RTC offset to alarm after fix-upCsókás, Bence2024-07-061-4/+5
| | | | | | | | | | | | | | | | `rtc_add_offset()` is called by `__rtc_read_time()` and `__rtc_read_alarm()` to add the RTC's offset to the raw read-outs from the device drivers. However, in the latter case, a fix-up algorithm is run if the RTC device does not report a full `struct rtc_time` alarm value. In that case, the offset was forgot to be added. Fixes: fd6792bb022e ("rtc: fix alarm read and set offset") Signed-off-by: Csókás, Bence <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: ds1307: Clamp year to valid BCD (0-99) in `set_time()`Csókás, Bence2024-07-061-1/+1
| | | | | | | | | | | | `tm_year` may go up to 299 if the device supports the century bit. Therefore, subtracting may not give us a valid 2-digit number, but modulo does. Co-developed-by: Szentendrei, Tamás <[email protected]> Signed-off-by: Szentendrei, Tamás <[email protected]> Signed-off-by: Csókás, Bence <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: ds1307: Detect oscillator fail on mcp794xxCsókás, Bence2024-07-061-0/+5
| | | | | | | | | | This patch enables the detection of the oscillator failure on mcp794xx chips. Co-developed-by: Szentendrei, Tamás <[email protected]> Signed-off-by: Szentendrei, Tamás <[email protected]> Signed-off-by: Csókás, Bence <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: isl1208: Update correct procedure for clearing alarmBiju Das2024-06-271-5/+7
| | | | | | | | | | | | | | | | As per the latest HW manual[1], there is an internal delay(~250 microsec) from setting ALME = 0 to disabling the alarm function, so the user must add a short delay of greater than 250µs between setting ALME = 0 and clearing ALM. Currently setting of ALME = 0 is done after clearing the ALM, so just reverse the operation and add a delay of 275 microsec. [1]https://www.renesas.com/us/en/document/dst/raa215300-datasheet?r=1506351 Signed-off-by: Biju Das <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: isl1208: Add a delay for clearing alarmBiju Das2024-06-271-0/+13
| | | | | | | | | | | | | | | As per the latest HW manual[1], the INT# output is pulled low after the alarm is triggered. After the INT# output is pulled low, it is low for at least 250ms, even if the correct action is taken to clear it. It is impossible to clear ALM if it is still active. The host must wait for the RTC to progress past the alarm time plus the 250ms delay before clearing ALM. [1]https://www.renesas.com/us/en/document/dst/raa215300-datasheet?r=1506351 Signed-off-by: Biju Das <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: add missing MODULE_DESCRIPTION() macroJeff Johnson2024-06-277-0/+7
| | | | | | | | | | | | | | | | | | | | On x86, make allmodconfig && make W=1 C=1 reports: WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/rtc/lib_test.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/rtc/rtc-goldfish.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/rtc/rtc-omap.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/rtc/rtc-rc5t583.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/rtc/rtc-tps65910.o WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/rtc/rtc-twl.o Add the missing invocation of the MODULE_DESCRIPTION() macro to all files which have a MODULE_LICENSE(). This includes rtc-mpc5121.c, which does not produce a warning with the x86 allmodconfig since it is not built for x86, but it may cause this warning with Freescale PPC configurations. Signed-off-by: Jeff Johnson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: abx80x: Fix return value of nvmem callback on readJoy Chakraborty2024-06-271-4/+8
| | | | | | | | | | | | | | | | | | | | | Read callbacks registered with nvmem core expect 0 to be returned on success and a negative value to be returned on failure. abx80x_nvmem_xfer() on read calls i2c_smbus_read_i2c_block_data() which returns the number of bytes read on success as per its api description, this return value is handled as an error and returned to nvmem even on success. Fix to handle all possible values that would be returned by i2c_smbus_read_i2c_block_data(). Fixes: e90ff8ede777 ("rtc: abx80x: Add nvmem support") Cc: [email protected] Signed-off-by: Joy Chakraborty <[email protected]> Reviewed-by: Dan Carpenter <[email protected]> Reviewed-by: Sean Anderson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: cmos: Fix return value of nvmem callbacksJoy Chakraborty2024-06-271-6/+4
| | | | | | | | | | | | | | | | Read/write callbacks registered with nvmem core expect 0 to be returned on success and a negative value to be returned on failure. cmos_nvram_read()/cmos_nvram_write() currently return the number of bytes read or written, fix to return 0 on success and -EIO incase number of bytes requested was not read or written. Fixes: 8b5b7958fd1c ("rtc: cmos: use generic nvmem") Cc: [email protected] Signed-off-by: Joy Chakraborty <[email protected]> Reviewed-by: Dan Carpenter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: isl1208: Fix return value of nvmem callbacksJoy Chakraborty2024-06-271-7/+4
| | | | | | | | | | | | | | | Read/write callbacks registered with nvmem core expect 0 to be returned on success and a negative value to be returned on failure. isl1208_nvmem_read()/isl1208_nvmem_write() currently return the number of bytes read/written on success, fix to return 0 on success and negative on failure. Fixes: c3544f6f51ed ("rtc: isl1208: Add new style nvmem support to driver") Cc: [email protected] Signed-off-by: Joy Chakraborty <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: tps6594: Add power management supportRichard Genoud2024-06-271-0/+47
| | | | | | | | | | | | Add power management support to the driver. This allows a SoC to wake from suspend using the nINT provided by the RTC. It takes care of the case when the interrupt has not been caught because the kernel has not yet woke up. (This is the case when only edges interrupt are caught) Signed-off-by: Richard Genoud <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: tps6594: introduce private structure as drvdataRichard Genoud2024-06-271-12/+20
| | | | | | | | | | | This patch will prepare for the next one (power management support) by introducing struct tps6594_rtc. No functionnal change. Signed-off-by: Richard Genoud <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: tps6594: Fix memleak in probeRichard Genoud2024-06-271-4/+0
| | | | | | | | | | | | struct rtc_device is allocated twice in probe(), once with devm_kzalloc(), and then with devm_rtc_allocate_device(). The allocation with devm_kzalloc() is lost and superfluous. Fixes: 9f67c1e63976 ("rtc: tps6594: Add driver for TPS6594 RTC") Signed-off-by: Richard Genoud <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* pcf8563: add wakeup-source supportAlexandre Belloni2024-05-071-2/+7
| | | | | | | | | In some platforms, the RTC is able to wake up the system but is not directly connected to an IRQ. Add wakeup-source property support to be able to express this in the Device Tree. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: rx8111: handle VLOW flagAlexandre Belloni2024-05-071-0/+12
| | | | | | | | | | Allow userspace to get battery status information and be able to warn when battery is low and has to be replaced. Tested-by: Waqar Hameed <[email protected]> Reviewed-by: Waqar Hameed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: rx8111: demote warnings to debug levelAlexandre Belloni2024-05-071-5/+5
| | | | | | | | | | The proper way for userspace to react on a read time error is to have a look at the voltage low information. There is no point in cluttering dmesg as it is often not even visible to the end user. Reviewed-by: Waqar Hameed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: rx6110: Constify struct regmap_configChristophe JAILLET2024-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | | 'regmap_spi_config' and 'regmap_i2c_config' are not modified in this diver and are only used as a const struct regmap_config. Constifying these structures moves some data to a read-only section, so increase overall security. On a x86_64, with allmodconfig: Before: text data bss dec hex filename 8896 1554 32 10482 28f2 drivers/rtc/rtc-rx6110.o After: text data bss dec hex filename 9536 914 32 10482 28f2 drivers/rtc/rtc-rx6110.o Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/833a7f612c0de9dcb1179a0b75b189c237a335ac.1714862560.git.christophe.jaillet@wanadoo.fr Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: Add driver for Epson RX8111Waqar Hameed2024-04-163-0/+367
| | | | | | | | | Epson RX8111 is an RTC with alarm, timer and timestamp functionality. Add a basic driver with support for only reading/writing time (for now). Signed-off-by: Waqar Hameed <[email protected]> Link: https://lore.kernel.org/r/0c3e1b03f276da47b26ac50f5d0ddf5c67aabe5c.1700491765.git.waqar.hameed@axis.com Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: mcp795: drop unneeded MODULE_ALIASKrzysztof Kozlowski2024-04-161-1/+0
| | | | | | | | | | The ID table already has respective entry and MODULE_DEVICE_TABLE and creates proper alias for SPI driver. Having another MODULE_ALIAS causes the alias to be duplicated. Signed-off-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: nuvoton: Modify part number valueMia Lin2024-03-291-6/+9
| | | | | | | | | Base on datasheet, the part number is corresponding to bit 0 and 1 of the part info reg. Signed-off-by: Mia Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: test: Split rtc unit test into slow and normal speed testGuenter Roeck2024-03-291-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | On slow systems, the rtc unit test may result in soft lockups and/or generate messages such as # rtc_time64_to_tm_test_date_range: Test should be marked slow (runtime: 34.253230015s) # rtc_time64_to_tm_test_date_range: pass:1 fail:0 skip:0 total:1 The test covers a date range of 160,000 years, resulting in the long runtime. Unit tests running for more than 1 second are supposed to be marked as slow. Just marking the test as slow would prevent it from running when slow tests are disabled, which would not be desirable. At the same time, the current test range of 160,000 years seems to be of limited value. Split the test into two parts, one covering a range of 1,000 years and the other covering the current range of 160,000 years. Mark the 160,000 year test as slow to be able to separate it from the faster test. Signed-off-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: cros-ec: provide ID table for avoiding fallback matchTzung-Bi Shih2024-03-291-1/+8
| | | | | | | | | | | | Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Signed-off-by: Tzung-Bi Shih <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* Merge tag 'rtc-6.9' of ↵Linus Torvalds2024-03-228-253/+149
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Subsytem: - rtc_class is now const Drivers: - ds1511: cleanup, set date and time range and alarm offset limit - max31335: fix interrupt handler - pcf8523: improve suspend support" * tag 'rtc-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (28 commits) MAINTAINER: Include linux-arm-msm for Qualcomm RTC patches dt-bindings: rtc: zynqmp: Add support for Versal/Versal NET SoCs rtc: class: make rtc_class constant dt-bindings: rtc: abx80x: Improve checks on trickle charger constraints MAINTAINERS: adjust file entry in ARM/Mediatek RTC DRIVER rtc: nct3018y: fix possible NULL dereference rtc: max31335: fix interrupt status reg rtc: mt6397: select IRQ_DOMAIN instead of depending on it dt-bindings: rtc: abx80x: convert to yaml rtc: m41t80: Use the unified property API get the wakeup-source property dt-bindings: at91rm9260-rtt: add sam9x7 compatible dt-bindings: rtc: convert MT7622 RTC to the json-schema dt-bindings: rtc: convert MT2717 RTC to the json-schema rtc: pcf8523: add suspend handlers for alarm IRQ rtc: ds1511: set alarm offset limit rtc: ds1511: set range rtc: ds1511: drop inline/noinline hints rtc: ds1511: rename pdata rtc: ds1511: implement ds1511_rtc_read_alarm properly rtc: ds1511: remove partial alarm support ...
| * rtc: class: make rtc_class constantRicardo B. Marliere2024-03-082-9/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 43a7206b0963 ("driver core: class: make class_register() take a const *"), the driver core allows for struct class to be in read-only memory, so move the rtc_class structure to be declared at build time placing it into read-only memory, instead of having to be dynamically allocated at boot time. Cc: Greg Kroah-Hartman <[email protected]> Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Ricardo B. Marliere <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: nct3018y: fix possible NULL dereferenceAlexandre Belloni2024-03-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | alarm_enable and alarm_flag are allowed to be NULL but will be dereferenced later by the dev_dbg call. Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: max31335: fix interrupt status regAntoniu Miclaus2024-02-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix the register value comparison in the `max31335_volatile_reg` function for the interrupt status register. MAX31335_STATUS1 macro definition corresponds to the actual interrupt status register. Fixes: dedaf03b99d6 ("rtc: max31335: add driver support") Signed-off-by: Antoniu Miclaus <[email protected]> Reviewed-by: Nuno Sa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: mt6397: select IRQ_DOMAIN instead of depending on itRandy Dunlap2024-02-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IRQ_DOMAIN is a hidden (not user visible) symbol. Users cannot set it directly thru "make *config", so drivers should select it instead of depending on it if they need it. Relying on it being set for a dependency is risky. Consistently using "select" or "depends on" can also help reduce Kconfig circular dependency issues. Therefore, change the use of "depends on" for IRQ_DOMAIN to "select" for RTC_DRV_MT6397. Fixes: 04d3ba70a3c9 ("rtc: mt6397: add IRQ domain dependency") Cc: Arnd Bergmann <[email protected]> Cc: Eddie Huang <[email protected]> Cc: Sean Wang <[email protected]> Cc: Matthias Brugger <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Alessandro Zummo <[email protected]> Cc: Alexandre Belloni <[email protected]> Cc: [email protected] Cc: Marc Zyngier <[email protected]> Cc: Philipp Zabel <[email protected]> Cc: Peter Rosin <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Randy Dunlap <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: m41t80: Use the unified property API get the wakeup-source propertyCurtis Klein2024-02-291-4/+1
| | | | | | | | | | | | | | | | | | This allows both ACPI and Device Tree systems to specify the m41t80 as a wakeup-source. Signed-off-by: Curtis Klein <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: pcf8523: add suspend handlers for alarm IRQAlexandre Belloni2024-02-291-0/+25
| | | | | | | | | | | | | | Ensure the RTC is able to wake up the system from suspend. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: set alarm offset limitAlexandre Belloni2024-02-291-0/+1
| | | | | | | | | | | | | | | | The ds1511 can only support alarms up to a month in the future (which we currently limit to 28 days). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: set rangeAlexandre Belloni2024-02-291-0/+1
| | | | | | | | | | | | | | The ds1511 leap year calculation fails in 2100. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: drop inline/noinline hintsAlexandre Belloni2024-02-291-3/+3
| | | | | | | | | | | | | | | | There is no reason to not let the compiler optimise those functions as it wants. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: rename pdataAlexandre Belloni2024-02-291-29/+29
| | | | | | | | | | | | | | | | pdata is not actually about patform_data, rename it to something local to the driver. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: implement ds1511_rtc_read_alarm properlyAlexandre Belloni2024-02-291-22/+9
| | | | | | | | | | | | | | | | | | | | | | ds1511_rtc_read_alarm was useless as it is only called at boot time so the alarm members of pdata have not yet been set. Read the actual registers so there is a chance to get a meaningful value. Then, drop the alarm related members of pdata as they are not used anymore. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: remove partial alarm supportAlexandre Belloni2024-02-291-8/+4
| | | | | | | | | | | | | | | | The RTC core will always provide an alarm with all its members set, it is not necessary to support partial alarms. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: let the core know when alarm are not supportedAlexandre Belloni2024-02-291-15/+9
| | | | | | | | | | | | | | | | Instead of failing function calls, let the core know alarms are not supported so it can fail early and avoid unnecessary calls. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: remove ds1511_rtc_update_alarmAlexandre Belloni2024-02-291-29/+23
| | | | | | | | | | | | | | | | | | | | ds1511_rtc_update_alarm is called twice but one of the call is overkill as it only has to enable or disable the alarm instead of updating all the alarm registers. Merge it in its main call site and introduce a new finction to enable or disable the alarm. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: remove incomplete UIE supportAlexandre Belloni2024-02-291-13/+5
| | | | | | | | | | | | | | There is no way to enable UIE in the driver, drop RTC_UF support. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: fix function definitionAlexandre Belloni2024-02-291-16/+8
| | | | | | | | | | | | | | Use proper style for function definition. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: drop useless enumAlexandre Belloni2024-02-291-71/+49
| | | | | | | | | | | | | | | | Use regular defines for register offsets instead of the enum that doesn't bring any benefit. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: drop dead codeAlexandre Belloni2024-02-291-44/+0
| | | | | | | | | | | | | | | | The watchdog part of the code is not reachable and should be reimplemented properly as a watchdog driver. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: drop useless computationAlexandre Belloni2024-02-291-12/+1
| | | | | | | | | | | | | | | | All the callers of ds1511_rtc_set_time will use the same epoch for tm_year which is defined as the number of years minus 1900 since POSIX.1-2001. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
| * rtc: ds1511: drop useless checksAlexandre Belloni2024-02-291-12/+0
| | | | | | | | | | | | | | | | | | The RTC core will always pass a valid rtc_tm, it is unnecessary to check the validity of its members, especially with an open coded version of rtc_valid_tm(). Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>