ASoC: msm: HDMI PCM 6 channel support
HDMI 1.3 supports Multi channel PCM up to 8 channels with sample
size of 16/20/24 bits and sample rate of 32, 44.1, 48, 96, 176.4,
192K. This patch add supports for 6 channel PCM at 48K sample rate
with sample size of 16 bits.
Change-Id: Id09f1f9d7ef2e2444c8c1b661bfc5b3b4c1e66a6
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
diff --git a/sound/soc/msm/msm-pcm-routing.c b/sound/soc/msm/msm-pcm-routing.c
index 2b4999f..8b6b5f1 100644
--- a/sound/soc/msm/msm-pcm-routing.c
+++ b/sound/soc/msm/msm-pcm-routing.c
@@ -162,6 +162,7 @@
{
int i, session_type, path_type, port_type;
struct route_payload payload;
+ u32 channels;
if (fedai_id > MSM_FRONTEND_DAI_MM_MAX_ID) {
/* bad ID assigned in machine driver */
@@ -191,11 +192,23 @@
port_type) && msm_bedais[i].active &&
(test_bit(fedai_id,
&msm_bedais[i].fe_sessions))) {
- adm_open(msm_bedais[i].port_id,
+
+ channels = params_channels(msm_bedais[i].hw_params);
+
+ if ((stream_type == SNDRV_PCM_STREAM_PLAYBACK) &&
+ (channels > 2))
+ adm_multi_ch_copp_open(msm_bedais[i].port_id,
+ path_type,
+ params_rate(msm_bedais[i].hw_params),
+ channels,
+ DEFAULT_COPP_TOPOLOGY);
+ else
+ adm_open(msm_bedais[i].port_id,
path_type,
params_rate(msm_bedais[i].hw_params),
params_channels(msm_bedais[i].hw_params),
DEFAULT_COPP_TOPOLOGY);
+
payload.copp_ids[payload.num_copps++] =
msm_bedais[i].port_id;
}
@@ -243,6 +256,7 @@
static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set)
{
int session_type, path_type;
+ u32 channels;
pr_debug("%s: reg %x val %x set %x\n", __func__, reg, val, set);
@@ -271,10 +285,22 @@
set_bit(val, &msm_bedais[reg].fe_sessions);
if (msm_bedais[reg].active && fe_dai_map[val][session_type] !=
INVALID_SESSION) {
- adm_open(msm_bedais[reg].port_id, path_type,
+
+ channels = params_channels(msm_bedais[reg].hw_params);
+
+ if ((session_type == SESSION_TYPE_RX) && (channels > 2))
+ adm_multi_ch_copp_open(msm_bedais[reg].port_id,
+ path_type,
+ params_rate(msm_bedais[reg].hw_params),
+ channels,
+ DEFAULT_COPP_TOPOLOGY);
+ else
+ adm_open(msm_bedais[reg].port_id,
+ path_type,
params_rate(msm_bedais[reg].hw_params),
params_channels(msm_bedais[reg].hw_params),
DEFAULT_COPP_TOPOLOGY);
+
msm_pcm_routing_build_matrix(val,
fe_dai_map[val][session_type], path_type);
}
@@ -1463,6 +1489,7 @@
unsigned int be_id = rtd->dai_link->be_id;
int i, path_type, session_type;
struct msm_pcm_routing_bdai_data *bedai;
+ u32 channels;
if (be_id >= MSM_BACKEND_DAI_MAX) {
pr_err("%s: unexpected be_id %d\n", __func__, be_id);
@@ -1500,10 +1527,22 @@
for_each_set_bit(i, &bedai->fe_sessions, MSM_FRONTEND_DAI_MM_SIZE) {
if (fe_dai_map[i][session_type] != INVALID_SESSION) {
- adm_open(bedai->port_id, path_type,
+
+ channels = params_channels(bedai->hw_params);
+ if ((substream->stream == SNDRV_PCM_STREAM_PLAYBACK) &&
+ (channels > 2))
+ adm_multi_ch_copp_open(bedai->port_id,
+ path_type,
+ params_rate(bedai->hw_params),
+ channels,
+ DEFAULT_COPP_TOPOLOGY);
+ else
+ adm_open(bedai->port_id,
+ path_type,
params_rate(bedai->hw_params),
params_channels(bedai->hw_params),
DEFAULT_COPP_TOPOLOGY);
+
msm_pcm_routing_build_matrix(i,
fe_dai_map[i][session_type], path_type);
}