static int wm2000_suspend(struct snd_soc_codec *codec) { struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); int ret; printk( "wm2000 anc power suspend\n"); wm2000_clk_enable(); ret = wm2000_anc_transition(wm2000, ANC_OFF); intel_scu_ipc_set_osc_clk0(false, CLK0_MSIC); wm2000_clk_ref = 0; pr_debug("wm2000: clock refcount %d\n", wm2000_clk_ref); // wm2000_clk_disable(); return ret; }
static int wm2000_anc_set_mode(struct wm2000_priv *wm2000) { struct i2c_client *i2c = wm2000->i2c; enum wm2000_anc_mode mode; if (wm2000->anc_eng_ena && wm2000->spk_ena) if (wm2000->anc_active) mode = ANC_ACTIVE; else mode = ANC_BYPASS; else mode = ANC_STANDBY; dev_dbg(&i2c->dev, "Set mode %d (enabled %d, mute %d, active %d)\n", mode, wm2000->anc_eng_ena, !wm2000->spk_ena, wm2000->anc_active); return wm2000_anc_transition(wm2000, mode); }
static int wm2000_anc_set_mode(struct wm2000_priv *wm2000) { struct i2c_client *i2c = wm2000->i2c; enum wm2000_anc_mode mode; int ret; mutex_lock(&wm2000->anc_lock); #if 0 if (wm2000->anc_eng_ena && wm2000->spk_ena) if (wm2000->anc_active) mode = ANC_ACTIVE; else mode = ANC_BYPASS; else mode = ANC_STANDBY; #else if(wm2000->incall_mode) if(wm2000->anc_active) mode = ANC_ACTIVE; else mode = ANC_BYPASS; else mode = ANC_STANDBY; #endif dev_dbg(&i2c->dev, "Set mode %d (enabled %d, mute %d, active %d incall %d)\n", mode, wm2000->anc_eng_ena, !wm2000->spk_ena, wm2000->anc_active,wm2000->incall_mode); ret = wm2000_anc_transition(wm2000, mode); mutex_unlock(&wm2000->anc_lock); return ret; }
static int wm2000_remove(struct snd_soc_codec *codec) { struct wm2000_priv *wm2000 = dev_get_drvdata(codec->dev); return wm2000_anc_transition(wm2000, ANC_OFF); }