/* The WM831x has a user key preventing writes to particularly critical registers. This function locks those registers, preventing spurious writes.  */
int wm831x_reg_unlock(struct wm831x *wm831x)
/* The WM831x has a user key preventing writes to particularly critical registers. This function locks those registers, preventing spurious writes.  */
int wm831x_reg_unlock(struct wm831x *wm831x)
{
	int ret;
	ret = wm831x_reg_write(wm831x, WM831X_SECURITY_KEY, 0x9716);
	if (ret == 0) {
		dev_vdbg(wm831x->dev, "Registers unlocked\n");
		mutex_lock(&wm831x->io_lock);
		WARN_ON(!wm831x->locked);
		wm831x->locked = 0;
		mutex_unlock(&wm831x->io_lock);
	}
	return ret;
}