static int ctp_vb_cs42l73_startup(struct snd_pcm_substream *substream) { unsigned int device = substream->pcm->device; pr_debug("%s - applying rate constraint\n", __func__); switch (device) { case CTP_VB_AUD_ASP_DEV: case CTP_VB_AUD_PROBE_DEV: case CTP_VB_COMMS_FM_DEV: case CTP_VB_AUD_VIRTUAL_ASP_DEV: snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &constraints_48000); break; case CTP_VB_AUD_VSP_DEV: snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &constraints_16000); ctp_config_voicecall_flag(substream, true); break; case CTP_VB_COMMS_BT_SCO_DEV: snd_pcm_hw_constraint_list(substream->runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &constraints_8000_16000); break; default: pr_err("%s: Invalid device %d\n", __func__, device); return -EINVAL; } return 0; }
static void ctp_vb_cs42l73_shutdown(struct snd_pcm_substream *substream) { unsigned int device = substream->pcm->device; switch (device) { case CTP_VB_AUD_VSP_DEV: ctp_config_voicecall_flag(substream, false); break; default: pr_err("%s: Invalid device %d\n", __func__, device); } }
static void ctp_shutdown_vsp(struct snd_pcm_substream *substream) { ctp_config_voicecall_flag(substream, false); }
static int ctp_startup_vsp(struct snd_pcm_substream *substream) { ctp_config_voicecall_flag(substream, true); return 0; }