summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
AgeCommit message (Collapse)AuthorFilesLines
2016-05-20rtc: ds1307: Remove CLK_IS_ROOTStephen Boyd1-2/+0
This flag is a no-op now (see commit 47b0eeb3dc8a "clk: Deprecate CLK_IS_ROOT", 2016-02-02) so remove it. Cc: Akinobu Mita <akinobu.mita@gmail.com> Cc: Michael Tatarinov <kukabu@gmail.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: hym8563: Remove CLK_IS_ROOTStephen Boyd1-1/+1
This flag is a no-op now (see commit 47b0eeb3dc8a "clk: Deprecate CLK_IS_ROOT", 2016-02-02) so remove it. Cc: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: pcf8563: Remove CLK_IS_ROOTStephen Boyd1-1/+1
This flag is a no-op now (see commit 47b0eeb3dc8a "clk: Deprecate CLK_IS_ROOT", 2016-02-02) so remove it. Cc: Heiko Schocher <hs@denx.de> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Heiko Schocher <hs@denx.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: zynqmp: Write Calibration value before setting timeAnurag Kumar Vulisha1-7/+14
It is suggested to program CALIB_WRITE register with the calibration value before updating the SET_TIME_WRITE register, doing so will clear the Tick Counter and force the next second to be signaled exactly in 1 second. Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: zynqmp: Enable RTC switching to battery power when VCC_PSAUX is N/AAnurag Kumar Vulisha1-0/+8
In order to conserve battery energy, during the PS operation, it is expected that the supply for the battery-powered domain to be switched from the battery (VCC_PSBATT) to (VCC_PSAUX) and automatically be switched back to battery when VCC_PSAUX voltage drops below a limit, doing so prevents the logic within the battery-powered domain from functioning incorrectly. Signed-off-by: Anurag Kumar Vulisha <anuragku@xilinx.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: ds1685: actually spin forever in poweroff pathJosh Poimboeuf1-0/+1
objtool reports the following warning: drivers/rtc/rtc-ds1685.o: warning: objtool: ds1685_rtc_poweroff() falls through to next function ds1685_rtc_work_queue() Similar to commit 361c6ed6b153 ("rtc: ds1685: actually spin forever in poweroff error path"), there's another unreachable() annotation which is actually reachable, which we missed the first time. Actually spin forever to be consistent with the comment and to make the unreachable() annotation guaranteed to be unreachable. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: da9053: fix access ordering error during RTC interrupt at system power onSteve Twiss1-5/+8
This fix alters the ordering of the IRQ and device registrations in the RTC driver probe function. This change will apply to the RTC driver that supports both DA9052 and DA9053 PMICs. A problem could occur with the existing RTC driver if: A system is started from a cold boot using the PMIC RTC IRQ to initiate a power on operation. For instance, if an RTC alarm is used to start a platform from power off. The existing driver IRQ is requested before the device has been properly registered. i.e. ret = da9052_request_irq() comes before rtc->rtc = devm_rtc_device_register(); In this case, an interrupt exists before the device has been registered and the IRQ handler can be called immediately: this can happen be before the memory for rtc->rtc has been allocated. The IRQ handler da9052_rtc_irq() contains the function call: rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_AF); which in turn tries to access the unavailable rtc->rtc. The fix is to reorder the functions inside the RTC probe. The IRQ is requested after the RTC device resource has been registered so that da9052_request_irq() is the last thing to happen. Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: ds1307: ensure that any pending alarm is cleared before a new alarm is ↵Nicolas Boullis1-5/+8
enabled If a previously-set alarm was disabled and then triggered, it may still be pending when a new alarm is configured. Then, if the alarm is enabled before the pending alarm is cleared, then an interrupt is immediately raised. Unfortunately, when the alarm is cleared and enabled during the same I²C block write, the chip (at least the DS1339 I have) considers that the alarm is enabled before it is cleared, and raises an interrupt. This patch ensures that the pending alarm is cleared before the alarm is enabled. Signed-off-by: Nicolas Boullis <nboullis@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: ds1307: fix ds1307_native_smbus_read_block_data functionNicolas Boullis1-2/+6
The i2c_smbus_read_i2c_block_data function returns 0 on success, not the number of bytes written. Hence, when there are 32 bytes or less to send, the ds1307_native_smbus_write_block_data function returns 0 on success, while it returns the number of bytes when there are more than 32. The ds1307_write_block_data always returns the number of bytes on success. Signed-off-by: Nicolas Boullis <nboullis@debian.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: ds1302: fix write value for day of week registerAkinobu Mita1-1/+1
The valid range of day of week register for DS1302 is 1 to 7. But the set_time callback for rtc-ds1302 attempts to write the value of tm->tm_wday which is in the range 0 to 6. While the get_time callback correctly decodes the register. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Sergey Yanovich <ynvich@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: ds1302: fix error check in set_timeAkinobu Mita1-1/+1
The set_time callback for rtc-ds1302 doesn't write clock registers because the error check for the return value from spi_write_then_read() is not correct. spi_write_then_read() which returns zero on success. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Sergey Yanovich <ynvich@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: m41t80: handle oscillator failure bitMylène Josserand1-2/+23
Handle the Oscillator Failure (OF) bit on each read of date-time. If the OF is set, an error is returned (-EINVAL) instead of the date-time. The OF bit is cleared each time the date is set. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: m41t80: add wakealarm functionalityMylène Josserand1-0/+2
To enable the wakealarm, the device must be able to wakeup. This is done by setting the device wakeup capability to true with 'device_init_wakeup' function. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: m41t80: add alarm functionalityMylène Josserand1-13/+167
Previous 'commit c3b79770e51a ("Expire alarms after the time is set")' and 'commit 48e9766726eb ("remove disabled alarm functionality")' removed the alarm support because the alarm irq was not functional. Add the alarm IRQ functionality with newer functions than previous code. Tested with 'rtctest' and the alarm is functional. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: m41t80: remove warnings and replace obsolete functionMylène Josserand1-11/+15
Replace the obsolete "simple_strtoul" function to "kstrtoul". Remove some checkpatch's errors, warnings and checks : - alignment with open parenthesis - spaces around '<' and '<<' - blank line after structure - quoted string split across lines Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: m41t80: add the use of 'BIT' macroMylène Josserand1-15/+15
Replace bit shifts by BIT macro. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: m41t80: replace i2c functions for smbus onesMylène Josserand1-90/+44
The driver used i2c_transfer methods to read and set date/time. The smbus methods should be used. This commit replaces i2c_transfer functions by i2c_smbus_XX_i2c_block_data for reading and setting the datetime. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: m41t80: remove proc macroMylène Josserand1-4/+0
Remove the CONFIG_RTC_INTF_PROC and CONFIG_RTC_INTF_PROC_MODULE macro which is not necessary anymore. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: m41t80: update sysfs entries exportMylène Josserand1-24/+32
The driver used an old sysfs entry export. Update it to use the DEVICE_ATTR_XX macro and remove the unnecessary CONFIG_RTC_INTF_SYSFS macro. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: remove useless DRV_VERSIONAlexandre Belloni25-89/+1
Many drivers are defining a DRV_VERSION. This is often only used for MODULE_VERSION and sometimes to print an info message at probe time. This is kind of pointless as they are all versionned with the kernel anyway. Also the core will print a message when a new rtc is found. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: at91sam9: remove duplicate assignment of variable mrColin Ian King1-1/+1
mr is written twice with the same value, remove one of the redundant assignments to mr. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-05-20rtc: ds1302: rewrite using SPISergey Yanovich2-197/+166
DS1302 is an half-duplex SPI device. The driver respects this fact now. Pin configurations should be implemented using SPI subsystem. Signed-off-by: Sergei Ianovich <ynvich@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-04-21rtc: ds1307: Use irq when available for wakeup-source deviceNishanth Menon1-1/+1
With commit 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'") we lost the ability for rtc irq functionality for devices that are actually hooked on a real IRQ line and have capability to wakeup as well. This is not an expected behavior. So, instead of just not requesting IRQ, skip the IRQ requirement only if interrupts are not defined for the device. Fixes: 8bc2a40730ec ("rtc: ds1307: add support for the DT property 'wakeup-source'") Reported-by: Tony Lindgren <tony@atomide.com> Cc: Michael Lange <linuxstuff@milaw.biz> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Nishanth Menon <nm@ti.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-04-21rtc: ds1307: ds3231 temperature s16 overflowZhuang Yuyao1-2/+2
while retrieving temperature from ds3231, the result may be overflow since s16 is too small for a multiplication with 250. ie. if temp_buf[0] == 0x2d, the result (s16 temp) will be negative. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Tested-by: Michael Tatarinov <kukabu@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-24Merge tag 'rtc-4.6-2' of ↵Linus Torvalds7-16/+305
git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux Pull more RTC updates from Alexandre Belloni: "A second pull request for v4.6 with a few fixesi before -rc1. The new features for abx80x actually make the RTC behave correctly. Drivers: - abx80x: handle both XT and RC oscillators, XT failure bit and autocalibration - m41t80: avoid out of range year values - rv8803: workaround an i2c HW issue" * tag 'rtc-4.6-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: abx80x: handle the oscillator failure bit rtc: abx80x: handle autocalibration rtc: rv8803: workaround i2c HW issue rtc: mcp795: add devicetree support rtc: asm9260: remove incorrect __init/__exit annotations rtc: m41t80: avoid out of range year values rtc: s3c: Don't print an error on probe deferral rtc: rv3029: stop mentioning rv3029c2
2016-03-25rtc: abx80x: handle the oscillator failure bitMylène Josserand1-2/+31
Handle the Oscillator Failure ('OF') bit from Oscillator Status register (0x1D). This bit is cleared on set_time function and is read each time the date/time is read, but only in case of XT Oscillator selection. In RC mode, this bit is always set. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-25rtc: abx80x: handle autocalibrationMylène Josserand1-0/+219
The autocalibration is separated in two bits to set in Oscillator Control register (0x1c) : - OSEL bit to select the oscillator type (XT or RC). - ACAL bit to select the autocalibration type. These functionnalities are exported in sysfs entries : "oscillator" and "autocalibration". Respectively, the values are "xtal" for XT oscillator and "rc" for RC oscillator and 0 to disable the autocalibration cycle, 512 for a 512 seconds autocalibration cycle and 1024 for a cycle of 1024 seconds. Examples : Set to XT Oscillator echo xtal > /sys/class/rtc/rtc0/device/oscillator Activate an autocalibration every 512 seconds echo 512 > /sys/class/rtc/rtc0/device/autocalibration Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-25rtc: rv8803: workaround i2c HW issueAlexandre Belloni1-6/+22
The rv8803 has a 60µs window where it will not answer on the i2c bus. It also means there will be no ack for the communication. Make sure communication is tried multiple times when this happens (the i2c subsystem mandates -ENXIO is that case but the number of retries is host specific). The critical parts are the probe function and the alarm callback so make sure we handle the failure there. Cc: stable@vger.kernel.org # v4.4 Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-21rtc: mcp795: add devicetree supportEmil Bartczak1-0/+10
Add device tree support to the rtc-mcp795 driver. Signed-off-by: Emil Bartczak <emilbart@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-19rtc: asm9260: remove incorrect __init/__exit annotationsArnd Bergmann1-2/+2
The probe and remove callbacks of the platform driver are marked __init and __exit, respectively. However, this is not a correct way to annotate them, as it will result in those sections to be discarded at link time or after boot, while we can actually call them again based on manual unbinding, or deferred probing. Kbuild warns about the problem: WARNING: drivers/rtc/rtc-asm9260.o(.data+0x0): Section mismatch in reference from the variable asm9260_rtc_driver to the function .init.text:asm9260_rtc_probe() This removes the annotations, so we no longer branch into missing code and avoid the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 125e550fd257 ("rtc: add Alphascale asm9260 driver") Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-19rtc: m41t80: avoid out of range year valuesStefan Christ1-0/+6
Avoid saving an out of range year value to the RTC. Reading that value from the RTC again returns a totally wrong time value. For Example $ timedatectl set-ntp no $ timedatectl set-time "1990-01-01 12:12:00" # Reboot rtc-m41t80 0-0068: setting system clock to 2090-01-01 12:12:35 UTC (3786955955) Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-19rtc: s3c: Don't print an error on probe deferralJavier Martinez Canillas1-5/+14
The clock and source clock looked up by the driver may not be available just because the clock controller driver was not probed yet so printing an error in this case is not correct and only adds confusion to users. However, knowing that a driver's probe was deferred may be useful so it can be printed as a debug information. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-17Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree updates from Jiri Kosina. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: drivers/rtc: broken link fix drm/i915 Fix typos in i915_gem_fence.c Docs: fix missing word in REPORTING-BUGS lib+mm: fix few spelling mistakes MAINTAINERS: add git URL for APM driver treewide: Fix typo in printk
2016-03-15rtc: rv3029: stop mentioning rv3029c2Alexandre Belloni1-1/+1
rv3029c2 is actually rv3029. c2 denotes an option. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: pcf2127: add pcf2129 device idAkinobu Mita1-3/+6
There are only a few differences between PCF2127 and PCF2129 (PCF2127 has 512 bytes of general purpose SRAM and count-down timer). The rtc-pcf2127 driver currently doesn't use the PCF2127 specific functionality and Kconfig help text already says this driver supports PCF2127/29, so we can simply add pcf2129 to device id list. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: pcf2127: add support for spi interfaceAkinobu Mita2-11/+126
pcf2127 has selectable I2C-bus and SPI-bus interface support. This adds support for SPI interface. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: pcf2127: convert to use regmapAkinobu Mita1-70/+144
pcf2127 has selectable I2C-bus and SPI-bus interface support. Currently rtc-pcf2127 driver only supports I2C. This is preparation for support for SPI interface. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: rv3029: Add thermometer hwmon supportMichael Büsch2-0/+129
This adds support to - enable/disable the thermometer - set the temperature scanning interval - read the current temperature that is used for temp compensation. via hwmon interface Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: rv3029: Add update_bits helper for eeprom accessMichael Büsch1-14/+25
This simplifies the update of single bits in the eeprom. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: ds1685: actually spin forever in poweroff error pathJosh Poimboeuf1-0/+1
objtool reports the following warnings: drivers/rtc/rtc-ds1685.o: warning: objtool: ds1685_rtc_work_queue()+0x0: duplicate frame pointer save drivers/rtc/rtc-ds1685.o: warning: objtool: ds1685_rtc_work_queue()+0x3: duplicate frame pointer setup drivers/rtc/rtc-ds1685.o: warning: objtool: ds1685_rtc_work_queue()+0x0: frame pointer state mismatch The warning message needs to be improved, but what it really means in this case is that ds1685_rtc_poweroff() has a possible code path where it can actually fall through to the next function in the object code, ds1685_rtc_work_queue(). The bug is caused by the use of the unreachable() macro in a place which is actually reachable. That causes gcc to assume that the printk() immediately before the unreachable() macro never returns, when in fact it does. So gcc places the printk() at the very end of the function's object code. When the printk() returns, the next function starts executing. The surrounding comment and printk message state that the code should spin forever, which explains the unreachable() statement. However the actual spin code is missing. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: hym8563: fix invalid year calculationAlexander Kochetkov1-1/+1
Year field must be in BCD format, according to hym8563 datasheet. Due to the bug year 2016 became 2010. Fixes: dcaf03849352 ("rtc: add hym8563 rtc-driver") Signed-off-by: Alexander Kochetkov <al.kochet@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: ds3232: use rtc->ops_lock to protect alarm operationsAkinobu Mita1-21/+4
ds3232->mutex is used to protect for alarm operations which need to access status and control registers. But we can use rtc->ops_lock instead. rtc->ops_lock is held when most of rtc_class_ops methods are called, so we only need to explicitly acquire it from irq handler in order to protect form concurrent accesses. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: ds3232: fix issue when irq is shared several devicesAkinobu Mita1-69/+12
ds3232-core requests irq with IRQF_SHARED, so irq can be shared by several devices. But the irq handler for ds3232 unconditionally disables the irq at first and the irq is re-enabled only when the interrupt source was the ds3232's alarm. This behaviour breaks the devices sharing the same irq in the various scenarios. This converts to use threaded irq and remove outdated code in suspend/resume paths. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Suggested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: ds3232: remove unused UIE codeAkinobu Mita1-19/+1
UIE mode irqs are handled by the generic rtc core now. But there are remaining unused code fragments for it. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: ds3232: add register access error checksAkinobu Mita1-7/+22
Add missing register access error checks and make it return error code or print error message. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: ds3232: fix read on /dev/rtc after RTC_AIE_ONAkinobu Mita1-7/+3
The rtctest (tools/testing/selftests/timers/rtctest.c) found that reading ds3232 rtc device immediately return the value 0x20 (RTC_AF) without waiting alarm interrupt. This is because alarm_irq_enable() of ds3232 driver changes RTC_AF flag in rtc->irq_data. So calling ioctl with RTC_AIE_ON generates invalid value in rtc device. The lower-level driver should not touch rtc->irq_data directly. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: merge ds3232 and ds3234Akinobu Mita4-194/+189
According to "Feature Comparison of the DS323x Real-Time Clocks" (http://pdfserv.maximintegrated.com/en/an/AN5143.pdf), DS3232 and DS3234 are very similar. This merges rtc-ds3232 and rtc-ds3234 with using regmap. This change also enables to support alarm for ds3234. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Suggested-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: ds3232: convert to use regmapAkinobu Mita1-103/+113
This is preparation for merging rtc-ds3232 i2c driver and rtc-ds3234 spi driver. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com> Cc: Dennis Aberilla <denzzzhome@yahoo.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: pxa: fix Kconfig indentationAlexandre Belloni1-4/+4
The pxa section is indented using spaces, use tabs. Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14rtc: rv3029: Add device tree property for trickle chargerMichael Büsch1-3/+103
The trickle charger resistor can be enabled via device tree property trickle-resistor-ohms. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>