Commit graph

5 commits

Author SHA1 Message Date
Alexandre Belloni
85062c9b99 rtc: rv8803: workaround i2c HW issue
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-25 02:38:59 +01:00
Oleksij Rempel
9d1fa4c373 rtc: rv8803: convert spin_lock to mutex_lock
Fix a scheduling while atomic issue caused by rv8803_set_time()
holding a spinlock during the call to i2c_smbus_read_byte_data().

Signed-off-by: Oleksij Rempel <fixed-term.Oleksij.Rempel@de.bosch.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-03-14 17:08:15 +01:00
Gregory CLEMENT
78ef5f2d2d rtc: rv8803: Extend compatibility with the rx8900
The Seiko Epson's RTC RX8900 layout register is compatible with the
RV8803. So let's add its ID in order to reuse the same driver.

Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-01-11 20:20:00 +01:00
Andrzej Hajda
68c85f2916 rtc: rv8803: fix handling return value of i2c_smbus_read_byte_data
The function can return negative values, so its result should
be assigned to signed variable.

The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2016-01-11 20:20:00 +01:00
Alexandre Belloni
1e3929ef0e rtc: Add a driver for Micro Crystal RV8803
This driver supports the following functions:
 - reading and settings time
 - alarms when connected to an IRQ
 - reading and clearing the voltage low flags
 - nvram

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
2015-11-08 14:12:32 +01:00