1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
3 // Copyright (c) 2018, Linaro Limited
5 #include "q6dsp-common.h"
6 #include <linux/kernel.h>
7 #include <linux/module.h>
8 #include <linux/string.h>
9 #include <linux/errno.h>
11 int q6dsp_map_channels(u8 ch_map
[PCM_MAX_NUM_CHANNEL
], int ch
)
13 memset(ch_map
, 0, PCM_MAX_NUM_CHANNEL
);
17 ch_map
[0] = PCM_CHANNEL_FC
;
20 ch_map
[0] = PCM_CHANNEL_FL
;
21 ch_map
[1] = PCM_CHANNEL_FR
;
24 ch_map
[0] = PCM_CHANNEL_FL
;
25 ch_map
[1] = PCM_CHANNEL_FR
;
26 ch_map
[2] = PCM_CHANNEL_FC
;
29 ch_map
[0] = PCM_CHANNEL_FL
;
30 ch_map
[1] = PCM_CHANNEL_FR
;
31 ch_map
[2] = PCM_CHANNEL_LS
;
32 ch_map
[3] = PCM_CHANNEL_RS
;
35 ch_map
[0] = PCM_CHANNEL_FL
;
36 ch_map
[1] = PCM_CHANNEL_FR
;
37 ch_map
[2] = PCM_CHANNEL_FC
;
38 ch_map
[3] = PCM_CHANNEL_LS
;
39 ch_map
[4] = PCM_CHANNEL_RS
;
42 ch_map
[0] = PCM_CHANNEL_FL
;
43 ch_map
[1] = PCM_CHANNEL_FR
;
44 ch_map
[2] = PCM_CHANNEL_LFE
;
45 ch_map
[3] = PCM_CHANNEL_FC
;
46 ch_map
[4] = PCM_CHANNEL_LS
;
47 ch_map
[5] = PCM_CHANNEL_RS
;
50 ch_map
[0] = PCM_CHANNEL_FL
;
51 ch_map
[1] = PCM_CHANNEL_FR
;
52 ch_map
[2] = PCM_CHANNEL_LFE
;
53 ch_map
[3] = PCM_CHANNEL_FC
;
54 ch_map
[4] = PCM_CHANNEL_LS
;
55 ch_map
[5] = PCM_CHANNEL_RS
;
56 ch_map
[6] = PCM_CHANNEL_LB
;
57 ch_map
[7] = PCM_CHANNEL_RB
;
65 EXPORT_SYMBOL_GPL(q6dsp_map_channels
);
66 MODULE_LICENSE("GPL v2");