/* The WM8350 has a hardware lock which can be used to prevent writes to some registers (generally those which can cause particularly serious problems if misused). This function enables that lock.  */
int wm8350_reg_lock(struct wm8350 *wm8350)
/* The WM8350 has a hardware lock which can be used to prevent writes to some registers (generally those which can cause particularly serious problems if misused). This function enables that lock.  */
int wm8350_reg_lock(struct wm8350 *wm8350)
{
	u16 key = WM8350_LOCK_KEY;
	int ret;
	ldbg(__func__);
	mutex_lock(&io_mutex);
	ret = wm8350_write(wm8350, WM8350_SECURITY, 1, &key);
	if (ret)
		dev_err(wm8350->dev, "lock failed\n");
	mutex_unlock(&io_mutex);
	return ret;
}