diff options
author | Bin Meng | 2017-03-16 07:26:27 -0700 |
---|---|---|
committer | Bin Meng | 2017-04-10 10:02:03 +0800 |
commit | d24c7fbcc5e530bb5a2b5326869aaa2d7a61d607 (patch) | |
tree | 554bd94a3cad5bd697a9adfc6fc54cca60fbd3d1 /include/rtc.h | |
parent | c04cf0a5717372f8546d07cdb6a13abcdcc5be85 (diff) |
dm: rtc: Add 16-bit read/write support
At present there are only 8-bit and 32-bit read/write routines in
the rtc uclass driver. This adds the 16-bit support.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/rtc.h')
-rw-r--r-- | include/rtc.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/rtc.h b/include/rtc.h index 69fe8d4db05..49142b6e188 100644 --- a/include/rtc.h +++ b/include/rtc.h @@ -128,6 +128,26 @@ int rtc_read8(struct udevice *dev, unsigned int reg); int rtc_write8(struct udevice *dev, unsigned int reg, int val); /** + * rtc_read16() - Read a 16-bit value from the RTC + * + * @dev: Device to read from + * @reg: Offset to start reading from + * @valuep: Place to put the value that is read + * @return 0 if OK, -ve on error + */ +int rtc_read16(struct udevice *dev, unsigned int reg, u16 *valuep); + +/** + * rtc_write16() - Write a 16-bit value to the RTC + * + * @dev: Device to write to + * @reg: Register to start writing to + * @value: Value to write + * @return 0 if OK, -ve on error + */ +int rtc_write16(struct udevice *dev, unsigned int reg, u16 value); + +/** * rtc_read32() - Read a 32-bit value from the RTC * * @dev: Device to read from |