diff mbox series

[5/6] rtc: pcf2127: provide ->write8_array method

Message ID 20200504212032.3759-6-rasmus.villemoes@prevas.dk
State New
Headers show
Series rtc: add rtc_{read,write}8_array and rtc command | expand

Commit Message

Rasmus Villemoes May 4, 2020, 9:20 p.m. UTC
Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
---
 drivers/rtc/pcf2127.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Simon Glass May 6, 2020, 3:42 a.m. UTC | #1
On Mon, 4 May 2020 at 15:20, Rasmus Villemoes
<rasmus.villemoes at prevas.dk> wrote:
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> ---
>  drivers/rtc/pcf2127.c | 7 +++++++
>  1 file changed, 7 insertions(+)

Reviewed-by: Simon Glass <sjg at chromium.org>
diff mbox series

Patch

diff --git a/drivers/rtc/pcf2127.c b/drivers/rtc/pcf2127.c
index b3f6de8496..227ab09880 100644
--- a/drivers/rtc/pcf2127.c
+++ b/drivers/rtc/pcf2127.c
@@ -43,6 +43,12 @@  static int pcf2127_rtc_read8_array(struct udevice *dev, uint offset,
 	return dm_i2c_xfer(dev, &msg, 1);
 }
 
+static int pcf2127_rtc_write8_array(struct udevice *dev, uint offset,
+				   const u8 *buffer, uint len)
+{
+	return dm_i2c_write(dev, offset, buffer, len);
+}
+
 static int pcf2127_rtc_set(struct udevice *dev, const struct rtc_time *tm)
 {
 	uchar buf[7] = {0};
@@ -110,6 +116,7 @@  static const struct rtc_ops pcf2127_rtc_ops = {
 	.set = pcf2127_rtc_set,
 	.reset = pcf2127_rtc_reset,
 	.read8_array = pcf2127_rtc_read8_array,
+	.write8_array = pcf2127_rtc_write8_array,
 };
 
 static const struct udevice_id pcf2127_rtc_ids[] = {