io: Add support for 16bit register IO

Enable IO with 16 bit HW.

Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
This commit is contained in:
Rander Wang 2018-01-22 23:50:59 +00:00 committed by Liam Girdwood
parent 2b5507232e
commit a86d2d7ae2
1 changed files with 10 additions and 0 deletions

View File

@ -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