Loading sound/soc/msm/apq8096-auto.c +81 −4 Original line number Diff line number Diff line Loading @@ -53,9 +53,11 @@ static int msm_hdmi_rx_ch = 2; static int msm_proxy_rx_ch = 2; static int hdmi_rx_sample_rate = SAMPLING_RATE_48KHZ; static int msm_sec_mi2s_tx_ch = 2; static int msm_sec_mi2s_rx_ch = 2; static int msm_tert_mi2s_tx_ch = 2; static int msm_quat_mi2s_rx_ch = 2; static int msm_sec_mi2s_tx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_sec_mi2s_rx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_tert_mi2s_tx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_quat_mi2s_rx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_sec_mi2s_rate = SAMPLING_RATE_48KHZ; Loading Loading @@ -775,6 +777,41 @@ static int msm_tert_mi2s_tx_bit_format_put(struct snd_kcontrol *kcontrol, return 0; } static int msm_sec_mi2s_rx_bit_format_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { switch (msm_sec_mi2s_rx_bit_format) { case SNDRV_PCM_FORMAT_S24_LE: ucontrol->value.integer.value[0] = 1; break; case SNDRV_PCM_FORMAT_S16_LE: default: ucontrol->value.integer.value[0] = 0; break; } pr_debug("%s: msm_sec_mi2s_rx_bit_format = %ld\n", __func__, ucontrol->value.integer.value[0]); return 0; } static int msm_sec_mi2s_rx_bit_format_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { switch (ucontrol->value.integer.value[0]) { case 1: msm_sec_mi2s_rx_bit_format = SNDRV_PCM_FORMAT_S24_LE; break; case 0: default: msm_sec_mi2s_rx_bit_format = SNDRV_PCM_FORMAT_S16_LE; break; } pr_debug("%s: msm_sec_mi2s_rx_bit_format = %d\n", __func__, msm_sec_mi2s_rx_bit_format); return 0; } static int msm_sec_mi2s_tx_bit_format_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { Loading Loading @@ -2897,16 +2934,38 @@ static int msm_hdmi_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, static int msm_mi2s_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); rate->min = rate->max = SAMPLING_RATE_48KHZ; switch (cpu_dai->id) { case 1: /*MSM_SEC_MI2S*/ pr_debug("%s: channel:%d\n", __func__, msm_sec_mi2s_rx_ch); rate->min = rate->max = msm_sec_mi2s_rate; channels->min = channels->max = msm_sec_mi2s_rx_ch; param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, msm_sec_mi2s_rx_bit_format); break; case 3: /*MSM_QUAT_MI2S*/ pr_debug("%s: channel:%d\n", __func__, msm_quat_mi2s_rx_ch); rate->min = rate->max = SAMPLING_RATE_48KHZ; channels->min = channels->max = msm_quat_mi2s_rx_ch; param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, msm_quat_mi2s_rx_bit_format); break; default: pr_err("%s: dai id 0x%x not supported\n", __func__, cpu_dai->id); return -EINVAL; } pr_debug("%s: dai id = 0x%x channels = %d rate = %d format = 0x%x\n", __func__, cpu_dai->id, channels->max, rate->max, params_format(params)); return 0; } Loading Loading @@ -3835,6 +3894,9 @@ static const struct snd_kcontrol_new msm_snd_controls[] = { SOC_ENUM_EXT("TERT_MI2S_TX Bit Format", msm_snd_enum[7], msm_tert_mi2s_tx_bit_format_get, msm_tert_mi2s_tx_bit_format_put), SOC_ENUM_EXT("SEC_MI2S_RX Bit Format", msm_snd_enum[7], msm_sec_mi2s_rx_bit_format_get, msm_sec_mi2s_rx_bit_format_put), SOC_ENUM_EXT("SEC_MI2S_TX Bit Format", msm_snd_enum[7], msm_sec_mi2s_tx_bit_format_get, msm_sec_mi2s_tx_bit_format_put), Loading Loading @@ -5541,6 +5603,21 @@ static struct snd_soc_dai_link apq8096_common_be_dai_links[] = { static struct snd_soc_dai_link apq8096_auto_be_dai_links[] = { /* Backend DAI Links */ { .name = LPASS_BE_SEC_MI2S_RX, .stream_name = "Secondary MI2S Playback", .cpu_dai_name = "msm-dai-q6-mi2s.1", .platform_name = "msm-pcm-routing", .codec_name = "msm-stub-codec.1", .codec_dai_name = "msm-stub-rx", .no_pcm = 1, .dpcm_playback = 1, .be_id = MSM_BACKEND_DAI_SECONDARY_MI2S_RX, .be_hw_params_fixup = msm_mi2s_rx_be_hw_params_fixup, .ops = &apq8096_mi2s_be_ops, .ignore_suspend = 1, .ignore_pmdown_time = 1, }, { .name = LPASS_BE_SEC_MI2S_TX, .stream_name = "Secondary MI2S Capture", Loading Loading
sound/soc/msm/apq8096-auto.c +81 −4 Original line number Diff line number Diff line Loading @@ -53,9 +53,11 @@ static int msm_hdmi_rx_ch = 2; static int msm_proxy_rx_ch = 2; static int hdmi_rx_sample_rate = SAMPLING_RATE_48KHZ; static int msm_sec_mi2s_tx_ch = 2; static int msm_sec_mi2s_rx_ch = 2; static int msm_tert_mi2s_tx_ch = 2; static int msm_quat_mi2s_rx_ch = 2; static int msm_sec_mi2s_tx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_sec_mi2s_rx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_tert_mi2s_tx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_quat_mi2s_rx_bit_format = SNDRV_PCM_FORMAT_S16_LE; static int msm_sec_mi2s_rate = SAMPLING_RATE_48KHZ; Loading Loading @@ -775,6 +777,41 @@ static int msm_tert_mi2s_tx_bit_format_put(struct snd_kcontrol *kcontrol, return 0; } static int msm_sec_mi2s_rx_bit_format_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { switch (msm_sec_mi2s_rx_bit_format) { case SNDRV_PCM_FORMAT_S24_LE: ucontrol->value.integer.value[0] = 1; break; case SNDRV_PCM_FORMAT_S16_LE: default: ucontrol->value.integer.value[0] = 0; break; } pr_debug("%s: msm_sec_mi2s_rx_bit_format = %ld\n", __func__, ucontrol->value.integer.value[0]); return 0; } static int msm_sec_mi2s_rx_bit_format_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { switch (ucontrol->value.integer.value[0]) { case 1: msm_sec_mi2s_rx_bit_format = SNDRV_PCM_FORMAT_S24_LE; break; case 0: default: msm_sec_mi2s_rx_bit_format = SNDRV_PCM_FORMAT_S16_LE; break; } pr_debug("%s: msm_sec_mi2s_rx_bit_format = %d\n", __func__, msm_sec_mi2s_rx_bit_format); return 0; } static int msm_sec_mi2s_tx_bit_format_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { Loading Loading @@ -2897,16 +2934,38 @@ static int msm_hdmi_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, static int msm_mi2s_rx_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params) { struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct snd_interval *rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE); struct snd_interval *channels = hw_param_interval(params, SNDRV_PCM_HW_PARAM_CHANNELS); rate->min = rate->max = SAMPLING_RATE_48KHZ; switch (cpu_dai->id) { case 1: /*MSM_SEC_MI2S*/ pr_debug("%s: channel:%d\n", __func__, msm_sec_mi2s_rx_ch); rate->min = rate->max = msm_sec_mi2s_rate; channels->min = channels->max = msm_sec_mi2s_rx_ch; param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, msm_sec_mi2s_rx_bit_format); break; case 3: /*MSM_QUAT_MI2S*/ pr_debug("%s: channel:%d\n", __func__, msm_quat_mi2s_rx_ch); rate->min = rate->max = SAMPLING_RATE_48KHZ; channels->min = channels->max = msm_quat_mi2s_rx_ch; param_set_mask(params, SNDRV_PCM_HW_PARAM_FORMAT, msm_quat_mi2s_rx_bit_format); break; default: pr_err("%s: dai id 0x%x not supported\n", __func__, cpu_dai->id); return -EINVAL; } pr_debug("%s: dai id = 0x%x channels = %d rate = %d format = 0x%x\n", __func__, cpu_dai->id, channels->max, rate->max, params_format(params)); return 0; } Loading Loading @@ -3835,6 +3894,9 @@ static const struct snd_kcontrol_new msm_snd_controls[] = { SOC_ENUM_EXT("TERT_MI2S_TX Bit Format", msm_snd_enum[7], msm_tert_mi2s_tx_bit_format_get, msm_tert_mi2s_tx_bit_format_put), SOC_ENUM_EXT("SEC_MI2S_RX Bit Format", msm_snd_enum[7], msm_sec_mi2s_rx_bit_format_get, msm_sec_mi2s_rx_bit_format_put), SOC_ENUM_EXT("SEC_MI2S_TX Bit Format", msm_snd_enum[7], msm_sec_mi2s_tx_bit_format_get, msm_sec_mi2s_tx_bit_format_put), Loading Loading @@ -5541,6 +5603,21 @@ static struct snd_soc_dai_link apq8096_common_be_dai_links[] = { static struct snd_soc_dai_link apq8096_auto_be_dai_links[] = { /* Backend DAI Links */ { .name = LPASS_BE_SEC_MI2S_RX, .stream_name = "Secondary MI2S Playback", .cpu_dai_name = "msm-dai-q6-mi2s.1", .platform_name = "msm-pcm-routing", .codec_name = "msm-stub-codec.1", .codec_dai_name = "msm-stub-rx", .no_pcm = 1, .dpcm_playback = 1, .be_id = MSM_BACKEND_DAI_SECONDARY_MI2S_RX, .be_hw_params_fixup = msm_mi2s_rx_be_hw_params_fixup, .ops = &apq8096_mi2s_be_ops, .ignore_suspend = 1, .ignore_pmdown_time = 1, }, { .name = LPASS_BE_SEC_MI2S_TX, .stream_name = "Secondary MI2S Capture", Loading