Loading include/sound/q6core.h +4 −0 Original line number Diff line number Diff line Loading @@ -185,13 +185,17 @@ struct avcs_cmd_get_version_result { #define AVCS_CMDRSP_Q6_ID_2_6 0x00040000 #define AVCS_CMDRSP_Q6_ID_2_7 0x00040001 #define AVCS_CMDRSP_Q6_ID_2_8 0x00040002 #define AVCS_CMDRSP_Q6_ID_2_9 0x00040003 enum q6_subsys_image { Q6_SUBSYS_AVS2_6 = 1, Q6_SUBSYS_AVS2_7, Q6_SUBSYS_AVS2_8, Q6_SUBSYS_AVS2_9, Q6_SUBSYS_INVALID, }; enum q6_subsys_image q6core_get_avs_version(void); int core_get_adsp_ver(void); #endif /* __Q6CORE_H__ */ sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c +40 −3 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ struct msm_compr_pdata { struct msm_compr_ch_map *ch_map[MSM_FRONTEND_DAI_MAX]; int32_t ion_fd[MSM_FRONTEND_DAI_MAX]; bool is_in_use[MSM_FRONTEND_DAI_MAX]; bool avs_ver; }; struct msm_compr_audio { Loading Loading @@ -1017,6 +1018,17 @@ static int msm_compr_send_media_format_block(struct snd_compr_stream *cstream, sample_word_size = 16; break; } if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_media_format_block_pcm_format_support_v3( prtd->audio_client, prtd->sample_rate, prtd->num_channels, bit_width, stream_id, use_default_chmap, chmap, sample_word_size); else ret = q6asm_media_format_block_pcm_format_support_v4( prtd->audio_client, prtd->sample_rate, Loading Loading @@ -1273,6 +1285,8 @@ static int msm_compr_configure_dsp_for_playback uint16_t bits_per_sample = 16; int dir = IN, ret = 0; struct audio_client *ac = prtd->audio_client; struct msm_compr_pdata *pdata = snd_soc_platform_get_drvdata(soc_prtd->platform); uint32_t stream_index; struct asm_softpause_params softpause = { .enable = SOFT_PAUSE_ENABLE, Loading Loading @@ -1323,6 +1337,13 @@ static int msm_compr_configure_dsp_for_playback } else { pr_debug("%s: stream_id %d bits_per_sample %d\n", __func__, ac->stream_id, bits_per_sample); if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_stream_open_write_v3(ac, prtd->codec, bits_per_sample, ac->stream_id, prtd->gapless_state.use_dsp_gapless_mode); else ret = q6asm_stream_open_write_v4(ac, prtd->codec, bits_per_sample, ac->stream_id, Loading Loading @@ -2639,6 +2660,13 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd) pr_debug("%s: open_write stream_id %d bits_per_sample %d", __func__, stream_id, bits_per_sample); if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) rc = q6asm_stream_open_write_v3(prtd->audio_client, prtd->codec, bits_per_sample, stream_id, prtd->gapless_state.use_dsp_gapless_mode); else rc = q6asm_stream_open_write_v4(prtd->audio_client, prtd->codec, bits_per_sample, stream_id, Loading Loading @@ -4091,6 +4119,15 @@ static int msm_compr_probe(struct snd_soc_platform *platform) pdata->use_legacy_api = false; pr_debug("%s: use legacy api %d\n", __func__, pdata->use_legacy_api); if (of_property_read_bool(platform->dev->of_node, "qcom,avs-version")) pdata->avs_ver = true; else pdata->avs_ver = false; pr_debug("%s: avs_ver = %d\n", __func__, pdata->avs_ver); /* * use_dsp_gapless_mode part of platform data(pdata) is updated from HAL * through a mixer control before compress driver is opened. The mixer Loading sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c +43 −2 Original line number Diff line number Diff line Loading @@ -384,6 +384,17 @@ static int msm_pcm_playback_prepare(struct snd_pcm_substream *substream) prtd->audio_client = NULL; return -ENOMEM; } } else if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) { ret = q6asm_open_write_v3(prtd->audio_client, FORMAT_LINEAR_PCM, bits_per_sample); if (ret < 0) { pr_err("%s: q6asm_open_write_v3 failed (%d)\n", __func__, ret); q6asm_audio_client_free(prtd->audio_client); prtd->audio_client = NULL; return -ENOMEM; } } else { ret = q6asm_open_write_with_retry(prtd->audio_client, fmt_type, bits_per_sample); Loading Loading @@ -433,6 +444,14 @@ static int msm_pcm_playback_prepare(struct snd_pcm_substream *substream) prtd->channel_map, bits_per_sample, sample_word_size, ASM_LITTLE_ENDIAN, DEFAULT_QF); else if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_media_format_block_multi_ch_pcm_v3( prtd->audio_client, runtime->rate, runtime->channels, !prtd->set_channel_map, prtd->channel_map, bits_per_sample, sample_word_size); else ret = q6asm_media_format_block_multi_ch_pcm_v4( prtd->audio_client, runtime->rate, Loading Loading @@ -497,7 +516,12 @@ static int msm_pcm_capture_prepare(struct snd_pcm_substream *substream) pr_debug("%s Opening %d-ch PCM read stream, perf_mode %d\n", __func__, params_channels(params), prtd->audio_client->perf_mode); if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_open_read_v3(prtd->audio_client, FORMAT_LINEAR_PCM, bits_per_sample); else ret = q6asm_open_read_with_retry(prtd->audio_client, FORMAT_LINEAR_PCM, bits_per_sample, false); Loading Loading @@ -577,6 +601,15 @@ static int msm_pcm_capture_prepare(struct snd_pcm_substream *substream) sample_word_size, ASM_LITTLE_ENDIAN, DEFAULT_QF); else if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_enc_cfg_blk_pcm_format_support_v3( prtd->audio_client, prtd->samp_rate, prtd->channel_mode, bits_per_sample, sample_word_size); else ret = q6asm_enc_cfg_blk_pcm_format_support_v4( prtd->audio_client, Loading Loading @@ -3048,6 +3081,14 @@ static int msm_pcm_probe(struct platform_device *pdev) pdata->perf_mode = LEGACY_PCM_MODE; } if (of_property_read_bool(pdev->dev.of_node, "qcom,avs-version")) pdata->avs_ver = true; else pdata->avs_ver = false; pr_debug("%s: avs_ver = %d\n", __func__, pdata->avs_ver); dev_set_drvdata(&pdev->dev, pdata); dev_dbg(&pdev->dev, "%s: dev name %s\n", Loading sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.h +1 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ struct output_meta_data_st { struct msm_plat_data { int perf_mode; bool avs_ver; struct snd_pcm *pcm; struct snd_pcm *pcm_device[MSM_FRONTEND_DAI_MM_SIZE]; struct msm_pcm_channel_mixer chmixer_pspd[MSM_FRONTEND_DAI_MM_SIZE][2]; Loading Loading
include/sound/q6core.h +4 −0 Original line number Diff line number Diff line Loading @@ -185,13 +185,17 @@ struct avcs_cmd_get_version_result { #define AVCS_CMDRSP_Q6_ID_2_6 0x00040000 #define AVCS_CMDRSP_Q6_ID_2_7 0x00040001 #define AVCS_CMDRSP_Q6_ID_2_8 0x00040002 #define AVCS_CMDRSP_Q6_ID_2_9 0x00040003 enum q6_subsys_image { Q6_SUBSYS_AVS2_6 = 1, Q6_SUBSYS_AVS2_7, Q6_SUBSYS_AVS2_8, Q6_SUBSYS_AVS2_9, Q6_SUBSYS_INVALID, }; enum q6_subsys_image q6core_get_avs_version(void); int core_get_adsp_ver(void); #endif /* __Q6CORE_H__ */
sound/soc/msm/qdsp6v2/msm-compress-q6-v2.c +40 −3 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ struct msm_compr_pdata { struct msm_compr_ch_map *ch_map[MSM_FRONTEND_DAI_MAX]; int32_t ion_fd[MSM_FRONTEND_DAI_MAX]; bool is_in_use[MSM_FRONTEND_DAI_MAX]; bool avs_ver; }; struct msm_compr_audio { Loading Loading @@ -1017,6 +1018,17 @@ static int msm_compr_send_media_format_block(struct snd_compr_stream *cstream, sample_word_size = 16; break; } if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_media_format_block_pcm_format_support_v3( prtd->audio_client, prtd->sample_rate, prtd->num_channels, bit_width, stream_id, use_default_chmap, chmap, sample_word_size); else ret = q6asm_media_format_block_pcm_format_support_v4( prtd->audio_client, prtd->sample_rate, Loading Loading @@ -1273,6 +1285,8 @@ static int msm_compr_configure_dsp_for_playback uint16_t bits_per_sample = 16; int dir = IN, ret = 0; struct audio_client *ac = prtd->audio_client; struct msm_compr_pdata *pdata = snd_soc_platform_get_drvdata(soc_prtd->platform); uint32_t stream_index; struct asm_softpause_params softpause = { .enable = SOFT_PAUSE_ENABLE, Loading Loading @@ -1323,6 +1337,13 @@ static int msm_compr_configure_dsp_for_playback } else { pr_debug("%s: stream_id %d bits_per_sample %d\n", __func__, ac->stream_id, bits_per_sample); if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_stream_open_write_v3(ac, prtd->codec, bits_per_sample, ac->stream_id, prtd->gapless_state.use_dsp_gapless_mode); else ret = q6asm_stream_open_write_v4(ac, prtd->codec, bits_per_sample, ac->stream_id, Loading Loading @@ -2639,6 +2660,13 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd) pr_debug("%s: open_write stream_id %d bits_per_sample %d", __func__, stream_id, bits_per_sample); if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) rc = q6asm_stream_open_write_v3(prtd->audio_client, prtd->codec, bits_per_sample, stream_id, prtd->gapless_state.use_dsp_gapless_mode); else rc = q6asm_stream_open_write_v4(prtd->audio_client, prtd->codec, bits_per_sample, stream_id, Loading Loading @@ -4091,6 +4119,15 @@ static int msm_compr_probe(struct snd_soc_platform *platform) pdata->use_legacy_api = false; pr_debug("%s: use legacy api %d\n", __func__, pdata->use_legacy_api); if (of_property_read_bool(platform->dev->of_node, "qcom,avs-version")) pdata->avs_ver = true; else pdata->avs_ver = false; pr_debug("%s: avs_ver = %d\n", __func__, pdata->avs_ver); /* * use_dsp_gapless_mode part of platform data(pdata) is updated from HAL * through a mixer control before compress driver is opened. The mixer Loading
sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.c +43 −2 Original line number Diff line number Diff line Loading @@ -384,6 +384,17 @@ static int msm_pcm_playback_prepare(struct snd_pcm_substream *substream) prtd->audio_client = NULL; return -ENOMEM; } } else if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) { ret = q6asm_open_write_v3(prtd->audio_client, FORMAT_LINEAR_PCM, bits_per_sample); if (ret < 0) { pr_err("%s: q6asm_open_write_v3 failed (%d)\n", __func__, ret); q6asm_audio_client_free(prtd->audio_client); prtd->audio_client = NULL; return -ENOMEM; } } else { ret = q6asm_open_write_with_retry(prtd->audio_client, fmt_type, bits_per_sample); Loading Loading @@ -433,6 +444,14 @@ static int msm_pcm_playback_prepare(struct snd_pcm_substream *substream) prtd->channel_map, bits_per_sample, sample_word_size, ASM_LITTLE_ENDIAN, DEFAULT_QF); else if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_media_format_block_multi_ch_pcm_v3( prtd->audio_client, runtime->rate, runtime->channels, !prtd->set_channel_map, prtd->channel_map, bits_per_sample, sample_word_size); else ret = q6asm_media_format_block_multi_ch_pcm_v4( prtd->audio_client, runtime->rate, Loading Loading @@ -497,7 +516,12 @@ static int msm_pcm_capture_prepare(struct snd_pcm_substream *substream) pr_debug("%s Opening %d-ch PCM read stream, perf_mode %d\n", __func__, params_channels(params), prtd->audio_client->perf_mode); if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_open_read_v3(prtd->audio_client, FORMAT_LINEAR_PCM, bits_per_sample); else ret = q6asm_open_read_with_retry(prtd->audio_client, FORMAT_LINEAR_PCM, bits_per_sample, false); Loading Loading @@ -577,6 +601,15 @@ static int msm_pcm_capture_prepare(struct snd_pcm_substream *substream) sample_word_size, ASM_LITTLE_ENDIAN, DEFAULT_QF); else if (pdata->avs_ver && (q6core_get_avs_version() == Q6_SUBSYS_AVS2_7)) ret = q6asm_enc_cfg_blk_pcm_format_support_v3( prtd->audio_client, prtd->samp_rate, prtd->channel_mode, bits_per_sample, sample_word_size); else ret = q6asm_enc_cfg_blk_pcm_format_support_v4( prtd->audio_client, Loading Loading @@ -3048,6 +3081,14 @@ static int msm_pcm_probe(struct platform_device *pdev) pdata->perf_mode = LEGACY_PCM_MODE; } if (of_property_read_bool(pdev->dev.of_node, "qcom,avs-version")) pdata->avs_ver = true; else pdata->avs_ver = false; pr_debug("%s: avs_ver = %d\n", __func__, pdata->avs_ver); dev_set_drvdata(&pdev->dev, pdata); dev_dbg(&pdev->dev, "%s: dev name %s\n", Loading
sound/soc/msm/qdsp6v2/msm-pcm-q6-v2.h +1 −0 Original line number Diff line number Diff line Loading @@ -123,6 +123,7 @@ struct output_meta_data_st { struct msm_plat_data { int perf_mode; bool avs_ver; struct snd_pcm *pcm; struct snd_pcm *pcm_device[MSM_FRONTEND_DAI_MM_SIZE]; struct msm_pcm_channel_mixer chmixer_pspd[MSM_FRONTEND_DAI_MM_SIZE][2]; Loading