aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-at91rm9200.c
Commit message (Collapse)AuthorAgeFilesLines
* rtc: use boolean values with device_init_wakeup()Wolfram Sang2025-01-091-1/+1
| | | | | | | | | | | | 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: Switch back to struct platform_driver::remove()Uwe Kleine-König2024-11-101-1/+1
| | | | | | | | | | | | | | | 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]>
* rtc: at91rm9200: annotate at91_rtc_remove with __exit againAlexandre Belloni2023-10-161-1/+1
| | | | | | | | | | | | | | | Having the driver as a builtin after dropping the __exit annotation results in: >> drivers/rtc/rtc-at91rm9200.c:561:13: warning: 'at91_rtc_remove' defined but not used [-Wunused-function] 561 | static void at91_rtc_remove(struct platform_device *pdev) | ^~~~~~~~~~~~~~~ Reported-by: Stephen Rothwell <[email protected]> Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: Convert to platform remove callback returning voidUwe Kleine-König2023-10-131-4/+2
| | | | | | | | | | | | | | | | | | | The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove(). Trivially convert this driver from always returning zero in the remove callback to the void returning variant. 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: at91rm9200: Mark driver struct with __refdata to prevent section ↵Uwe Kleine-König2023-10-131-1/+7
| | | | | | | | | | | | mismatch warning As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent a section mismatch warning. 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: remove redundant of_match_ptr()Zhu Wang2023-08-101-1/+1
| | | | | | | | | | Signed-off-by: Zhu Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: Explicitly include correct DT includesRob Herring2023-07-271-1/+0
| | | | | | | | | | | | | | | The DT of_device.h and of_platform.h date back to the separate of_platform_bus_type before it as merged into the regular platform bus. As part of that merge prepping Arm DT support 13 years ago, they "temporarily" include each other. They also include platform_device.h and of.h. As a result, there's a pretty much random mix of those include files used throughout the tree. In order to detangle these headers and replace the implicit includes with struct declarations, users need to explicitly include the correct includes. Signed-off-by: Rob Herring <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: Fix syntax errors in commentsXiang wangx2022-12-151-1/+1
| | | | | | | | Delete the redundant word 'is'. Signed-off-by: Xiang wangx <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: rework rtc_register_device() resource managementBartosz Golaszewski2020-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | rtc_register_device() is a managed interface but it doesn't use devres by itself - instead it marks an rtc_device as "registered" and the devres callback for devm_rtc_allocate_device() takes care of resource release. This doesn't correspond with the design behind devres where managed structures should not be aware of being managed. The correct solution here is to register a separate devres callback for unregistering the device. While at it: rename rtc_register_device() to devm_rtc_register_device() and add it to the list of managed interfaces in devres.rst. This way we can avoid any potential confusion of driver developers who may expect there to exist a corresponding unregister function. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* rtc: at91rm9200: Add sam9x60 compatibleAlexandre Belloni2020-11-171-0/+3
| | | | | | | | | Handle the sam9x60 RTC. While it can work with the at91sam9x5 fallback, it has crystal correction support and doesn't need to shadow IMR. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* rtc: at91rm9200: add correction supportAlexandre Belloni2020-11-171-4/+99
| | | | | | | | | The sama5d4 and sama5d2 RTCs are able to correct for imprecise crystals, up to 1953 ppm. Signed-off-by: Alexandre Belloni <[email protected]> Reviewed-by: Nicolas Ferre <[email protected]> Link: https://lore.kernel.org/r/[email protected]
* rtc: at91rm9200: use FIELD_PREP/FIELD_GETAlexandre Belloni2020-01-151-20/+22
| | | | | | | Use FIELD_PREP and FIELD_GET instead of hardcoding already defined values. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: avoid time readout in at91_rtc_setalarmAlexandre Belloni2020-01-151-14/+6
| | | | | | | | The current rtc time is read out in at91_rtc_setalarm but it it immediately overwritten by the alarm time. Remove the readout. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: move register definitions to C fileAlexandre Belloni2020-01-151-1/+45
| | | | | | | | | | The header was simply moved from the arm mach folder to drivers/rtc but there is not point in having it separated from the driver. Also remove unused bit definitions and use BIT and GENMASK. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: add sama5d4 and sama5d2 compatiblesAlexandre Belloni2020-01-151-0/+6
| | | | | | | | Both the sama5d4 and sama5d2 RTCs have more features than the previous RTCs, add a compatible string for them. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: remove procfs informationAlexandre Belloni2020-01-151-15/+0
| | | | | | | | The RTC procfs interface is deprecated and hasn't been used by userspace for years. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: use of_device_get_match_data()Claudiu Beznea2019-10-031-18/+1
| | | | | | | | | | Use of_device_get_match_data() since all platforms should now use DT bindings. AVR32 architecture has been removed in commit 26202873bb51 ("avr32: remove support for AVR32 architecture"). Signed-off-by: Claudiu Beznea <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: Remove dev_err() usage after platform_get_irq()Stephen Boyd2019-08-131-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Cc: Alessandro Zummo <[email protected]> Cc: Alexandre Belloni <[email protected]> Cc: [email protected] Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Stephen Boyd <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
* treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152Thomas Gleixner2019-05-301-6/+1
| | | | | | | | | | | | | | | | | | | | | Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 3029 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
* rtc: at91rm9200: Switch to use %ptRAndy Shevchenko2018-12-101-11/+4
| | | | | | | | Use %ptR instead of open coded variant to print content of struct rtc_time in human readable format. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: add rangeAlexandre Belloni2018-05-171-0/+2
| | | | | | | The at91rm9200 RTC can support dates from 1900-01-01 00:00:00 to 2099-12-31 23:59:59. Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: fix reading alarm valueAlexandre Belloni2017-11-101-12/+6
| | | | | | | | | | | | | | | | When alarm value is read at boot time, at91_alarm_year is not yet set to the proper value so the year is always set to 1900. This results in that kind of message at boot: rtc rtc0: invalid alarm value: 1900-1-14 2:11:39 There is no way to recover from that as the alarm is now only read when booting. Instead, rely on the rtc core to figure out the proper year. Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: stop calculating yday in at91_rtc_readalarmAlexandre Belloni2017-11-101-1/+0
| | | | | | | | | Calculating yday in the read_alarm callback is useless as this value is never used later. Also, it was buggy anyway because at the time this is done, tm_year is always 0 as the alarm register doesn't hold the year. Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: remove race conditionAlexandre Belloni2017-07-071-6/+8
| | | | | | | | | | While highly unlikely, it is possible to get an interrupt as soon as it is requested. In that case, at91_rtc_interrupt() will be called with rtc == NULL. Solve that by using devm_rtc_allocate_device/rtc_register_device. Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: clear RTC alarm status flag prior to suspendingWenyou Yang2015-11-081-0/+2
| | | | | | | | | | | | | As said in the SAMA5D2 datasheet, "Prior to instructing the device to enter ULP mode 1, ... and the internal sources of wake-up must be cleared." This patch is to clear the RTC alarm status flag prior to suspending to avoid the erroneous wake-up activity, as it is often used as the wake-up source for the ULP mode 1. Signed-off-by: Wenyou Yang <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: get and use slow clockAlexandre Belloni2015-09-051-3/+24
| | | | | | | | | | | Commit dca1a4b5ff6e ("clk: at91: keep slow clk enabled to prevent system hang") added a workaround for the slow clock as it is not properly handled by its users. Get and use the slow clock as it is necessary for the at91rm9200 rtc. Acked-by: Boris Brezillon <[email protected]> Signed-off-by: Alexandre Belloni <[email protected]>
* rtc: at91rm9200: sort headers alphabeticallyAlexandre Belloni2015-09-051-8/+8
| | | | | | | | Sort included headers alphabetically. Signed-off-by: Alexandre Belloni <[email protected]> Acked-by: Boris Brezillon <[email protected]> Acked-by: Nicolas Ferre <[email protected]>
* drivers/rtc/rtc-at91rm9200.c: make IO endian agnosticBen Dooks2015-04-171-2/+2
| | | | | | | | | | | | | Change the __raw IO calls to readl/write_relaxed which makes the driver endian agnostic to run properly on big endian systems. Signed-off-by: Ben Dooks <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Andrew Victor <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc: at91rm9200: double locking bug in at91_rtc_interrupt()Dan Carpenter2015-03-181-1/+1
| | | | | | | | | | | There is a typo here so we deadlock. Fixes: dd1f1f391dd7 ('rtc: at91rm9200: rework wakeup and interrupt handling') Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Boris Brezillon <[email protected]> Reported-by: David Dueck <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
* rtc: at91rm9200: rework wakeup and interrupt handlingBoris BREZILLON2015-03-041-14/+48
| | | | | | | | | | | | | | | | | | The IRQ line used by the RTC device is usually shared with the system timer (PIT) on at91 platforms. Since timers are registering their handlers with IRQF_NO_SUSPEND, we should expect being called in suspended state, and properly wake the system up when this is the case. Set IRQF_COND_SUSPEND flag when registering the IRQ handler to inform irq core that it can safely be called while the system is suspended. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alexandre Belloni <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Acked-by: Mark Rutland <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
* rtc: drop owner assignment from platform_driversWolfram Sang2014-10-201-1/+0
| | | | | | | A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <[email protected]>
* rtc: rtc-at91rm9200: fix infinite wait for ACKUPD irqBoris BREZILLON2014-06-061-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | The rtc user must wait at least 1 sec between each time/calandar update (see atmel's datasheet chapter "Updating Time/Calendar"). Use the 1Hz interrupt to update the at91_rtc_upd_rdy flag and wait for the at91_rtc_wait_upd_rdy event if the rtc is not ready. This patch fixes a deadlock in an uninterruptible wait when the RTC is updated more than once every second. AFAICT the bug is here from the beginning, but I think we should at least backport this fix to 3.10 and the following longterm and stable releases. Signed-off-by: Boris BREZILLON <[email protected]> Reported-by: Bryan Evenson <[email protected]> Tested-by: Bryan Evenson <[email protected]> Cc: Andrew Victor <[email protected]> Cc: Nicolas Ferre <[email protected]> Cc: Jean-Christophe Plagniol-Villard <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* drivers/rtc/rtc-at91rm9200.c: correct alarm over day/month wrapLinus Pizunski2013-12-131-0/+2
| | | | | | | | | | | Update month and day of month to the alarm month/day instead of current day/month when setting the RTC alarm mask. Signed-off-by: Linus Pizunski <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* ARM: drivers/rtc/rtc-at91rm9200.c: disable interrupts at shutdownJohan Hovold2013-11-221-0/+9
| | | | | | | | | | | | | | | | | | | | Make sure RTC-interrupts are disabled at shutdown. As the RTC is generally powered by backup power (VDDBU), its interrupts are not disabled on wake-up, user, watchdog or software reset. This could cause troubles on other systems (e.g. older kernels) if an interrupt occurs before a handler has been installed at next boot. Let us be well-behaved and disable them on clean shutdowns at least (as do the RTT-based rtc-at91sam9 driver). Signed-off-by: Johan Hovold <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Cc: Jean-Christophe Plagniol-Villard <[email protected]> Cc: Andrew Victor <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* drivers/rtc/rtc-at91rm9200.c: use devm_* APIsSachin Kamat2013-11-131-21/+7
| | | | | | | | | devm_* APIs are device managed and make code simpler. Signed-off-by: Sachin Kamat <[email protected]> Cc: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc: rtc-at91rm9200: remove unnecessary platform_set_drvdata()Jingoo Han2013-07-031-1/+0
| | | | | | | | | | | The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata = NULL when no driver is bound"). Thus, it is not needed to manually clear the device driver data to NULL. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* drivers/rtc/rtc-at91rm9200.c: include <linux/uaccess.h>Sachin Kamat2013-07-031-2/+1
| | | | | | | | | | | Silences the following checkpatch warning: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> Signed-off-by: Sachin Kamat <[email protected]> Cc: Andrew Victor <[email protected]> Cc: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc-at91rm9200: use shadow IMR on at91sam9x5Johan Hovold2013-06-121-0/+7
| | | | | | | | | | | | | | | Add support for the at91sam9x5-family which must use the shadow interrupt mask due to a hardware issue (causing RTC_IMR to always be zero). Signed-off-by: Johan Hovold <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Cc: Douglas Gilbert <[email protected]> Cc: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Ludovic Desroches <[email protected]> Cc: Robert Nelson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc-at91rm9200: add shadow interrupt maskJohan Hovold2013-06-121-1/+38
| | | | | | | | | | | | | | | | | | | | | Add shadow interrupt-mask register which can be used on SoCs where the actual hardware register is broken. Note that some care needs to be taken to make sure the shadow mask corresponds to the actual hardware state. The added overhead is not an issue for the non-broken SoCs due to the relatively infrequent interrupt-mask updates. We do, however, only use the shadow mask value as a fall-back when it actually needed as there is still a theoretical possibility that the mask is incorrect (see the code for details). Signed-off-by: Johan Hovold <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Cc: Douglas Gilbert <[email protected]> Cc: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Ludovic Desroches <[email protected]> Cc: Robert Nelson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc-at91rm9200: refactor interrupt-register handlingJohan Hovold2013-06-121-14/+29
| | | | | | | | | | | | | | | | Add accessors for the interrupt register. This will allow us to easily add a shadow interrupt-mask register to use on SoCs where the interrupt-mask register cannot be used. Signed-off-by: Johan Hovold <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Cc: Douglas Gilbert <[email protected]> Cc: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Ludovic Desroches <[email protected]> Cc: Robert Nelson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc-at91rm9200: add configuration supportJohan Hovold2013-06-121-8/+38
| | | | | | | | | | | | | | Add configuration support which can be used to implement SoC-specific workarounds for broken hardware. Signed-off-by: Johan Hovold <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Cc: Douglas Gilbert <[email protected]> Cc: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Ludovic Desroches <[email protected]> Cc: Robert Nelson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc-at91rm9200: add match-table compile guardJohan Hovold2013-06-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The members of Atmel's at91sam9x5 family (9x5) have a broken RTC interrupt mask register (AT91_RTC_IMR). It does not reflect enabled interrupts but instead always returns zero. The kernel's rtc-at91rm9200 driver handles the RTC for the 9x5 family. Currently when the date/time is set, an interrupt is generated and this driver neglects to handle the interrupt. The kernel complains about the un-handled interrupt and disables it henceforth. This not only breaks the RTC function, but since that interrupt is shared (Atmel's SYS interrupt) then other things break as well (e.g. the debug port no longer accepts characters). Tested on the at91sam9g25. Bug confirmed by Atmel. This patch (of 5): Add missing match-table compile guard. Signed-off-by: Johan Hovold <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Cc: Douglas Gilbert <[email protected]> Cc: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Ludovic Desroches <[email protected]> Cc: Robert Nelson <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* drivers/rtc/rtc-at91rm9200.c: fix missing iounmapJohan Hovold2013-04-301-3/+11
| | | | | | | | | | Add missing iounmap to probe error path and remove. Signed-off-by: Johan Hovold <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* drivers/rtc/rtc-at91rm9200.c: add DT supportJoachim Eastwood2013-04-301-0/+9
| | | | | | | Signed-off-by: Joachim Eastwood <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc: rtc-at91rm9200: switch to using SIMPLE_DEV_PM_OPSJingoo Han2013-04-301-12/+4
| | | | | | | | | Switch to using the SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. It reduces code size. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc: rtc-at91rm9200: use module_platform_driver_probe()Jingoo Han2013-04-301-12/+1
| | | | | | | | | Use module_platform_driver_probe() macro which makes the code smaller and simpler. Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* Revert "drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMR"Johan Hovold2013-04-051-31/+19
| | | | | | | | | | | | | | | | | This reverts commit 0ef1594c017521ea89278e80fe3f80dafb17abde. This patch introduced a few races which cannot be easily fixed with a small follow-up patch. Furthermore, the SoC with the broken hardware register, which this patch intended to add support for, can only be used with device trees, which this driver currently does not support. [ Here is the discussion that led to this "revert" patch: https://lkml.org/lkml/2013/4/3/176 ] Cc: stable <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* drivers/rtc/rtc-at91rm9200.c: use a variable for storing IMRNicolas Ferre2013-03-221-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some revisions of AT91 SoCs, the RTC IMR register is not working. Instead of elaborating a workaround for that specific SoC or IP version, we simply use a software variable to store the Interrupt Mask Register and modify it for each enabling/disabling of an interrupt. The overhead of this is negligible anyway. The interrupt mask register (IMR) for the RTC is broken on the AT91SAM9x5 sub-family of SoCs (good overview of the members here: http://www.eewiki.net/display/linuxonarm/AT91SAM9x5 ). The "user visible effect" is the RTC doesn't work. That sub-family is less than two years old and only has devicetree (DT) support and came online circa lk 3.7 . The dust is yet to settle on the DT stuff at least for AT91 SoCs (translation: lots of stuff is still broken, so much that it is hard to know where to start). The fix in the patch is pretty simple: just shadow the silicon IMR register with a variable in the driver. Some older SoCs (pre-DT) use the the rtc-at91rm9200 driver (e.g. obviously the AT91RM9200) and they should not be impacted by the change. There shouldn't be a large volume of interrupts associated with a RTC. Signed-off-by: Nicolas Ferre <[email protected]> Reported-by: Douglas Gilbert <[email protected]> Cc: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Ludovic Desroches <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* rtc: rtc-at91rm9200: use dev_dbg()/dev_err() instead of printk()/pr_debug()Jingoo Han2013-02-221-9/+8
| | | | | | | | | | Fix the checkpatch warning as below: WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ... Signed-off-by: Jingoo Han <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
* arm: at91: move at91rm9200 rtc header in drivers/rtcJean-Christophe PLAGNIOL-VILLARD2012-11-061-1/+1
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Nicolas Ferre <[email protected]>