Lines Matching +full:buck +full:- +full:d

1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
3 // Copyright (c) 2017-2018, Linaro Limited
10 #include "wcd-clsh-v2.h"
22 /* Class-H registers for codecs from and above WCD9335 */
122 struct snd_soc_component *comp = ctrl->comp; in wcd_enable_clsh_block()
124 if ((enable && ++ctrl->clsh_users == 1) || in wcd_enable_clsh_block()
125 (!enable && --ctrl->clsh_users == 0)) in wcd_enable_clsh_block()
129 if (ctrl->clsh_users < 0) in wcd_enable_clsh_block()
130 ctrl->clsh_users = 0; in wcd_enable_clsh_block()
179 struct snd_soc_component *comp = ctrl->comp; in wcd_clsh_buck_ctrl()
181 /* enable/disable buck */ in wcd_clsh_buck_ctrl()
182 if ((enable && (++ctrl->buck_users == 1)) || in wcd_clsh_buck_ctrl()
183 (!enable && (--ctrl->buck_users == 0))) in wcd_clsh_buck_ctrl()
188 * 500us sleep is required after buck enable/disable in wcd_clsh_buck_ctrl()
199 /* enable/disable buck */ in wcd_clsh_v3_buck_ctrl()
200 if ((enable && (++ctrl->buck_users == 1)) || in wcd_clsh_v3_buck_ctrl()
201 (!enable && (--ctrl->buck_users == 0))) { in wcd_clsh_v3_buck_ctrl()
206 * 500us sleep is required after buck enable/disable in wcd_clsh_v3_buck_ctrl()
228 struct snd_soc_component *comp = ctrl->comp; in wcd_clsh_flyback_ctrl()
231 if ((enable && (++ctrl->flyback_users == 1)) || in wcd_clsh_flyback_ctrl()
232 (!enable && (--ctrl->flyback_users == 0))) { in wcd_clsh_flyback_ctrl()
248 struct snd_soc_component *comp = ctrl->comp; in wcd_clsh_set_gain_path()
341 dev_err(component->dev, "%s:Invalid mode %d\n", __func__, mode); in wcd_clsh_v3_set_hph_mode()
350 struct snd_soc_component *comp = ctrl->comp; in wcd_clsh_set_hph_mode()
352 if (ctrl->codec_version >= WCD937X) in wcd_clsh_set_hph_mode()
458 if ((enable && (++ctrl->flyback_users == 1)) || in wcd_clsh_v3_flyback_ctrl()
459 (!enable && (--ctrl->flyback_users == 0))) { in wcd_clsh_v3_flyback_ctrl()
493 struct snd_soc_component *component = ctrl->comp; in wcd_clsh_v3_state_aux()
512 struct snd_soc_component *comp = ctrl->comp; in wcd_clsh_state_lo()
515 dev_err(comp->dev, "%s: LO cannot be in this mode: %d\n", in wcd_clsh_state_lo()
539 struct snd_soc_component *component = ctrl->comp; in wcd_clsh_v3_state_hph_r()
542 dev_dbg(component->dev, "%s: Normal mode not applicable for hph_r\n", in wcd_clsh_v3_state_hph_r()
559 /* buck and flyback set to default mode and disable */ in wcd_clsh_v3_state_hph_r()
571 struct snd_soc_component *comp = ctrl->comp; in wcd_clsh_state_hph_r()
574 dev_err(comp->dev, "%s: Normal mode not applicable for hph_r\n", in wcd_clsh_state_hph_r()
617 /* buck and flyback set to default mode and disable */ in wcd_clsh_state_hph_r()
629 struct snd_soc_component *component = ctrl->comp; in wcd_clsh_v3_state_hph_l()
632 dev_dbg(component->dev, "%s: Normal mode not applicable for hph_l\n", in wcd_clsh_v3_state_hph_l()
649 /* set buck and flyback to Default Mode */ in wcd_clsh_v3_state_hph_l()
661 struct snd_soc_component *comp = ctrl->comp; in wcd_clsh_state_hph_l()
664 dev_err(comp->dev, "%s: Normal mode not applicable for hph_l\n", in wcd_clsh_state_hph_l()
707 /* set buck and flyback to Default Mode */ in wcd_clsh_state_hph_l()
719 struct snd_soc_component *component = ctrl->comp; in wcd_clsh_v3_state_ear()
733 /* set buck and flyback to Default Mode */ in wcd_clsh_v3_state_ear()
745 struct snd_soc_component *comp = ctrl->comp; in wcd_clsh_state_ear()
748 dev_err(comp->dev, "%s: mode: %d cannot be used for EAR\n", in wcd_clsh_state_ear()
782 if (ctrl->codec_version >= WCD937X) in _wcd_clsh_ctrl_set_state()
788 if (ctrl->codec_version >= WCD937X) in _wcd_clsh_ctrl_set_state()
794 if (ctrl->codec_version >= WCD937X) in _wcd_clsh_ctrl_set_state()
800 if (ctrl->codec_version < WCD937X) in _wcd_clsh_ctrl_set_state()
804 if (ctrl->codec_version >= WCD937X) in _wcd_clsh_ctrl_set_state()
849 struct snd_soc_component *comp = ctrl->comp; in wcd_clsh_ctrl_set_state()
851 if (nstate == ctrl->state) in wcd_clsh_ctrl_set_state()
855 dev_err(comp->dev, "Class-H not a valid new state:\n"); in wcd_clsh_ctrl_set_state()
856 return -EINVAL; in wcd_clsh_ctrl_set_state()
868 ctrl->state = nstate; in wcd_clsh_ctrl_set_state()
869 ctrl->mode = mode; in wcd_clsh_ctrl_set_state()
877 return ctrl->state; in wcd_clsh_ctrl_get_state()
888 return ERR_PTR(-ENOMEM); in wcd_clsh_ctrl_alloc()
890 ctrl->state = WCD_CLSH_STATE_IDLE; in wcd_clsh_ctrl_alloc()
891 ctrl->comp = comp; in wcd_clsh_ctrl_alloc()
892 ctrl->codec_version = version; in wcd_clsh_ctrl_alloc()
904 MODULE_DESCRIPTION("WCD93XX Class-H driver");