summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-stm32.c
Commit message (Collapse)AuthorAgeFilesLines
* rtc: stm32: remove one condition check in stm32_rtc_set_alarm()Markus Elfring2019-07-131-5/+1
| | | | | | | | | | | | | | A condition check was repeated in this function implementation despite of a corresponding check in the stm32_rtc_alarm_irq_enable() function. Thus delete redundant source code here. This issue was detected by using the Coccinelle software. Suggested-by: Russell King <linux@armlinux.org.uk> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com> Link: https://lore.kernel.org/r/4da614a4-83c6-548c-a112-033b846c561b@web.de Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stm32: manage the get_irq probe defer caseFabien Dessenne2019-04-291-3/+6
| | | | | | | | Manage the -EPROBE_DEFER error case for the wake IRQ. Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com> Acked-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stm32: add stm32mp1 rtc supportAmelie Delaunay2018-05-221-14/+89
| | | | | | | | | | | | This patch adds support for stm32mp1 RTC. Some common registers with previous RTC version have a different offset. It is the case for Control Register (CR) and ALaRMA Register (ALRMAR). There are also new registers regarding event flags: now, Alarm event flag is in Status Register (SR) and write 1 in Status Clear Register (SCR) is required to clear the event. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stm32: rework register management to prepare other version of RTCAmelie Delaunay2018-05-221-57/+127
| | | | | | | | | This patch reworks register/bits management because next version of RTC uses the same way of working but with different register's offset or bits moved in new registers. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stm32: fix misspelling and misalignment issuesAmelie Delaunay2018-05-221-2/+2
| | | | | | | | | | | | | | | | This patch cleans the following checkpatch complaints: CHECK: 'initalized' may be misspelled - perhaps 'initialized'? #644: FILE: drivers/rtc/rtc-stm32.c:644: + * the calendar has been initalized or not. INITS flag is reset by a CHECK: Alignment should match open parenthesis #669: FILE: drivers/rtc/rtc-stm32.c:669: + rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, pdev->name, + &stm32_rtc_ops, THIS_MODULE); Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stm32: get DBP register and mask from DT st, syscfg propertyAmelie Delaunay2018-05-061-22/+37
| | | | | | | | | | | | RTC driver should not be aware of the PWR registers offset and bits position. Furthermore, we can imagine that DBP relative register and bit mask could change depending on the SoC. So this patch introduces 2 parameters, dbp_reg and dbp_mask, allowing to get PWR_CR and PWR_CR_DBP from device tree. And it prepares next RTC version, backup domain write protection is disabled only if needed. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stm32: fix alarm interrupt flags by removing IRQF_TRIGGER_RISINGAmelie Delaunay2018-05-061-2/+1
| | | | | | | | RTC alarm interrupt is active high and already configured by device tree. So remove IRQF_TRIGGER_RISING from driver. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stm32: fix copyright and adopt SPDX identifierAmelie Delaunay2018-05-061-3/+3
| | | | | | | | Fix copyright by removing "SA" and "for STMicroelectronics", not required. Adopt SPDX identifier. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* rtc: stm32: Fix copyrightBenjamin Gaignard2017-11-291-2/+2
| | | | | | | | | Uniformize STMicroelectronics copyrights header Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com> CC: Amelie Delaunay <amelie.delaunay@st.com> Acked-by: Alexandre TORGUE <alexandre.torgue@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: stm32: add STM32H7 RTC supportAmelie Delaunay2017-07-061-17/+65
| | | | | | | | This patch adds support for STM32H7 RTC. On STM32H7, the RTC bus interface clock (APB clock) needs to be enabled. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: stm32: fix comparison warningsAmelie Delaunay2017-01-231-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | This patches fixes comparison between signed and unsigned values as it could produce an incorrect result when the signed value is converted to unsigned: drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_valid_alrm': drivers/rtc/rtc-stm32.c:404:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if ((((tm->tm_year > cur_year) && ... It also fixes comparison always true or false due to the fact that unsigned value is compared against zero with >= or <: drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_init': drivers/rtc/rtc-stm32.c:514:35: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits] for (pred_a = pred_a_max; pred_a >= 0; pred_a-- ) { drivers/rtc/rtc-stm32.c:530:44: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] (rate - ((pred_a + 1) * (pred_s + 1)) < 0) ? Fixes: 4e64350f42e2 ("rtc: add STM32 RTC driver") Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: stm32: use 0 instead of ~PWR_CR_DBP in regmap_update_bitsAmelie Delaunay2017-01-231-2/+2
| | | | | | | | | | | | | | | | | | Using the ~ operator on a BIT() constant results in a large 'unsigned long' constant that won't fit into an 'unsigned int' function argument on 64-bit architectures, resulting in a harmless build warning in x86 allmodconfig: drivers/rtc/rtc-stm32.c: In function 'stm32_rtc_probe': drivers/rtc/rtc-stm32.c:651:51: error: large integer implicitly truncated to unsigned type [-Werror=overflow] regmap_update_bits(rtc->dbp, PWR_CR, PWR_CR_DBP, ~PWR_CR_DBP); As PWR_CR_DBP mask prevents other bits to be cleared, replace all ~PWR_CR_DBP by 0. Fixes: 4e64350f42e2 ("rtc: add STM32 RTC driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: stm32: fix building without CONFIG_OFArnd Bergmann2017-01-131-2/+0
| | | | | | | | | | | | The new driver has a stray #ifdef in it that causes a build error: drivers/rtc/rtc-stm32.c:718:21: error: 'stm32_rtc_of_match' undeclared here (not in a function); did you mean 'stm32_rtc_pm_ops'? As the #ifdef serves no purpose here, let's just remove it. Fixes: 4e64350f42e2 ("rtc: add STM32 RTC driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: stm32: remove __exit annotation on remove callbackArnd Bergmann2017-01-131-1/+1
| | | | | | | | | | | | | | The remove function can be called at runtime for a manual 'unbind' operation and must not be left out from a built-in driver, as kbuild complains: `stm32_rtc_remove' referenced in section `.data.stm32_rtc_driver' of drivers/rtc/rtc-stm32.o: defined in discarded section `.exit.text' of drivers/rtc/rtc-stm32.o This removes the extraneous annotation. Fixes: 4e64350f42e2 ("rtc: add STM32 RTC driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: add STM32 RTC driverAmelie Delaunay2017-01-131-0/+727
This patch adds support for the STM32 RTC. Signed-off-by: Amelie Delaunay <amelie.delaunay@st.com> Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
OpenPOWER on IntegriCloud