static void wcd9xxx_clsh_state_hph_r(struct snd_soc_codec *codec, struct wcd9xxx_clsh_cdc_data *clsh_d, u8 req_state, bool is_enable) { if (is_enable) { wcd9xxx_cfg_clsh_buck(codec); wcd9xxx_cfg_clsh_param_common(codec); wcd9xxx_cfg_clsh_param_hph(codec); wcd9xxx_enable_clsh_block(codec, true); wcd9xxx_chargepump_request(codec, true); wcd9xxx_enable_anc_delay(codec, true); wcd9xxx_clsh_comp_req(codec, clsh_d, CLSH_COMPUTE_HPH_R, true); wcd9xxx_enable_buck_mode(codec, BUCK_VREF_2V); wcd9xxx_set_fclk_enable_ncp(codec, NCP_FCLK_LEVEL_8); dev_dbg(codec->dev, "%s: Done\n", __func__); } else { if (req_state == WCD9XXX_CLSH_STATE_HPHL) { wcd9xxx_clsh_comp_req(codec, clsh_d, CLSH_COMPUTE_HPH_L, false); } else { dev_dbg(codec->dev, "%s: stub fallback to hph_r\n", __func__); } } }
static void wcd9xxx_clsh_state_hph_r(struct snd_soc_codec *codec, struct wcd9xxx_clsh_cdc_data *clsh_d, u8 req_state, bool is_enable) { pr_debug("%s: enter %s, state %d, req_state %d\n", __func__, is_enable ? "enable" : "disable", clsh_d->state, req_state); if (is_enable) { wcd9xxx_cfg_clsh_param_common(codec); wcd9xxx_cfg_clsh_param_hph(codec); wcd9xxx_enable_clsh_block(codec, clsh_d, true); wcd9xxx_chargepump_request(codec, true); wcd9xxx_enable_anc_delay(codec, true); wcd9xxx_clsh_comp_req(codec, clsh_d, CLSH_COMPUTE_HPH_R, true); wcd9xxx_set_buck_mode(codec, BUCK_VREF_0P494V); wcd9xxx_enable_buck(codec, clsh_d, true); wcd9xxx_set_fclk_get_ncp(codec, clsh_d, NCP_FCLK_LEVEL_8); dev_dbg(codec->dev, "%s: Done\n", __func__); } else { wcd9xxx_set_fclk_put_ncp(codec, clsh_d, NCP_FCLK_LEVEL_8); wcd9xxx_enable_buck(codec, clsh_d, false); wcd9xxx_clsh_comp_req(codec, clsh_d, CLSH_COMPUTE_HPH_R, false); wcd9xxx_chargepump_request(codec, false); wcd9xxx_enable_clsh_block(codec, clsh_d, false); } }