23 Dec, 2019
4 commits
-
Remove redundant messages or messages that would not add any value because
the information is already conveyed properly using errno.Link: https://lore.kernel.org/r/20191223100108.1083078-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
rv30{2,4}9_register_driver and rv30{2,4}9_unregister_driver are only called
from the init and exit functions of the module. Annotate them properly.Link: https://lore.kernel.org/r/20191223101430.1091572-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
The compatibles have been marked obsolete for more that 2 years, drop them
now. Note that this doesn't currently prevent the driver from probing
because the i2c core will still match using the i2c_device_id table.Link: https://lore.kernel.org/r/20191212230239.65784-1-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
Export the 8 byte RAM using nvmem.
Link: https://lore.kernel.org/r/20191214221022.622482-17-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni
18 Dec, 2019
13 commits
-
Despite the comment, the RV3029 uses a 7bit BCD register for the year,
making 2079 the last supported year.Link: https://lore.kernel.org/r/20191214221022.622482-14-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
This allows further improvement of the driver.
Link: https://lore.kernel.org/r/20191214221022.622482-13-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
In case the data is invalid (PON or VLOW2 are set in STATUS, explicitly
tell userspace that the time is invalid. Only remove VLOW2 when setting a
new valid time.Link: https://lore.kernel.org/r/20191214221022.622482-12-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
The RV3029 can report three different conditions: power on, voltage dropped
and data is lost and voltage is low and temperature compensation has
stopped. The first two conditions amount to the same status, the RTC data
is invalid.VLOW1 has to be cleared manually to resume temperature compensation, this
is achieved using RTC_VL_CLEAR.Link: https://lore.kernel.org/r/20191214221022.622482-11-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
rv3029_read_regs and rv3029_write_regs are simply calling
regmap_bulk_{read,write}. Drop them and call regmap_{,bulk}_{read,write} as
appropriate.Link: https://lore.kernel.org/r/20191214221022.622482-10-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
It is unecessay to test alarm->enabled before calling
rv3029_alarm_irq_enable.Link: https://lore.kernel.org/r/20191214221022.622482-9-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
Use regmap_update_bits instead of open coding it in
rv3029_alarm_irq_enable.Link: https://lore.kernel.org/r/20191214221022.622482-8-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
There is no point in having 2 indirections before calling regmap_read,
especially since rv3029_get_sr also changes the return value without any
good reason. Call regmap_read directly.Link: https://lore.kernel.org/r/20191214221022.622482-7-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
RV3029_STATUS is read in multiple location but its value is never used
afterwards. Avoid this register access when not necessary.Link: https://lore.kernel.org/r/20191214221022.622482-6-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
There is no lock preventing concurrent access to the status register from
bth the rtc subsystem and the hwmon subsystem. Use regmap_update_bits to
ensure updating RV3029_STATUS is properly locked.Link: https://lore.kernel.org/r/20191214221022.622482-5-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
rv3029_update_bits open codes regmap_update_bits and forgets to properly
lock the register range while doing so. Use regmap_update_bits instead.Link: https://lore.kernel.org/r/20191214221022.622482-4-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
Instead of trying to validate the accessed registers in custom functions,
let regmap handle that. This allows to defines all the holes in the
register range and gives access to the regmap debugfs register dump.Link: https://lore.kernel.org/r/20191214221022.622482-3-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni -
The correct name for the rtc is rv3029. c2 is actually the package form
factor rv3029c3 exists and simply has a smaller form factor.Link: https://lore.kernel.org/r/20191214221022.622482-2-alexandre.belloni@bootlin.com
Signed-off-by: Alexandre Belloni
21 Aug, 2019
1 commit
-
My error handling "cleanup" was totally wrong. Both the "err" and "ret"
variables are required. The "err" variable holds the error codes for
rv3029_eeprom_enter/exit() and the "ret" variable holds the error codes
for if actual write fails. In my patch if the write failed, the
function probably still returned success.Reported-by: Tom Evans
Fixes: 97f5b0379c38 ("rtc: rv3029: Clean up error handling in rv3029_eeprom_write()")
Signed-off-by: Dan Carpenter
Link: https://lore.kernel.org/r/20190817065604.GB29951@mwanda
Signed-off-by: Alexandre Belloni
19 Jun, 2019
1 commit
-
Based on 2 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 version 2 as
published by the free software foundationthis program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #extracted by the scancode license scanner the SPDX license identifier
GPL-2.0-only
has been chosen to replace the boilerplate/reference in 4122 file(s).
Signed-off-by: Thomas Gleixner
Reviewed-by: Enrico Weigelt
Reviewed-by: Kate Stewart
Reviewed-by: Allison Randal
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman
12 Oct, 2017
1 commit
-
We don't need both "ret" and "err" when they do the same thing. All the
functions called here return zero on success or negative error codes.
It's more clear to return a literal zero at the end instead of
"return ret;"Signed-off-by: Dan Carpenter
Signed-off-by: Alexandre Belloni
26 Sep, 2017
1 commit
-
The vendor string for Microcrystal is microcrystal.
Acked-by: Rob Herring
Signed-off-by: Alexandre Belloni
01 Sep, 2017
1 commit
-
i2c_device_id are not supposed to change at runtime. All functions
working with i2c_device_id provided by work with
const i2c_device_id. So mark the non-const structs as const.Signed-off-by: Arvind Yadav
Signed-off-by: Alexandre Belloni
09 Mar, 2017
1 commit
-
The driver doesn't have a struct of_device_id table but supported devices
are registered via Device Trees. This is working on the assumption that a
I2C device registered via OF will always match a legacy I2C device ID and
that the MODALIAS reported will always be of the form i2c:.But this could change in the future so the correct approach is to have an
OF device ID table if the devices are registered via OF.Signed-off-by: Javier Martinez Canillas
Signed-off-by: Alexandre Belloni
21 May, 2016
8 commits
-
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
Fixes: d08f50dd0afc ("rtc: rv3029: Add support of RV3049")
Signed-off-by: Alexandre Belloni -
Add the alarm IRQ functionality.
Signed-off-by: Mylène Josserand
Signed-off-by: Alexandre Belloni -
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
Signed-off-by: Alexandre Belloni -
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 bin2bcdSigned-off-by: Mylène Josserand
Signed-off-by: Alexandre Belloni -
Remove some checks from checkpatch such as spaces around arithmetic
operations or prefer "unsigned int".Signed-off-by: Mylène Josserand
Signed-off-by: Alexandre Belloni -
Add support of Microcrystal RV3049 RTC (SPI) using regmap on the
RV3029 (I2C) driver.Signed-off-by: Mylène Josserand
Signed-off-by: Alexandre Belloni -
To add support of rv3049, the current driver is converted to use regmap.
Signed-off-by: Mylène Josserand
Signed-off-by: Alexandre Belloni -
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
Signed-off-by: Alexandre Belloni
15 Mar, 2016
8 commits
-
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 interfaceSigned-off-by: Michael Buesch
Signed-off-by: Alexandre Belloni -
This simplifies the update of single bits in the eeprom.
Signed-off-by: Michael Buesch
Signed-off-by: Alexandre Belloni -
The trickle charger resistor can be enabled via device tree
property trickle-resistor-ohms.Signed-off-by: Michael Buesch
Signed-off-by: Alexandre Belloni -
This adds functions for access to the EEPROM memory on the rv3029.
Signed-off-by: Michael Buesch
Signed-off-by: Alexandre Belloni -
This simplifies mask/set operations on device I2C registers.
Signed-off-by: Michael Buesch
Signed-off-by: Alexandre Belloni -
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
Signed-off-by: Alexandre Belloni -
The C2 suffix does not appear in the latest datasheet, so add
a device ID without it.Signed-off-by: Michael Buesch
Signed-off-by: Alexandre Belloni -
The C2 suffix does not appear anymore in the latest device and
data sheet versions.Signed-off-by: Michael Buesch
Signed-off-by: Alexandre Belloni
04 Apr, 2014
1 commit
-
RTC drivers must not return an error after device registration.
Signed-off-by: Gregory Hermant
Acked-by: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds