Skip to contentSkip to conversation

rtc: Add read8 and write8 support to isl1208 driver

PATCH In review Trent Piepho 3 participants 3 messages May 31, 2018 – Oct 11, 2018 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: Add read8 and write8 support to isl1208 driver

This can be used for device register access from board code.

This allows access to capabilities in the RTC chip not abstracted in U-Boot's RTC class. E.g., device NVRAM or a tamper detection circuit.

Cc Klaus Goger <[email protected]>
Cc Philipp Tomsich <[email protected]>
Cc Simon Glass <[email protected]>
---
 drivers/rtc/isl1208.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/rtc/isl1208.c +20 -0
index 22ac0d2b08..59a60b75b3 100644
@@ -51,6 +51,24 @@
 #define RTC_STAT_BIT_BAT	0x02	/* BATTERY BIT */
 #define RTC_STAT_BIT_RTCF	0x01	/* REAL TIME CLOCK FAIL BIT */
 
+/*
+ * Read an RTC register
+ */
+
+static int isl1208_rtc_read8(struct udevice *dev, unsigned int reg)
+{
+	return dm_i2c_reg_read(dev, reg);
+}
+
+/*
+ * Write an RTC register
+ */
+
+static int isl1208_rtc_write8(struct udevice *dev, unsigned int reg, int val)
+{
+	return dm_i2c_reg_write(dev, reg, val);
+}
+
 /*
  * Get the current time from the RTC
  */
@@ -161,6 +179,8 @@ static const struct rtc_ops isl1208_rtc_ops = {
 	.get = isl1208_rtc_get,
 	.set = isl1208_rtc_set,
 	.reset = isl1208_rtc_reset,
+	.read8 = isl1208_rtc_read8,
+	.write8 = isl1208_rtc_write8,
 };
 
 static const struct udevice_id isl1208_rtc_ids[] = {
Signature · 1 line
2.14.3
#1 lore raw

PATCH 1/1 rtc: Add read8 and write8 support to isl1208 driver

Quoted 12 lines · Trent Piepho

This can be used for device register access from board code.

This allows access to capabilities in the RTC chip not abstracted in U-Boot's RTC class. E.g., device NVRAM or a tamper detection circuit.

Cc Klaus Goger <[email protected]>
Cc Philipp Tomsich <[email protected]>
Cc Simon Glass <[email protected]>
#2 lore raw
In reply to Trent Piepho
Quoted 10 lines · Trent Piepho

This can be used for device register access from board code.

This allows access to capabilities in the RTC chip not abstracted in U-Boot's RTC class. E.g., device NVRAM or a tamper detection circuit.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181011/9e6be045/attachment.sig>