summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-rv3029c2.c
Commit message (Collapse)AuthorAgeFilesLines
* rtc: rv3029: hide unused i2c device tableArnd Bergmann2016-05-211-7/+7
| | | | | | | | | | | | | | The added support for SPI mode made it possible to configure the driver when I2C is disabled, leaving an unused device table: drivers/rtc/rtc-rv3029c2.c:794:29: error: 'rv3029_id' defined but not used [-Werror=unused-variable] This moves the table inside of the #ifdef section that has the only user, to avoid the harmless warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: d08f50dd0afc ("rtc: rv3029: Add support of RV3049") Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: add alarm IRQMylène Josserand2016-05-211-21/+93
| | | | | | | Add the alarm IRQ functionality. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: fix set_time functionMylène Josserand2016-05-211-1/+1
| | | | | | | | The bin2bcd function in set_time is uncorrect on weekdays as the bit mask should be done at the end of arithmetic operations. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: fix alarm supportMylène Josserand2016-05-211-7/+16
| | | | | | | | | | | | | | | The RTC RV3029 handles different types of alarms : seconds, minutes, ... These alarms can be enabled or disabled individually using an AE_x bit which is the last bit (BIT(7)) on each alarm registers. To prepare the alarm IRQ support, the current code enables all the alarm types by setting each AE_x to 1. It also fixes others alarms issues : - month and weekday errors : it was performing -1 instead of +1. - wrong use of bit mask with bin2bcd Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: Remove some checks and warningsMylène Josserand2016-05-211-34/+34
| | | | | | | | Remove some checks from checkpatch such as spaces around arithmetic operations or prefer "unsigned int". Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: Add support of RV3049Mylène Josserand2016-05-211-3/+105
| | | | | | | | Add support of Microcrystal RV3049 RTC (SPI) using regmap on the RV3029 (I2C) driver. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: convert to use regmapMylène Josserand2016-05-211-133/+142
| | | | | | | To add support of rv3049, the current driver is converted to use regmap. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: remove 'i2c' in functions namesMylène Josserand2016-05-211-75/+57Star
| | | | | | | | To prepare the use of regmap to add the support of RV-3049, all the 'i2c' in functions's names are removed. Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: Add thermometer hwmon supportMichael Büsch2016-03-141-0/+120
| | | | | | | | | | | 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>
* rtc: rv3029: Add update_bits helper for eeprom accessMichael Büsch2016-03-141-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>
* rtc: rv3029: Add device tree property for trickle chargerMichael Büsch2016-03-141-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>
* rtc: rv3029: Add functions for EEPROM accessMichael Büsch2016-03-141-0/+125
| | | | | | | This adds functions for access to the EEPROM memory on the rv3029. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: Add i2c register update-bits helperMichael Büsch2016-03-141-26/+28
| | | | | | | This simplifies mask/set operations on device I2C registers. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: Add missing register definitionsMichael Büsch2016-03-141-16/+45
| | | | | | | | | This adds all (according to the data sheet) missing register and bit definitions. It also fixes the definition of the trickle charger bit masks. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: Add "rv3029" I2C device idMichael Büsch2016-03-141-0/+1
| | | | | | | | The C2 suffix does not appear in the latest datasheet, so add a device ID without it. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* rtc: rv3029: Remove all 'C2' suffixes from identifiersMichael Büsch2016-03-141-147/+148
| | | | | | | | The C2 suffix does not appear anymore in the latest device and data sheet versions. Signed-off-by: Michael Buesch <m@bues.ch> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
* drivers/rtc/rtc-rv3029c2.c: fix potential race conditionGregory Hermant2014-04-041-6/+6
| | | | | | | | | RTC drivers must not return an error after device registration. Signed-off-by: Gregory Hermant <gregory.hermant@calao-systems.com> Acked-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drivers/rtc/rtc-rv3029c2.c: remove empty functionSachin Kamat2013-07-041-6/+0Star
| | | | | | | | | | | After the switch to devm_* functions and the removal of rtc_device_unregister(), the 'remove' function does not do anything. Delete it. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Gregory Hermant <gregory.hermant@calao-systems.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* drivers/rtc/rtc-rv3029c2.c: fix disabling AIE irqAxel Lin2013-07-041-1/+1
| | | | | | | | | | | | In the disable AIE irq code path, current code passes "1" to enable parameter of rv3029c2_rtc_i2c_alarm_set_irq(). Thus it does not disable AIE irq. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Heiko Schocher <hs@denx.de> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* rtc: rtc-rv3029c2: use devm_rtc_device_register()Jingoo Han2013-04-301-13/+3Star
| | | | | | | | | devm_rtc_device_register() is device managed and makes cleanup paths simpler. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Drivers: rtc: remove __dev* attributes.Greg Kroah-Hartman2013-01-041-4/+4
| | | | | | | | | | | | | | | | | | | | | CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <wfp5p@virginia.edu> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com> Cc: Linus Walleij <linus.walleij@linaro.org> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* rtc: convert rtc i2c drivers to module_i2c_driverAxel Lin2012-03-241-12/+1Star
| | | | | | | | | | | | | | | | | | | | | | | Factor out some boilerplate code for i2c driver registration into module_i2c_driver. Signed-off-by: Axel Lin <axel.lin@gmail.com> Cc: Piotr Ziecik <kosmo@semihalf.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Scott Wood <scottwood@freescale.com> Cc: Srikanth Srinivasan <srikanth.srinivasan@freescale.com> Cc: Mike Rapoport <mike@compulab.co.il> Cc: Sergey Lapin <slapin@ossfans.org> Cc: Roman Fietze <roman.fietze@telemotive.de> Cc: Herbert Valerio Riedel <hvr@gnu.org> Cc: Alexander Bigga <ab@mycable.de> Cc: Dale Farnsworth <dale@farnsworth.org> Cc: Gregory Hermant <gregory.hermant@calao-systems.com> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: Martyn Welch <martyn.welch@ge.com> Cc: Byron Bradley <byron.bbradley@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* rtc: add rv3029c2 RTC supportHeiko Schocher2011-05-271-0/+454
Add support for the Micro Crystal RV3029-C2 RTC chips. Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Gregory Hermant <gregory.hermant@calao-systems.com> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>