/* @wm8400: Pointer to wm8400 control structure @reg: Register to access @mask: Mask of bits to change @val: Value to set for masked bits  */
int wm8400_set_bits(struct wm8400 *wm8400, u8 reg, u16 mask, u16 val)
/* @wm8400: Pointer to wm8400 control structure @reg: Register to access @mask: Mask of bits to change @val: Value to set for masked bits  */
int wm8400_set_bits(struct wm8400 *wm8400, u8 reg, u16 mask, u16 val)
{
	u16 tmp;
	int ret;
	mutex_lock(&wm8400->io_lock);
	ret = wm8400_read(wm8400, reg, 1, &tmp);
	tmp = (tmp & ~mask) | val;
	if (ret == 0)
		ret = wm8400_write(wm8400, reg, 1, &tmp);
	mutex_unlock(&wm8400->io_lock);
	return ret;
}