mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
apq8064: Add support for hdmi multichannel
Provide support for hdmi channel fixup. Fix channel map order to WAV format. BUG-ID: 7156174 Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
This commit is contained in:
parent
6c9ad4d7e6
commit
69b1f52a8d
2 changed files with 32 additions and 6 deletions
|
@ -94,6 +94,7 @@ static int msm_slim_3_rx_ch = 1;
|
|||
|
||||
static int msm_btsco_rate = BTSCO_RATE_8KHZ;
|
||||
static int msm_btsco_ch = 1;
|
||||
static int msm_hdmi_rx_ch = 2;
|
||||
|
||||
static int rec_mode = INCALL_REC_MONO;
|
||||
|
||||
|
@ -674,11 +675,14 @@ static const struct snd_soc_dapm_route apq8064_liquid_cdp_audio_map[] = {
|
|||
static const char *spk_function[] = {"Off", "On"};
|
||||
static const char *slim0_rx_ch_text[] = {"One", "Two"};
|
||||
static const char *slim0_tx_ch_text[] = {"One", "Two", "Three", "Four"};
|
||||
static const char *hdmi_rx_ch_text[] = {"Two", "Three", "Four", "Five",
|
||||
"Six", "Seven", "Eight"};
|
||||
|
||||
static const struct soc_enum msm_enum[] = {
|
||||
SOC_ENUM_SINGLE_EXT(2, spk_function),
|
||||
SOC_ENUM_SINGLE_EXT(2, slim0_rx_ch_text),
|
||||
SOC_ENUM_SINGLE_EXT(4, slim0_tx_ch_text),
|
||||
SOC_ENUM_SINGLE_EXT(7, hdmi_rx_ch_text),
|
||||
};
|
||||
|
||||
static const char *btsco_rate_text[] = {"8000", "16000"};
|
||||
|
@ -788,6 +792,25 @@ static int msm_incall_rec_mode_put(struct snd_kcontrol *kcontrol,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int msm_hdmi_rx_ch_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
pr_debug("%s: msm_hdmi_rx_ch = %d\n", __func__,
|
||||
msm_hdmi_rx_ch);
|
||||
ucontrol->value.integer.value[0] = msm_hdmi_rx_ch - 2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_hdmi_rx_ch_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
msm_hdmi_rx_ch = ucontrol->value.integer.value[0] + 2;
|
||||
|
||||
pr_debug("%s: msm_hdmi_rx_ch = %d\n", __func__,
|
||||
msm_hdmi_rx_ch);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static const struct snd_kcontrol_new tabla_msm_controls[] = {
|
||||
SOC_ENUM_EXT("Speaker Function", msm_enum[0], msm_get_spk,
|
||||
msm_set_spk),
|
||||
|
@ -801,6 +824,8 @@ static const struct snd_kcontrol_new tabla_msm_controls[] = {
|
|||
msm_incall_rec_mode_get, msm_incall_rec_mode_put),
|
||||
SOC_ENUM_EXT("SLIM_3_RX Channels", msm_enum[1],
|
||||
msm_slim_3_rx_ch_get, msm_slim_3_rx_ch_put),
|
||||
SOC_ENUM_EXT("HDMI_RX Channels", msm_enum[3],
|
||||
msm_hdmi_rx_ch_get, msm_hdmi_rx_ch_put),
|
||||
};
|
||||
|
||||
static void *def_tabla_mbhc_cal(void)
|
||||
|
@ -1354,6 +1379,7 @@ static int msm_hdmi_be_hw_params_fixup(struct snd_soc_pcm_runtime *rtd,
|
|||
channels->min, channels->max);
|
||||
|
||||
rate->min = rate->max = 48000;
|
||||
channels->min = channels->max = msm_hdmi_rx_ch;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -2296,12 +2296,12 @@ int q6asm_media_format_block_multi_ch_pcm(struct audio_client *ac,
|
|||
channel_mapping[0] = PCM_CHANNEL_FL;
|
||||
channel_mapping[1] = PCM_CHANNEL_FR;
|
||||
} else if (channels == 6) {
|
||||
channel_mapping[0] = PCM_CHANNEL_FC;
|
||||
channel_mapping[1] = PCM_CHANNEL_FL;
|
||||
channel_mapping[2] = PCM_CHANNEL_FR;
|
||||
channel_mapping[3] = PCM_CHANNEL_LB;
|
||||
channel_mapping[4] = PCM_CHANNEL_RB;
|
||||
channel_mapping[5] = PCM_CHANNEL_LFE;
|
||||
channel_mapping[0] = PCM_CHANNEL_FL;
|
||||
channel_mapping[1] = PCM_CHANNEL_FR;
|
||||
channel_mapping[2] = PCM_CHANNEL_FC;
|
||||
channel_mapping[3] = PCM_CHANNEL_LFE;
|
||||
channel_mapping[4] = PCM_CHANNEL_LB;
|
||||
channel_mapping[5] = PCM_CHANNEL_RB;
|
||||
} else {
|
||||
pr_err("%s: ERROR.unsupported num_ch = %u\n", __func__,
|
||||
channels);
|
||||
|
|
Loading…
Reference in a new issue