/* Register write function used only for mipi dsi controller. Parameter: @regs: mipi controller address @reg: combination of regaddr(16bit)|bitswidth(8bit)|offset(8bit) you can use define in rk_mipi.h directly for this parameter @val: value that will be write to specified bits of register  */
static void rk_mipi_dsi_write(uintptr_t regs, u32 reg, u32 val)
/* Register write function used only for mipi dsi controller. Parameter: @regs: mipi controller address @reg: combination of regaddr(16bit)|bitswidth(8bit)|offset(8bit) you can use define in rk_mipi.h directly for this parameter @val: value that will be write to specified bits of register  */
static void rk_mipi_dsi_write(uintptr_t regs, u32 reg, u32 val)
{
	u32 dat;
	u32 mask;
	u32 offset = (reg >> OFFSET_SHIFT) & 0xff;
	u32 bits = (reg >> BITS_SHIFT) & 0xff;
	uintptr_t addr = (reg >> ADDR_SHIFT) + regs;
	mask = ~((0xffffffff << offset) & (0xffffffff >> (32 - offset - bits)));
	val &= ~(0xffffffff << bits);
	dat = readl(addr);
	dat &= mask;
	dat |= val << offset;
	writel(dat, addr);
}