summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'rtc-4.19' of ↵Linus Torvalds2018-08-2024-941/+490
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "It is now possible to add custom sysfs attributes while avoiding a possible race condition. Unused code has been removed resulting in a nice reduction of the code base. And more drivers have been switched to SPDX by their maintainers. Summary: Subsystem: - new helpers to add custom sysfs attributes - struct rtc_task removal along with rtc_irq_[un]register() - rtc_irq_set_state and rtc_irq_set_freq are not exported anymore Drivers: - armada38x: reset after rtc power loss - ds1307: now supports m41t11 - isl1208: now supports isl1219 and tamper detection - pcf2127: internal SRAM support" * tag 'rtc-4.19' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (34 commits) rtc: ds1307: simplify hwmon config rtc: s5m: Add SPDX license identifier rtc: maxim: Add SPDX license identifiers rtc: isl1219: add device tree documentation rtc: isl1208: set ev-evienb bit from device tree rtc: isl1208: Add "evdet" interrupt source for isl1219 rtc: isl1208: add support for isl1219 with tamper detection rtc: sysfs: facilitate attribute add to rtc device rtc: remove struct rtc_task char: rtc: remove task handling rtc: pcf85063: preserve control register value between stop and start rtc: sh: remove unused variable rtc_dev rtc: unexport rtc_irq_set_* rtc: simplify rtc_irq_set_state/rtc_irq_set_freq rtc: remove irq_task and irq_task_lock rtc: remove rtc_irq_register/rtc_irq_unregister rtc: sh: remove dead code rtc: sa1100: don't set PIE frequency rtc: ds1307: support m41t11 variant rtc: ds1307: fix data pointer to m41t0 ...
| * rtc: ds1307: simplify hwmon configHeiner Kallweit2018-08-162-10/+1
| | | | | | | | | | | | | | | | | | | | We don't have to define an extra config symbol, IS_REACHABLE does what we need. And having this config symbol just to save the few bytes of hwmon support on non-DS3231 chips isn't worth it IMO (especially as the symbol is set per default). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: s5m: Add SPDX license identifierKrzysztof Kozlowski2018-08-141-16/+6
| | | | | | | | | | | | | | | | Replace GPL v2.0+ license statement with SPDX license identifier. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: maxim: Add SPDX license identifiersKrzysztof Kozlowski2018-08-143-39/+21
| | | | | | | | | | | | | | | | Replace GPL v2.0+ license statements with SPDX license identifiers. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: isl1208: set ev-evienb bit from device treeDenis Osterland2018-08-141-3/+18
| | | | | | | | | | | | | | Add support to disable event in pull-up. Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: isl1208: Add "evdet" interrupt source for isl1219Denis Osterland2018-08-141-16/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for "evdet" named interrupt source. The check if i2c client irq matches evdet irq is needed for the case that there is only one interrupt named "evdet". In this case i2c client code handles this like an unnamed interrupt souce and assigns the value. Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com> Reviewed-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: isl1208: add support for isl1219 with tamper detectionMichael Grzeschik2018-08-141-7/+124
| | | | | | | | | | | | | | | | | | | | | | | | We add support for the ISL1219 chip that got an integrated tamper detection function. This patch implements the feature by adding an additional timestamp0 file to sysfs device path. This file contains seconds since epoch, if an event occurred, or is empty, if none occurred. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: sysfs: facilitate attribute add to rtc deviceDenis Osterland2018-08-142-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patches addresses following problem: rtc_allocate_device devm_device_add_group <-- kernel oops / null pointer, because sysfs entry does not yet exist rtc_register_device rc = devm_device_add_group if (rc) return rc; <-- forbidden to return error code after device register This patch adds rtc_add_group(s) functions. The functions store the sum of attribute groups as device resource. Signed-off-by: Denis Osterland <Denis.Osterland@diehl.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: remove struct rtc_taskAlexandre Belloni2018-08-021-4/+4
| | | | | | | | | | | | Include rtc_task members directly in rtc_timer member. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: pcf85063: preserve control register value between stop and startAlvin Šipraga2018-07-281-10/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix a bug that caused the Control_1 register to get zeroed whenever the RTC time is set. The problem occurred between stopping and starting the RTC clock, wherein the return value of a successful I2C write function would get written to the register. Also update variables of the start and stop functions to be more consistent with the rest of the driver. Signed-off-by: Alvin Šipraga <alvin@airtame.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: sh: remove unused variable rtc_devAnders Roxell2018-07-271-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | When building rtc-sh, rtc_dev isn't used in function __sh_rtc_periodic. drivers/rtc/rtc-sh.c: In function ‘__sh_rtc_periodic’: drivers/rtc/rtc-sh.c:146:21: warning: unused variable ‘rtc_dev’ [-Wunused-variable] struct rtc_device *rtc_dev = rtc->rtc_dev; ^~~~~~~ Remove the declaration of rtc_dev to dispose the warning. Fixes: ec623ff014c4 ("rtc: sh: remove dead code") Signed-off-by: Anders Roxell <anders.roxell@linaro.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: unexport rtc_irq_set_*Alexandre Belloni2018-07-261-2/+0
| | | | | | | | | | | | Make the rtc_irq_set interface internale to the RTC subsystem. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: simplify rtc_irq_set_state/rtc_irq_set_freqAlexandre Belloni2018-07-262-6/+6
| | | | | | | | | | | | | | The PIE doesn't handle tasks anymore, remove the pointer from the interface. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: remove irq_task and irq_task_lockAlexandre Belloni2018-07-262-41/+10
| | | | | | | | | | | | | | There is no way to set a periodic task anymore, remove task pointer and lock. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: remove rtc_irq_register/rtc_irq_unregisterAlexandre Belloni2018-07-261-33/+0
| | | | | | | | | | | | | | The rtc_irq_* interface is not used from outside the RTC subsytem since 2016. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: sh: remove dead codeAlexandre Belloni2018-07-261-88/+1
| | | | | | | | | | | | | | | | | | Since commit 80d4bb515b78 ("RTC: Cleanup rtc_class_ops->irq_set_state") and commit 696160fec162 ("RTC: Cleanup rtc_class_ops->irq_set_freq()"), sh_rtc_irq_set_state and sh_rtc_irq_set_freq are never called. Remove them along with task handling. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: sa1100: don't set PIE frequencyAlexandre Belloni2018-07-251-1/+0
| | | | | | | | | | | | | | It doesn't make sense to set the PIE frequency from the driver. Let userspace do its job. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1307: support m41t11 variantGiulio Benetti2018-07-161-0/+14
| | | | | | | | | | | | | | | | | | | | | | The m41t11 variant is very similar to the already supported m41t00 and m41t0, but it has also 56 bytes of NVRAM. Add it to driver taking into account NVRAM section. Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1307: fix data pointer to m41t0Giulio Benetti2018-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | data field points to m41t00, instead it should point to m41t0. Driver works correctly because on both cases(m41t0 and m41t00) chip_desc are equal. Point to right enum m41t0 instead of m41t00. Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: use ktime_get_real_ts64() instead of getnstimeofday64()Arnd Bergmann2018-07-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | getnstimeofday64() is just a wrapper around the ktime accessor, so we should use that directly. I considered using ktime_get_boottime_ts64() (to avoid leap second problems) or ktime_get_real_seconds() (to simplify the calculation, but in the end concluded that the existing interface is probably the most appropriate in this case. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: m48t59: remove redundant pointer 'name'Colin Ian King2018-07-121-4/+0
| | | | | | | | | | | | | | | | | | | | | | Pointer 'name' is being assigned but is never used hence it is redundant and can be removed. Cleans up clang warning: warning: variable 'name' set but not used [-Wunused-but-set-variable] Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: omap: drop unnecessary register unlock around readsJohan Hovold2018-07-121-4/+0
| | | | | | | | | | | | | | Drop unnecessary register write-unlock around two read accesses. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: omap: add missing register lock in error pathJohan Hovold2018-07-121-0/+1
| | | | | | | | | | | | | | For completeness re-lock the registers also in the power-off error path. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: omap: fix resource leak in registration error pathJohan Hovold2018-07-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | Make sure to deregister the pin controller in case rtc registration fails. Fixes: 57072758623f ("rtc: omap: switch to rtc_register_device") Cc: stable <stable@vger.kernel.org> # 4.14 Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: omap: fix potential crash on power offJohan Hovold2018-07-121-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not set the system power-off callback and omap power-off rtc pointer until we're done setting up our device to avoid leaving stale pointers around after a late probe error. Fixes: 97ea1906b3c2 ("rtc: omap: Support ext_wakeup configuration") Cc: stable <stable@vger.kernel.org> # 4.9 Cc: Marcin Niestroj <m.niestroj@grinn-global.com> Cc: Tony Lindgren <tony@atomide.com> Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: test: make array pdev staticColin Ian King2018-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | The array pdev is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'pdev' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: armada38x: reset after rtc power lossBaruch Siach2018-07-121-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the RTC block looses power it needs a reset sequence to make it usable again. Otherwise, writes to the time register have no effect. This reset sequence combines information from the mvebu_rtc driver in the Marvell provided U-Boot, and the SolidRun provided U-Boot repo. Tested on the Armada 388 based SolidRun Clearfog Base. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Acked-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: stmp3xxx: Don't reset the rtc in .probe() when watchdog is runningUwe Kleine-König2018-07-111-4/+16
| | | | | | | | | | | | | | | | | | | | As pointed out in the added comment resetting the rtc also stops the included watchdog. This is bad if the bootloader started the watchdog to secure the boot process. So don't reset if the watchdog is running. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: pcf2127: add support for accessing internal static RAMUwe Kleine-König2018-07-111-6/+62
| | | | | | | | | | | | | | | | The PCF2127 has 512 bytes of internal static RAM and this patch expands the driver to access this memory. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: snvs: Add timeouts to avoid kernel lockupsTrent Piepho2018-07-111-35/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to read correctly from asynchronously updated RTC registers, it's necessary to read repeatedly until their values do not change from read to read. It's also necessary to wait for three RTC clock ticks for certain operations. There are no timeouts in this code and these operations could possibly loop forever. To avoid kernel hangs, put in timeouts. The iMX7d can be configured to stop the SRTC on a tamper event, which will lockup the kernel inside this driver as described above. These hangs can happen when running under qemu, which doesn't emulate the SNVS RTC, though currently the driver will refuse to load on qemu due to a timeout in the driver probe method. It could also happen if the SRTC block where somehow placed into reset or the slow speed clock that drives the SRTC counter (but not the CPU) were to stop. The symptoms on a two core iMX7d are a work queue hang on rtc_timer_do_work(), which eventually blocks a systemd fsnotify operation that triggers a work queue flush, causing systemd to hang and thus causing all services that should be started by systemd, like a console getty, to fail to start or stop. Also optimize the wait code to wait less. It only needs to wait for the clock to advance three ticks, not to see it change three times. Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Shawn Guo <shawn.guo@linaro.org> Cc: Bryan O'Donoghue <pure.logic@nexus-software.ie> Signed-off-by: Trent Piepho <tpiepho@impinj.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: bq4802: add error handling for devm_ioremapZhouyang Jia2018-07-111-0/+4
| | | | | | | | | | | | | | | | | | | | When devm_ioremap fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling devm_ioremap. Signed-off-by: Zhouyang Jia <jiazhouyang09@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1685: remove sysfs access to control registersAlexandre Belloni2018-06-202-381/+0
| | | | | | | | | | | | | | Access to the control registers is mostly not needed and can cause runtime issues (like missed interrupts). Remove this debugging interface. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * rtc: ds1685: remove improper datetime access ABIAlexandre Belloni2018-06-201-221/+0
| | | | | | | | | | | | | | The driver exposes an undocumented ABI to access the date and time registers. It is not actually used by any userspace tools. Remove it. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* | Merge 4.18-rc5 into char-misc-nextGreg Kroah-Hartman2018-07-162-6/+6
|\ \ | | | | | | | | | | | | | | | We want the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * | rtc: fix alarm read and set offsetAlexandre Belloni2018-07-131-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | The offset needs to be added after reading the alarm value. It also needs to be subtracted after the now < alarm test. Tested-by: Jon Hunter <jonathanh@nvidia.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: mrst: fix error code in probe()Dan Carpenter2018-06-201-3/+1
| |/ | | | | | | | | | | | | | | | | We should be returning "retval". The "mrst_rtc.rtc" variable is a valid pointer. Fixes: 32b41f93dcaf ("rtc: mrst: switch to devm functions") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
* / headers: separate linux/mod_devicetable.h from linux/platform_device.hRandy Dunlap2018-07-078-0/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | At over 4000 #includes, <linux/platform_device.h> is the 9th most #included header file in the Linux kernel. It does not need <linux/mod_devicetable.h>, so drop that header and explicitly add <linux/mod_devicetable.h> to source files that need it. 4146 #include <linux/platform_device.h> After this patch, there are 225 files that use <linux/mod_devicetable.h>, for a reduction of around 3900 times that <linux/mod_devicetable.h> does not have to be read & parsed. 225 #include <linux/mod_devicetable.h> This patch was build-tested on 20 different arch-es. It also makes these drivers SubmitChecklist#1 compliant. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kbuild test robot <lkp@intel.com> # drivers/media/platform/vimc/ Reported-by: kbuild test robot <lkp@intel.com> # drivers/pinctrl/pinctrl-u300.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge tag 'mfd-next-4.18' of ↵Linus Torvalds2018-06-111-4/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Device Support: - Add support for AXP813 ADC to AXP20x - Add support for PM8005, PM8998 and PMI8998 New Functionality: - Add support for Battery Power Supply to AXP813 - Add support for SYSCON to SPARD SC27XX SPI - Add support for RTC to ChromeOS Embedded-Controller Fix-ups: - Remove unused code; exynos{4,5}-pmu, cros_ec, cros_ec_acpi_gpe - Remove duplicate error messages (-ENOMEM, etc); htc-i2cpld, janz-cmodio, max8997, rc5t583, sm501, smsc-ece1099, abx500-core, si476x-i2c, ti_am335x_tscadc, tps65090, tps6586x, tps65910, tps80031, twl6030-irq, viperboard - Succinctly use ptr to struct in sizeof(); rc5t583, abx500-core, sm501, smsc-ece1099 - Simplify syntax for NULL ptr checking; abx500-core, sm501 - No not unnecessarily initialise variables; tps65910, tps65910 - Reorganise and simplify driver data; omap-usb-tll - Move to SPDX license statement; tps68470 - Probe ADCs via DT; axp20x - Use new GPIOD API; arizona-core - Constify things; axp20x - Reduce code-size (use MACROS, etc); axp20x, omap-usb-host - Add DT support/docs; motorola-cpcap - Remove VLAs; rave-sp - Use devm_* managed resources; cros_ec - Interrogate HW for firmware version; rave-sp - Provide ACPI support for ChromeOS Embedded-Controller Bug Fixes: - Reorder ordered (enum) device list; tps65218 - Only accept valid data from the offset; rave-sp - Refrain from copying junk from failed SPI read; cros_ec_dev - Fix potential memory leaks; pcf50633-core - Fix clock initialisation; twl-core - Fix build-issue; tps65911 - Fix off-by-one error; tps65911 - Fix code ordering issues; intel-lpss - Fix COMPILE_TEST related issues; pwm-stm32 - Fix broken MMC card detection; asic3 - Fix clocking related issues; intel-lpss-pci" * tag 'mfd-next-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (84 commits) mfd: cros_ec: Remove unused __remove function mfd: wm97xx-core: Platform data can be NULL mfd: cros_ec_dev: Don't advertise junk features on failure mfd: cros_ec: Use devm_kzalloc for private data mfd: intel-lpss: Fix Intel Cannon Lake LPSS I2C input clock mfd: asic3: Fix broken MMC card detection mfd: timberdale: Fix spelling mistake "Uknown" -> "Unknown" mfd: omap-usb-host: Use match_string() helper mfd: stm32-timers: Fix pwm-stm32 linker issue with COMPILE_TEST pwm: stm32: Initialize raw local variables mfd: arizona: Update DT doc to support more standard Reset binding dt-bindings: mfd: Add bindings for DA9063L mfd: intel-lpss: Correct names of RESETS register bits mfd: qcom-spmi-pmic: Add support for pm8005, pm8998 and pmi8998 mfd: intel-lpss: Program REMAP register in PIO mode mfd: cros_ec_i2c: Moving the system sleep pm ops to late mfd: cros_ec_i2c: Add ACPI module device table mfd: cros_ec_dev: Register shutdown function for debugfs mfd: cros_ec_dev: Register cros-ec-rtc driver as a subdevice mfd: cros_ec: Don't try to grab log when suspended ...
| * mfd: mt6397: Create irq mappings in mfd core driverChen Zhong2018-04-161-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | The core driver should create and manage irq mappings instead of leaf drivers. This patch change to pass irq domain to devm_mfd_add_devices() and it will create mapping for irq resources automatically. And remove irq mapping in rtc driver since this has been done in core driver. Signed-off-by: Chen Zhong <chen.zhong@mediatek.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
* | Merge tag 'rtc-4.18' of ↵Linus Torvalds2018-06-1040-828/+876
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull RTC updates from Alexandre Belloni: "Setting the supported range from drivers for RTCs failing soon has started. A few fixes are developed along the way. Some drivers have been switched to SPDX by their maintainers. Subsystem: - rework of the rtc-test driver which allows to test the core more thoroughly - rtc_set_alarm() now fails early when alarms are not supported Drivers: - mktime() is now replaced by mktime64() - RTC range added for 88pm80x, ab-b5ze-s3, at91rm9200, brcmstb-waketimer, ds1685, ftrtc010, ls1x, mxc_v2, rx8581, sprd, st-lpc, tps6586x, tps65910 and vr41xx - fixed a possible race condition in probe functions - pxa: fix the probe function that is broken since v4.3 - stm32: now supports stm32mp1" * tag 'rtc-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (78 commits) rtc: pxa: fix probe function rtc: cros-ec: Switch to SPDX identifier. rtc: cros-ec: Make license text and module license match. rtc: ensure rtc_set_alarm fails when alarms are not supported rtc: test: remove alarm support from the first device rtc: test: convert to devm_rtc_allocate_device rtc: ftrtc010: let the core handle range rtc: ftrtc010: handle dates after 2106 rtc: ftrtc010: switch to devm_rtc_allocate_device rtc: mrst: switch to devm functions rtc: sunxi: fix possible race condition rtc: test: remove irq sysfs file rtc: test: emulate alarms using timers rtc: test: store time as an offset to system time rtc: test: allow registering many devices rtc: test: remove useless proc info rtc: ds1685: Add range rtc: ds1685: fix possible race condition rtc: sprd: Add new RTC power down check method rtc: sun6i: Fix bit_idx value for clk_register_gate ...
| * | rtc: pxa: fix probe functionDan Carpenter2018-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is from static analysis and I don't have the hardware to to test it. I think the test is reversed so now the probe function will return success early and the last part of the function is dead code. Fixes: 3cdf4ad9633e ("rtc: pxa: convert to use shared sa1100 functions") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: cros-ec: Switch to SPDX identifier.Enric Balletbo i Serra2018-06-071-16/+5
| | | | | | | | | | | | | | | | | | | | | | | | Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: cros-ec: Make license text and module license match.Enric Balletbo i Serra2018-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The license text is specifying "GPLv2" but the MODULE_LICENSE is set to GPL which means GNU Public License v2 or later. When MODULE_LICENSE and boiler plate does not match, go for boiler plate license. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: ensure rtc_set_alarm fails when alarms are not supportedAlexandre Belloni2018-06-071-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using RTC_ALM_SET or RTC_WKALM_SET with rtc_wkalrm.enabled not set, rtc_timer_enqueue() is not called and rtc_set_alarm() may succeed but the subsequent RTC_AIE_ON ioctl will fail. RTC_ALM_READ would also fail in that case. Ensure rtc_set_alarm() fails when alarms are not supported to avoid letting programs think the alarms are working for a particular RTC when they are not. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: test: remove alarm support from the first deviceAlexandre Belloni2018-06-071-1/+13
| | | | | | | | | | | | | | | | | | | | | To test for issues with RTCs that don't provide an alarm, remove alarm support from the first test RTC device. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: test: convert to devm_rtc_allocate_deviceAlexandre Belloni2018-06-071-3/+4
| | | | | | | | | | | | | | | | | | This allows further improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: ftrtc010: let the core handle rangeAlexandre Belloni2018-06-071-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | The current range handling is highly suspicious. Anyway, let the core handle it. The RTC has a 32 bit counter on top of days + hh:mm:ss registers. Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: ftrtc010: handle dates after 2106Alexandre Belloni2018-06-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Use correct types for offset and time and use rtc_time64_to_tm/rtc_tm_to_time64 to handle dates after 2106 properly. Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: ftrtc010: switch to devm_rtc_allocate_deviceAlexandre Belloni2018-06-071-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | Switch to devm_rtc_allocate_device/rtc_register_device. This allow or further improvement and simplifies ftrtc010_rtc_remove(). Acked-by: Hans Ulli Kroll <ulli.kroll@googlemail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
| * | rtc: mrst: switch to devm functionsAlexandre Belloni2018-06-051-27/+18
| | | | | | | | | | | | | | | | | | | | | Switch to devm managed functions to simplify error handling and device removal Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>