[Sound-open-firmware] [PATCH] io: Add support for 16bit register IO

Liam Girdwood liam.r.girdwood at linux.intel.com
Tue Jan 23 17:40:02 CET 2018


From: Rander Wang <rander.wang at linux.intel.com>

Enable IO with 16 bit HW.

Signed-off-by: Rander Wang <rander.wang at linux.intel.com>
---
 src/include/reef/io.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/include/reef/io.h b/src/include/reef/io.h
index 4b608b2..3181d41 100644
--- a/src/include/reef/io.h
+++ b/src/include/reef/io.h
@@ -48,4 +48,14 @@ static inline void io_reg_update_bits(uint32_t reg, uint32_t mask, uint32_t valu
 	io_reg_write(reg, (io_reg_read(reg) & (~mask)) | (value & mask));
 }
 
+static inline uint16_t io_reg_read16(uint32_t reg)
+{
+	return *((volatile uint16_t*)reg);
+}
+
+static inline void io_reg_write16(uint32_t reg, uint16_t val)
+{
+	*((volatile uint16_t*)reg) = val;
+}
+
 #endif
-- 
2.14.1



More information about the Sound-open-firmware mailing list