* [U-Boot] [PATCH] rtc: Add read8 and write8 support to isl1208 driver
@ 2018-05-31 18:14 Trent Piepho
2018-05-31 18:16 ` Dr. Philipp Tomsich
2018-10-11 14:11 ` [U-Boot] " Tom Rini
0 siblings, 2 replies; 3+ messages in thread
From: Trent Piepho @ 2018-05-31 18:14 UTC (permalink / raw)
To: u-boot
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 <klaus.goger@theobroma-systems.com>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Simon Glass <sjg@chromium.org>
Signed-off-by: Trent Piepho <tpiepho@impinj.com>
---
drivers/rtc/isl1208.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/rtc/isl1208.c b/drivers/rtc/isl1208.c
index 22ac0d2b08..59a60b75b3 100644
--- a/drivers/rtc/isl1208.c
+++ b/drivers/rtc/isl1208.c
@@ -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[] = {
--
2.14.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] rtc: Add read8 and write8 support to isl1208 driver
2018-05-31 18:14 [U-Boot] [PATCH] rtc: Add read8 and write8 support to isl1208 driver Trent Piepho
@ 2018-05-31 18:16 ` Dr. Philipp Tomsich
2018-10-11 14:11 ` [U-Boot] " Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Dr. Philipp Tomsich @ 2018-05-31 18:16 UTC (permalink / raw)
To: u-boot
> On 31 May 2018, at 20:14, Trent Piepho <tpiepho@impinj.com> wrote:
>
> 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 <klaus.goger@theobroma-systems.com>
> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Cc: Simon Glass <sjg@chromium.org>
> Signed-off-by: Trent Piepho <tpiepho@impinj.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] rtc: Add read8 and write8 support to isl1208 driver
2018-05-31 18:14 [U-Boot] [PATCH] rtc: Add read8 and write8 support to isl1208 driver Trent Piepho
2018-05-31 18:16 ` Dr. Philipp Tomsich
@ 2018-10-11 14:11 ` Tom Rini
1 sibling, 0 replies; 3+ messages in thread
From: Tom Rini @ 2018-10-11 14:11 UTC (permalink / raw)
To: u-boot
On Thu, May 31, 2018 at 11:14:44AM -0700, Trent Piepho wrote:
> 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 <klaus.goger@theobroma-systems.com>
> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Cc: Simon Glass <sjg@chromium.org>
> Signed-off-by: Trent Piepho <tpiepho@impinj.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Applied to u-boot/master, thanks!
--
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>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-11 14:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31 18:14 [U-Boot] [PATCH] rtc: Add read8 and write8 support to isl1208 driver Trent Piepho
2018-05-31 18:16 ` Dr. Philipp Tomsich
2018-10-11 14:11 ` [U-Boot] " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.