Loading sound/soc/msm/qdsp6v2/msm-pcm-loopback-v2.c +25 −2 Original line number Diff line number Diff line Loading @@ -68,6 +68,25 @@ static const struct snd_pcm_hardware dummy_pcm_hardware = { .periods_max = 128, }; static void msm_pcm_route_event_handler(enum msm_pcm_routing_event event, void *priv_data) { struct msm_pcm_loopback *pcm = priv_data; BUG_ON(!pcm); pr_debug("%s: event %x\n", __func__, event); switch (event) { case MSM_PCM_RT_EVT_DEVSWITCH: q6asm_cmd(pcm->audio_client, CMD_PAUSE); q6asm_cmd(pcm->audio_client, CMD_FLUSH); q6asm_run(pcm->audio_client, 0, 0, 0); default: break; } } static void msm_pcm_loopback_event_handler(uint32_t opcode, uint32_t token, uint32_t *payload, void *priv) { Loading Loading @@ -112,6 +131,7 @@ static int msm_pcm_open(struct snd_pcm_substream *substream) struct msm_pcm_loopback *pcm; int ret = 0; uint16_t bits_per_sample = 16; struct msm_pcm_routing_evt event; pcm = dev_get_drvdata(rtd->platform->dev); mutex_lock(&pcm->lock); Loading Loading @@ -154,12 +174,15 @@ static int msm_pcm_open(struct snd_pcm_substream *substream) mutex_unlock(&pcm->lock); return -ENOMEM; } event.event_func = msm_pcm_route_event_handler; event.priv_data = (void *) pcm; msm_pcm_routing_reg_phy_stream(soc_pcm_tx->dai_link->be_id, pcm->audio_client->perf_mode, pcm->session_id, pcm->capture_substream->stream); msm_pcm_routing_reg_phy_stream(soc_pcm_rx->dai_link->be_id, msm_pcm_routing_reg_phy_stream_v2(soc_pcm_rx->dai_link->be_id, pcm->audio_client->perf_mode, pcm->session_id, pcm->playback_substream->stream); pcm->session_id, pcm->playback_substream->stream, event); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { pcm->playback_substream = substream; ret = pcm_loopback_set_volume(pcm, pcm->volume); Loading sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c +6 −0 Original line number Diff line number Diff line Loading @@ -682,6 +682,12 @@ static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set) topology, fe_dai_perf_mode[val][session_type], bits_per_sample); if (session_type == SESSION_TYPE_RX && fdai->event_info.event_func) fdai->event_info.event_func( MSM_PCM_RT_EVT_DEVSWITCH, fdai->event_info.priv_data); msm_pcm_routing_build_matrix(val, fdai->strm_id, path_type, fe_dai_perf_mode[val][session_type]); Loading sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.h +1 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,7 @@ enum { enum msm_pcm_routing_event { MSM_PCM_RT_EVT_BUF_RECFG, MSM_PCM_RT_EVT_DEVSWITCH, MSM_PCM_RT_EVT_MAX, }; Loading Loading
sound/soc/msm/qdsp6v2/msm-pcm-loopback-v2.c +25 −2 Original line number Diff line number Diff line Loading @@ -68,6 +68,25 @@ static const struct snd_pcm_hardware dummy_pcm_hardware = { .periods_max = 128, }; static void msm_pcm_route_event_handler(enum msm_pcm_routing_event event, void *priv_data) { struct msm_pcm_loopback *pcm = priv_data; BUG_ON(!pcm); pr_debug("%s: event %x\n", __func__, event); switch (event) { case MSM_PCM_RT_EVT_DEVSWITCH: q6asm_cmd(pcm->audio_client, CMD_PAUSE); q6asm_cmd(pcm->audio_client, CMD_FLUSH); q6asm_run(pcm->audio_client, 0, 0, 0); default: break; } } static void msm_pcm_loopback_event_handler(uint32_t opcode, uint32_t token, uint32_t *payload, void *priv) { Loading Loading @@ -112,6 +131,7 @@ static int msm_pcm_open(struct snd_pcm_substream *substream) struct msm_pcm_loopback *pcm; int ret = 0; uint16_t bits_per_sample = 16; struct msm_pcm_routing_evt event; pcm = dev_get_drvdata(rtd->platform->dev); mutex_lock(&pcm->lock); Loading Loading @@ -154,12 +174,15 @@ static int msm_pcm_open(struct snd_pcm_substream *substream) mutex_unlock(&pcm->lock); return -ENOMEM; } event.event_func = msm_pcm_route_event_handler; event.priv_data = (void *) pcm; msm_pcm_routing_reg_phy_stream(soc_pcm_tx->dai_link->be_id, pcm->audio_client->perf_mode, pcm->session_id, pcm->capture_substream->stream); msm_pcm_routing_reg_phy_stream(soc_pcm_rx->dai_link->be_id, msm_pcm_routing_reg_phy_stream_v2(soc_pcm_rx->dai_link->be_id, pcm->audio_client->perf_mode, pcm->session_id, pcm->playback_substream->stream); pcm->session_id, pcm->playback_substream->stream, event); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { pcm->playback_substream = substream; ret = pcm_loopback_set_volume(pcm, pcm->volume); Loading
sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.c +6 −0 Original line number Diff line number Diff line Loading @@ -682,6 +682,12 @@ static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set) topology, fe_dai_perf_mode[val][session_type], bits_per_sample); if (session_type == SESSION_TYPE_RX && fdai->event_info.event_func) fdai->event_info.event_func( MSM_PCM_RT_EVT_DEVSWITCH, fdai->event_info.priv_data); msm_pcm_routing_build_matrix(val, fdai->strm_id, path_type, fe_dai_perf_mode[val][session_type]); Loading
sound/soc/msm/qdsp6v2/msm-pcm-routing-v2.h +1 −0 Original line number Diff line number Diff line Loading @@ -139,6 +139,7 @@ enum { enum msm_pcm_routing_event { MSM_PCM_RT_EVT_BUF_RECFG, MSM_PCM_RT_EVT_DEVSWITCH, MSM_PCM_RT_EVT_MAX, }; Loading